AM243x Motor Control SDK  09.00.00
dcl_pi.h File Reference

Introduction

Contains PI controller with its related structures and functions.

Go to the source code of this file.

Data Structures

struct  DCL_PI_SPS
 Defines DCL_PI shadow parameter set used for updating controller parameter. More...
 
struct  dcl_pi
 DCL_PI object for storing PI specific parameters. More...
 

Macros

#define PI_SPS_DEFAULTS   { 1.0f, 0.0f, 1.0f, -1.0f }
 Defines default values to initialize DCL_PI_SPS. More...
 
#define PI_DEFAULTS
 Defines default values to initialize DCL_PI. More...
 
#define PI_INT_DEFAULTS
 Macro for internal default values to initialize DCL_PI Example: DCL_PI pi_ctrl = { .Kp = 1.0f, .Ki = 0.0f, .Umax = 1.0f, .Umin = -1.0f, PI_INT_DEFAULTS };. More...
 
#define DCL_initPI()   &(DCL_PI)PI_DEFAULTS
 Initialize DCL_PI struct with default parameters Example: DCL_PI* pi_ctrl = DCL_initPI();. More...
 
#define DCL_initPIasParam(kp, ki, umax, umin)
 Initialize DCL_PI struct with input controller parameters Example: DCL_PI* pi_ctrl = DCL_initPIasParam(1.0f,0.0f,1.0f,-1.0f); Note: input parameter needs to be in the same order as listed in PI_SPS struct. More...
 
#define DCL_initPIasSPS(pi_ptr, sps_ptr)
 Initialize DCL_PI struct with sps parameters Example: DCL_PI_SPS pi_sps = { .Kp = , .Ki = , ...}; DCL_PI pi_ctrl; DCL_initPIasSPS(&pi_ctrl,&pi_sps);. More...
 

Typedefs

typedef _DCL_VOLATILE struct dcl_pi DCL_PI
 
typedef _DCL_VOLATILE struct dcl_piPI_Handle
 

Functions

_DCL_CODE_ACCESS void DCL_resetPI (DCL_PI *pi)
 Resets PI internal storage data with interrupt protection. More...
 
_DCL_CODE_ACCESS void DCL_fupdatePI (DCL_PI *pi)
 Loads PI tuning parameter from its SPS parameter
More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION bool DCL_updatePI (DCL_PI *pi)
 Updates PI parameter from its SPS parameter with interrupt protection. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION bool DCL_pendingUpdatePI (DCL_PI *pi)
 A conditional update based on the pending-for-update flag. If the pending status is set, the function will update PI parameter from its SPS parameter and clear the status flag on completion. Note: Use DCL_setPendingStatus(pi) to set the pending status. More...
 
_DCL_CODE_ACCESS void DCL_updatePISPS (DCL_PI *pi)
 Update SPS parameter with active param, userful when needing to update only few active param from SPS and keep rest the same
More...
 
_DCL_CODE_ACCESS void DCL_loadSeriesPIasZPK (DCL_PI *pi, DCL_ZPK3 *zpk)
 Configures a series PI controller in "zero-pole-gain" form Note: Sampling period pi->css->t_sec are used in the calculation. New settings take effect after DCL_updatePI(). Only z1 considered in DCL_ZPK3, other poles & zeros ignored. Zero frequency assumed to be in radians/sec. More...
 
_DCL_CODE_ACCESS void DCL_loadParallelPIasZPK (DCL_PI *pi, DCL_ZPK3 *zpk)
 Configures a parallel PI controller in "zero-pole-gain" form Note: Sampling period pi->css->t_sec are used in the calculation. New settings take effect after DCL_updatePI(). Zero frequency assumed to be in radians/sec. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION float32_t DCL_runPISeries (DCL_PI *pi, float32_t rk, float32_t yk)
 Executes an inline series form PI controller. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION float32_t DCL_runPIParallel (DCL_PI *pi, float32_t rk, float32_t yk)
 Executes a parallel form PI controller Implemented as inline C function. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION float32_t DCL_runPIParallelEnhanced (DCL_PI *pi, float32_t rk, float32_t yk, float32_t Imax, float32_t Imin)
 Executes a parallel form PI controller with enhanced anti-windup logic incorporating an addintional integrator saturation clamp. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION float32_t DCL_runPISeriesTustin (DCL_PI *pi, float32_t rk, float32_t yk)
 Executes a series form PI controller with Tustin integrator. More...