Data Structures | Typedefs | Functions
PI

Data Structures

struct  _PI_Obj_
 Defines the PI controller object. More...
 

Typedefs

typedef struct _PI_Obj_ PI_Obj
 Defines the PI controller object. More...
 
typedef struct _PI_Obj_PI_Handle
 Defines the PI handle. More...
 

Functions

static float32_t PI_getFbackValue (PI_Handle handle)
 Gets the feedback value in the PI controller. More...
 
static float32_t PI_getFfwdValue (PI_Handle handle)
 Gets the feedforward value in the PI controller. More...
 
static void PI_getGains (PI_Handle handle, float32_t *pKp, float32_t *pKi)
 Gets the gains in the PI controller. More...
 
static float32_t PI_getKi (PI_Handle handle)
 Gets the integral gain in the PI controller. More...
 
static float32_t PI_getKp (PI_Handle handle)
 Gets the proportional gain in the PI controller. More...
 
static void PI_getMinMax (PI_Handle handle, float32_t *pOutMin, float32_t *pOutMax)
 Gets the minimum and maximum output value allowed in the PI controller. More...
 
static float32_t PI_getOutMax (PI_Handle handle)
 Gets the maximum output value allowed in the PI controller. More...
 
static float32_t PI_getOutMin (PI_Handle handle)
 Gets the minimum output value allowed in the PI controller. More...
 
static float32_t PI_getRefValue (PI_Handle handle)
 Gets the reference value in the PI controller. More...
 
static float32_t PI_getUi (PI_Handle handle)
 Gets the integrator start value in the PI controller. More...
 
PI_Handle PI_init (void *pMemory, const size_t numBytes)
 Initializes the PI controller. More...
 
PI_Handle cla_PI_init (void *pMemory, const size_t numBytes)
 
static void PI_setFbackValue (PI_Handle handle, const float32_t fbackValue)
 Sets the feedback value in the PI controller. More...
 
static void PI_setFfwdValue (PI_Handle handle, const float32_t ffwdValue)
 Sets the feedforward value in the PI controller. More...
 
static void PI_setGains (PI_Handle handle, const float32_t Kp, const float32_t Ki)
 Sets the gains in the PI controller. More...
 
static void PI_setKi (PI_Handle handle, const float32_t Ki)
 Sets the integral gain in the PI controller. More...
 
static void PI_setKp (PI_Handle handle, const float32_t Kp)
 Sets the proportional gain in the PI controller. More...
 
static void PI_setMinMax (PI_Handle handle, const float32_t outMin, const float32_t outMax)
 Sets the minimum and maximum output value allowed in the PI controller. More...
 
static void PI_setOutMax (PI_Handle handle, const float32_t outMax)
 Sets the maximum output value allowed in the PI controller. More...
 
static void PI_setOutMin (PI_Handle handle, const float32_t outMin)
 Sets the minimum output value allowed in the PI controller. More...
 
static void PI_setRefValue (PI_Handle handle, const float32_t refValue)
 Sets the reference value in the PI controller. More...
 
static void PI_setUi (PI_Handle handle, const float32_t Ui)
 Sets the integrator start value in the PI controller. More...
 
static void PI_run_parallel (PI_Handle handle, const float32_t refValue, const float32_t fbackValue, const float32_t ffwdValue, float32_t *pOutValue)
 Runs the parallel form of the PI controller. More...
 
static void PI_run_series (PI_Handle handle, const float32_t refValue, const float32_t fbackValue, const float32_t ffwdValue, float32_t *pOutValue)
 Runs the series form of the PI controller. More...
 
static void PI_run (PI_Handle handle, const float32_t refValue, const float32_t fbackValue, float32_t *pOutValue)
 Runs the series form of the PI controller. More...
 

Detailed Description

Typedef Documentation

◆ PI_Obj

typedef struct _PI_Obj_ PI_Obj

Defines the PI controller object.

◆ PI_Handle

typedef struct _PI_Obj_* PI_Handle

Defines the PI handle.

Function Documentation

◆ PI_getFbackValue()

static float32_t PI_getFbackValue ( PI_Handle  handle)
inlinestatic

Gets the feedback value in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The feedback value in the PI controller

References _PI_Obj_::fbackValue.

◆ PI_getFfwdValue()

static float32_t PI_getFfwdValue ( PI_Handle  handle)
inlinestatic

Gets the feedforward value in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The feedforward value in the PI controller

References _PI_Obj_::ffwdValue.

◆ PI_getGains()

