AC_AttitudeControl: add comments for system ID disturbance input code

This commit is contained in:
bnsgeyer 2024-05-13 19:33:26 -04:00 committed by Bill Geyer
parent a1a5647b7f
commit 8a42a29ef7
2 changed files with 4 additions and 2 deletions

View File

@ -643,6 +643,7 @@ void AC_PosControl::update_xy_controller()
// Position Controller
const Vector3f &curr_pos = _inav.get_position_neu_cm();
// determine the combined position of the actual position and the disturbance from system ID mode
Vector3f comb_pos = curr_pos;
comb_pos.xy() += _disturb_pos;
Vector2f vel_target = _p_pos_xy.update_all(_pos_target.x, _pos_target.y, comb_pos);
@ -655,6 +656,7 @@ void AC_PosControl::update_xy_controller()
// Velocity Controller
const Vector2f &curr_vel = _inav.get_velocity_xy_cms();
// determine the combined velocity of the actual velocity and the disturbance from system ID mode
Vector2f comb_vel = curr_vel;
comb_vel += _disturb_vel;
Vector2f accel_target = _pid_vel_xy.update_all(_vel_target.xy(), comb_vel, _dt, _limit_vector.xy());

View File

@ -462,8 +462,8 @@ protected:
float _jerk_max_xy_cmsss; // Jerk limit of the xy kinematic path generation in cm/s^3 used to determine how quickly the aircraft varies the acceleration target
float _jerk_max_z_cmsss; // Jerk limit of the z kinematic path generation in cm/s^3 used to determine how quickly the aircraft varies the acceleration target
float _vel_z_control_ratio = 2.0f; // confidence that we have control in the vertical axis
Vector2f _disturb_pos;
Vector2f _disturb_vel;
Vector2f _disturb_pos; // position disturbance generated by system ID mode
Vector2f _disturb_vel; // velocity disturbance generated by system ID mode
// output from controller
float _roll_target; // desired roll angle in centi-degrees calculated by position controller