ArduPilot飞控之FAILSAFE机制

1. 源由

之前对《航模飞控之FAILSAFE机制》做了一个简单的探讨,并根据自己的理解做了基本的需求整理。

为了更好的了解现行Ardupilot开源飞控对上述情况的处理方法,以及采用何种策略进行救援,能将损失减到最小。

接下来一起来看下Ardupilot的设计逻辑(场景分析)。

注:以下内容主要来自Wiki文档以及部分代码的理解,因个人的理解,以及时间的变化,可能实际代码会有所变更。如果发现有出入的地方,也请小伙伴们能评论给出大家的意见和建议,谢谢!

2. 设计

Copter有许多异常场景下的保护机制。在四轴航模失去控制的情况下,采取策略恢复故障或避险措施,来避免飞行器丢失。不同的情况可能有不同的救援策略,具体策略的选择又需要根据飞行环境的场景进行选择,这部分的决策大部分交给了用户(因为飞手更了解飞行的实际场景,以及出现意外情况后,期望使用什么方法进行避险)。

注:当然,如果能有足够多的外部传感器,结合环境分析,如果伴机电脑能够更加明确的做出最优解,那就是更佳的方式。

以下列出了主要的触发故障保护的原因:

  1. Radio Failsafe (遥控信号丢失)
  2. Battery Failsafe (电池低电)
  3. GCS Failsafe (地面站/电传信号丢失)
  4. EKF Failsafe (EKF故障,Extended Kalman Filter)
  5. Dead Reckoning Failsafe (航迹推算救援)
  6. Vibration Failsafe (振动故障保护)
  7. Dead Motor Takeoff Prevention (起飞异常)
  8. Terrain Data Loss Failsafe (地形数据异常)
  9. Crash Check (碰撞检查)
  10. Parachute (掉高异常,降落伞)
  11. Independent Watchdog (看门狗事件)

注:其中看门狗事件方面的异常,并没有很好的方法处理,但是在固定翼飞行中,有该功能DEMO,并没有整合到正式版本中。

接下来,我们一个一个的来逐个过下从原理上以上该问题发生的场景。

  • FS_OPTIONS

0: Disabled
1: Continue if in Auto on RC failsafe only
2: Continue if in Auto on GCS failsafe only
3: Continue if in Auto on RC and/or GCS failsafe
4: Continue if in Guided on RC failsafe only
8: Continue if landing on any failsafe
16: Continue if in pilot controlled modes on GCS failsafe
19: Continue if in Auto on RC and/or GCS failsafe and continue if in pilot controlled modes on GCS failsafe

2.1 遥控信号丢失

资料:Ardupilot - Radio Failsafe

这个图还是很形象的,遥控器和接收机之间无线通信异常,导致信号丢失等情况发生,就会触发该Failsafe事件。

当然上面说的是比较笼统的一个用户层级能够非常简单就能理解的情况,但是从从工程技术的角度来看,开发人员仅仅知道这个是不太够的,这就需要从分析层面更加深入的的具体化分析。

在这里插入图片描述

注:每个公司的组织结构可能不太一样,且同个工种的具体工作任务可能也存在差异。从个人的理解来说,这种场景通常是一个复合的多因素问题,通常不是一个工种专业能够全部覆盖的。不过凡事总是有个牵头的,而通常这个牵头的人员,比较合适的人选是产品经理,并需要开出具体的工作任务单给相关工种,最终汇总该功能点的总体需求清单。

不说组织结构和工种职责了,这个有点偏离话题。

2.1.1 触发原因

我们来看下Ardupilot分析出来的几条具体需求点,当以下情况发生并持续时间超出RC_FS_TIMEOUT时,触发Failsafe

  1. The pilot turns off the RC transmitter.

理解:遥控发射器发生掉电
实际情况,比如:人为关遥控器;电池用完;

  1. The vehicle travels outside of RC range and signal is lost.

理解:RF射频信号超出通信最大距离
实际情况,比如:障碍物遮挡;飞行距离超出LOS通信最大距离

  1. The pilot forces the throttle channel below FS_THR_VALUE from the transmitter.

理解:油门杆量低于FS_THR_VALUE表明遥控器并未与飞控正常通信
实际情况,通常遥控器正常连接飞控的时候油门最低值会设置在大于FS_THR_VALUE,不管何种原因,如果该值不正确,可以认为所有接收到的遥控信号都是存疑的。

  1. The receiver loses power (unlikely).