static void PI_getGains ( PI_Handle  handle,
float32_t pKp,
float32_t pKi 
)
inlinestatic

Gets the gains in the PI controller.

Parameters
[in]handleThe PI controller handle
[out]pKpThe pointer to the proportional gain value
[out]pKiThe pointer to the integrator gain value
Returns
None

References _PI_Obj_::Ki, and _PI_Obj_::Kp.

◆ PI_getKi()

static float32_t PI_getKi ( PI_Handle  handle)
inlinestatic

Gets the integral gain in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The integral gain in the PI controller

References _PI_Obj_::Ki.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_getKp()

static float32_t PI_getKp ( PI_Handle  handle)
inlinestatic

Gets the proportional gain in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The proportional gain in the PI controller

References _PI_Obj_::Kp.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_getMinMax()

static void PI_getMinMax ( PI_Handle  handle,
float32_t pOutMin,
float32_t pOutMax 
)
inlinestatic

Gets the minimum and maximum output value allowed in the PI controller.

Parameters
[in]handleThe PI controller handle
[out]pOutMinThe pointer to the minimum output value allowed
[out]pOutMaxThe pointer to the maximum output value allowed
Returns
None

References _PI_Obj_::outMax, and _PI_Obj_::outMin.

◆ PI_getOutMax()

static float32_t PI_getOutMax ( PI_Handle  handle)
inlinestatic

Gets the maximum output value allowed in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The maximum output value allowed

References _PI_Obj_::outMax.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_getOutMin()

static float32_t PI_getOutMin ( PI_Handle  handle)
inlinestatic

Gets the minimum output value allowed in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The minimum output value allowed

References _PI_Obj_::outMin.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_getRefValue()

static float32_t PI_getRefValue ( PI_Handle  handle)
inlinestatic

Gets the reference value in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The reference value in the PI controller

References _PI_Obj_::refValue.

Referenced by CTRL_getRefValue().

◆ PI_getUi()

static float32_t PI_getUi ( PI_Handle  handle)
inlinestatic

Gets the integrator start value in the PI controller.

Parameters
[in]handleThe PI controller handle
Returns
The integrator start value for the PI controller

References _PI_Obj_::Ui.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_init()

PI_Handle PI_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the PI controller.

Parameters
[in]pMemoryA pointer to the memory for the PI controller object
[in]numBytesThe number of bytes allocated for the PI controller object, bytes
Returns
The PI controller (PI) object handle

◆ cla_PI_init()

PI_Handle cla_PI_init ( void *  pMemory,
const size_t  numBytes 
)

◆ PI_setFbackValue()

static void PI_setFbackValue ( PI_Handle  handle,
const float32_t  fbackValue 
)
inlinestatic

Sets the feedback value in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]fbackValueThe feedback value
Returns
None

References _PI_Obj_::fbackValue.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_setFfwdValue()

static void PI_setFfwdValue ( PI_Handle  handle,
const float32_t  ffwdValue 
)
inlinestatic

Sets the feedforward value in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]ffwdValueThe feedforward value
Returns
None

References _PI_Obj_::ffwdValue.

Referenced by PI_run_parallel(), and PI_run_series().

◆ PI_setGains()

static void PI_setGains ( PI_Handle  handle,
const float32_t  Kp,
const float32_t  Ki 
)
inlinestatic

Sets the gains in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]KpThe proportional gain for the PI controller
[in]KiThe integrator gain for the PI controller
Returns
None

References _PI_Obj_::Ki, and _PI_Obj_::Kp.

◆ PI_setKi()

static void PI_setKi ( PI_Handle  handle,
const float32_t  Ki 
)
inlinestatic

Sets the integral gain in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]KiThe integral gain for the PI controller
Returns
None

References _PI_Obj_::Ki.

Referenced by CTRL_setup(), FWC_setGains(), and FWC_setKi().

◆ PI_setKp()

static void PI_setKp ( PI_Handle  handle,
const float32_t  Kp 
)
inlinestatic

Sets the proportional gain in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]KpThe proportional gain for the PI controller
Returns
None

References _PI_Obj_::Kp.

Referenced by CTRL_setup(), FWC_setGains(), and FWC_setKp().

◆ PI_setMinMax()

static void PI_setMinMax ( PI_Handle  handle,
const float32_t  outMin,
const float32_t  outMax 
)
inlinestatic

Sets the minimum and maximum output value allowed in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]outMinThe minimum output value allowed
[in]outMaxThe maximum output value allowed
Returns
None

