找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 411|回复: 0

PX41.15.0断桨保护的相关参数

[复制链接]

130

主题

44

回帖

3万

积分

管理员

积分
39544
发表于 2025-9-4 09:51:40 | 显示全部楼层 |阅读模式
                               
/**
*Imbalanced propeller check threshold
*
*Value at which the imbalanced propeller metric (based on horizontaland
*vertical acceleration variance) triggers a failure
*
*Setting this value to 0 disables the feature.
*
*@min 0
*@max 1000
*@increment 1
*@group Failure Detector
*/
PARAM_DEFINE_INT32(FD_IMB_PROP_THR,30);



/**
*Imbalanced propeller failsafe mode
*
*Action the system takes when an imbalanced propeller is detected bythe failure detector.
*See also FD_IMB_PROP_THR to set the failure threshold.
*
*@group Commander
*
*@value -1 Disabled
*@value 0 Warning
*@value 1 Return
*@value 2 Land
*@increment 1
*/
PARAM_DEFINE_INT32(COM_IMB_PROP_ACT,0);



voidFailureDetector::updateImbalancedPropStatus()
{
//

                               constbool is_imbalanced = metric_lpf > _param_fd_imb_prop_thr.get();
                               _status.flags.imbalanced_prop= is_imbalanced;
//
}







/**
*安全飞行数据擦除(SFDESecureFlight Data Erasure)功能螺旋桨不平衡故障恢复时间
*
*SFDE_ACT_MASK中启用了【检测到螺旋桨不平衡故障】后,留给故障恢复的时间,超过该时间后则安全飞行数据擦除功能生效。
*本参数修改后实时生效。
*
*@unit s
*@min 0
*@max 100
*@group Secure Flight Data Erasure
*/
PARAM_DEFINE_INT32(SFDE_IMBPROP_RCV,60);






voidCommander::run()
{
  //

        while(!should_exit()) {


   fd_status.fd_imbalanced_prop= _failure_detector.getStatusFlags().imbalanced_prop;
                       fd_status.fd_motor= _failure_detector.getStatusFlags().motor;
                       fd_status.imbalanced_prop_metric= _failure_detector.getImbalancedPropMetric();
                       fd_status.motor_failure_mask= _failure_detector.getMotorFailures();
        }
}




     reporter.failsafeFlags().fd_imbalanced_prop= context.status().failure_detector_status &
                       vehicle_status_s::FAILURE_IMBALANCED_PROP;

        if(reporter.failsafeFlags().fd_imbalanced_prop) {
                /*EVENT
                 *@description
                 *Check that all propellers are mounted correctly and are not damaged.
                 *
                 *<profile name="dev">
                 *This check can be configured via <param>FD_IMB_PROP_THR</param>and <param>COM_IMB_PROP_ACT</param> parameters.
                 *</profile>
                 */
               reporter.healthFailure(NavModes::All,health_component_t::system,events::ID("check_failure_detector_imbalanced_prop"),
                                      events:og::Critical,"Imbalanced propeller detected");

                if(reporter.mavlink_log_pub()) {
                       mavlink_log_critical(reporter.mavlink_log_pub(),"reflight Fail: Imbalanced propeller detected");
                }
        }


          if(!_erase&& (_act_mask & 0x20)){ // 检测到螺旋桨不平衡故障
                       if(_failure_detector_status.fd_imbalanced_prop) {
                               if(_failure_imbalanced_prop_timestamp== 0){
                                       _failure_imbalanced_prop_timestamp= now;
                               }

                               if(hrt_elapsed_time(&_failure_imbalanced_prop_timestamp)> (hrt_abstime)_param_sfde_imbprop_rcv.get() * 1e6){
                                       _erase= true;
                                       _reason= 0x10;
                                       _erase_cancel= false;
                                       mavlink_log_critical(&_mavlink_log_pub,"螺旋桨不平衡故障触发擦除");
                                       _failure_imbalanced_prop_timestamp= 0;
                               }
                       }else{
                               _failure_imbalanced_prop_timestamp= now;
                       }
                }




(ParamInt<px4::params::SFDE_IMBPROP_RCV>)_param_sfde_imbprop_rcv,













您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|flightreview|小黑屋|PX4-Autopilot|PX4论坛

GMT+8, 2026-1-27 07:30 , Processed in 0.054654 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表