AM243x Motor Control SDK  09.00.00
dcl_df22.h File Reference

Introduction

Contains direct form 2 2nd order DF22 compensator with its related structures and functions.

Go to the source code of this file.

Data Structures

struct  DCL_DF22_SPS
 Defines DCL_DF22 shadow parameter set used for updating compensator parameter. More...
 
struct  dcl_df22
 DCL_DF22 object for storing df22 specific parameters. More...
 

Macros

#define DF22_SPS_DEFAULTS   { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }
 
#define DF22_DEFAULTS
 Defines default values to initialize DCL_DF22. More...
 
#define DF22_INT_DEFAULTS
 Macro for internal default values to initialize DCL_DF22 Example: DCL_DF22 df22_ctrl = { .b0 = 1.00f, .b1 = 0.0f, ... .a2 = 0.0f, DF22_INT_DEFAULTS };. More...
 
#define DCL_initDF22()   &(DCL_DF22)DF22_DEFAULTS
 Initialize DCL_DF22 struct with default parameters Example: DCL_DF22* df22_ctrl = DCL_initDF22();. More...
 
#define DCL_initDF22asParam(_b0, _b1, _b2, _a1, _a2)
 Initialize DCL_DF22 struct with input compensator parameters Example: DCL_DF22 DF22_ctrl = DCL_initD22asParam(1.0f,0.0f,0.0f,0.0f,0.0f); Note: input parameter needs to be in the same order as listed in DF22_SPS struct. More...
 
#define DCL_initDF22asSPS(df_ptr, sps_ptr)
 Initialize DCL_DF22 struct using sps parameters Example: DCL_DF22_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF22 df_ctrl; DCL_initDF22asSPS(&df_ctrl,&df_sps);. More...
 

Typedefs

typedef _DCL_VOLATILE struct dcl_df22 DCL_DF22
 
typedef _DCL_VOLATILE struct dcl_df22DF22_Handle
 

Functions

_DCL_CODE_ACCESS void DCL_resetDF22 (DCL_DF22 *df)
 Resets DF22 internal storage data with interrupt protection. More...
 
_DCL_CODE_ACCESS void DCL_fupdateDF22 (DCL_DF22 *df)
 Loads DF22 tuning parameter from its SPS parameter. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION bool DCL_updateDF22 (DCL_DF22 *df)
 Updates DF22 parameter from its SPS parameter with interrupt protection. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION bool DCL_pendingUpdateDF22 (DCL_DF22 *df)
 A conditional update based on the pending-for-update flag. If the pending status is set, the function will update DF22 parameter from its SPS parameter and clear the status flag on completion. Note: Use DCL_setPendingStatus(df) to set the pending status. More...
 
_DCL_CODE_ACCESS void DCL_updateDF22SPS (DCL_DF22 *df)
 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 bool DCL_isStableDF22 (DCL_DF22 *df)
 Determines stability of the shadow compensator. More...
 
_DCL_CODE_ACCESS void DCL_loadDF22asZPK (DCL_DF22 *df, DCL_ZPK3 *zpk)
 Loads the DF22 shadow coefficients from a ZPK3 description Note: Sampling period df->css->t_sec are used in the calculation. New settings take effect after DCL_updateDF22(). Only z1, z2, p1 & p2 are considered, z3 & p3 are ignored. More...
 
_DCL_CODE_ACCESS void DCL_loadDF22asZwn (DCL_DF22 *df, float32_t z, float32_t wn)
 Loads the DF22 shadow coefficients from damping ratio and un-damped natural frequency using sample rate in CSS. Note: Sampling period df->css->t_sec are used in the calculation. New settings take effect after DCL_updateDF22(). More...
 
_DCL_CODE_ACCESS void DCL_loadDF22asSeriesPID (DCL_DF22 *df, float32_t Kp, float32_t Ki, float32_t Kd, float32_t fc)
 Loads the shadow DF22 compensator coefficients to emulate a series form PID. Note: Sampling period df->css->t_sec are used in the calculation. New settings take effect after DCL_updateDF22(). More...
 
_DCL_CODE_ACCESS void DCL_loadDF22asParallelPID (DCL_DF22 *df, float32_t Kp, float32_t Ki, float32_t Kd, float32_t fc)
 Loads the shadow DF22 compensator coefficients to emulate a parallel form PID. Note: Sampling period df->css->t_sec are used in the calculation. New settings take effect after DCL_updateDF22(). More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION float32_t DCL_runDF22 (DCL_DF22 *df, float32_t ek)
 Executes a 2nd order Direct Form 2 controller. More...
 
_DCL_CODE_ACCESS float32_t DCL_runDF22PartialCompute (DCL_DF22 *df, float32_t ek)
 Immediate computation to obtain DF22 servo error without updating the controller. More...
 
_DCL_CODE_ACCESS void DCL_runDF22PartialUpdate (DCL_DF22 *df, float32_t ek, float32_t uk)
 Update DF22 controller based on pre-computed control effort. More...
 
_DCL_CODE_ACCESS _DCL_CODE_SECTION float32_t DCL_runDF22Clamp (DCL_DF22 *df, float32_t ek, float32_t Umax, float32_t Umin)
 Executes a 2nd order Direct Form 2 controller with clamp. More...