References _PI_Obj_::outMax, and _PI_Obj_::outMin.

Referenced by CTRL_run(), and FWC_setAngleMinMax().

◆ PI_setOutMax()

static void PI_setOutMax ( PI_Handle  handle,
const float32_t  outMax 
)
inlinestatic

Sets the maximum output value allowed in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]outMaxThe maximum output value allowed
Returns
None

References _PI_Obj_::outMax.

◆ PI_setOutMin()

static void PI_setOutMin ( PI_Handle  handle,
const float32_t  outMin 
)
inlinestatic

Sets the minimum output value allowed in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]outMaxThe minimum output value allowed
Returns
None

References _PI_Obj_::outMin.

Referenced by FWC_setAngleMax().

◆ PI_setRefValue()

static void PI_setRefValue ( PI_Handle  handle,
const float32_t  refValue 
)
inlinestatic

Sets the reference value in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]refValueThe reference value
Returns
None

References _PI_Obj_::refValue.

Referenced by PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_setUi()

static void PI_setUi ( PI_Handle  handle,
const float32_t  Ui 
)
inlinestatic

Sets the integrator start value in the PI controller.

Parameters
[in]handleThe PI controller handle
[in]UiThe integral start value for the PI controller
Returns
None

References _PI_Obj_::Ui.

Referenced by CTRL_setup(), FWC_resetUi(), FWC_setUi(), PI_run(), PI_run_parallel(), and PI_run_series().

◆ PI_run_parallel()

static void PI_run_parallel ( PI_Handle  handle,
const float32_t  refValue,
const float32_t  fbackValue,
const float32_t  ffwdValue,
float32_t pOutValue 
)
inlinestatic

Runs the parallel form of the PI controller.

Parameters
[in]handleThe PI controller handle
[in]refValueThe reference value to the controller
[in]fbackValueThe feedback value to the controller
[in]ffwdValueThe feedforward value to the controller
[in]pOutValueThe pointer to the controller output value
Returns
None

References _PI_Obj_::fbackValue, _PI_Obj_::ffwdValue, _PI_Obj_::Ki, _PI_Obj_::Kp, MATH_sat(), _PI_Obj_::outMax, _PI_Obj_::outMin, PI_getKi(), PI_getKp(), PI_getOutMax(), PI_getOutMin(), PI_getUi(), PI_setFbackValue(), PI_setFfwdValue(), PI_setRefValue(), PI_setUi(), _PI_Obj_::refValue, and _PI_Obj_::Ui.

◆ PI_run_series()

static void PI_run_series ( PI_Handle  handle,
const float32_t  refValue,
const float32_t  fbackValue,
const float32_t  ffwdValue,
float32_t pOutValue 
)
inlinestatic

Runs the series form of the PI controller.

Parameters
[in]handleThe PI controller handle
[in]refValueThe reference value to the controller
[in]fbackValueThe feedback value to the controller
[in]ffwdValueThe feedback value to the controller
[in]pOutValueThe pointer to the controller output value
Returns
None

References _PI_Obj_::fbackValue, _PI_Obj_::ffwdValue, _PI_Obj_::Ki, _PI_Obj_::Kp, MATH_sat(), _PI_Obj_::outMax, _PI_Obj_::outMin, PI_getKi(), PI_getKp(), PI_getOutMax(), PI_getOutMin(), PI_getUi(), PI_setFbackValue(), PI_setFfwdValue(), PI_setRefValue(), PI_setUi(), _PI_Obj_::refValue, and _PI_Obj_::Ui.

Referenced by CTRL_run(), and FWC_computeCurrentAngle().

◆ PI_run()

static void PI_run ( PI_Handle  handle,
const float32_t  refValue,
const float32_t  fbackValue,
float32_t pOutValue 
)
inlinestatic

Runs the series form of the PI controller.

Parameters
[in]handleThe PI controller handle
[in]refValueThe reference value to the controller
[in]fbackValueThe feedback value to the controller
[in]pOutValueThe pointer to the controller output value
Returns
None

References _PI_Obj_::fbackValue, _PI_Obj_::Ki, _PI_Obj_::Kp, MATH_sat(), _PI_Obj_::outMax, _PI_Obj_::outMin, PI_getKi(), PI_getKp(), PI_getOutMax(), PI_getOutMin(), PI_getUi(), PI_setFbackValue(), PI_setRefValue(), PI_setUi(), _PI_Obj_::refValue, and _PI_Obj_::Ui.


Copyright 2023, Texas Instruments Incorporated