MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

Modules | Data Structures | Typedefs | Functions
PI

## Modules
| PI_OVERVIEW

## 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...
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 _iq | PI_getFbackValue (PI_Handle handle)
| Gets the feedback value in the PI controller. More...
static _iq | PI_getFfwdValue (PI_Handle handle)
| Gets the feedforward value in the PI controller. More...
static void | PI_getGains (PI_Handle handle, _iq *pKp, _iq *pKi)
| Gets the gains in the PI controller. More...
static _iq | PI_getKi (PI_Handle handle)
| Gets the integral gain in the PI controller. More...
static _iq | PI_getKp (PI_Handle handle)
| Gets the proportional gain in the PI controller. More...
static void | PI_getMinMax (PI_Handle handle, _iq *pOutMin, _iq *pOutMax)
| Gets the minimum and maximum output value allowed in the PI controller. More...
static _iq | PI_getOutMax (PI_Handle handle)
| Gets the maximum output value allowed in the PI controller. More...
static _iq | PI_getOutMin (PI_Handle handle)
| Gets the minimum output value allowed in the PI controller. More...
static _iq | PI_getRefValue (PI_Handle handle)
| Gets the reference value in the PI controller. More...
static _iq | 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...
static void | PI_setFbackValue (PI_Handle handle, const _iq fbackValue)
| Sets the feedback value in the PI controller. More...
static void | PI_setFfwdValue (PI_Handle handle, const _iq ffwdValue)
| Sets the feedforward value in the PI controller. More...
static void | PI_setGains (PI_Handle handle, const _iq Kp, const _iq Ki)
| Sets the gains in the PI controller. More...
static void | PI_setKi (PI_Handle handle, const _iq Ki)
| Sets the integral gain in the PI controller. More...
static void | PI_setKp (PI_Handle handle, const _iq Kp)
| Sets the proportional gain in the PI controller. More...
static void | PI_setMinMax (PI_Handle handle, const _iq outMin, const _iq outMax)
| Sets the minimum and maximum output value allowed in the PI controller. More...
static void | PI_setOutMax (PI_Handle handle, const _iq outMax)
| Sets the maximum output value allowed in the PI controller. More...
static void | PI_setOutMin (PI_Handle handle, const _iq outMin)
| Sets the minimum output value allowed in the PI controller. More...
static void | PI_setRefValue (PI_Handle handle, const _iq refValue)
| Sets the reference value in the PI controller. More...
static void | PI_setUi (PI_Handle handle, const _iq Ui)
| Sets the integrator start value in the PI controller. More...
static void | PI_run_parallel (PI_Handle handle, const _iq refValue, const _iq fbackValue, const _iq ffwdValue, _iq *pOutValue)
| Runs the parallel form of the PI controller. More...
static void | PI_run_series (PI_Handle handle, const _iq refValue, const _iq fbackValue, const _iq ffwdValue, _iq *pOutValue)
| Runs the series form of the PI controller. More...
static void | PI_getGains (PI_Handle handle, float_t *pKp, float_t *pKi)
| Gets the gains in the PI controller. More...
static void | PI_getMinMax (PI_Handle handle, float_t *pOutMin, float_t *pOutMax)
| Gets the minimum and maximum output value allowed in the PI controller. More...
static void | PI_setFbackValue (PI_Handle handle, const float_t fbackValue)
| Sets the feedback value in the PI controller. More...
static void | PI_setFfwdValue (PI_Handle handle, const float_t ffwdValue)
| Sets the feedforward value in the PI controller. More...
static void | PI_setGains (PI_Handle handle, const float_t Kp, const float_t Ki)
| Sets the gains in the PI controller. More...
static void | PI_setKi (PI_Handle handle, const float_t Ki)
| Sets the integral gain in the PI controller. More...
static void | PI_setKp (PI_Handle handle, const float_t Kp)
| Sets the proportional gain in the PI controller. More...
static void | PI_setMinMax (PI_Handle handle, const float_t outMin, const float_t outMax)
| Sets the minimum and maximum output value allowed in the PI controller. More...
static void | PI_setOutMax (PI_Handle handle, const float_t outMax)
| Sets the maximum output value allowed in the PI controller. More...
static void | PI_setOutMin (PI_Handle handle, const float_t outMin)
| Sets the minimum output value allowed in the PI controller. More...
static void | PI_setRefValue (PI_Handle handle, const float_t refValue)
| Sets the reference value in the PI controller. More...
static void | PI_setUi (PI_Handle handle, const float_t Ui)
| Sets the integrator start value in the PI controller. More...
static void | PI_run_parallel (PI_Handle handle, const float_t refValue, const float_t fbackValue, const float_t ffwdValue, float_t *pOutValue)
| Runs the parallel form of the PI controller. More...
static void | PI_run_series (PI_Handle handle, const float_t refValue, const float_t fbackValue, const float_t ffwdValue, float_t *pOutValue)
| Runs the series form of the PI controller. More...

