Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/en/config/safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,16 @@ Motor failures are non-latching: if the failure condition clears, the failure is
The undercurrent and overcurrent conditions are defined by:

```text
undercurrent: {esc current} < {MOTFAIL_C2T} * {motor command [0,1]} - {MOTFAIL_LOW_OFF}
overcurrent: {esc current} > {MOTFAIL_C2T} * {motor command [0,1]} + {MOTFAIL_HIGH_OFF}
undercurrent: {esc current} < {MOTFAIL_C2T} * {motor command [0,1]} - {MOTFAIL_OFF}
overcurrent: {esc current} > {MOTFAIL_C2T} * {motor command [0,1]} + {MOTFAIL_OFF}
```

| Parameter | Description |
| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="FD_ACT_EN"></a>[FD_ACT_EN](../advanced_config/parameter_reference.md#FD_ACT_EN) | Enable/disable the motor failure trigger completely. |
| <a id="MOTFAIL_C2T"></a>[MOTFAIL_C2T](../advanced_config/parameter_reference.md#MOTFAIL_C2T) | Slope between normalized motor command [0–1] and expected steady-state current (FD_ACT_MOT_C2T at 100%) (A/%). |
| <a id="MOTFAIL_LOW_OFF"></a>[MOTFAIL_LOW_OFF](../advanced_config/parameter_reference.md#MOTFAIL_LOW_OFF) | Undercurrent detection threshold offset (A). Subtracted from the expected current to form the lower bound. |
| <a id="MOTFAIL_HIGH_OFF"></a>[MOTFAIL_HIGH_OFF](../advanced_config/parameter_reference.md#MOTFAIL_HIGH_OFF) | Overcurrent detection threshold offset (A). Added to the expected current to form the upper bound. |
| <a id="MOTFAIL_OFF"></a>[MOTFAIL_OFF](../advanced_config/parameter_reference.md#MOTFAIL_OFF) | Under/over-current detection threshold offset (A). Subtracted from the expected current to form the lower bound. |
Comment thread
ttechnick marked this conversation as resolved.
Outdated
|
| <a id="MOTFAIL_TIME"></a>[MOTFAIL_TIME](../advanced_config/parameter_reference.md#MOTFAIL_TIME) | Hysteresis time (s) for which the current threshold must remain exceeded before a motor failure is triggered. |
| <a id="CA_FAILURE_MODE"></a>[CA_FAILURE_MODE](../advanced_config/parameter_reference.md#CA_FAILURE_MODE) | Configure to not only warn about a motor failure but remove the first motor that detects a failure from the allocation effectiveness which turns off the motor and tries to operate the vehicle without it until disarming the next time. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ uint16_t EscChecks::checkMotorStatus(const Context &context, Report &reporter, c
thrust = fabsf(actuator_motors.control[actuator_function_index]);
}

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();
bool current_too_low = current < (thrust * _param_motfail_c2t.get()) - _param_motfail_off.get();
bool current_too_high = current > (thrust * _param_motfail_c2t.get()) + _param_motfail_off.get();

_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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ class EscChecks : public HealthAndArmingCheckBase
(ParamBool<px4::params::FD_ACT_EN>) _param_fd_act_en,
(ParamFloat<px4::params::MOTFAIL_C2T>) _param_motfail_c2t,
(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);
(ParamFloat<px4::params::MOTFAIL_OFF>) _param_motfail_off);
};
17 changes: 3 additions & 14 deletions src/modules/commander/HealthAndArmingChecks/esc_check_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,10 @@ parameters:
unit: A/%
decimal: 2
increment: 1
MOTFAIL_LOW_OFF:
MOTFAIL_OFF:
description:
short: Undercurrent motor failure limit offset
long: threshold = FD_ACT_MOT_C2T * thrust - FD_ACT_LOW_OFF
type: float
default: 10.0
min: 0
max: 30
unit: A
decimal: 2
increment: 1
MOTFAIL_HIGH_OFF:
description:
short: Overcurrent motor failure limit offset
long: threshold = FD_ACT_MOT_C2T * thrust + FD_ACT_HIGH_OFF
short: Under/over-current motor failure limit offset
long: threshold = FD_ACT_MOT_C2T * thrust - FD_ACT_OFF
Comment thread
ttechnick marked this conversation as resolved.
Outdated
type: float
default: 10.0
min: 0
Expand Down
Loading