User Tools

Site Tools


en:mag_subsys

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:mag_subsys [2019/09/16 15:35]
golikov
en:mag_subsys [2020/01/20 09:23] (current)
golikov
Line 1: Line 1:
-**Magnetometer** \\  +====== ​Magnetometer ​====== 
-Virtual ​[[power_subsys|consumption]] - 40mA + 
 +Virtual ​power draw: 40 mA
  
 {{ :​ru:​магнитометр.png?​direct&​200| Магнитометр}} {{ :​ru:​магнитометр.png?​direct&​200| Магнитометр}}
  
-When designing spacecrafts that operate in low earth orbits, ​a magnetometer ​is often used as one of the devices ​for determining orientation ​(usually ​supplementing the solar sensors). The magnetometer ​measures ​the magnetic field around itself ​and outputs ​three components of the magnetic ​field induction ​vector in Tesla unitsUnder ideal conditionsthe magnetometer ​on board the satellite measures ​the geomagnetic field of the Earth - the very thing that causes a compass ​needle ​to rotate ​for the ground ​user. However, in real lifethe construction ​of any satellite ​contains ​magnetic materials (for example, ​permanent magnets of electric ​drives), so the magnetometer ​measures ​certain total magnetic field of the Earth and the magnetic field of the satellite ​itself - the so-called superposition of fields.+Low-orbit spacecraft is most often designed with a magnetometer as one of positioning ​devices (usually ​complementing ​solar sensors). 
 + 
 +The magnetometer ​senses ​the surrounding ​magnetic field and generates ​three components of the magnetic ​flux vector in teslasIn ideal conditions the magnetometer ​in the orbiter register’s Earth’s own geomagnetic field – the same field that turns the needle ​in the compass ​for a user on the ground. However, in the real life the design ​of any satellite ​includes ​magnetic materials (e.g. permanent magnets of electric ​drive motors), therefore the field registered by the magnetometer ​will comprise ​so-called superposition ​of the Earth’s magnetic field and the magnetic field of the orbiter proper. 
 + 
 +It is possible to determine the spatial orientation (and sometimes position as well) of spacecraft by comparing magnetometer readings with computed values from the geomagnetic field model. For experiments with the Orbicraft construction set it is assumed that the magnetometer will be used to sense both orientation and position ​of the satellite ​on the orbit i.e. for navigational purposes. In this case the “geomagnetic” field registered by the magnetometer onboard will be created by the special Terra laboratory setup and measured from the computer using a predetermined known control law. 
 + 
 +The following function (in C) is used to obtain current magnetometer readings: 
 + 
 +<code C>​int32_t magnetometer_request_raw(uint16_t num,int16_t *pRAW_dataX,​int16_t *pRAW_dataY,​int16_t *pRAW_dataZ);​ </​code>​  
 + 
 +As would be the case with real-world spacecraft, magnetometer readings inside Orbicraft are not determined exclusively by the external geomagnetic field. Other instruments (mainly including reaction wheel motors and the power supply system) can interfere with readings. For that reason it is not recommended that the magnetometer be located immediately next to those devices.
  
-The magnetic field of the Earth is well-researched,​ not only at the surface of the Earth, but also in near-Earth space. There are, however, some distinctions in its behavior, including many interesting,​ yet not fully explored effects... But this is science. To determine the satellite orientation according to the magnetometer readings, it is sufficient to use the exact mathematical model of the magnetic field, for example, IGRF, which can be placed on the satellite in the form of program code.\\ +==== Magnetometer Test Code in C ====
-{{ ::​earth_mag_field.jpg?​200|}} +
-Comparing the magnetometer readings with the calculated values of the geomagnetic field model makes it possible to estimate the orientation (and in some cases the position) of the spacecraft in space. When carrying out experiments with a "​satellite"​ in the laboratory, it is proposed to use a magnetometer as an instrument both for determining the orientation and for determining the position of the satellite in "​orbit",​ i.e. for navigation. In this case, the "​geomagnetic"​ field, measured by a magnetometer on-board, is created by special laboratory equipment and is controlled from the computer according to a predetermined control law.+
  
-At the beginning of the experiment, users will be given a function of the magnetic field dependence on the satellite position in orbit above the planet. After that, by making the appropriate changes to your program code, it becomes possible to determine the satellite position according to the magnetometer readings.+<file c mag_test.c> 
 +#define LSS_OK 0  
 +#define LSS_ERROR 1  
 +#define LSS_BREAK 2
  
-To obtain the current ​magnetometer ​readingsuse this function:\\  +#include <​stdio.h>​ 
-  ​int32_t ​magnetometer_request_raw(uint16_t ​num,int16_t *pRAW_dataX,int16_t *pRAW_dataY,int16_t *pRAW_dataZ);  +#include <​stdint.h>​ 
 +#include "​libschsat.h"​ 
 +int control() // Основная функция программы,​ в которой вызываем остальные функции 
 +
 + int16_t mgn_result[] = {0,0,0,0}; // Инициализируем mgn_result 
 + uint16_t num = 1; // номер магнитометра 
 + int i; 
 + printf("​Rnable ​magnetometer ​№%d\n"​num); 
 + magnetometer_turn_on(num);​ 
 + Sleep(1);​ 
 + printf("​Get RAW data from magnetometer\n"); 
 + for (i = 0; i < 1000; i++) 
 + { 
 + mgn_result[0] = magnetometer_request_raw(num,​& mgn_result[1],& mgn_result[2],& mgn_result[3]); 
 + if (!mgn_result[0])//​ если датчик вернул сообщение об ошибке,​ 
 +
 + printf("​\nstate:​%d,​ \nx_raw =%d,\ny_raw =%d, \nz_raw =%d\n",​i,​ mgn_result[1],​ mgn_result[2],​ mgn_result[3]);​ //​Обратите внимание на символ переноса строки! 
 +
 + else if (mgn_result[0] == 1){ 
 + printf("​Fail because of access error, check the connection"​);​ 
 +
 + else if (mgn_result[0] == 2){ 
 + printf("​Fail because of interdace error, check your code"​);​ 
 +
 + Sleep(0.1);​ 
 +
 + printf("​Disable magnetometer №%d\n",​ num); 
 + magnetometer_turn_off(num);​ 
 + return 0; 
 +
 +</​file>​
  
-Once again, we emphasize that inside the "​satellite,"​ as well as on real spacecrafts,​ the magnetometer readings do not only depend on the external "​geomagnetic"​ field. Other devices (mainly [[wheel_subsys|flywheel motors]] and [[power_subsys|power supply systems]]) can interfere with measurements,​ so it is not recommended to install a magnetometer near these devices. 
  
en/mag_subsys.1568637348.txt.gz · Last modified: 2019/09/16 15:35 by golikov