Skip to content

Commit 6f8f1ae

Browse files
committed
Plane: Use stall speed for roll stall prevention
1 parent 9fb1e2b commit 6f8f1ae

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ArduPlane/Attitude.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,12 @@ void Plane::update_load_factor(void)
659659
}
660660
#endif
661661

662-
float max_load_factor = sq(smoothed_airspeed / MAX(aparm.airspeed_min, 1));
662+
float stall_airspeed_1g = is_positive(aparm.airspeed_stall)
663+
? aparm.airspeed_stall
664+
: aparm.airspeed_min;
665+
666+
float max_load_factor =
667+
sq(smoothed_airspeed / MAX(stall_airspeed_1g, 1));
663668

664669
if (max_load_factor <= 1) {
665670
// our airspeed is below the minimum airspeed. Limit roll to
@@ -671,7 +676,7 @@ void Plane::update_load_factor(void)
671676
// load limit. Limit our roll to a bank angle that will keep
672677
// the load within what the airframe can handle. We always
673678
// allow at least 25 degrees of roll however, to ensure the
674-
// aircraft can be manoeuvred with a bad airspeed estimate. At
679+
// aircraft can be manoeuvered with a bad airspeed estimate. At
675680
// 25 degrees the load factor is 1.1 (10%)
676681
int32_t roll_limit = degrees(acosf(1.0f / max_load_factor))*100;
677682
if (roll_limit < 2500) {

ArduPlane/Parameters.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ const AP_Param::Info Plane::var_info[] = {
323323

324324
// @Param: AIRSPEED_STALL
325325
// @DisplayName: Stall airspeed
326-
// @Description: If stall prevention is enabled this speed is used to calculate the minimum airspeed while banking. If this is set to 0 then the stall speed is assumed to be the minimum airspeed speed. Typically set slightly higher then true stall speed. Value is as an indicated (calibrated/apparent) airspeed.
326+
// @Description: If stall prevention is enabled this speed is used for its calculations. If set to 0 then AIRSPEED_MIN is used instead. Typically set slightly higher than the true stall speed. Value is as an indicated (calibrated/apparent) airspeed.
327327
// @Units: m/s
328328
// @Range: 5 75
329329
// @User: Standard

0 commit comments

Comments
 (0)