Spacecraft Control Bundle 1
|
A PID based attitude control system. More...
#include <fsw_attitude_control.h>
Public Member Functions | |
fsw_attitude_control (const char *mod_name) | |
void | initialize_data () |
Create data and request the FSW_ATTITUDE_CONTROL_TRIGGER. More... | |
void | initialize_data_requests () |
void | handle_event (int code) |
int | valid_quaternion (ml_matrix q) |
Checks the validity of a quaternion. More... | |
int | valid_vector (ml_matrix u) |
Checks the validity of a unit vector. More... | |
ml_matrix | make_unit_vector (ml_matrix u) |
Make a unit vector. More... | |
int | get_index (int id, ml_matrix index_list) |
Get the index for the SPICE id. More... | |
Protected Attributes | |
Inputs | |
| |
CD_REQUEST_REF | od_state_ref |
State estimate od_state. More... | |
CD_REQUEST_REF | inertia_ref |
The spacecraft inertia matrix. More... | |
CD_REQUEST_REF | quaternion_ref |
The estimated quaternion. More... | |
CD_REQUEST_REF | omega_ref |
The estimated body rate. More... | |
CD_REQUEST_REF | ephem_planet_position_ref |
Planet position. More... | |
CD_REQUEST_REF | ephem_planet_index_ref |
Planet index. More... | |
CD_REQUEST_REF | ephem_planet_rotation_matrix_ref |
Planet rotation matrix. More... | |
CD_REQUEST_REF | ephem_planet_radius_ref |
Planet radius. More... | |
CD_REQUEST_REF | ephem_sun_vector_ref |
Sun vector. More... | |
Outputs | |
CD_CREATE_REF | acs_error_ref |
ACS error code (int) More... | |
CD_CREATE_REF | acs_attitude_error_ref |
Attitude error (3x1) More... | |
CD_CREATE_REF | acs_torque_demand_ref |
The torque demand for all attitude control (3x1) More... | |
CD_CREATE_REF | acs_target_quaternion_ref |
Desired quaternion (4x1) More... | |
ACS Parameters and Commands | |
| |
CD_CREATE_REF | acs_q_eci_to_body_command_ref |
CD_CREATE_REF | acs_omega_command_ref |
Commanded angular rate for rate control (3x1) More... | |
CD_CREATE_REF | acs_axis_rate_command_ref |
Commanded axis rate. More... | |
CD_CREATE_REF | acs_eci_align_axis_command_ref |
The eci axis to be aligned (3x1) More... | |
CD_CREATE_REF | acs_body_align_axis_command_ref |
The body axis to be aligned (3x1) More... | |
CD_CREATE_REF | acs_rotate_axis_command_ref |
The axis to be rotated about (3x1) More... | |
CD_CREATE_REF | acs_rotate_angle_command_ref |
The angle to be rotated (double) More... | |
CD_CREATE_REF | acs_control_mode_command_ref |
Select the control mode (int) More... | |
CD_CREATE_REF | acs_solar_system_target_command_ref |
Solar system target. Format: integer SPICE ID. More... | |
CD_CREATE_REF | acs_attitude_gain_a_command_ref |
The ACS control algorithm state space gain a matrix. More... | |
CD_CREATE_REF | acs_attitude_gain_b_command_ref |
The ACS control algorithm state space gain b matrix. More... | |
CD_CREATE_REF | acs_attitude_gain_c_command_ref |
The ACS control algorithm state space gain c matrix. More... | |
CD_CREATE_REF | acs_attitude_gain_d_command_ref |
The ACS control algorithm state space gain d matrix. More... | |
CD_CREATE_REF | acs_planet_target_command_ref |
Planet target. More... | |
CD_CREATE_REF | acs_body_rate_gain_command_ref |
The scalar body rate gain (double) More... | |
CD_CREATE_REF | acs_q_nadir_offset_command_ref |
Nadir offset (4x1) More... | |
CD_CREATE_REF | acs_control_period_command_ref |
ACS control period (double) More... | |
CD_CREATE_REF | acs_maximum_delta_angle_command_ref |
Desired maximum delta angle (double) More... | |
A PID based attitude control system.
The attitude control system takes inputs from attitude estimation and uses it to control pointing. The control system can control body rates, rotate about a specified axis, align a body axis with an inertial axis, track an attitude quaternion, align a body axis with a planet fixed target or do the last while rotating about that planet aligned axis.
You can compute the gain matrices using
[a,b,c,d] = PIDMIMO( 1, zeta, omega, tau_integral, omega_rolloff, t_samp, 'z' )
from the Spacecraft Control Toolbox (in MATLAB). omega_rolloff is a first order rate filter break frequency. 'z' implies that the controller equations are x[k+1] = a*x[k] + b*u[k]
The output is the torque demand. This is processed by the propulsion module.
You must also input the vehicle inertia matrix. It may be necessary to update the torque matrix and inertia matrix as fuel is consumed or when mass properties change.
The following are the pointing modes:
int fsw_attitude_control::get_index | ( | int | id, |
ml_matrix | index_list | ||
) |
Get the index for the SPICE id.
void fsw_attitude_control::initialize_data | ( | ) |
Create data and request the FSW_ATTITUDE_CONTROL_TRIGGER.
References acs_attitude_error_ref, acs_attitude_gain_a_command_ref, acs_attitude_gain_b_command_ref, acs_attitude_gain_c_command_ref, acs_attitude_gain_d_command_ref, acs_axis_rate_command_ref, acs_body_align_axis_command_ref, acs_body_rate_gain_command_ref, acs_control_mode_command_ref, acs_control_period_command, acs_control_period_command_ref, acs_eci_align_axis_command_ref, acs_error_ref, acs_maximum_delta_angle_command_ref, acs_omega_command_ref, acs_planet_target_command_ref, acs_q_eci_to_body_command_ref, acs_q_nadir_offset_command_ref, acs_rotate_angle_command_ref, acs_rotate_axis_command_ref, acs_solar_system_target_command_ref, acs_target_quaternion_ref, acs_torque_demand_ref, FSW_ATTITUDE_CONTROL_TRIGGER, and sc_data::path.
ml_matrix fsw_attitude_control::make_unit_vector | ( | ml_matrix | u | ) |
Make a unit vector.
int fsw_attitude_control::valid_quaternion | ( | ml_matrix | q | ) |
Checks the validity of a quaternion.
int fsw_attitude_control::valid_vector | ( | ml_matrix | u | ) |
Checks the validity of a unit vector.
|
protected |
Attitude error (3x1)
Referenced by initialize_data().
|
protected |
ACS error code (int)
Referenced by initialize_data().
|
protected |
Desired quaternion (4x1)
Referenced by initialize_data().
|
protected |
The torque demand for all attitude control (3x1)
Referenced by initialize_data().
|
protected |
Planet index.
|
protected |
Planet position.
|
protected |
Planet radius.
|
protected |
Planet rotation matrix.
|
protected |
Sun vector.
|
protected |
The spacecraft inertia matrix.
|
protected |
State estimate od_state.
|
protected |
The estimated body rate.
|
protected |
The estimated quaternion.