理解:航模上的遥控接收机掉电
实际情况,有可能供电异常导致接收机不能正常工作(通常来说这种情况比较少,但是未必不可能)

  1. The wires connecting the receiver to the autopilot are broken (unlikely).

理解:接收机与飞控之前的通信总线异常
实际情况,由于振动,线缆老化等情况导致通信线缆出现破损,进一步导致通信总线异常(通常来说这种情况比较少,但是未必不可能)

2.1.2 场景分析

触发以后,实际飞控所处的状态,对于后续具体操作是有影响的,因此分析

  1. If the copter is disarmed, no failsafe will take place.

当飞控处于上锁状态时,不会触发任何Failsafe操作。
这个很容易立即,当一个上锁的飞控,显然处在一个安全状态,无需仍和救援操作。

  1. If the copter is armed but has landed, the copter will immediately disarm.

当飞控处于解锁状态且此时已经降落,飞控立即上锁。
已经降落是一个安全状态,此时上锁就可以切断动力,避免不必要的涡喷或者螺旋桨导致意外事故。

  1. If the copter is armed in Stabilize or Acro modes, and the throttle input is at minimum, the copter will immediately disarm.

多旋翼在自稳、手动等状态,最低油门时,触发Failsafe就直接上锁。
注1:首先,要关注这个是多旋翼而非滑翔机,因为滑翔机很可能长时间低油门输出。
注2:其次,通常情况下多轴飞行,油门不会长时间最低,但是要注意花飞动作,通常是有个短时间的低油门时间。
注3:同时,发生长时间低油门+RC链路信号丢失的情况非常少见。比如:高空可控低油门跌落(持续一段时间),发生遥控器信号丢失,导致上锁。

  1. If the failsafe clears (i.e. transmitter and receiver regain contact) the copter will remain in its failsafe mode. It will not automatically return to the flight mode that was active before the failsafe was triggered. If the pilot wished to re-take control he/she would need to change your flight mode switch to another position and then back to previos mode.

如果遥控器信号恢复连接,飞控不会立即退出到之前的状态,会仍然保持当前的Failsafe状态。如果飞手想要获得控制,需要对摇杆进行操作,激活飞控的遥控器控制权。

  1. When a radio failsafe is triggered, the copter can be configured via parameters to do nothing, land immediately, RTL, or SmartRTL. It can also be configured to bypass the failsafe in an Auto Mode mission, or to continue landing if already in a landing phase.

其他场景下(飞行时),出现遥控信号丢失,飞控将按照预先配置策略(do nothing/land immediately/RTL/SmartRTL)执行相关策略。
注:当Auto Mission任务期间,可以配置绕开配置策略,选择继续执行任务。

2.1.3 重要参数

  • RC_FS_TIMEOUT default 1seconds for confirming RC loss event
  • FS_THR_ENABLE

0: Disabled
1: Enabled always RTL
2: Enabled Continue with Mission in Auto Mode
3. Enabled always Land
4: Enabled always SmartRTL or RTL
5: Enabled always SmartRTL or Land
6: Enabled Auto DO_LAND_START or RTL
7. Enabled always Brake or Land

  • FS_THR_VALUEdefault 975us for detecting PWM failsafe level on channel 3

2.2 电池低电

资料:Ardupilot - Battery Failsafe

电池低电触发必须首先有一个能够进行电压/电流采集的电源模块,否则该功能没有正确的触发输入条件。

2.2.1 触发原因

  1. voltage drops below the voltage held in the BATT_LOW_VOLT parameter (or FS_BATT_VOLTAGE in older versions) for more than 10 seconds. The default voltage is 10.5 volts. If set to zero, the voltage based trigger will be disabled.

理解:当电池电压低于 BATT_LOW_VOLT;默认0时,该功能不执行;

  1. remaining capacity falls below the BATT_LOW_MAH parameter (or FS_BATT_MAH in older versions) 20% of the battery’s full capacity is a good choice (i.e. “1000” for a 5000mAh battery). If set to zero, the capacity based trigger will be disabled.

理解:当电池使用MAH低于 BATT_LOW_MAH;默认0时,该功能不执行;

2.2.2 场景分析

当满足触发条件后,将会执行以下操作:

  1. Buzzer will play a loud low-battery alarm
  2. LEDs will flash yellow
  3. “Low Battery!” will be displayed on the ground stations HUD (if telemetry is connected)
  4. 该步骤与实际状态有关,详见下面分析:

4.1 当上锁时,保持当前状态
4.2 当解锁时,执行BATT_FS_LOW_ACTBATT_FS_CRT_ACT 配置的救援操作

2.2.3 重要参数

  • BATT_LOW_TIMERdefault 10 second, how long the voltage must be below the threshold for the failsafe to trigger
  • BATT_FS_VOLTSRCallows configuring whether the raw battery voltage or a sag corrected voltage is used
  • BATT_FS_LOW_ACT

0: None
1: Land
2: RTL
3. SmartRTL or RTL
4: SmartRTL or Land
5: Terminate
6: Auto DO_LAND_START or RTL

  • BATT_LOW_VOLTdefault 0 voltage for None Action
  • BATT_LOW_MAHdefault 0 capacity for None Action
  • BATT_FS_CRT_ACT

0: None
1: Land
2: RTL
3. SmartRTL or RTL
4: SmartRTL or Land
5: Terminate
6: Auto DO_LAND_START or RTL

  • BATT_CRT_VOLTdefault 0 voltage for None Action, holds the secondary (lower) voltage threshold. Set to zero to disable.
  • BATT_CRT_MAHdefault 0 capacity for None Action, holds the secondary (lower) capacity threshold. Set to zero to disable.

2.3 地面站/电传信号丢失

资料:Ardupilot - GCS Failsafe

地面站信号故障是通过监测地面站软件与Ardupilot系统上一次MAVLink心跳以来的时间来感知。如果未接收到心跳超过FS_GCS_TIMEOUT秒(默认值为5秒),则GCS故障保护事件将根据参数设置触发。请注意,如果没有连接地面军事系统,则无论参数设置如何,地面军事系统故障保护都将保持非激活状态。

2.3.1 触发原因

    1. turns off or otherwise disconnects the GCS

理解:关闭或者断开GCS地面站软件

    1. The copter travels beyond the range of the GCS telemetry radios

理解:RF射频信号超出通信最大距离

    1. The GCS telemetry radio on either end loses power

理解:发射机或者接收机出现掉电,导致通讯丢失

    1. Wires connecting the GCS telemetry radio to the autopilot or ground equipment become disconnected

理解:当电传与飞控之间的通讯线出现断链,导致通讯丢失

2.3.2 场景分析

  1. If the copter is disarmed, no failsafe will take place.

在上锁情况下,无需做任何动作

  1. If the copter is armed but has landed, the copter will immediately disarm.

解锁情况下,如果已经降落,直接上锁(确保安全)

  1. If the copter is armed in Stabilize or Acro modes, and the throttle input is at minimum, the copter will immediately disarm.

解锁情况,在【Stabilize】和【Auto】模式下,且油门处于最低,直接上锁(确保安全)

  1. Otherwise, the copter will take the actions as configured in the parameters described below.

当GCS failsafe触发时,将会按照FS_GCS_ENABLE设定执行相关救援策略

  1. If the failsafe clears (i.e. GCS reconnects and MAVLink heartbeat is restored) the copter will remain in its failsafe mode. It will not automatically return to the flight mode that was active before the failsafe was triggered.

This means that if, for example, the vehicle was in Loiter when the failsafe occurred and the flight mode was automatically changed to RTL, even after the GCS reconnects, the vehicle would remain in RTL. If the pilot wished to re-take control in Loiter he/she would need to change the flight mode switch to another position and then back to Loiter. This can be done via the re-connected GCS also.
换句话说当GCS软件断链触发相关救援后,如果GCS重连后,要退出救援模式需要GCS上发出指令来恢复用户控制权。

2.3.3 重要参数

  • FS_GCS_TIMEOUTdefault 5 seconds
  • FS_GCS_ENABLE

0: Disabled/NoAction
1: RTL
2: RTL or Continue with Mission in Auto Mode
3. SmartRTL or RTL
4: SmartRTL or Land
5: Land
6: Auto DO_LAND_START or RTL
7. Brake or Land

2.4 EKF故障(Extended Kalman Filter)

资料:Ardupilot - EKF Failsafe

EKF故障保护通过监测EKF(位置和姿态估计系统)的运行状况,以发现位置估计异常(通常由GPS故障或指南针错误引起),并防止“飞离”。

2.4.1 触发原因

  • The EKF failsafe will trigger when any two of the EKF “variances” for compass, position or velocity are higher than the FS_EKF_THRESH parameter value for 1 second.
  1. compass + position 满足FS_EKF_THRESH设定,并持续1秒,触发EKF救援
  2. compass + velocity 满足FS_EKF_THRESH设定,并持续1秒,触发EKF救援

2.4.2 场景分析

EKF异常会触发相应的流程:

  1. The autopilot’s LED will flash red-yellow or blue-yellow and the tone-alarm will sound

  2. “EKF variance” will appear on the ground station’s HUD if telemetry is connected

  3. 不同模式下的处理方式不同:

3.1 In manual flight modes that do not require GPS (i.e. Stabilize, Acro, AltHold) nothing further will happen but the pilot will be unable to switch into autonomous flight modes (Loiter, PosHold, RTL, Guided, Auto) until the failure clears
不需要GPS的模式下,不会发生任何问题。此时,也无法切换到自动导航模式。

3.2 In autonomous modes that require GPS (i.e. Loiter, PosHold, RTL, Guided, Auto, etc) the FS_EKF_ACTION controls the behaviour. By default this is “1” meaning the vehicle will switch to Land mode. This is a “pilot controlled” land meaning the pilot will have control of the roll and pitch angle but the vehicle will descend at the LAND_SPEED. It will land and finally disarm its motors.
Note: After an EKF failsafe occurs, the pilot can re-take control (using the flight mode switch) in a manual flight mode such as AltHold to bring the vehicle home.
自动导航模式下,则会受控降落;如果期望手动控制,飞手需要切换到手动模式(i.e. Stabilize, Acro, AltHold)等无需GPS的模式下,进行控制。

  1. An EKF failsafe error will be written to the dataflash logs

2.4.3 重要参数

  • FS_EKF_THRESH

disable: 0
strict: 0.6
default: 0.8
Relaxed: 1.0

  • FS_EKF_ACTION

1: Land
2: AltHold
3. Land even in Stablize

2.5 航迹推算救援

资料:Ardupilot - Dead Reckoning Failsafe

当飞控失去GPS(或者更准确地说,如果它失去了基于GPS、OpticalFlow等的位置估计),可以让飞机返回起飞点(或部分返回起飞点)。

2.5.1 触发原因

  • The deadreckoning failsafe will trigger under the same conditions as the EKF failsafe. Namely when any two of the EKF “variances” for compass, position or velocity are higher than the FS_EKF_THRESH parameter for 1 second.
  1. compass + position 满足FS_EKF_THRESH设定,并持续1秒,触发EKF救援
  2. compass + velocity 满足FS_EKF_THRESH设定,并持续1秒,触发EKF救援
  • In practice it is expected that normally it will be the loss of GPS that will trigger the failsafe.

出现该救援的场景,通常出现在GPS信号丢失。

2.5.2 场景分析

自动导航飞行过程中,出现GPS信号丢失时:

  1. The vehicle will continue to fly normally for 7 to 10 seconds after the loss of GPS

飞控会维持飞行7 ~ 10秒钟

  1. “Dead Reckoning started” will be displayed on the GCS and the vehicle will switch to RTL mode and begin flying home

GCS出现“Dead Reckoning started”提示,并切换到RTL模式,并开始返航

  1. If the vehicle does not reach home within FS_DR_TIMEOUT seconds, the EKF failsafe will trigger and the vehicle will switch to Land mode

当超过FS_DR_TIMEOUT时间,如果尚未到达,则切换到降落模式。

  1. Even if the GPS recovers while the vehicle is returning home, the vehicle will remain in RTL

返航过程中,如果GPS信号恢复,飞控会继续RTL救援。

2.5.3 重要参数

Ballistic coefficient for X axis drag; Note: This parameter is for advanced users

Ballistic coefficient for Y axis drag; Note: This parameter is for advanced users

Momentum coefficient for propeller drag; Note: This parameter is for advanced users

  • FS_DR_ENABLE

0: Disabled/NoAction
1: Land
2: RTL
3. SmartRTL or RTL
4: SmartRTL or Land
5: Land
6: Auto DO_LAND_START or RTL

  • FS_DR_TIMEOUTdefault 30 seconds

*注:关于EK3_DRAG_参数暂时笔者也没有搞明白,应该是基于IMU做的位置估计。所以需要关于风速的计算,总的来说是会有偏差的,但是不失为一种方法,(Best Effect)尽量返航。

2.6 振动故障保护

资料:Ardupilot - Vibration Failsafe

振动故障保护与ArduPilot中的大多数其他故障保护有点不同,因为它不会启动飞行模式更改。相反,它改变了在高度控制模式下控制高度和爬升率的算法。

2.6.1 触发原因

多旋翼机可能遭受非常高的振动水平,可能导致加速度计饱和(即超出传感器可以测量的范围)。意味着EKF无法准确计算其爬升率或垂直加速度。直接后果将会导致飞控无法控制其爬升速度,在严重情况下,可能导致油门全开时快速爬升。

  1. EKF’s vertical velocity innovations are positive (see onboard log’s NKF4.IVD value)

Δ V e l = V V e l p r e d i c t e d − V V e l n o n − I M U > 0 \Delta Vel = VVel_{predicted} - VVel_{non-IMU} > 0 ΔVel=VVelpredictedVVelnonIMU>0

  1. EKF’s vertical position innovations are positive (see NKF4.IPD)

Δ P o s = V P o s p r e d i c t e d − V P o s n o n − I M U > 0 \Delta Pos = VPos_{predicted} - VPos_{non-IMU} > 0 ΔPos=VPospredictedVPosnonIMU>0

  1. EKF’s velocity variance is 1 or higher (see NKF4.SV)

V V a r > 1 VVar > 1 VVar>1, ⇒ bad

Note:An Innovation is the difference between the predicted value and the latest (non-IMU) value. A Variance is the EKF’s reported confidence in its estimate. 0 is very good, >1 is bad.

2.6.2 场景分析

因为该功能使能情况下,只是改变了在高度控制模式下控制高度和爬升率的算法。

因此,整个振动故障救援主要是两个场景:

  1. 触发
  2. 恢复
2.6.2.1 触发
  1. “Vibration compensation ON” will appear on the Ground Stations HUD. EKF’s climb rate will be calculated using a 3rd order complementary filter which is tuned to be more resistant to vibration (but less accurate) than the normal method.

GCS上显示“Vibration compensation ON”,下降率采用三阶互补滤波器过滤(精度降低,但抗振动)

  1. Altitude controller switches to a more vibration resistant two-stage controller (position->velocity) instead of the regular three-stage controller (i.e. position->velocity->acceleration)

姿态控制器使用抗振两级控制器

  1. The vehicle will not change mode but its altitude hold will be less accurate than normal. The vehicle may overshoot it’s altitude targets and/or respond more slowly to pilot input.

飞行模式不做调整,但是姿态控制精度会相对降低。

2.6.2.2 恢复
  1. Vibration failsafe will deactivate 15 seconds after the EKF returns to normal

EKF正常15秒后,才会从保护状态恢复

  1. “Vibration compensation OFF” will be displayed on the HUD

GCS上显示“Vibration compensation OFF”

  1. Altitude and climb rate controllers will return to their normal methods

进入正常EKF过滤和控制算法

2.6.3 重要参数

  • FS_VIBE_ENABLE

0: Disabled
1: Enabled

2.7 (起飞异常)

资料:Ardupilot - Dead Motor Takeoff Prevention

Ardupilot提供了一种机制,通过ESC RPM转速检测,来判断电机因损坏而无法以最低转速运行,防止起飞时发生翻转。

重要参数

  • TKOFF_RPM_MIN该值将会比MOT_SPIN_ARM小,因此当起飞时电机转速小于该设定值,油门推杆将不会作用于电机。

2.8 地形数据异常

资料:Ardupilot - Terrain Data Loss Failsafe

Copter几乎在所有自动、引导、RTL和陆地模式下都支持“地形跟随”。该功能使用面朝下的激光雷达或声纳,或根据地面站使用地图服务(如谷歌地图)提供的SRTM数据(也称为地形高度数据),或存储在SD卡的“terrain”子目录中,爬升或下降以在地形上方保持指定距离。

在这里插入图片描述

2.8.1 触发原因

  • This feature allows the vehicle to climb or descend to maintain a specified distance above the terrain using either a downward facing Lidar or Sonar or from SRTM data (aka terrain altitude data) provided by the ground station using a mapping service such as Google maps or stored on the autopilot’s SD card in the “Terrain” subdirectory.
  1. 地面高度传感器数据失效

