Data Structures | |
struct | _PID_Obj_ |
Defines the PID controller object. More... | |
Typedefs | |
typedef struct _PID_Obj_ | PID_Obj |
Defines the PID controller object. More... | |
typedef struct _PID_Obj_ * | PID_Handle |
Defines the PID handle. More... | |
Functions | |
void | PID_getDerFilterParams (PID_Handle handle, float32_t *b0, float32_t *b1, float32_t *a1, float32_t *x1, float32_t *y1) |
Gets the derivative filter parameters. More... | |
static float32_t | PID_getFbackValue (PID_Handle handle) |
Gets the feedback value in the PID controller. More... | |
static float32_t | PID_getFfwdValue (PID_Handle handle) |
Gets the feedforward value in the PID controller. More... | |
static void | PID_getGains (PID_Handle handle, float32_t *pKp, float32_t *pKi, float32_t *pKd) |
Gets the gains in the PID controller. More... | |
static float32_t | PID_getKd (PID_Handle handle) |
Gets the derivative gain in the PID controller. More... | |
static float32_t | PID_getKi (PID_Handle handle) |
Gets the integral gain in the PID controller. More... | |
static float32_t | PID_getKp (PID_Handle handle) |
Gets the proportional gain in the PID controller. More... | |
static void | PID_getMinMax (PID_Handle handle, float32_t *pOutMin, float32_t *pOutMax) |
Gets the minimum and maximum output value allowed in the PID controller. More... | |
static float32_t | PID_getOutMax (PID_Handle handle) |
Gets the maximum output value allowed in the PID controller. More... | |
static float32_t | PID_getOutMin (PID_Handle handle) |
Gets the minimum output value allowed in the PID controller. More... | |
static float32_t | PID_getRefValue (PID_Handle handle) |
Gets the reference value in the PID controller. More... | |
static float32_t | PID_getUi (PID_Handle handle) |
Gets the integrator start value in the PID controller. More... | |
PID_Handle | PID_init (void *pMemory, const size_t numBytes) |
Initializes the PID controller. More... | |
void | PID_setDerFilterParams (PID_Handle handle, const float32_t b0, const float32_t b1, const float32_t a1, const float32_t x1, const float32_t y1) |
Sets the derivative filter parameters. More... | |
static void | PID_setFbackValue (PID_Handle handle, const float32_t fbackValue) |
Sets the feedback value in the PID controller. More... | |
static void | PID_setFfwdValue (PID_Handle handle, const float32_t ffwdValue) |
Sets the feedforward value in the PID controller. More... | |
static void | PID_setGains (PID_Handle handle, const float32_t Kp, const float32_t Ki, const float32_t Kd) |
Sets the gains in the PID controller. More... | |
static void | PID_setKd (PID_Handle handle, const float32_t Kd) |
Sets the derivative gain in the PID controller. More... | |
static void | PID_setKi (PID_Handle handle, const float32_t Ki) |
Sets the integral gain in the PID controller. More... | |
static void | PID_setKp (PID_Handle handle, const float32_t Kp) |
Sets the proportional gain in the PID controller. More... | |
static void | PID_setMinMax (PID_Handle handle, const float32_t outMin, const float32_t outMax) |
Sets the minimum and maximum output value allowed in the PID controller. More... | |
static void | PID_setOutMax (PID_Handle handle, const float32_t outMax) |
Sets the maximum output value allowed in the PID controller. More... | |
static void | PID_setOutMin (PID_Handle handle, const float32_t outMin) |
Sets the minimum output value allowed in the PID controller. More... | |
static void | PID_setRefValue (PID_Handle handle, const float32_t refValue) |
Sets the reference value in the PID controller. More... | |
static void | PID_setUi (PID_Handle handle, const float32_t Ui) |
Sets the integrator start value in the PID controller. More... | |
static void | PID_run_parallel (PID_Handle handle, const float32_t refValue, const float32_t fbackValue, const float32_t ffwdValue, float32_t *pOutValue) |
Runs the parallel form of the PID controller. More... | |
static void | PID_run_series (PID_Handle handle, const float32_t refValue, const float32_t fbackValue, const float32_t ffwdValue, float32_t *pOutValue) |
Runs the series form of the PID controller. More... | |
typedef struct _PID_Obj_* PID_Handle |
Defines the PID handle.
void PID_getDerFilterParams | ( | PID_Handle | handle, |
float32_t * | b0, | ||
float32_t * | b1, | ||
float32_t * | a1, | ||
float32_t * | x1, | ||
float32_t * | y1 | ||
) |
Gets the derivative filter parameters.
y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1]
[in] | handle | The PID controller handle |
[in] | b0 | The numerator filter coefficient value for z^0 |
[in] | b1 | The numerator filter coefficient value for z^(-1) |
[in] | a1 | The denominator filter coefficient value for z^(-1) |
[in] | x1 | The input value at time sample n=-1 |
[in] | y1 | The output value at time sample n=-1 |
|
inlinestatic |
Gets the feedback value in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::fbackValue.
|
inlinestatic |
Gets the feedforward value in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::ffwdValue.
|
inlinestatic |
Gets the gains in the PID controller.
[in] | handle | The PID controller handle |
[out] | pKp | The pointer to the proportional gain value |
[out] | pKi | The pointer to the integrator gain value |
[out] | pKd | The pointer to the derivative gain value |
References _PID_Obj_::Kd, _PID_Obj_::Ki, and _PID_Obj_::Kp.
|
inlinestatic |
Gets the derivative gain in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::Kd.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Gets the integral gain in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::Ki.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Gets the proportional gain in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::Kp.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Gets the minimum and maximum output value allowed in the PID controller.
[in] | handle | The PID controller handle |
[out] | pOutMin | The pointer to the minimum output value allowed |
[out] | pOutMax | The pointer to the maximum output value allowed |
References _PID_Obj_::outMax, and _PID_Obj_::outMin.
|
inlinestatic |
Gets the maximum output value allowed in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::outMax.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Gets the minimum output value allowed in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::outMin.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Gets the reference value in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::refValue.
|
inlinestatic |
Gets the integrator start value in the PID controller.
[in] | handle | The PID controller handle |
References _PID_Obj_::Ui.
Referenced by PID_run_parallel(), and PID_run_series().
PID_Handle PID_init | ( | void * | pMemory, |
const size_t | numBytes | ||
) |
Initializes the PID controller.
[in] | pMemory | A pointer to the memory for the PID controller object |
[in] | numBytes | The number of bytes allocated for the PID controller object, bytes |
void PID_setDerFilterParams | ( | PID_Handle | handle, |
const float32_t | b0, | ||
const float32_t | b1, | ||
const float32_t | a1, | ||
const float32_t | x1, | ||
const float32_t | y1 | ||
) |
Sets the derivative filter parameters.
y[n] = b0*x[n] + b1*x[n-1] - a1*y[n-1]
[in] | handle | The PID controller handle |
[in] | b0 | The numerator filter coefficient value for z^0 |
[in] | b1 | The numerator filter coefficient value for z^(-1) |
[in] | a1 | The denominator filter coefficient value for z^(-1) |
[in] | x1 | The input value at time sample n=-1 |
[in] | y1 | The output value at time sample n=-1 |
|
inlinestatic |
Sets the feedback value in the PID controller.
[in] | handle | The PID controller handle |
[in] | fbackValue | The feedback value |
References _PID_Obj_::fbackValue.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Sets the feedforward value in the PID controller.
[in] | handle | The PID controller handle |
[in] | ffwdValue | The feedforward value |
References _PID_Obj_::ffwdValue.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Sets the gains in the PID controller.
[in] | handle | The PID controller handle |
[in] | Kp | The proportional gain for the PID controller |
[in] | Ki | The integrator gain for the PID controller |
[in] | Kd | The derivative gain for the PID controller |
References _PID_Obj_::Kd, _PID_Obj_::Ki, and _PID_Obj_::Kp.
|
inlinestatic |
Sets the derivative gain in the PID controller.
[in] | handle | The PID controller handle |
[in] | Kd | The derivative gain for the PID controller |
References _PID_Obj_::Kd.
|
inlinestatic |
Sets the integral gain in the PID controller.
[in] | handle | The PID controller handle |
[in] | Ki | The integral gain for the PID controller |
References _PID_Obj_::Ki.
|
inlinestatic |
Sets the proportional gain in the PID controller.
[in] | handle | The PID controller handle |
[in] | Kp | The proportional gain for the PID controller |
References _PID_Obj_::Kp.
|
inlinestatic |
Sets the minimum and maximum output value allowed in the PID controller.
[in] | handle | The PID controller handle |
[in] | outMin | The minimum output value allowed |
[in] | outMax | The maximum output value allowed |
References _PID_Obj_::outMax, and _PID_Obj_::outMin.
|
inlinestatic |
Sets the maximum output value allowed in the PID controller.
[in] | handle | The PID controller handle |
[in] | outMax | The maximum output value allowed |
References _PID_Obj_::outMax.
|
inlinestatic |
Sets the minimum output value allowed in the PID controller.
[in] | handle | The PID controller handle |
[in] | outMax | The minimum output value allowed |
References _PID_Obj_::outMin.
|
inlinestatic |
Sets the reference value in the PID controller.
[in] | handle | The PID controller handle |
[in] | refValue | The reference value |
References _PID_Obj_::refValue.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Sets the integrator start value in the PID controller.
[in] | handle | The PID controller handle |
[in] | Ui | The integral start value for the PID controller |
References _PID_Obj_::Ui.
Referenced by PID_run_parallel(), and PID_run_series().
|
inlinestatic |
Runs the parallel form of the PID controller.
[in] | handle | The PID controller handle |
[in] | refValue | The reference value to the controller |
[in] | fbackValue | The feedback value to the controller |
[in] | ffwdValue | The feedforward value to the controller |
[in] | pOutValue | The pointer to the controller output value |
References _PID_Obj_::derFilterHandle, _PID_Obj_::fbackValue, _PID_Obj_::ffwdValue, FILTER_FO_run(), _PID_Obj_::Kd, _PID_Obj_::Ki, _PID_Obj_::Kp, MATH_sat(), _PID_Obj_::outMax, _PID_Obj_::outMin, PID_getKd(), PID_getKi(), PID_getKp(), PID_getOutMax(), PID_getOutMin(), PID_getUi(), PID_setFbackValue(), PID_setFfwdValue(), PID_setRefValue(), PID_setUi(), _PID_Obj_::refValue, and _PID_Obj_::Ui.
|
inlinestatic |
Runs the series form of the PID controller.
[in] | handle | The PID controller handle |
[in] | refValue | The reference value to the controller |
[in] | fbackValue | The feedback value to the controller |
[in] | ffwdValue | The feedforward value to the controller |
[in] | pOutValue | The pointer to the controller output value |
References _PID_Obj_::derFilterHandle, _PID_Obj_::fbackValue, _PID_Obj_::ffwdValue, FILTER_FO_run(), _PID_Obj_::Kd, _PID_Obj_::Ki, _PID_Obj_::Kp, MATH_sat(), _PID_Obj_::outMax, _PID_Obj_::outMin, PID_getKd(), PID_getKi(), PID_getKp(), PID_getOutMax(), PID_getOutMin(), PID_getUi(), PID_setFbackValue(), PID_setFfwdValue(), PID_setRefValue(), PID_setUi(), _PID_Obj_::refValue, and _PID_Obj_::Ui.