diff --git a/APMrover2/AP_MotorsUGV.cpp b/APMrover2/AP_MotorsUGV.cpp index f4866f1951..331a72a634 100644 --- a/APMrover2/AP_MotorsUGV.cpp +++ b/APMrover2/AP_MotorsUGV.cpp @@ -45,15 +45,6 @@ const AP_Param::GroupInfo AP_MotorsUGV::var_info[] = { // @User: Advanced AP_GROUPINFO("SAFE_DISARM", 3, AP_MotorsUGV, _disarm_disable_pwm, 0), - // @Param: SLEWRATE - // @DisplayName: Throttle slew rate - // @Description: maximum percentage change in throttle per second. A setting of 10 means to not change the throttle by more than 10% of the full throttle range in one second. A value of zero means no limit. A value of 100 means the throttle can change over its full range in one second. Note that for some NiMH powered rovers setting a lower value like 40 or 50 may be worthwhile as the sudden current demand on the battery of a big rise in throttle may cause a brownout. - // @Units: %/s - // @Range: 0 100 - // @Increment: 1 - // @User: Standard - AP_GROUPINFO("SLEWRATE", 4, AP_MotorsUGV, _slew_rate, 100), - // @Param: THR_MIN // @DisplayName: Throttle minimum // @Description: Throttle minimum percentage the autopilot will apply. This is mostly useful for rovers with internal combustion motors, to prevent the motor from cutting out in auto mode. @@ -81,6 +72,15 @@ const AP_Param::GroupInfo AP_MotorsUGV::var_info[] = { // @User: Standard AP_GROUPINFO("SKID_FRIC", 7, AP_MotorsUGV, _skid_friction, 0.0f), + // @Param: SLEWRATE + // @DisplayName: Throttle slew rate + // @Description: Throttle slew rate as a percentage of total range per second. A value of 100 allows the motor to change over its full range in one second. A value of zero disables the limit. Note some NiMH powered rovers require a lower setting of 40 to reduce current demand to avoid brownouts. + // @Units: %/s + // @Range: 0 1000 + // @Increment: 1 + // @User: Standard + AP_GROUPINFO("SLEWRATE", 8, AP_MotorsUGV, _slew_rate, 100), + AP_GROUPEND }; diff --git a/APMrover2/AP_MotorsUGV.h b/APMrover2/AP_MotorsUGV.h index 62e15adeec..3e6bf811d8 100644 --- a/APMrover2/AP_MotorsUGV.h +++ b/APMrover2/AP_MotorsUGV.h @@ -93,7 +93,7 @@ protected: AP_Int8 _pwm_type; // PWM output type AP_Int8 _pwm_freq; // PWM output freq for brushed motors AP_Int8 _disarm_disable_pwm; // disable PWM output while disarmed - AP_Int8 _slew_rate; // slew rate expressed as a percentage / second + AP_Int16 _slew_rate; // slew rate expressed as a percentage / second AP_Int8 _throttle_min; // throttle minimum percentage AP_Int8 _throttle_max; // throttle maximum percentage AP_Float _skid_friction; // skid steering vehicle motor output compensation for friction while stopped