## Detailed Description

## Data Structure Documentation

struct _PI_Obj_

Defines the PI controller object.

Definition at line 74 of file 32b/pi.h.

Data Fields
_iq | fbackValue | the feedback input value
float_t | fbackValue | the feedback input value
_iq | ffwdValue | the feedforward input value
float_t | ffwdValue | the feedforward input value
_iq | Ki | the integral gain for the PI controller
float_t | Ki | the integral gain for the PI controller
float_t | Kp | the proportional gain for the PI controller
_iq | Kp | the proportional gain for the PI controller
float_t | outMax | the maximum output value allowed for the PI controller
_iq | outMax | the maximum output value allowed for the PI controller
float_t | outMin | the minimum output value allowed for the PI controller
_iq | outMin | the minimum output value allowed for the PI controller
float_t | refValue | the reference input value
_iq | refValue | the reference input value
float_t | Ui | the integrator start value for the PI controller
_iq | Ui | the integrator start value for the PI controller

## Typedef Documentation

typedef struct _PI_Obj_* PI_Handle

Defines the PI handle.

Definition at line 93 of file 32b/pi.h.

typedef struct _PI_Obj_* PI_Handle

Defines the PI handle.

Definition at line 93 of file float/pi.h.

typedef struct _PI_Obj_ PI_Obj

Defines the PI controller object.

typedef struct _PI_Obj_ PI_Obj

Defines the PI controller object.

## Function Documentation

static _iq PI_getFbackValue | ( | PI_Handle | handle | ) |
| inline static

Gets the feedback value in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The feedback value in the PI controller

Definition at line 102 of file 32b/pi.h.

References _PI_Obj_::fbackValue.

static _iq PI_getFfwdValue | ( | PI_Handle | handle | ) |
| inline static

Gets the feedforward value in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The feedforward value in the PI controller

Definition at line 113 of file 32b/pi.h.

References _PI_Obj_::ffwdValue.

static void PI_getGains | ( | PI_Handle | handle,
|  | _iq * | pKp,
|  | _iq * | pKi
| ) |  |
| inline static

Gets the gains in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [out] | pKp | The pointer to the proportional gain value
  [out] | pKi | The pointer to the integrator gain value

Definition at line 125 of file 32b/pi.h.

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

static void PI_getGains | ( | PI_Handle | handle,
|  | float_t * | pKp,
|  | float_t * | pKi
| ) |  |
| inline static

Gets the gains in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [out] | pKp | The pointer to the proportional gain value
  [out] | pKi | The pointer to the integrator gain value

Definition at line 125 of file float/pi.h.

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

static _iq PI_getKi | ( | PI_Handle | handle | ) |
| inline static

Gets the integral gain in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The integral gain in the PI controller

Definition at line 139 of file 32b/pi.h.

References _PI_Obj_::Ki.

Referenced by PI_run_parallel(), and PI_run_series().

static _iq PI_getKp | ( | PI_Handle | handle | ) |
| inline static

Gets the proportional gain in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The proportional gain in the PI controller

Definition at line 150 of file 32b/pi.h.

References _PI_Obj_::Kp.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_getMinMax | ( | PI_Handle | handle,
|  | _iq * | pOutMin,
|  | _iq * | pOutMax
| ) |  |
| inline static

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

Parameters

  [in] | handle | The PI controller handle
  [out] | pOutMin | The pointer to the minimum output value allowed
  [out] | pOutMax | The pointer to the maximum output value allowed

Definition at line 162 of file 32b/pi.h.

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

static void PI_getMinMax | ( | PI_Handle | handle,
|  | float_t * | pOutMin,
|  | float_t * | pOutMax
| ) |  |
| inline static

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

Parameters

  [in] | handle | The PI controller handle
  [out] | pOutMin | The pointer to the minimum output value allowed
  [out] | pOutMax | The pointer to the maximum output value allowed

Definition at line 162 of file float/pi.h.

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

static _iq PI_getOutMax | ( | PI_Handle | handle | ) |
| inline static

Gets the maximum output value allowed in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The maximum output value allowed

Definition at line 176 of file 32b/pi.h.

References _PI_Obj_::outMax.

Referenced by PI_run_parallel(), and PI_run_series().

static _iq PI_getOutMin | ( | PI_Handle | handle | ) |
| inline static

Gets the minimum output value allowed in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The minimum output value allowed

