AC_PID: use set_and_defualt to set defualt values
This commit is contained in:
parent
88d9550214
commit
3f84ba12c0
@ -23,7 +23,7 @@ public:
|
||||
AC_P(const float &initial_p = 0.0f)
|
||||
{
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
_kp = initial_p;
|
||||
_kp.set_and_default(initial_p);
|
||||
}
|
||||
|
||||
CLASS_NO_COPY(AC_P);
|
||||
|
@ -30,9 +30,9 @@ AC_PI::AC_PI(float initial_p, float initial_i, float initial_imax)
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
kP.set(initial_p);
|
||||
kI.set(initial_i);
|
||||
imax.set(initial_imax);
|
||||
kP.set_and_default(initial_p);
|
||||
kI.set_and_default(initial_i);
|
||||
imax.set_and_default(initial_imax);
|
||||
}
|
||||
|
||||
float AC_PI::update(float measurement, float target, float dt)
|
||||
|
@ -75,16 +75,16 @@ AC_PID::AC_PID(float initial_p, float initial_i, float initial_d, float initial_
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
_kp = initial_p;
|
||||
_ki = initial_i;
|
||||
_kd = initial_d;
|
||||
_kff = initial_ff;
|
||||
_kimax = fabsf(initial_imax);
|
||||
filt_T_hz(initial_filt_T_hz);
|
||||
filt_E_hz(initial_filt_E_hz);
|
||||
filt_D_hz(initial_filt_D_hz);
|
||||
_slew_rate_max.set(initial_srmax);
|
||||
_slew_rate_tau.set(initial_srtau);
|
||||
_kp.set_and_default(initial_p);
|
||||
_ki.set_and_default(initial_i);
|
||||
_kd.set_and_default(initial_d);
|
||||
_kff.set_and_default(initial_ff);
|
||||
_kimax.set_and_default(initial_imax);
|
||||
_filt_T_hz.set_and_default(initial_filt_T_hz);
|
||||
_filt_E_hz.set_and_default(initial_filt_E_hz);
|
||||
_filt_D_hz.set_and_default(initial_filt_D_hz);
|
||||
_slew_rate_max.set_and_default(initial_srmax);
|
||||
_slew_rate_tau.set_and_default(initial_srtau);
|
||||
|
||||
// reset input filter to first value received
|
||||
_flags._reset_filter = true;
|
||||
|
@ -56,13 +56,13 @@ AC_PID_2D::AC_PID_2D(float initial_kP, float initial_kI, float initial_kD, float
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
_kp = initial_kP;
|
||||
_ki = initial_kI;
|
||||
_kd = initial_kD;
|
||||
_kff = initial_kFF;
|
||||
_kimax = fabsf(initial_imax);
|
||||
filt_E_hz(initial_filt_E_hz);
|
||||
filt_D_hz(initial_filt_D_hz);
|
||||
_kp.set_and_default(initial_kP);
|
||||
_ki.set_and_default(initial_kI);
|
||||
_kd.set_and_default(initial_kD);
|
||||
_kff.set_and_default(initial_kFF);
|
||||
_kimax.set_and_default(initial_imax);
|
||||
_filt_E_hz.set_and_default(initial_filt_E_hz);
|
||||
_filt_D_hz.set_and_default(initial_filt_D_hz);
|
||||
|
||||
// reset input filter to first value received
|
||||
_reset_filter = true;
|
||||
|
@ -58,13 +58,13 @@ AC_PID_Basic::AC_PID_Basic(float initial_p, float initial_i, float initial_d, fl
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
_kp = initial_p;
|
||||
_ki = initial_i;
|
||||
_kd = initial_d;
|
||||
_kff = initial_ff;
|
||||
_kimax = fabsf(initial_imax);
|
||||
filt_E_hz(initial_filt_E_hz);
|
||||
filt_D_hz(initial_filt_D_hz);
|
||||
_kp.set_and_default(initial_p);
|
||||
_ki.set_and_default(initial_i);
|
||||
_kd.set_and_default(initial_d);
|
||||
_kff.set_and_default(initial_ff);
|
||||
_kimax.set_and_default(initial_imax);
|
||||
_filt_E_hz.set_and_default(initial_filt_E_hz);
|
||||
_filt_D_hz.set_and_default(initial_filt_D_hz);
|
||||
|
||||
// reset input filter to first value received
|
||||
_reset_filter = true;
|
||||
|
@ -36,9 +36,10 @@ AC_PI_2D::AC_PI_2D(float initial_p, float initial_i, float initial_imax, float i
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
_kp = initial_p;
|
||||
_ki = initial_i;
|
||||
_imax = fabsf(initial_imax);
|
||||
_kp.set_and_default(initial_p);
|
||||
_ki.set_and_default(initial_i);
|
||||
_imax.set_and_default(initial_imax);
|
||||
_filt_hz.set_and_default(initial_filt_hz);
|
||||
filt_hz(initial_filt_hz);
|
||||
|
||||
// reset input filter to first value received
|
||||
|
@ -19,7 +19,7 @@ AC_P_1D::AC_P_1D(float initial_p, float dt) :
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
_kp = initial_p;
|
||||
_kp.set_and_default(initial_p);
|
||||
}
|
||||
|
||||
// update_all - set target and measured inputs to P controller and calculate outputs
|
||||
|
@ -19,7 +19,7 @@ AC_P_2D::AC_P_2D(float initial_p, float dt) :
|
||||
// load parameter values from eeprom
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
|
||||
_kp = initial_p;
|
||||
_kp.set_and_default(initial_p);
|
||||
}
|
||||
|
||||
// update_all - set target and measured inputs to P controller and calculate outputs
|
||||
|
Loading…
Reference in New Issue
Block a user