Satellite state machine
Nine modes can be distinguished in the logic of the satellite’s payload operation. Five of them, that is the default logic, are shown in the diagram below.
Last updated
Nine modes can be distinguished in the logic of the satellite’s payload operation. Five of them, that is the default logic, are shown in the diagram below.
Last updated
IDLE mode is a low power consumption mode that is set as a middle mode in which the state machine waits for the fulfilment of the next mode’s begin conditions.
The diagnostic algorithm is used to validate proper functioning of satellite's hardware. This procedure toggles certain actuators in predefined intervals. Simultaneously, measurements from the IMU and the temperature sensor that is attached to the payload container are taken.
F.R.W. control algorithms are designed to control electromagnets in order to accelerate the ferrofluid. Its custom function is turned on by interruption from timer 5. F.R.W. can work in 9 different modes which are listed in the table below. More information about control system of the Ferrofluid Reactio Wheel can be found in: Jan Życzkowski, "Ferrofluid reaction wheel for nanosatellites orientation control", Master Thesis, AGH University of Science and Technology, Cracow 2019, supervisor: Adam Piłat.
FRW_ControlBasicClockwise works as a universal control. It is possible to change its parameters:
To control F.R.W. in opposite direction use function: FRW_ControlBasicAntiClockwiseFunction.
The payload detumbling algorithm uses magnetorquers in all three satellite axes. A magnetorquer is an electromagnet which due to current flow creates a magnetic moment which interfaces with the Earth'a magnetic field. This creates a torque acting on the satellite. Thus, being able to control the current flowing through the coil (the words coil and electromagnet will be used interchangeably) enables controling the angular velocity of the satellite. The equation used to calculate the torque created by the electromagnet is shown below:
The algorithm is based on the so-called Angular Rate Feedback algorithm. The equation used to calculate the needed current in each of the coils is shown below (the current in each coil is one of the components of the current vector):
The optimal value of k was chosen after conducting simulations on a model of the satellite. An appropriate PWM signal is passed on the inputs of H-bridges, which control the current of the magnetorquers.
One cycle of the algorithm consists of five steps; the time interval between those steps is 200 ms (so the whole algorithm cycle is 1s).
Step 1: At the beginning of this step, the current in all coils is always zero. The magnetic field induction (B) is measured (because no current flows through the magnetorquers, their magnetic field has no influence on the measurement). Also the angular velocity of the satellite is acquired. The output current of the coils is calculated using the above equation and the current of the coils is changed.
Step 2, 3, 4: In each of these steps the magnetic field induction in the satellite-oriented reference frame is estimated and the angular velocity is measured. Apart from that, the operations are the same as in step 1
Step 5: The current of the coils is set to 0, so that the magnetic field induction can be measured in step 1. Return to step 1.
The estimation of the magnetic field induction in the satellite-oriented reference frame is conducted as follows: it is assumed that it is constant in the Earth-oriented frame and it changes because of the non-zero angular velocity of the satellite (which is measured). So, the magnetic field induction can be estimated as:
where:
More information about detumbling system can be found in: Artur Hadasz, "Simulation of stabilization algorithms and building a prototype of a stabilization system for picosatellites using magnetorquers", BSc Thesis, AGH University of Science and Technology, Cracow 2018, supervisor: Paweł Zagórski and in the work: Piotr Mikołajek, "Design and simulation of a picosatellite low Earth orbit magnetic field based attitude determination system", BSc Thesis, AGH University of Science and Technology, Cracow 2018, supervisor: Paweł Zagórski.
Where is the created torque, is the magnetic moment and is the Earth's magnetic field's induction.
Property
Description
mode_id
The id of the mode.
init_function
The function that is executed within initialization of the mode.
exit_function
The function that is executed immediately on the exit of the mode.
condition_exit
The function that returns state enum when at least one of stop conditions of the mode is fulfilled.
condition_entry
The function that returns state enum when all of begin conditions of the mode are fulfilled.
do_custom_function
The function that contains logic that is executed not in 1min/1s/200ms timer exception.
do_1min_cycle
The function that contains logic that is executed in 1min timer exception.
do_1000ms_cycle
The function that contains logic that is executed not in 1s timer exception.
do_200ms_cycle
The function that contains logic that is executed not in 200ms timer exception.
timer_1s
The default value that determines the maximum time of the mode duration [s].
timer_prescaler
The value that is prescaler for property timer_1s.
is_timer_active
The property that determines if timer timer_1s is active.
next_mode
The mode that will be set as a following mode if condition_entry equals SUCCESS.
failure_mode
The mode that will be set as a following mode if condition_entry equals FAIL.
Property
Description
mode_id
0
init_function
None
exit_function
None
condition_exit
The stop condition is equal to the begin condition of the next mode
condition_entry
None
do_custom_function
None
do_1min_cycle
IMU magnetometer sensor refresh
do_1000ms_cycle
None
do_200ms_cycle
None
timer_1s
n/a
timer_prescaler
1
is_timer_active
False
next_mode
Diagnostic
failure_mode
Diagnostic
Property
Description
mode_id
6
init_function
Initialization of all actuators.
exit_function
Stop of all actuators.
condition_exit
If power voltage < 9.5 then WAIT IN IDLE; If temp F.R.W. temperature > 90 then FAIL; If timer_1s <= 0 then SUCCESS;
condition_entry
If power voltage > 10 then SUCCESS.
do_custom_function
None
do_1min_cycle
None
do_1000ms_cycle
The function is described in section "Diagnostic algorithm"
do_200ms_cycle
None
timer_1s
100
timer_prescaler
1
is_timer_active
True
next_mode
Detumbling
failure_mode
Detumbling
Property
Description
mode_id
7
init_function
Initialization of all actuators.
exit_function
Stop of all actuators.
condition_exit
If power voltage < 9 then WAIT IN IDLE; If timer_1s <= 0 then SUCCESS;
condition_entry
If power voltage > 10 then SUCCESS.
do_custom_function
None
do_1min_cycle
None
do_1000ms_cycle
The function is described in section "Diagnostic algorithm"
do_200ms_cycle
None
timer_1s
100
timer_prescaler
1
is_timer_active
True
next_mode
Detumbling
failure_mode
Detumbling
Property
Description
mode_id
3
init_function
Initialization of PWM timers for F.R.W. magnetorquers.
exit_function
Stop of PWM timers for F.R.W. magnetorquers.
condition_exit
If power voltage < 9.5 then WAIT IN IDLE; if temp F.R.W. temperature > 90 then FAIL; if timer_1s <= 0 then SUCCESS;
condition_entry
If power voltage > 10 and temp F.R.W. temperature > 0 and temp F.R.W. temperature < 50 then SUCCESS;
do_custom_function
The function logic is described in section "F.R.W. control algorithm".
do_1min_cycle
None
do_1000ms_cycle
None
do_200ms_cycle
None
timer_1s
180
timer_prescaler
1
is_timer_active
True
next_mode
IDLE time
failure_mode
IDLE time
Property
Description
mode_id
3
init_function
Initialization of PWM timers for F.R.W. magnetorquers.
exit_function
Stop of PWM timers for F.R.W. magnetorquers.
condition_exit
If power voltage < 9 then WAIT IN IDLE; if timer_1s <= 0 then SUCCESS.
condition_entry
If power voltage > 10 then SUCCESS.
do_custom_function
The function logic is described in section "F.R.W. control algorithm".
do_1min_cycle
None
do_1000ms_cycle
None
do_200ms_cycle
None
timer_1s
180
timer_prescaler
1
is_timer_active
True
next_mode
IDLE time
failure_mode
IDLE time
Property
Description
mode_id
1
init_function
Initialization of PWM timer for ADCS magnetorquers.
exit_function
Stop of PWM timer for ADCS magnetorquers.
condition_exit
If power voltage < 9.5 or temp F.R.W. temperature > 80 then WAIT IN IDLE; If timer_1s <= 0 then FAIL;
If average angular speed in all axes < 5°/s then SUCCESS;
condition_entry
If power voltage > 10 and temp F.R.W. temperature < 60 then SUCCESS.
do_custom_function
None
do_1min_cycle
None
do_1000ms_cycle
None
do_200ms_cycle
The function logic is described in section "Detumbling algorithm".
timer_1s
10800
timer_prescaler
1
is_timer_active
True
next_mode
F.R.W. experiment
failure_mode
Detumbling SR
Property
Description
mode_id
2
init_function
Initialization of PWM timer for ADCS magnetorquers.
exit_function
Stop of PWM timer for ADCS magnetorquers.
condition_exit
If power voltage < 9 then WAIT IN IDLE; If timer_1s <= 0 then FAIL;
If average angular speed in all axes < 5°/s then SUCCESS.
condition_entry
If power voltage > 10 then SUCCESS.
do_custom_function
None
do_1min_cycle
None
do_1000ms_cycle
None
do_200ms_cycle
The function logic is described in section "Detumbling algorithm".
timer_1s
10800
timer_prescaler
1
is_timer_active
True
next_mode
F.R.W. experiment
failure_mode
F.R.W. experiment
Property
Description
mode_id
10
init_function
Initialization of detumbling algorithm embedded in the OBC board.
exit_function
Stop of detumbling algorithm embedded in the OBC board.
condition_exit
If OBC transmit SUCCESS then SUCCESS; If timer_1s <= 0 then FAIL.
condition_entry
None
do_custom_function
None
do_1min_cycle
Check register table if OBC transmit SUCCESS.
do_1000ms_cycle
None
do_200ms_cycle
None
timer_1s
2700
timer_prescaler
1
is_timer_active
True
next_mode
F.R.W. experiment
failure_mode
F.R.W. experiment
Property
Description
mode_id
5
init_function
Initialization of PWM timer for ADCS magnetorquers.
exit_function
Stop of PWM timer for ADCS magnetorquers.
condition_exit
If timer_1s <= 0 then SUCCESS;
If battery_volt<9 then FAILURE.
condition_entry
If battery_volt>10 then SUCCESS.
do_custom_function
None
do_1min_cycle
None
do_1000ms_cycle
ADCS magnetorquers control and IMU magnetometer sensor refresh.
do_200ms_cycle
None
timer_1s
10800* timer_prescaler
timer_prescaler
1
is_timer_active
True
next_mode
IDLE
failure_mode
IDLE
Property
Description
mode_id
8
init_function
None
exit_function
None
condition_exit
If timer_1s <= 0 or (battery_volt>10 and special log buffer is not full) then SUCCESS;
condition_entry
None
do_custom_function
None
do_1min_cycle
IMU magnetometer sensor refresh
do_1000ms_cycle
None
do_200ms_cycle
None
timer_1s
2880 * timer_prescaler
timer_prescaler
60
is_timer_active
True
next_mode
Diagnostic mode
failure_mode
Diagnostic mode
Timeline
Step
15 s
Only measurements
10 s
ADCS magnetorquer X
10 s
ADCS magnetorquer Y
10 s
ADCS magnetorquer Z
15 s
Only measurements
10 s
F.R.W. electromagnets phase 0
10 s
F.R.W. electromagnets phase 1
10 s
F.R.W. electromagnets phase 2
10 s
F.R.W. electromagnets phase 3
Control mode
mode ID
FRW_BAISIC_CLOCKWISE
0
FRW_BAISIC_ANTICLOCKWISE
1
FRW_ACC_CLOCKWISE
2
FRW_ACC_ANTICLOCKWISE
3
FRW_STEP_CLOCKWISE
4
FRW_STEP_ANTICLOCKWISE
5
FRW_PID_DUTY
6
FRW_PID_FREQ
7
FRW_LIST_MODE
8
Parameter
Details
pwm_duty
duty of coils PWM
period
period with which 4 coils are working, in ms. Period of the is F.R.W. two times larger
pwm_direct
direction of the current going through coils (it is not the direction for F.R.W.)
control duty
percentage of time every phase is tuned on during cycle (e.g. 25 - one-step, 37 - one and half-step, 50 - two-step)
Parameter
Details
start_period
Starting period for 4 coils
stop_period
ending period for 4 coils
acceleration_time
Time of acceleration in seconds. After this time, F.R.W.will work with period: stop_period
Parameter
Details
period
period with which 4 coils are working, in ms
coils_on_time
Time of one phase turned on, in ms
phase_delay
delay in turning on phases, in ms
pwm_direct
direction of the current going through coils (it is not the direction for F.R.W.)
pwm_duty
duty of coils PWM
Parameter
Details
coil
phase which should be changed
time
time till next action [ms]
dir
direction of current in phase - 0 for clockwise, 1 for anticlockwise
duty
duty for changed phase
reset
1- for cleaning all data on the list, 0 - to add instruction
Mode name
Mode ID
IDLE
0
DETUMBLING
1
DETUMBLING_F
2
EXPERIMENT
3
EXPERIMENT_F
4
MANUAL
5
DIAGNOSTIC
6
DIAGNOSTIC_F
7
IDLE_FOR_TIME
8
CURRENT_MODE
9
DETUMBLING_SR_MODE
10