Skip to content

Commit

Permalink
AP_TECS: correct comment explaining roll-induced-drag scaling
Browse files Browse the repository at this point in the history
Co-authored-by: George Zogopoulos <[email protected]>
  • Loading branch information
peterbarker and Georacer committed Dec 13, 2024
1 parent 1ab0dcd commit 9835fe8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/AP_TECS/AP_TECS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ void AP_TECS::_update_throttle_with_airspeed(void)
const float nomThr = aparm.throttle_cruise * 0.01f;
const Matrix3f &rotMat = _ahrs.get_rotation_body_to_ned();
// Use the demanded rate of change of total energy as the feed-forward demand, but add
// additional component which scales with (1/cos(bank angle) - 1) to compensate for induced
// additional component which scales with (1/(cos(bank angle)**2) - 1) to compensate for induced
// drag increase during turns.
const float cosPhi_squared = (rotMat.a.y*rotMat.a.y) + (rotMat.b.y*rotMat.b.y);
STEdot_dem = STEdot_dem + _rollComp * (1.0f/constrain_float(cosPhi_squared, 0.1f, 1.0f) - 1.0f);
Expand Down Expand Up @@ -905,7 +905,7 @@ void AP_TECS::_update_throttle_without_airspeed(int16_t throttle_nudge, float pi
// Calculate additional throttle for turn drag compensation including throttle nudging
const Matrix3f &rotMat = _ahrs.get_rotation_body_to_ned();
// Use the demanded rate of change of total energy as the feed-forward demand, but add
// additional component which scales with (1/cos(bank angle) - 1) to compensate for induced
// additional component which scales with (1/(cos(bank angle)**2) - 1) to compensate for induced
// drag increase during turns.
const float cosPhi_squared = (rotMat.a.y*rotMat.a.y) + (rotMat.b.y*rotMat.b.y);
float STEdot_dem = _rollComp * (1.0f/constrain_float(cosPhi_squared, 0.1f, 1.0f) - 1.0f);
Expand Down

0 comments on commit 9835fe8

Please sign in to comment.