# Конструктор спутника "ОрбиКрафт"

### Sidebar

en:old_sun_subsys

This is an old revision of the document!

Solar Sensor (Old version)
Virtual consumption - 45mA

Solar sensors on satellites serve as orientation sensors, determining the satellite spatial attitude relative to the Sun. Very often they are used for rough satellite solar panels orientation on the Sun. It should be noted that it is impossible to determine satellite attitude completely only by solar sensors readings - there will always remain an uncertainty with the spacecraft rotation angle around the direction “satellite-sun”.

Solar sensors supplied with the construction set (a total of 4 items) are also light sensors. All of them are the same, each gives to the on-board computer only the angle of the sun's rays. In general, to determine the direction from which the sun is shining, you need to use readings of at least three such sensors located at different angles to the light flux.

“The Sun“ in laboratory is a special spotlight with a narrow beam of light (a beam diameter of about 20 cm). In our case, since the satellite is hanged on a thread and the position of its rotation axis in space is immediately known readings of only two sensors are enough to calculate the direction to the “Sun” (spotlight) and in fact - the angle of twist of the satellite on the thread.

To obtain raw measurement data you can use the function
int32_t sunsensor_request_raw(uint16_t num,uint16_t *pRAW_data);

To obtain an angle from the raw readings you can use the function
int32_t sunsensors_angle(uint16_t positive,uint16_t negative,uint16_t ambient,double *angle);

This function allows you to calculate the direction angle to the sun according to the readings of two sensors. The indication of one of the sensors determines the negative direction, the second one is positive. The function also needs to know the background level of illumination in the room (with the spotlight turned off). In case the readings of both sensors are above the background illumination level the direction angle to the sun will be calculated, otherwise the function will return an error code.

Distance to the Sun
Real solar sensors work in conditions in which the Sun is so far from their sensitive elements that the stream of sun rays can be considered parallel and the distance to the Sun can be considered unchanged, regardless of the orientation and position of the solar sensors on the satellite. In laboratory conditions, this is not quite so.With satellite rotation the distance between each of the sensors and “the Sun” changes. The level of illumination changes because of the uneven density of the spotlight beam. Thus, the installation of sensors can have a significant effect on the accuracy of calculating the angle of direction to the “Sun”, and on the accuracy of satellite stabilization in “orbit”.

It is not recommended to install sensors at a different distance from the central axis of the desired direction.

More correct would be this installation

Accuracy of installation:
It should be noted that the accuracy of mounting the sensors inside the solar 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 bodies manufacture relative the required size, the errors of installing electronics boards inside the bodies, the imperfection of the sensors themselves (they all differ slightly from each other).It is clear that most of such errors remain unchanged during 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, slightly dependent on temperature, and this makes it possible to perform their one-time calibration before using. In your hands there is a set of 4 sensors, it is desirable to calibrate each of them before start the competition. Think for yourself how this could be done, or contact us for advice.