Stall Avoidance on APM Plane (Rev 1) by Francis Nelson Henderson Nov 11, 2014 APM Plane autopilot needs only three (3) new parameters in order to avoid stalling. First, a reference stall speed (Vs) at Standard Temperature and Pressure (STP) computed on-line using aircraft weight and wing dimensions, plus current weight, if different. That is all (Reference Vs, reference weight, and current weight). Autopilots have two airspeed reference systems, True Air Speed (TAS) and Indicated (calibrated) Air Speed (IAS). Navigation functions (like waypoints or Inertial navigation) need TAS; the piloting functions (like turning or landing or avoiding stall) need IAS. The desirable feature about IAS is that different altitudes and temperatures do not affect stall speed, or banked turn speed, or landing speed. For example, the TAS at which an airplane stalls is different at different altitudes for the same weight or g loads. However, the air density change with altitude affects IAS proportionally to the way it affects wing stall. Therefore, stall speed (Vs) for a given weight or g load is at the same IAS even though air densities are different. IAS or TAS may be converted given autopilot sensor inputs (barometric pressure, temperature, and GPS altitude). Using airspeed sensor and GPS sensor inputs the Extended Kalman Filter (EKF) presently produces its best estimate of airspeed as an output. This means it is possible to convert EKF airspeed into what is called IAS for stall avoidance. (ekf) The Vs reference stall speed is at sea level Standard Temperature and Pressure (STP). The IAS (ekf) conversion could be from local air density to sea level STP density or the reverse. The one-g reference Vs entered into the Ground Control Station (GCS) is at sea level STP. In either case IAS is proposed for determining when stall avoidance thresholds are crossed. For example (ekf) ignoring compressibility: TAS=IAS/sqrt(delta) where Delta=ratio of air density to ISA SeaLevel density = 288.15/(T+273.15) * (P/1013.25) and P= Ambient pressure in HPa(mB), T= ambient temperature in degrees Celsius Airspeed is not the single factor affecting an approaching stall. Wing g force loading also acts along with airspeed to cause or to relieve a stall condition. Small nose down elevator increases airspeed slowly, however down elevator is an immediate relief to g loads throughout the resultant slightly curved downward arc. It allows time for added thrust to restore safe speed or for transient turbulence to subside. In order to implement in flight stall avoidance, a one-g reference stall speed (Vs) is needed. It may be computed on-line using weight, wing span, wing root cord and wing tip cord seen at the link below and entered into the GCS: http://adamone.rchomepage.com/design.htm#calculate Alternatively, the airplane may be flown manually and tested for stall at safe altitude while recording the flight on the GCS. One can then observe the stalling speed by replaying the telemetry logs post flight. In the future the autopilot may automatically learn or refine the initial stall speed estimate using in- flight observations but we begin more simply as above. Even though typical RC aircraft have only one configuration (no flaps, fixed landing gear) the data structure providing the reference stall speeds to the autopilot shall support the following configurations: a. Gear Down state (fixed or retractable gear are down), Flap setting percentage 0% to 100% where 0% is the special no flaps case. The data structure will contain a 0%, 33%, 66%, and 100% stall speed flap setting reference points. Servo settings at points in between are interpolated. Rarely, will the 33%, 66%, and 100% data points be provided, but they are not excluded from the software design. b. Gear Up state (retractable gear case or no landing gear), with flap setting percentage 0% to 100% where 0% is the no flaps special case. As above, the design does not exclude stall speed estimates at partial flap settings. Autopilot software must take care the structure is safely initialized and defend against GCS omissions or errors. The data structure contains a reference weight at which the stall speeds are measured or calculated. It also includes the current weight at takeoff and fuel burn rates (for example oz/minute) at 0%, 33%, 66%, and 100% throttle settings. Fuel burn rates at intermediate throttle servo settings are interpolated. The autopilot integrates fuel consumed without needing to decide whether the model is petrol or electric. Electric aircraft burn zero oz/minute. The GCS should minimize operator entry by asking for additional information only if necessary. Reference weight and current weight are important because the formulas below relate weight, acceleration ( g forces), and reference stall speeds to avoid stalling in flight under varying wing load conditions. (1) Wing stall for an airfoil at STP air density occurs at a specific Angle of Attack (AoA). However, AoA on a flying airplane wing depends on the weight (total force resulting from g accelerations) and IAS so that an impending stall may be predicted without an AoA sensor, but using weight (g force) and IAS. Fortunately, the autopilot has a running real-time IAS estimate taking wind into account provided by the EKF. The same principal applies in a balanced banked turn where the stall speed goes up (or down) in proportion to the square root of g’s pulled. (2) For example, turning at 60 degrees bank (cos 60 = 0.5) results in 2 g’s. This is equivalent to doubling the weight. Once you know your level one-g stall speed, you can calculate it for a banked turn by doing the inverse: Multiplying Vs by the square root of the acceleration you must endure. Hence at 60 degrees bank, your stall speed increase by your level stall speed times the square root of 2, or 1.41. Say your stall speed at level is 28 knots. Maintaining altitude in a balanced turn at 60 degrees banking, Vs would then be 39 knots. Bank Angle G's Stall (ϴ) pulled Speed Degrees in turn Increase 0 1.00 1.00 10 1.02 1.01 20 1.06 1.03 30 1.15 1.07 40 1.31 1.14 50 1.56 1.25 60 2.00 1.41 65 2.37 1.54 70 2.92 1.71 75 3.86 1.97 80 5.76 2.40 85 11.47 3.39 The above table suggests that if the turn radius is long enough to keep the bank angle (ϴ) shallow, then the banked stall speed does not increase much. The ratio of Weight2/Weight1 from equation (1) is equivalent to g acceleration. Therefore, Equation (1) can be rewritten to give the Current Computed Stall speed (Vccs) dependant on g loading. If (Vccs ≥ IAS ) then remedy stall (3) (ekf) By monitoring the Z-accelerometer and IAS for approaching stall conditions the autopilot may take (ekf) action to increase IAS and reduce g force. (ekf) What can the autopilot do to avoid stall? It can: 1.) Trigger an audio stall warning at the GCS. 2.) Add power. 3.) Level the wings. 4.) Reduce the angle of attack: 1.) Trigger an audio voiced stall warning at the GCS when IAS is falling downward passing (ekf) through 1.2 Vccs threshold. Audio message content will depend on the flight mode such as whether the autopilot or pilot is controlling the throttle. 2.) Add power in modes where the autopilot has control of the throttle and the throttle setting is low. Suggest the throttle be increased using an existing slew rate at the point where IAS declined below 1.2 Vccs until IAS rises above the original 1.3Vccs (ekf) (ekf) threshold. 3.) Level the wings. A 30 degree bank increases the g’s by 15% thus raising the stall speed by 7%. Suggest leveling the wings starting at the 1.07Vs threshold. Aileron deflection should be small in order avoid inducing a tip stall (undesirable). Suggest 20% constant aileron servo deflection until level or until IAS rises above the original 1.3Vccs threshold. (ekf) 4.) Reduce the angle of attack by pitching the nose down 2 degrees per second, but not to exceed 6 degrees below the horizontal. 12 – 15 degrees are typical examples of stalling AoA. Exit stall recovery when IAS rises above the original 1.3Vccs threshold. (ekf) Otherwise, the downward flight path angle of descent will be at least twice the nose down angle and the aircraft is expected to gain speed power off. It can be flown onto the ground at those down slope angles without flaring. An over simplified event driven state machine approach is used for thinking through Stall Avoidance suggestions in each of the 16 APM Plane Flight Modes . It does not apply to Copter or Rover. Plane wing leveling and pitch down can succeed at lowering the new Current Computed Stall speed (Vccs) below the original stall speed thresholds, thereby averting an impending stall. It should be noted the original Vs factor is not necessarily a one-g factor if the stall avoidance is caused by wing loading rather than low speed. Therefore when stall avoidance lowers Vccs by reducing g loading, the as yet unchanged forward speed IAS is unlikely to qualify as above the (ekf) original 1.3Vccs stall exit threshold. Recommend the stall state machine ignore the temorary benefits of reduced g loading and require IAS to rise above the original 1.3Vccs stall speed exit (ekf) threshold. It is intended to provide hysteresis. I diverge for a moment to note the autopilot does not have direct feedback from the motors. Eventually this needs to be corrected no matter whether petrol or electric power. Stall Avoidance needs to know immediately whether servo PWM signals to the throttle have actually added power. The event generator is a simple piece of code primarily responsible for calling the state machine with two indexes into the function table. The event generator always loads the new 32 bit Real- Time Counter (RTC) and the new Vccs into the state machine’s associated data structure. RTC time tags give states the ability to perform delays. The event generator does not decide anything based on state because that is accomplished by the indexing. The event generator may log exception conditions or trace the state machine if trace is enabled. The event generator could be called at the Plane 50 Hz loop rate, but I think no less than 10 Hz. State Machine decision making is as fast as indexing into an array of function handles. State machine function handlers may manipulate the Vccs stall thresholds used for comparisons by the event generator (1.3Vs, 1.2Vs, 1.07Vs). The event detects a speed level, however the state machine determines falling or rising edge. Flight Mode is the first index into the state machine. Event is the second index. Both are stored in the state machine structure, but are extracted and passed to the state machine execute function in order to extract and call the chosen function. Event indexes could be: 1. IAS is above 1.3Vccs. (ekf) 2. IAS is between 1.2Vccs – 1.3Vccs (ekf) 3. IAS is between 1.07Vccs - 1.2Vccs (ekf) 4. IAS is below 1.07Vccs (ekf) Some of the 16 Flight Modes (states) need to progress through sub-states, for example when transitioning between modes. Following are suggested concepts of operation for Stall avoidance in each flight mode: MANUAL MODE: No action is taken to avoid stall in Manual Mode because stall may be intentional. Furthermore, suggest no audio verbal stall warning flags be sent to the GCS because Manual Mode is closest to pure Radio Control flying. The event generator runs every cycle in order that the stall state machine always tracks whether the plane is transitioning to flying speed (1.3Vs) from takeoff or from Stall Warning when modes are switched. STABALIZE MODE No action is taken to avoid stall in Stabilize Mode (state) because stall may be intentional. However, suggest audio verbal stall warning flags be sent to the GCS on the event falling edge qualifies as “IAS is between 1.07Vccs and 1.2Vccs” thus causing the GCS to say, “Approaching (ekf) Stall.” The event generator runs every cycle. The stall state machine tracks whether the plane is transitioning to flying speed (1.3Vccs) from Stall Warning or from takeoff. If from stall warning recovery, then the GCS may say, “Flight speed recovered”. Avoid using the key words like “stall” or “warning” in the spoken recovery message. FBWA MODE Stall is actively avoided in FBWA mode. Verbal stall warning triggers are sent to the GCS on the qualified event falling edge “IAS is between 1.2Vs – 1.07Vccs” thus causing the GCS to say, (ekf) “Approaching Stall, add power” because the pilot controls the throttle. When the event falling edge “IAS is below 1.07Vccs” qualifies as valid, trigger the GCS to say (ekf) once, “Avoiding Stall, leveling wings, lowering nose .” Level the wings using constant 20% aileron servo deflection until level or until IAS rises above the original 1.3Vccs threshold. (ekf) Simultaneously reduce the angle of attack by pitching the nose down 2 degrees per second, but not to exceed 6 degrees below the horizontal. Suggest avoid adding more parameters to the GCS. The flight path angle of descent will be at least twice the maximum 6 degree nose down angle and the aircraft is expected to glide successfully if power off. It can be flown onto the ground at those angles without flaring. Stall is successfully avoided. FBWA may resume responding to otherwise contrary pilot aileron inputs (like increasing the roll angle) and elevator inputs (like more up elevator) when 1.3Vccs threshold is crossed. The hysteresis is between 1.07Vccs – 1.3Vccs. The autopilot could know from increases to the throttle servo settings whether the pilot has added power, and secondly from the energy measurement system, whether the motor has responded. However, this knowledge is best not used by the autopilot because it violates the FBWA concept. Exit from FBWA stall avoidance occurs when Vccs rises above the 1.3Vccs threshold. The GCS is triggered to announce, “Flight speed Recovered.” Initial aircraft attitude on return to pilot control is at the final stall recovery attitude. FBWB MODE Active stall avoidance in FBWB mode is similar to FBWA. Verbal stall warning triggers are sent to the GCS on the qualified event falling edge “IAS is between 1.2Vccs – 1.07Vccs” thus causing the (ekf) GCS to say, “Approaching Stall, level the wings, lower the nose, add power.” When the event falling edge “IAS is below 1.07Vccs” qualifies as valid, trigger the GCS to say (ekf) once, “Avoiding Stall, leveling wings, lowering nose .” Level the wings using constant 20% aileron servo deflection until level or until IAS rises above the original 1.3Vccs threshold. (ekf) Simultaneously reduce the angle of attack by pitching the nose down 2 degrees per second, but not to exceed 6 degrees below the horizontal. Avoid adding more parameters to the GCS. The flight path angle of descent will be at least twice the maximum 6 degree nose down angle and the aircraft is expected to glide successfully if power off. It can be flown onto the ground at those angles without flaring. Stall is successfully avoided. The autopilot does not intervene to control the throttle because it violates the FBWB concept. FBWB may resume responding to otherwise contrary pilot aileron input (like increasing the roll angle) and elevator inputs (like more up elevator) when when IAS crosses the 1.3Vccs recovery (ekf) threshold. The hysteresis is between 1.07Vccs – 1.3Vccs. Exit from FBWB stall avoidance occurs when IAS rises above the original 1.3Vccs threshold. The (ekf) GCS is triggered to announce, “Flight speed Recovered.” Initial aircraft attitude on return to pilot control is at the final stall recovery attitude. AUTOTUNE MODE Stall avoidance is active in Autotune Mode by making GCS announcements and by limiting up elevator excursions. Otherwise, Autotune is treated like Manual mode – no intervention. The autopilot does not have Vs information for inverted flight or negative g’s, therefore that case is ignored. Fortunately, it is also unlikely to happen. Verbal stall warning triggers are sent to the GCS on the qualified falling edge event “IAS is (ekf) between 1.2Vccs – 1.07Vccs” thus causing the GCS to say, “Approaching Stall, add power” because the pilot controls the throttle. When the falling edge event “IAS is below 1.07Vccs” is qualified valid, trigger the GCS to say (ekf) once, “Avoiding Stall, limiting up elevator .” The GCS should complete one announcement before beginning a second. Only elevator motion is limited or reduced, not aileron. No Stall recovery announcement is made at the GCS when IAS rises above the original 1.3Vccs threshold. However, the 1.3Vccs event (ekf) does reset the stall state machine for new falling edge event announcements at 1.2Vccs and 1.07Vccs. Exit from Autotune stall avoidance elevator restriction occurs when IAS rises above the original (ekf) 1.3Vccs threshold. However, landing glide slope or landing flare could be affected, harmlessly. The pilot may wish to switch to Manual mode. TRAINING MODE Stall avoidance is active in Training Mode. Intervention is similar to Autotune Mode by making GCS announcements and by limiting up elevator excursions. Verbal stall warning triggers are sent to the GCS on the qualified falling edge event “IAS is (ekf) between 1.2Vccs – 1.07Vccs” thus causing the GCS to say, “Approaching Stall, add power, level the wings, lower the nose.” The pilot controls the throttle. When the falling edge event “IAS is below 1.07Vccs” is qualified valid, trigger the GCS to say (ekf) once, “Avoiding Stall, limiting up elevator .” The GCS should complete one announcement before making a second since these two announcements could come in rapid succession. Only up elevator motion is limited, not aileron. Stall recovery announcement is made at the GCS when IAS rises above the original 1.3Vccs threshold. The 1.3Vccs event resets the stall state (ekf) machine for new falling edge event announcements at 1.2Vccs and 1.07Vccs. Exit from stall avoidance up elevator restriction occurs when Vccs rises above the 1.3Vccs threshold. However, landing glide slope or landing flare are affected, beneficially. The trainer pilot is protected from stalling on final approach, and severe ballooning is reduced on landing flair. ACRO MODE Stall Avoidance is NOT active in ACRO (acrobatic) mode. The autopilot has no inverted flight (negative g) reference stall speed, Vs. Like Manual Mode, the pilot controls the maneuvers and the throttle. CRUISE MODE Stall avoidance is active in Cruise Mode similar to FBWB. Verbal stall warning triggers are sent to the GCS on the qualified falling edge event “IAS(ekf) is between 1.2Vccs – 1.07Vccs” thus causing the GCS to say, “Approaching Stall, level the wings, lower the nose, add power.” When the falling edge event “IAS(ekf) is below 1.07Vccs” qualifies as valid, trigger the GCS to say, “Avoiding Stall, leveling wings, lowering nose .” Suggest the autopilot levels the wings using constant 20% aileron servo deflection until level or until IAS rises above the original 1.3Vccs (ekf) threshold. Simultaneously reduce the angle of attack by pitching the nose down 2 degrees per second, but not to exceed 6 degrees below the horizontal. Avoid adding more parameters to the GCS. The flight path angle of descent will be at least twice the maximum 6 degree nose down angle and the aircraft is expected to glide successfully if power is off. It can be flown onto the ground at those angles without flaring. Stall is successfully avoided. CRUISE stall avoidance needs more throttle. However, the autopilot does not intervene to control the throttle because it violates the CRUISE concept. CRUISE may resume responding to otherwise contrary pilot aileron input (like increasing the roll angle) and contrary elevator inputs (like more up elevator) after IAS crosses the original (ekf) 1.3Vccs threshold. The hysteresis is between 1.07Vccs – 1.3Vccs. AUTO MODE Stall avoidance is Active in AUTO Mode similar to CRUISE except the autopilot has the advantage of controlling the throttle. Since the autopilot is completely controlling the flight, stall events are likely caused by loss of power or by a mission plan the aircraft cannot perform (like too steep a climb or too short a waypoint turn radius at specified speeds). The first new stall avoidance action for AUTO mode should occur at the GCS where pre-flight input parameter checks are made against Vs to assure turn radius (r), speed (V), and bank angle (ϴ) are stall safe. Presently, the GCS user could unknowingly, at a given speed, choose waypoint radii that are too short, that if obeyed, require violation of the maximum bank angle or could result in a stall from increased g loads in the turn. One needs to know the mathematical relationship between speed (V), balanced turn bank angle (ϴ), and radius (r) in order to set parameters. For example the balanced turn radius (r) depends on speed (V) and bank angle (ϴ): (4) g = acceleration of gravity = 9.81 meters/sec2 r = turn radius WP_RADIUS and WP_LOITER_RAD at Mission Planner GCS. ϴ = bank angle LIM_ROLL_CD at Mission Planner GCS. V = speed ARSPD_FBW_MAX at Mission Planner GCS. From equation (2), g’s pulled in a coordinated banked turn are: (5) The order in which a GCS User Interface design would prompt for input parameters is unknown. However, parameters like bank angle ϴ are candidates for elimination because ϴ is derived from other parameters like speed, turn induced g forces, and stall thresholds. The result of GCS Vs proof checking (page 5) is that all auto maneuvers are thought stall proof. None-the-less in AUTO Mode, should something go wrong, verbal stall warning triggers are sent to the GCS on the qualified falling edge event “IAS is between 1.2Vccs – 1.07Vccs” thus causing (ekf) the GCS to say, “Approaching Stall, adding power.” The autopilot adds power if available. If successful, the GCS announces, “ Flight speed recovered.” Failure is likely to mean the aircraft has lost power. When the falling edge event “IAS is below 1.07Vccs” qualifies as valid, trigger the GCS to say, (ekf) “Avoiding Stall, leveling wings, lowering nose .” Suggest the autopilot level the wings using constant 20% aileron servo deflection until level or until IAS rises above the original 1.3Vccs (ekf) threshold. Simultaneously the autopilot reduces the angle of attack by pitching the nose down 2 degrees per second, but not to exceed 6 degrees below the horizontal. The flight path angle of descent will be at least twice the maximum 6 degree nose down angle and the aircraft is expected to glide successfully if power off. It can be flown onto the ground at these angles without flaring. Stall is successfully avoided. However, if in 5 seconds the energy management system determines that the commanded energy increase did not occur, then RTL is triggered. If above 15 meters altitude, the autopilot begins a shallow turning descending return into the home direction. The new RTL mode also incorporates stall avoidance. RETURN TO LAUNCH (RTL) MODE RTL is an AUTO like waypoint flight mode in which the autopilot controls the throttle, attitude, and heading. RTL needs to know from the Energy Management System whether the aircraft is without power. If without power, the autopilot enters a shallow turning gliding descent towards home at 6 degrees nose down. If the loiter location is reached, the autopilot conducts a shallow circling descent at 6 degrees nose down. Otherwise in RTL Mode, verbal stall warning triggers are sent to the GCS on the qualified falling edge event “IAS is between 1.2Vccs – 1.07Vccs” thus causing the GCS to say, “Approaching (ekf) Stall, adding power.” The autopilot adds power if available. If successful, the GCS announces, “ Flight speed recovered.” Failure means the aircraft has lost power. Therefore, when the falling edge event “IAS is below (ekf) 1.07Vccs” qualifies as valid, trigger the GCS to say, “Avoiding Stall, lowering nose .” Wing leveling is not used because shallow banks affect Vccs very little and the airplane needs to turn towards home. The autopilot reduces the angle of attack by pitching the nose down 2 degrees per second, but not to exceed 6 degrees below the horizontal. The flight path angle of descent will be at least twice the maximum 6 degree nose down angle and the aircraft is expected to glide successfully if power off. It can be flown onto the ground at these angles without flaring or it may reach the loiter location first. Stall is avoided.
Description: