mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-03-23 18:13:49 +08:00
escCheck: Change MOTFAIL_TIME unit to seconds for better UX
This commit is contained in:
@@ -75,7 +75,6 @@ void EscChecks::checkAndReport(const Context &context, Report &reporter)
|
||||
|
||||
esc_status_s esc_status;
|
||||
|
||||
|
||||
// Run motor status checks even when no new ESC data arrives (to detect timeouts)
|
||||
if (_esc_status_sub.copy(&esc_status)) {
|
||||
if (esc_status.esc_count <= 0) {
|
||||
@@ -257,8 +256,8 @@ uint16_t EscChecks::checkMotorStatus(const Context &context, Report &reporter, c
|
||||
bool current_too_low = current < (thrust * _param_motfail_c2t.get()) - _param_motfail_low_off.get();
|
||||
bool current_too_high = current > (thrust * _param_motfail_c2t.get()) + _param_motfail_high_off.get();
|
||||
|
||||
_esc_undercurrent_hysteresis[i].set_hysteresis_time_from(false, _param_motfail_time.get() * 1_ms);
|
||||
_esc_overcurrent_hysteresis[i].set_hysteresis_time_from(false, _param_motfail_time.get() * 1_ms);
|
||||
_esc_undercurrent_hysteresis[i].set_hysteresis_time_from(false, _param_motfail_time.get() * 1_s);
|
||||
_esc_overcurrent_hysteresis[i].set_hysteresis_time_from(false, _param_motfail_time.get() * 1_s);
|
||||
|
||||
if (!_esc_undercurrent_hysteresis[i].get_state()) {
|
||||
// Only set, never clear mid-air: stopping the motor in response could make it appear healthy again
|
||||
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
(ParamBool<px4::params::COM_ARM_CHK_ESCS>) _param_com_arm_chk_escs,
|
||||
(ParamBool<px4::params::FD_ACT_EN>) _param_fd_act_en,
|
||||
(ParamFloat<px4::params::MOTFAIL_C2T>) _param_motfail_c2t,
|
||||
(ParamInt<px4::params::MOTFAIL_TIME>) _param_motfail_time,
|
||||
(ParamFloat<px4::params::MOTFAIL_TIME>) _param_motfail_time,
|
||||
(ParamFloat<px4::params::MOTFAIL_LOW_OFF>) _param_motfail_low_off,
|
||||
(ParamFloat<px4::params::MOTFAIL_HIGH_OFF>) _param_motfail_high_off);
|
||||
};
|
||||
|
||||
@@ -95,9 +95,10 @@ PARAM_DEFINE_FLOAT(MOTFAIL_HIGH_OFF, 10.f);
|
||||
* Motor failure only triggers after current thresholds are exceeded for this time.
|
||||
*
|
||||
* @group Motor Failure
|
||||
* @unit ms
|
||||
* @min 10
|
||||
* @max 10000
|
||||
* @increment 100
|
||||
* @unit s
|
||||
* @min 0.01
|
||||
* @max 10
|
||||
* @decimal 2
|
||||
* @increment 1
|
||||
*/
|
||||
PARAM_DEFINE_INT32(MOTFAIL_TIME, 1000);
|
||||
PARAM_DEFINE_FLOAT(MOTFAIL_TIME, 1.f);
|
||||
|
||||
Reference in New Issue
Block a user