- The
ReactionWheel
class simulates a reaction wheel. - The
ReactionWheel
class generates torque caused by the reaction wheel.
reaction_wheel.cpp, reaction_wheel.hpp
: Definitions and declarations of the classreaction_wheel_ode.cpp, reaction_wheel_ode.hpp
: Ordinary differential equation for RW emulationreaction_wheel.ini
: Initialization fileplot_reaction_wheel.py
: An example of a Python script to plot reaction_wheel output
- Set the parameters in
reaction_wheel.ini
.moment_of_inertia_kgm2
: Moment of inertia of the rotormax_output_torque_Nm
: Maximum output torquemax_angular_velocity_rpm
: Maximum angular velocity- Direction parameters
direction_determination_mode
: Mode of direction definitionquaternion_b2c
: Quaternion body to component (used in RW jitter)direction_b
: Rotation direction
position_b_m
: Position of the wheeldead_time_s
: Dead timetime_constant_s
: Time constant of the first-order control lag- Friction parameters
friction_order
: Order of friction accelerationfriction_coefficients
: Coefficients of friction acceleration
stop_limit_angular_velocity_rad_s
: Stop limit angular velocityinitial_motor_drive_flag
: Initial motor drive flaginitial_angular_velocity_rad_s
: Initial angular velocity- Other parameters
- Parameters for the
Component
class - Parameters for the
PowerPort
class - Parameters for the
RwJitter
class
- Parameters for the
- Create an instance by using the initialization function
InitReactionWheel
- Use the
SetDriveFlag
,SetVelocityLimit_rpm
, andSetTargetTorque_*
to drive the reaction wheel. - Use the
GetAngularVelocity_*
to get angular velocity information.
- The
MainRoutine
function calculates the generating torque including control lag and friction.
- TBW
- TBW
- Case 1
- Parameters: Default
- Command: +20 rad/s2 -> -20 rad/s2 -> drive_flag = false.
- Case 2
- Parameters: time_constant = 0, friction_coefficients = 1.0
- Command: +20 rad/s2 -> -20 rad/s2 -> drive_flag = false.