硬件失效:供电故障、通讯故障
软件失效:测量数据无效(不再合理范围内)

  1. 地形高度数据无法获取

地面站无法获取地形数据
飞控存储飞行数据(比如:SD卡)无当前位置有效地形数据

2.8.2 场景分析

  • If the vehicle is executing a mission command that requires terrain data but it is unable to retrieve terrain data for two seconds (normally because the range finder fails, goes out of range or the Ground Station is unable to provide terrain data) the vehicle will switch to RTL mode (if it is flying) or disarm (if it is landed).
  1. 飞行时,直接切换RTL模式
  2. 已经降落,直接上锁

2.8.3 重要参数

  • TERRAIN_ENABLE set to 1

0: Disabled
1: Enabled

  • TERRAIN_SPACINGDistance between terrain grid points in meters. This controls the horizontal resolution of the terrain data that is stored on te SD card and requested from the ground station. If your GCS is using the ArduPilot SRTM database like Mission Planner or MAVProxy, then a resolution of 100 meters is appropriate.

Note: Grid spacings lower than 100 meters waste SD card space if the GCS cannot provide that resolution. The grid spacing also controls how much data is kept in memory during flight. A larger grid spacing will allow for a larger amount of data in memory. A grid spacing of 100 meters results in the vehicle keeping 12 grid squares in memory with each grid square having a size of 2.7 kilometers by 3.2 kilometers. Any additional grid squares are stored on the SD once they are fetched from the GCS and will be loaded as needed.

Do not set the EK2_ALT_SOURCE or EK3_ALT_SOURCE parameters. These parameters should be left at “0” (barometer).

  • EK2_ALT_SOURCE
  • EK3_ALT_SOURCE

Do not set the EK2_RNG_USE_HGT or EK3_RNG_USE_HGT parameters. These parameters should be left at “-1”.

  • EK2_RNG_USE_HGT
  • EK3_RNG_USE_HGT

2.9 碰撞检查

资料:Ardupilot - Crash Check

Copter包括一项碰撞检查,在可能失控并撞到地面的情况下,该检查会解除电机的武装。这减少了损坏,也减少了车辆附近人员受伤的机会。

2.9.1 触发原因

如果以下所有条件满足,并发生超过2秒钟,则标志发生碰撞:

  1. the vehicle is armed

设备已经解锁

  1. the vehicle is not landed (as far as it can tell)

尚未正常降落

  1. the current flight mode is not ACRO or FLIP

不包括(ACRO or FLIP)模式
注:因此在手动花飞模式下,要注意一旦出现炸机,要手动disarm飞机

  1. the vehicle is not accelerating by more than 3m/s/s

加速度小于3米每平方秒
???该问题存疑,为什么是这个值?理由是什么?
注:后续阅读代码可能能够更加理解这个条件的含义。

  1. the actual lean angle has diverged from the desired lean angle (perhaps input by the pilot) by more than 30 degrees

期望角度与实际角度相差超过30度

2.9.2 场景分析

当触发后,该场景比较单一,顺序执行以下操作即可:

  1. the motors will disarm

上锁,防止进一步的损害

  1. “Crash: Disarming” will be displayed on the Ground Station

GCS上显示“Crash: Disarming”

  1. a crash event will be written to the dataflash logs

日志记录

2.9.3 重要参数

  • FS_CRASH_CHECK

0: Disabled
1: Enabled

2.10 掉高异常,降落伞

资料:Ardupilot - Parachute

在这里插入图片描述

2.10.1 触发原因

主要有两种触发原因:

  • A:自动降落(“Crash check: 1,2,3,4” + 5 + 6 ⇒ 触发)
  1. The motors are armed (Copter) or flying (Plane)

设备已经解锁

  1. The vehicle is not landed (Copter only)

尚未正常降落

  1. The vehicle is not in FLIP or ACRO flight mode (Copter only)

不包括(ACRO or FLIP)模式
注:因此在手动花飞模式下,要注意一旦出现炸机,要手动disarm飞机

  1. the roll and/or pitch angle of the vehicle is 30 degrees off from the target lean angle (Copter only)

期望角度与实际角度相差超过30度

  1. the barometer shows the vehicle is not climbing (excessive baro noise CAN prevent release in some cases) (Copter & Plane)

气压计显示在掉高

  1. the vehicle is above the CHUTE_ALT_MIN altitude (Copter & Plane). A value of “0” disables this check.

开伞高度在CHUTE_ALT_MIN之上。

  • B:遥控器手动降落

RCx_OPTION 控制触发方式:

B.1 RCx_OPTION = 21, A high enables the automatic release function, low disables it. Manual release is unaffected.
该功能相当于遥控器控制是否需要使能自动降落

B.2 RCx_OPTION = 23, If set to 23 (Parachute 3Pos), the low position disables, middle position enables auto operation, a high will attempt to force release.
该功能在B.1基础上,增加强制手动打开降落伞

2.10.2 场景分析

飞行中出现意外是常有的,尤其Copter会出现死亡翻滚,此时已经基本不受控,只能尽量降低损害。而降落伞可以有效解决这个问题。

当异常发生,通过动力关闭,然后延迟CHUTE_DELAY_MS,打开降落山,进行自由落体,不失为一个好方法,并且在最后空中时刻,可以观察到周边的一些图像信息,甚至GPS坐标发给飞手,比较容易找到飞机最后掉落的地方。

注:这个航模飞控之FAILSAFE机制起先就没有考虑到。所以2小时还是不够的,随着对问题的深入和思考,确实有很多好的思路。

2.10.3 重要参数

  • CHUTE_ENABLED

0: Disabled
1: Enabled

  • CHUTE_TYPE Parachute release mechanism type (relay or servo)

0: First Relay
1: Second Relay
2: Third Relay
3: Fourth Relay
10: Servo

  • CHUTE_SERVO_ON Parachute Servo ON PWM value
  • CHUTE_SERVO_OFF Servo OFF PWM value
  • CHUTE_ALT_MIN Parachute min altitude in meters above home, 0 to disable alt check.
  • CHUTE_DELAY_MS Delay in millseconds between motor stop and chute release
  • CHUTE_CRT_SINK Critical sink speed rate in m/s to trigger emergency parachute
  • CHUTE_OPTIONS Optional behaviour for parachute

default b i t 0 bit_0 bit0 = 0, hold open forever after release

2.11 看门狗事件

资料:Ardupilot - Independent Watchdog

在ArduPilot 4.0及更高版本的固件中,系统内部独立看门狗(软件)已启用。可以通过设置BRD_OPTIONS=0来禁用它。如果外设或代码“挂起”cpu,则cpu将被重置,并将重新启动cpu。如果在飞行或运动中,这功能不一定能够能救援到飞机。

注:这里不展开介绍,因为该功能更多是用来开发者分析定位问题的。

3. 总结

上述内容,实际上都是出现问题或异常,飞控软件尝试做的救援工作,只是说救援背后的目的有更进一步的扩展,比如:日志协助开发人员定位问题。

总的来看,可以将上述救援功能分为两大类:

  1. 导航类异常救援
  1. Radio Failsafe (遥控信号丢失)
  2. Battery Failsafe (电池低电)
  3. GCS Failsafe (地面站/电传信号丢失)
  4. EKF Failsafe (EKF故障,Extended Kalman Filter)
  5. Dead Reckoning Failsafe (航迹推算救援)
  6. Terrain Data Loss Failsafe (地形数据异常)
  7. Parachute (掉高异常,降落伞)
  1. 系统类异常救援
  1. Vibration Failsafe (振动故障保护)
  2. Dead Motor Takeoff Prevention (起飞异常)
  3. Crash Check (碰撞检查)
  4. Independent Watchdog (看门狗事件)

从需求分析的角度看,航模飞控之FAILSAFE机制更多从用户角度考虑的是导航类异常救援;而系统类异常救援从开发者角度,遇到的一些实际问题的解决方案,通常我们说“技术需求”。

通常用户实际使用接触配置的是导航类异常救援,容易理解。而相对专业的配置项则是系统类异常救援(这块从产品的角度来说,应该出厂配置好的,用户不用过多操心)。

最终,出现异常以后,有以下几个处理方法:

  1. LAND
  2. RTL
  3. Smart RTL
  4. Dead Reckoning Failsafe
  5. Crash Check

注:后续针对这不内容在详细的进行研读!

整体上看,Ardupilot确实分析是非常到位的,不愧为业界优秀的开源飞控之一!!!


代码方面关于FAILSAFE详见:ArduPilot开源飞控之do_failsafe_action

4. 参考资料

【1】航模飞控之FAILSAFE机制
【2】ArduPilot开源飞控系统之简单介绍

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值