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

### Sidebar

en:wheel_subsys

This is an old revision of the document!

Orientation flywheel
Virtual consumption - 2000mA

When in orbit, many satellites require precise orientation of certain surfaces in the correct direction - relative to the Earth, the Sun, stars or some other reference point. For example, the camera should be oriented towards the ground and the solar panels should be oriented towards the Sun. There are several known approaches for solving this problem. For example, you can use jet (rocket) orientation engines, which causes the spacecraft to rotate in the desired direction relative to the center of mass. However, this method requires the consumption of a working fluid (fuel), requires a complex system of engine nozzles, is potentially unsafe, etc. On small spacecraft, flywheels are most often used to provide a given orientation of the satellite in space relative to the center of mass.

The flywheel is an electromechanical device that consists of an electric motor with a wheel mounted on its axis of rotation. As the engine accelerates or decelerates, the spacecraft itself rotates faster or slower according to the law of conservation of the kinetic moment. Since there are no external forces in outer space and the amount of motion cannot change, turning the flywheel clockwise causes the whole spacecraft to rotate counterclockwise. Thus, by controlling the engine and the rotation of the flywheel, you can control the motion of the whole spacecraft (in fact, the rotation) around its center of mass.

In our model, free rotation of the spacecraft, and hence the flywheel, is possible only around one axis - vertical. Therefore, only one orientation flywheel is installed on the “satellite.”

The following functions are used for working with the flywheel motor:

int32_t motor_set_speed(uint16_t num,int16_t RPM,int16_t *confirm);
The function allows you to set the flywheel speed. If everything is successful, it will return the LSS_OK code and the “confirm” value equal to the desired RPM. However, it can take quite a long time for the flywheel to accelerate to the required speed.

int32_t motor_request_speed(uint16_t num,int16_t *pRPM);
This function allows you to request the current flywheel speed.