- This class has the function to propagate the attitude motion equation that forms the basis of the attitude simulator.
- Use the 4th Runge-Kutta equation for the propagation or set the attitude as determined values.
- This class also calculates the angular momentum.
src/dynamics/attitude/attitude.hpp, .cpp
- Definition of
Attitude
base class
- Definition of
src/dynamics/attitude/attitude_rk4.hpp, .cpp
- Normal free motion dynamics propagator
AttitudeRk4
class is defined here.
- Normal free motion dynamics propagator
src/dynamics/attitude/initialize_attitude.hpp, .cpp
- Make an instance of
Attitude
class.
- Make an instance of
sample_satellite.ini
: Initialization file
- Set the parameters in
sample_satellite.ini
or user defined satellite initialize file- If you want to use RK4 as attitude dynamics, please set
propagate_mode = RK4
at the[ATTITUDE]
section in thesample_satellite.ini
file. - Select
initialize_mode
at the[ATTITUDE]
section in thesample_satellite.ini
file.initialize_mode = MANUAL
- Initial attitude is defined by
initial_quaternion_i2b
andinitial_angular_velocity_b_rad_s
. initialize_mode = CONTROLLED
- Initial attitude is defined by [CONTROLLED_ATTITUDE] settings.
- If you want to use RK4 as attitude dynamics, please set
- Create an instance by using initialization function
InitAttitude
- Execute attitude propagation by
Propagate
function - Use
Get*
function to get attitude information.
- This function manages the timings of
RungeKuttaOneStep
function, which calculates the attitude dynamics and kinematics by the 4th Runge-Kutta method.
- input
- (double)
end_time_s
: Time incremented in the main function
- (double)
- output
- (void)
There are two-time steps definition related to attitude propagation.
- Time incremented in the main function
- This time step decides the timing to update the torque input values by disturbances and actuator outputs.
- The step is defined as the variable
propagation_step_s_
in thesimulation_time
class.
- Time incremented in Propagate function
- This time step is much shorter than the time step in the main function.
- This step determines the accuracy of the attitude propagation.
- The step is defined as the variable
propagation_step_s_
in theAttitude
class.
There is a while loop
in the Propagate
function, in which Runge-Kutta integration is performed. In addition, there is only one Runge-Kutta integration function outside the while loop, but this is for adjusting the time-lapse.
Calculate the attitude propagation by 4th Runge-Kutta integration.
- input
- (double) t: Elapsed time from the time when the
Propagate
function is called. - (double) dt: The duration for the attitude propagation
- (double) t: Elapsed time from the time when the
If the differential equation (1) is given, the state quantity in
where
In this attitude propagation, the quantity of state Quaternion_i2b
and angular velocity
The one that solves the upper differential equation is implemented in Library.
The equation of attitude motion is described in this function.
- inputs and outputs
- input
- (Vector<7>) x: Quantity of state
- (double) t: Elapsed time from the time when the
Propagate
starts
- output
- (Vector<7>) dxdt: Differentiation of quantity of state.
- algorithm
Equation of attitude motion is calculated as the equation (6), which is written in Chapter 6 of Reference 1,
where CalcAngularVelocityMatrix
function.
- Check that the integral propagation of kinematics equations is performed correctly
- attitude_integral_step_s : 0.001
- simulation_step_s: 0.1
- simulation_duration_s: 300
- Inertia tensor: diag [0.17, 0.1, 0.25]
- Initial quaternion_i2b: [0,0,0,1]
- Initial torque: [0,0,0]
- Initial angular velocity: Set by each case
- Disturbance torque: All Disable
- Initial angular velocity = [0,0,0]
- Initial angular velocity = [0.314, 0, 0] rad/s
- Initial angular velocity = [0, 0.314, 0] rad/s
- Initial angular velocity = [0, 0, 0.314] rad/s
- Initial angular velocity = [0, 0, -0.314] rad/s
Confirm that the integral propagation of the dynamics equation is performed correctly
- attitude_integral_step_s : 0.001
- simulation_step_s: 0.1
- simulation_duration_s: 300
- Inertia tensor: diag[0.17, 0.1, 0.25]
- Initial Quaternion_i2b: [0,0,0,1]
- Initial torque: Set by each case
- Initial angular velocity: [0,0,0]
- Disturbance torque: All Disable
-
Add constant torque: [0,0,0] Nm
-
Add constant torque = [0.1,0,0] Nm
-
Add constant torque = [0,0.1,0] Nm
-
Add constant torque = [0,0,0.1] Nm
Validate the time step of the attitude dynamics propagation
- attitude_integral_step_s : 0.001 / 0.01
- simulation_step_s: 0.1
- simulation_duration_s: 300
- Inertia tensor: diag[0.17, 0.1, 0.25]
- Initial Quaternion_i2b: [0,0,0,1]
- Initial torque: [0,0,0]
- Initial angular velocity: [0,0,0]
- Disturbance torque: All Disable
- No difference between two results in attitude_integral_step_s = 0.001 / 0.01 sec.
- 狼, 冨田, 中須賀, 松永, 宇宙ステーション入門第二版, 東京大学出版会, 2008. (Written in Japanese)