253 extern PID_Handle
PID_init(
void *pMemory,
const size_t numBytes);
444 Ui =
MATH_sat(Ui + (Ki * Error),outMax,outMin);
454 *pOutValue =
MATH_sat(Up + Ui + Ud + ffwdValue,outMax,outMin);
485 Ui =
MATH_sat(Ui + (Ki * Up),outMax,outMin);
495 *pOutValue =
MATH_sat(Up + Ui + Ud + ffwdValue,outMax,outMin);
506 #endif //end of _PID_H_ definition
Contains the public interface to the first-order filter (FILTER_FO) module routines.
Contains the public interface to the types definitions.
static float_t PID_getUi(PID_Handle handle)
Gets the integrator start value in the PID controller.
static void PID_setGains(PID_Handle handle, const float_t Kp, const float_t Ki, const float_t Kd)
Sets the gains in the PID controller.
static void PID_setFbackValue(PID_Handle handle, const float_t fbackValue)
Sets the feedback value in the PID controller.
static void PID_setKi(PID_Handle handle, const float_t Ki)
Sets the integral gain in the PID controller.
static void PID_setMinMax(PID_Handle handle, const float_t outMin, const float_t outMax)
Sets the minimum and maximum output value allowed in the PID controller.
static float_t PID_getKd(PID_Handle handle)
Gets the derivative gain in the PID controller.
static float_t PID_getKi(PID_Handle handle)
Gets the integral gain in the PID controller.
static void PID_setRefValue(PID_Handle handle, const float_t refValue)
Sets the reference value in the PID controller.
Contains the public interface to the math (MATH) module routines.
_iq Kd
the derivative gain for the PID controller
_iq Ki
the integral gain for the PID controller
static float_t PID_getOutMin(PID_Handle handle)
Gets the minimum output value allowed in the PID controller.
static void PID_setOutMax(PID_Handle handle, const float_t outMax)
Sets the maximum output value allowed in the PID controller.
static void PID_setKd(PID_Handle handle, const float_t Kd)
Sets the derivative gain in the PID controller.
static void PID_setKp(PID_Handle handle, const float_t Kp)
Sets the proportional gain in the PID controller.
float_t outMax
the maximum output value allowed for the PID controller
static void PID_getGains(PID_Handle handle, float_t *pKp, float_t *pKi, float_t *pKd)
Gets the gains in the PID controller.
static void PID_setFfwdValue(PID_Handle handle, const float_t ffwdValue)
Sets the feedforward value in the PID controller.
struct _PID_Obj_ PID_Obj
Defines the PID controller object.
float_t refValue
the reference input value
static float_t PID_getRefValue(PID_Handle handle)
Gets the reference value in the PID controller.
void PID_setDerFilterParams(PID_Handle handle, const float_t b0, const float_t b1, const float_t a1, const float_t x1, const float_t y1)
Sets the derivative filter parameters.
static _iq FILTER_FO_run(FILTER_FO_Handle handle, const _iq inputValue)
Runs a first-order filter of the form y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1].
Defines the first-order filter (FILTER_FO) object.
static float_t PID_getOutMax(PID_Handle handle)
Gets the maximum output value allowed in the PID controller.
float_t Ki
the integral gain for the PID controller
static void PID_getMinMax(PID_Handle handle, float_t *pOutMin, float_t *pOutMax)
Gets the minimum and maximum output value allowed in the PID controller.
static float_t MATH_sat(const float_t in, const float_t max, const float_t min)
Saturates the input value between the minimum and maximum values.
static void PID_run_parallel(PID_Handle handle, const float_t refValue, const float_t fbackValue, const float_t ffwdValue, float_t *pOutValue)
Runs the parallel form of the PID controller.
_iq fbackValue
the feedback input value
float_t fbackValue
the feedback input value
FILTER_FO_Handle derFilterHandle
the derivative filter handle
static float_t PID_getFfwdValue(PID_Handle handle)
Gets the feedforward value in the PID controller.
_iq outMin
the minimum output value allowed for the PID controller
struct _PID_Obj_ * PID_Handle
Defines the PID handle.
static void PID_setOutMin(PID_Handle handle, const float_t outMin)
Sets the minimum output value allowed in the PID controller.
float_t ffwdValue
the feedforward input value
float_t Ui
the integrator start value for the PID controller
FILTER_FO_Obj derFilter
the derivative filter object
PID_Handle PID_init(void *pMemory, const size_t numBytes)
Initializes the PID controller.
static float_t PID_getFbackValue(PID_Handle handle)
Gets the feedback value in the PID controller.
static float_t PID_getKp(PID_Handle handle)
Gets the proportional gain in the PID controller.
float_t Kp
the proportional gain for the PID controller
static void PID_setUi(PID_Handle handle, const float_t Ui)
Sets the integrator start value in the PID controller.
void PID_getDerFilterParams(PID_Handle handle, float_t *b0, float_t *b1, float_t *a1, float_t *x1, float_t *y1)
Gets the derivative filter parameters.
_iq refValue
the reference input value
_iq outMax
the maximum output value allowed for the PID controller
_iq Ui
the integrator start value for the PID controller
float_t Kd
the derivative gain for the PID controller
float_t outMin
the minimum output value allowed for the PID controller
_iq Kp
the proportional gain for the PID controller
Defines the first-order filter (FILTER_FO) object.
Defines the PID controller object.
static void PID_run_series(PID_Handle handle, const float_t refValue, const float_t fbackValue, const float_t ffwdValue, float_t *pOutValue)
Runs the series form of the PID controller.
float float_t
Defines the portable data type for 32 bit, signed floating-point data.