User Tools

Site Tools


en:sun_subsys

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
en:sun_subsys [2019/09/16 15:54]
golikov
en:sun_subsys [2020/01/20 09:38] (current)
golikov
Line 1: Line 1:
-**Sun Sensor** \\  +====== Solar Sensors ====== 
-Virtual ​[[power_subsys|consumption]] - 45mA+ 
 +Virtual ​power draw: 45 mA
  
 {{ :​ru:​сд_4.png?​direct&​200| Солнечные датчики}} {{ :​ru:​сд_4.png?​direct&​200| Солнечные датчики}}
  
-Sun sensors ​on satellites serve as orientation ​sensors, determining ​the satellite'​s ​spatial position relative to the sunVery often they are used for the rough orientation ​of satellite ​solar panels on the sun. It should be noted that it is impossible ​to completely determine ​the orientation of the satellite only from sun sensor ​readings ​there will always remain an uncertainty with the spacecraft rotation angle around the "​satellite-sun" direction.+Solar sensors ​in spacecraft act as positioning ​sensors ​as they identify ​the spatial position ​of the satellite ​relative to the SunQuite often they are used as a rough positioning aid for turning solar cells of the satellite ​to face the Sun. It should be noted that solar sensors stop short of providing complete positioning information as the turning angle around “orbiter-Sun” direction remains uncertain. 
 + 
 +The following function (in C) can be called ​to obtain raw measurement readings:  
 + 
 +<code C>int sunsensor_request_raw(uint16_t num, uint16_t *pRAW_data1,​ uint16_t *pRAW_data2);</​code>​ 
 + 
 +Readings come from two sensor elements observing ​the left and right hemispheres respectively. With either sensor receiving light the angle toward the Sun can be inferred from light intensity. With both sensors lit the more correct approach would be to use a ratio of light exposure on both sensors. 
 + 
 +The sensor is calibrated for different conditions by computing angles from light exposure levels. Nevertheless,​ even uncalibrated,​ sensors of this design can be used for orientation ​toward the Sun by correlating light exposure of the left vs. right hemispheres ​of the sensor
 + 
 +<note tip> 
 +**//It should be noted that the alignment of individual sensing elements inside housings is far from ideal – just like real-world devices – making each sensor somewhat unique. This misalignment is the combined effect of imprecise housing machining to specified dimensions, imperfect mounting of electronics PCBs within housings and less than ideal sensor uniformity (as individual sensors still differ somewhat from each other).//​** 
 +</​note>​ 
 + 
 +<note tip> 
 +**//Most errors of this kind persist throughout device lifetime, although there can also be errors that depend appreciably on external factors (such as temperature). In our case we assume that measurement errors of individual sensors are persistent and little affected by temperature,​ making their one-time calibration prior to use a viable option.//** 
 +</​note>​ 
 + 
 +==== Sample C Test Code for Solar Sensors ====
  
-To obtain raw measurement data, you can use the function \\  +<file c sun_test.c>​ 
-  int sunsensor_request_raw(uint16_t num, uint16_t *pRAW_data1,​ uint16_t *pRAW_data2);​+#include <​stdio.h>​ 
 +#include <​stdint.h>​ 
 +#include "​libschsat.h"​ 
 +#define LSS_OK 0  
 +#define LSS_ERROR 1  
 +#define LSS_BREAK 2
  
-The sensor ​returns readings from two sensors that examine the left and right hemispheres respectively. When one of the sensors is exposed to a level of illuminationthe sun angle can be determined. When both sensors have been illuminatedthe more correct approach is to use the ratio of the illumination levels on both sensors.+int control(){ //​Основная функция программы 
 + uint16_t sun_result[] = {0, 0, 0}; // инициализируем sun_result 
 + uint16_t num = 1; // номер солнечного датчика 
 + printf("​Enable sun sensor ​№%d\n"​num); 
 + sun_sensor_turn_on(num);​ //​включаем датчик  
 + Sleep(1); //Ждем включения 1 секунду 
 + printf("​Get RAW data from sun sensor №%d\n"​num); 
 + int i; 
 + for (i = 0; i < 10; i++) //​считываем показаия 10 раз 
 +
 + sun_result[0] = sun_sensor_request_raw(num,&​ sun_result[1],&​ sun_result[2]);/​*проверить как работает,​ очень странно, ​ что работает 
 + если не работает задать sun_result[0] */ 
 + if (!sun_result[0]){ //если датчик не вернул сообщение об ошибке,​ 
 + printf("​state:​ %d raw = %d, %d\n", i, sun_result[1],​ sun_result[2]);​ 
 +
 +  
 + else if (sun_result[0] == 1) { //если датчик вернул сообщение об ошибке 1 
 + printf("​Fail because ​of access error, check the connection\n"​);​ 
 +
 + else if (sun_result[0] == 2) { //если датчик вернул сообщение об ошибке 2 
 + printf("​Fail because of interface error, check you code\n"​);​ 
 +
 + Sleep(1); //​показания считываются раз в секунду
  
-Calculating the specific dependencies of the angle on the illumination levels is called calibrating the sensor ​under different conditions. Neverthelesseven without calibration,​ sensors of similar design can be used to track the position of the sun by analyzing the mutual illumination of the right and the left hemispheres of the sensor.+
 + printf("​Disable sun sensor ​№%d\n"​num); 
 + sun_sensor_turn_off(num);​ //​выключаем солнечный датчик 
 + return 0; 
 +
 +</​file>​
  
-**//​Accuracy of installation//​** \\  
-It should be noted that the accuracy of mounting the sensors inside the sun sensor bodies is not ideal - this is how it happens in real life, making each sensor unique in its own way. This is due to the inaccuracy of the manufacture of the cases relative the required size, the errors of installing electronics boards inside the cases, and the imperfection of the sensors themselves (they all differ slightly from each other). It is understood that most of such errors remain unchanged throughout the service life, although there are also errors that depend heavily on external factors (for example, temperature). In our case, we assume that the measurement errors of each sensor are constant in time and slightly dependent on temperature,​ which makes it possible to perform a one-time calibration before use. It is recommended to calibrate each of the 4 sensors in the set before use. Think for yourself about how this could be done, or contact us for advice. 
  
-Description of the [[old_sun_subsys|old version]] of the sensor. 
en/sun_subsys.txt · Last modified: 2020/01/20 09:38 by golikov