Definition at line 187 of file 32b/pi.h.

References _PI_Obj_::outMin.

Referenced by PI_run_parallel(), and PI_run_series().

static _iq PI_getRefValue | ( | PI_Handle | handle | ) |
| inline static

Gets the reference value in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The reference value in the PI controller

Definition at line 198 of file 32b/pi.h.

References _PI_Obj_::refValue.

Referenced by CTRL_getRefValue().

static _iq PI_getUi | ( | PI_Handle | handle | ) |
| inline static

Gets the integrator start value in the PI controller.

Parameters

  [in] | handle | The PI controller handle

Returns
  The integrator start value for the PI controller

Definition at line 209 of file 32b/pi.h.

References _PI_Obj_::Ui.

Referenced by PI_run_parallel(), and PI_run_series().

PI_Handle PI_init | ( | void * | pMemory,
|  | const size_t | numBytes
| ) |  |

Initializes the PI controller.

Parameters

  [in] | pMemory | A pointer to the memory for the PI controller object
  [in] | numBytes | The number of bytes allocated for the PI controller object, bytes

Returns
  The PI controller (PI) object handle

Definition at line 56 of file 32b/pi.c.

Referenced by CTRL_init().

static void PI_run_parallel | ( | PI_Handle | handle,
|  | const float_t | refValue,
|  | const float_t | fbackValue,
|  | const float_t | ffwdValue,
|  | float_t * | pOutValue
| ) |  |
| inline static

Runs the parallel form of the PI controller.

Parameters

  [in] | handle | The PI 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

Definition at line 364 of file float/pi.h.

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_setFfwdValue(), PI_setRefValue(), PI_setUi(), and _PI_Obj_::Ui.

static void PI_run_parallel | ( | PI_Handle | handle,
|  | const _iq | refValue,
|  | const _iq | fbackValue,
|  | const _iq | ffwdValue,
|  | _iq * | pOutValue
| ) |  |
| inline static

Runs the parallel form of the PI controller.

Parameters

  [in] | handle | The PI 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

Definition at line 364 of file 32b/pi.h.

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

static void PI_run_series | ( | PI_Handle | handle,
|  | const float_t | refValue,
|  | const float_t | fbackValue,
|  | const float_t | ffwdValue,
|  | float_t * | pOutValue
| ) |  |
| inline static

Runs the series form of the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | refValue | The reference value to the controller
  [in] | fbackValue | The feedback value to the controller
  [in] | ffwdValue | The feedback value to the controller
  [in] | pOutValue | The pointer to the controller output value

Definition at line 397 of file float/pi.h.

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_setFfwdValue(), PI_setRefValue(), PI_setUi(), and _PI_Obj_::Ui.

static void PI_run_series | ( | PI_Handle | handle,
|  | const _iq | refValue,
|  | const _iq | fbackValue,
|  | const _iq | ffwdValue,
|  | _iq * | pOutValue
| ) |  |
| inline static

Runs the series form of the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | refValue | The reference value to the controller
  [in] | fbackValue | The feedback value to the controller
  [in] | ffwdValue | The feedback value to the controller
  [in] | pOutValue | The pointer to the controller output value

Definition at line 397 of file 32b/pi.h.

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

Referenced by CTRL_run().

static void PI_setFbackValue | ( | PI_Handle | handle,
|  | const _iq | fbackValue
| ) |  |
| inline static

Sets the feedback value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | fbackValue | The feedback value

Definition at line 227 of file 32b/pi.h.

References _PI_Obj_::fbackValue.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setFbackValue | ( | PI_Handle | handle,
|  | const float_t | fbackValue
| ) |  |
| inline static

Sets the feedback value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | fbackValue | The feedback value

Definition at line 227 of file float/pi.h.

References _PI_Obj_::fbackValue.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setFfwdValue | ( | PI_Handle | handle,
|  | const float_t | ffwdValue
| ) |  |
| inline static

Sets the feedforward value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | ffwdValue | The feedforward value

Definition at line 240 of file float/pi.h.

References _PI_Obj_::ffwdValue.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setFfwdValue | ( | PI_Handle | handle,
|  | const _iq | ffwdValue
| ) |  |
| inline static

Sets the feedforward value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | ffwdValue | The feedforward value

Definition at line 240 of file 32b/pi.h.

References _PI_Obj_::ffwdValue.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setGains | ( | PI_Handle | handle,
|  | const _iq | Kp,
|  | const _iq | Ki
| ) |  |
| inline static

Sets the gains in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Kp | The proportional gain for the PI controller
  [in] | Ki | The integrator gain for the PI controller

Definition at line 254 of file 32b/pi.h.

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

