mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-16 22:40:34 +08:00
MPC_SPOOLUP_TIME -> COM_SPOOLUP_TIME
This commit is contained in:
committed by
Matthias Grob
parent
c8fb7a6990
commit
55563eba49
@@ -2721,8 +2721,8 @@ Commander::run()
|
||||
|
||||
if (_arm_state_machine.isArmed()) {
|
||||
if (fd_status_flags.arm_escs) {
|
||||
// 500ms is the PWM spoolup time. Within this timeframe controllers are not affecting actuator_outputs
|
||||
if (hrt_elapsed_time(&_vehicle_status.armed_time) < 500_ms) {
|
||||
// Checks have to pass within the spool up time
|
||||
if (hrt_elapsed_time(&_vehicle_status.armed_time) < _param_com_spoolup_time.get() * 1_s) {
|
||||
disarm(arm_disarm_reason_t::failure_detector);
|
||||
mavlink_log_critical(&_mavlink_log_pub, "ESCs did not respond to arm request\t");
|
||||
events::send(events::ID("commander_fd_escs_not_arming"), events::Log::Critical, "ESCs did not respond to arm request");
|
||||
|
||||
@@ -258,7 +258,9 @@ private:
|
||||
(ParamInt<px4::params::CBRK_VTOLARMING>) _param_cbrk_vtolarming,
|
||||
|
||||
(ParamInt<px4::params::COM_FLT_TIME_MAX>) _param_com_flt_time_max,
|
||||
(ParamFloat<px4::params::COM_WIND_MAX>) _param_com_wind_max
|
||||
(ParamFloat<px4::params::COM_WIND_MAX>) _param_com_wind_max,
|
||||
|
||||
(ParamFloat<px4::params::COM_SPOOLUP_TIME>) _param_com_spoolup_time
|
||||
)
|
||||
|
||||
// optional parameters
|
||||
|
||||
@@ -1023,6 +1023,22 @@ PARAM_DEFINE_INT32(COM_ARM_ARSP_EN, 1);
|
||||
*/
|
||||
PARAM_DEFINE_INT32(COM_ARM_SDCARD, 1);
|
||||
|
||||
/**
|
||||
* Enforced delay between arming and further navigation
|
||||
*
|
||||
* The minimal time from arming the motors until moving the vehicle is possible is COM_SPOOLUP_TIME seconds.
|
||||
* Goal:
|
||||
* - Motors and propellers spool up to idle speed before getting commanded to spin faster
|
||||
* - Timeout for ESCs and smart batteries to successfulyy do failure checks
|
||||
* e.g. for stuck rotors before the vehicle is off the ground
|
||||
*
|
||||
* @group Commander
|
||||
* @min 0
|
||||
* @max 5
|
||||
* @unit s
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(COM_SPOOLUP_TIME, 1.0f);
|
||||
|
||||
/**
|
||||
* Wind speed warning threshold
|
||||
*
|
||||
|
||||
@@ -269,7 +269,7 @@ void FailureDetector::updateEscsStatus(const vehicle_status_s &vehicle_status, c
|
||||
bool is_esc_failure = !is_all_escs_armed;
|
||||
|
||||
for (int i = 0; i < limited_esc_count; i++) {
|
||||
is_esc_failure = is_esc_failure | (esc_status.esc[i].failures > 0);
|
||||
is_esc_failure = is_esc_failure || (esc_status.esc[i].failures > 0);
|
||||
}
|
||||
|
||||
_esc_failure_hysteresis.set_hysteresis_time_from(false, 300_ms);
|
||||
|
||||
Reference in New Issue
Block a user