added a limit to range output
This commit is contained in:
parent
aa57fce9f4
commit
669e8e34ea
@ -111,6 +111,8 @@ static const AP_Param::Info var_info[] PROGMEM = {
|
||||
GSCALAR(camera_roll_gain, "CAM_R_G"),
|
||||
GSCALAR(stabilize_d, "STAB_D"),
|
||||
GSCALAR(acro_p, "ACRO_P"),
|
||||
GSCALAR(axis_lock_p, "AXIS_P"),
|
||||
GSCALAR(axis_enabled, "AXIS_ENABLE"),
|
||||
|
||||
// PID controller
|
||||
//---------------
|
||||
|
@ -108,6 +108,8 @@ RC_Channel::set_pwm(int pwm)
|
||||
if(_type == RC_CHANNEL_RANGE){
|
||||
//Serial.print("range ");
|
||||
control_in = pwm_to_range();
|
||||
//control_in = constrain(control_in, _low, _high);
|
||||
control_in = min(control_in, _high);
|
||||
control_in = (control_in < _dead_zone) ? 0 : control_in;
|
||||
|
||||
if (fabs(scale_output) != 1){
|
||||
|
Loading…
Reference in New Issue
Block a user