static void PI_setGains | ( | PI_Handle | handle,
|  | const float_t | Kp,
|  | const float_t | Ki
| ) |  |
| inline static

Sets the gains in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Kp | The proportional gain for the PI controller
  [in] | Ki | The integrator gain for the PI controller

Definition at line 254 of file float/pi.h.

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

static void PI_setKi | ( | PI_Handle | handle,
|  | const float_t | Ki
| ) |  |
| inline static

Sets the integral gain in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Ki | The integral gain for the PI controller

Definition at line 268 of file float/pi.h.

References _PI_Obj_::Ki.

static void PI_setKi | ( | PI_Handle | handle,
|  | const _iq | Ki
| ) |  |
| inline static

Sets the integral gain in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Ki | The integral gain for the PI controller

Definition at line 268 of file 32b/pi.h.

References _PI_Obj_::Ki.

Referenced by CTRL_setup().

static void PI_setKp | ( | PI_Handle | handle,
|  | const float_t | Kp
| ) |  |
| inline static

Sets the proportional gain in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Kp | The proportional gain for the PI controller

Definition at line 281 of file float/pi.h.

References _PI_Obj_::Kp.

static void PI_setKp | ( | PI_Handle | handle,
|  | const _iq | Kp
| ) |  |
| inline static

Sets the proportional gain in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Kp | The proportional gain for the PI controller

Definition at line 281 of file 32b/pi.h.

References _PI_Obj_::Kp.

Referenced by CTRL_setup().

static void PI_setMinMax | ( | PI_Handle | handle,
|  | const float_t | outMin,
|  | const float_t | outMax
| ) |  |
| inline static

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

Parameters

  [in] | handle | The PI controller handle
  [in] | outMin | The minimum output value allowed
  [in] | outMax | The maximum output value allowed

Definition at line 295 of file float/pi.h.

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

static void PI_setMinMax | ( | PI_Handle | handle,
|  | const _iq | outMin,
|  | const _iq | outMax
| ) |  |
| inline static

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

Parameters

  [in] | handle | The PI controller handle
  [in] | outMin | The minimum output value allowed
  [in] | outMax | The maximum output value allowed

Definition at line 295 of file 32b/pi.h.

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

Referenced by CTRL_run(), and CTRL_setParams().

static void PI_setOutMax | ( | PI_Handle | handle,
|  | const _iq | outMax
| ) |  |
| inline static

Sets the maximum output value allowed in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | outMax | The maximum output value allowed

Definition at line 309 of file 32b/pi.h.

References _PI_Obj_::outMax.

static void PI_setOutMax | ( | PI_Handle | handle,
|  | const float_t | outMax
| ) |  |
| inline static

Sets the maximum output value allowed in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | outMax | The maximum output value allowed

Definition at line 309 of file float/pi.h.

References _PI_Obj_::outMax.

static void PI_setOutMin | ( | PI_Handle | handle,
|  | const float_t | outMin
| ) |  |
| inline static

Sets the minimum output value allowed in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | outMax | The minimum output value allowed

Definition at line 322 of file float/pi.h.

References _PI_Obj_::outMin.

static void PI_setOutMin | ( | PI_Handle | handle,
|  | const _iq | outMin
| ) |  |
| inline static

Sets the minimum output value allowed in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | outMax | The minimum output value allowed

Definition at line 322 of file 32b/pi.h.

References _PI_Obj_::outMin.

static void PI_setRefValue | ( | PI_Handle | handle,
|  | const _iq | refValue
| ) |  |
| inline static

Sets the reference value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | refValue | The reference value

Definition at line 335 of file 32b/pi.h.

References _PI_Obj_::refValue.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setRefValue | ( | PI_Handle | handle,
|  | const float_t | refValue
| ) |  |
| inline static

Sets the reference value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | refValue | The reference value

Definition at line 335 of file float/pi.h.

References _PI_Obj_::refValue.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setUi | ( | PI_Handle | handle,
|  | const float_t | Ui
| ) |  |
| inline static

Sets the integrator start value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Ui | The integral start value for the PI controller

Definition at line 348 of file float/pi.h.

References _PI_Obj_::Ui.

Referenced by PI_run_parallel(), and PI_run_series().

static void PI_setUi | ( | PI_Handle | handle,
|  | const _iq | Ui
| ) |  |
| inline static

Sets the integrator start value in the PI controller.

Parameters

  [in] | handle | The PI controller handle
  [in] | Ui | The integral start value for the PI controller

Definition at line 348 of file 32b/pi.h.

References _PI_Obj_::Ui.

Referenced by CTRL_reset(), CTRL_setup(), PI_run_parallel(), and PI_run_series().