From 3b58caa32a15f371dff1c11b2a0dc10b332ea75a Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Wed, 21 Sep 2016 08:24:50 +0200 Subject: [PATCH] Updated motor RAMP timing to match slew rate limiter --- src/systemcmds/motor_ramp/motor_ramp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/systemcmds/motor_ramp/motor_ramp.cpp b/src/systemcmds/motor_ramp/motor_ramp.cpp index a7b6968cf1..e3baf8b854 100644 --- a/src/systemcmds/motor_ramp/motor_ramp.cpp +++ b/src/systemcmds/motor_ramp/motor_ramp.cpp @@ -119,6 +119,7 @@ usage(const char *reason) "Example:\n" "sdlog2 on\n" "mc_att_control stop\n" + "fw_att_control stop\n" "motor_ramp sine 1100 0.5\n"); } @@ -359,7 +360,7 @@ int motor_ramp_thread_main(int argc, char *argv[]) case RAMP_RAMP: { if (_mode == RAMP) { - output += dt / _ramp_time; + output += 1000.0f * dt / (_max_pwm - _min_pwm) / _ramp_time; } else if (_mode == SINE) { // sine outpout with period T = _ramp_time and magnitude between [0,1] @@ -385,6 +386,7 @@ int motor_ramp_thread_main(int argc, char *argv[]) case RAMP_WAIT: { if (timer > 1.0f) { _thread_should_exit = true; + PX4_WARN("stopping"); break; }