Here is the list of APIs used for Digital Control Library
Files | |
file | dcl.h |
Top level header that contains all collections of Digital Controller Library functions. | |
file | dcl_common.h |
Top level header that contains all DCL common strctures and functions. | |
file | dcl_pi.h |
Contains PI controller with its related structures and functions. | |
file | dcl_pi2.h |
Contains PI2 (double integrator) controller with its related structures and functions. | |
file | dcl_pid.h |
Contains 32-bit PID controller with its related structures and functions. | |
file | dcl_nlpid.h |
Contains 32-bit non-linear PID controller with its related structures and functions. | |
file | dcl_pidf64.h |
Contains 64-bit PID controller with its related structures and functions. | |
file | dcl_df11.h |
Contains direct form 1 1st order DF11 compensator with its related structures and functions. | |
file | dcl_df13.h |
Contains direct form 1 3rd order DF13 compensator with its related structures and functions. | |
file | dcl_df22.h |
Contains direct form 2 2nd order DF22 compensator with its related structures and functions. | |
file | dcl_df23.h |
Contains direct form 2 3rd order DF23 compensator with its related structures and functions. | |
file | dcl_macro.h |
Defines all the auxiliary macros for DCL. | |
file | dcl_clamp.h |
Defines both single, double precision clamp function for saturation. | |
file | dcl_css.h |
Defines Controller Common Support Structure (CSS) and related macros. | |
file | dcl_stability.h |
Defines polynomial stability functions. | |
file | dcl_zpk3.h |
Defines ZPK3 strcture that represents a third order transfer function of poles and zeros. | |
file | dcl_error.h |
Defines all error handling strctures and macro. | |
file | dcl_fdlog.h |
Defines a 32-bit floating-point data logger strcture and related functions. | |
file | dcl_mlog.h |
Defines the interface to Multi-channel data logger (mlog) | |
file | dcl_refgen.h |
Defines the interface to reference generator module (REFGEN) | |
file | dcl_tcm.h |
Defines the interface to the Transient Capture Module (TCM) | |
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... | |
struct | DCL_PI2_SPS |
Defines DCL_PI2 shadow parameter set used for updating controller parameter. More... | |
struct | dcl_pi2 |
DCL_PI2 object for storing PI2 specific parameters PI2 - PI controller with double integrators. More... | |
struct | DCL_PID_SPS |
Defines DCL_PID shadow parameter set used for updating controller parameter. More... | |
struct | dcl_pid |
DCL_PID object for storing PID specific parameters. More... | |
struct | DCL_NLPID_SPS |
Defines the shadow DCL_NLPID controller structure. More... | |
struct | dcl_nlpid |
Defines the active DCL_NLPID controller structure. More... | |
struct | DCL_PIDF64_SPS |
Defines DCL_PIDF64 shadow PID64 controller structure used for updating controller parameter. More... | |
struct | dcl_pidf64 |
DCL_PIDF64 object for storing 64bit PID specific parameters. More... | |
struct | DCL_DF11_SPS |
Defines DCL_DF11 shadow parameter set used for updating compensator parameter. More... | |
struct | dcl_df11 |
DCL_DF11 object for storing df11 specific parameters. More... | |
struct | DCL_DF13_SPS |
Defines the DCL_DF13 shadow parameter set used for updating compensator parameter. More... | |
struct | dcl_df13 |
DCL_DF13 object for storing df13 specific parameters. More... | |
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... | |
struct | DCL_DF23_SPS |
Defines DCL_DF23 shadow parameter set used for updating compensator parameter. More... | |
struct | dcl_df23 |
DCL_DF23 object for storing df23 specific parameters. More... | |
struct | DCL_CSS |
Defines the controller common support structure. More... | |
struct | DCL_CSSF64 |
Defines the 64bit CSS structure. More... | |
struct | DCL_ZPK3 |
Defines the DCL_ZPK3 structure. More... | |
struct | DCL_ZPK3F64 |
Defines the 64bit ZPK3 structure. More... | |
struct | dcl_fdlog |
Defines the data logger strcture for 32-bit float. More... | |
struct | dcl_mlog |
Defines the MLOG structure. More... | |
struct | dcl_refgen |
Defines the DCL_REFGEN structure. More... | |
struct | dcl_tcm |
Defines the TCM structure. More... | |
Functions | |
_DCL_CODE_ACCESS void | DCL_resetPI (DCL_PI *pi) |
Resets PI internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdatePI (DCL_PI *pi) |
Loads PI tuning parameter from its SPS parameter without interrupt protection More... | |
_DCL_CODE_ACCESS void | DCL_updatePINoCheck (DCL_PI *pi) |
Loads PI tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updatePI (DCL_PI *pi) |
A conditional update based on the update flag. If the update status is set, the function will update PI parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CODE_ACCESS void | DCL_loadSeriesPIasZPK (DCL_PI *pi, DCL_ZPK3 *zpk) |
Configures a series PI controller in "zero-pole-gain" form. More... | |
_DCL_CODE_ACCESS void | DCL_loadParallelPIasZPK (DCL_PI *pi, DCL_ZPK3 *zpk) |
Configures a parallel PI controller in "zero-pole-gain" form. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runPISeries (DCL_PI *pi, float32_t rk, float32_t yk) |
Executes an inline series form PI controller. More... | |
_DCL_CRIT_ACCESS 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_CRIT_ACCESS float32_t | DCL_runPIParallelEnhanced (DCL_PI *pi, float32_t rk, float32_t yk) |
Executes a parallel form PI controller with enhanced anti-windup logic incorporating an additional integrator saturation clamp. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runPISeriesTustin (DCL_PI *pi, float32_t rk, float32_t yk) |
Executes a series form PI controller with Tustin integrator. More... | |
_DCL_CODE_ACCESS void | DCL_resetPI2 (DCL_PI2 *pi2) |
Resets PI2 internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdatePI2 (DCL_PI2 *pi2) |
Loads PI2 tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updatePI2NoCheck (DCL_PI2 *pi2) |
Loads PI2 tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updatePI2 (DCL_PI2 *pi2) |
A conditional update based on the update flag. If the update status is set, the function will update PI2 parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runPI2Series (DCL_PI2 *pi2, float32_t rk, float32_t yk) |
Executes an inline series form PI2 controller on the FPU32. More... | |
_DCL_CODE_ACCESS void | DCL_resetPID (DCL_PID *pid) |
Resets PID internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdatePID (DCL_PID *pid) |
Loads PID tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updatePIDNoCheck (DCL_PID *pid) |
Loads PID tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updatePID (DCL_PID *pid) |
A conditional update based on the update flag. If the update status is set, the function will update PID parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CODE_ACCESS void | DCL_setPIDfilterBW (DCL_PID *pid, float32_t fc) |
Loads the derivative path filter shadow coefficients. More... | |
_DCL_CODE_ACCESS void | DCL_setActivePIDfilterBW (DCL_PID *pid, float32_t fc, float32_t T) |
Loads the PID derivative path filter active coefficients. More... | |
_DCL_CODE_ACCESS float32_t | DCL_getPIDfilterBW (DCL_PID *pid) |
Calculates the active derivative path filter bandwidth in Hz. More... | |
_DCL_CODE_ACCESS void | DCL_loadSeriesPIDasZPK (DCL_PID *pid, DCL_ZPK3 *zpk) |
Configures a series PID controller parameter in ZPK form. More... | |
_DCL_CODE_ACCESS void | DCL_loadParallelPIDasZPK (DCL_PID *pid, DCL_ZPK3 *zpk) |
Configures a parallel PID controller in ZPK form. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runPIDSeries (DCL_PID *pid, float32_t rk, float32_t yk, float32_t lk) |
Executes an ideal form PID controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runPIDParallel (DCL_PID *pid, float32_t rk, float32_t yk, float32_t lk) |
Executes a parallel form PID controller. More... | |
_DCL_CODE_ACCESS void | DCL_resetNLPID (DCL_NLPID *pid) |
Resets NLPID internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdateNLPID (DCL_NLPID *pid) |
Loads NLPID tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updateNLPIDNoCheck (DCL_NLPID *pid) |
Loads PID tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updateNLPID (DCL_NLPID *pid) |
A conditional update based on the update flag. If the update status is set, the function will update NLPID parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CODE_ACCESS void | DCL_setNLPIDfilterBW (DCL_NLPID *pid, float32_t fc) |
Loads the shadow derivative LP filter coefficients. More... | |
_DCL_CODE_ACCESS void | DCL_setActiveNLPIDfilterBW (DCL_NLPID *pid, float32_t fc, float32_t T) |
Loads the NLPID derivative path filter active coefficients. More... | |
_DCL_CODE_ACCESS float32_t | DCL_getNLPIDfilterBW (DCL_NLPID *pid) |
Returns the derivative LP filter bandwidth in Hz. More... | |
_DCL_CODE_ACCESS float32_t | DCL_getNLPIDgamma (float32_t alpha, float32_t delta) |
Returns the linearized region gain for specified (alpha,delta) More... | |
_DCL_CODE_ACCESS float32_t | DCL_getNLPIDdelta (float32_t alpha, float32_t gamma) |
Returns the semi-width of the linear gain region for specified (alpha,gamma) More... | |
_DCL_CODE_ACCESS void | DCL_setNLPIDgamma (DCL_NLPID *pid) |
Computes the linearized gains for each path Note: active coefficients not update DCL_updateNLPID() called. More... | |
_DCL_CODE_ACCESS void | DCL_setActiveNLPIDgamma (DCL_NLPID *pid) |
Computes the linearized gains for each path and loads the parameters in the active NLPID structure. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runNLPIDParallel (DCL_NLPID *pid, float32_t rk, float32_t yk, float32_t lk) |
Executes a parallel form non-linear PID controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runNLPIDSeries (DCL_NLPID *pid, float32_t rk, float32_t yk, float32_t lk) |
Executes a series form non-linear PID controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runNLF (float32_t x, float32_t alpha, float32_t delta) |
Executes a basic non-linear control function. More... | |
_DCL_CODE_ACCESS void | DCL_resetPIDF64 (DCL_PIDF64 *pid) |
Resets PID64 internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdatePIDF64 (DCL_PIDF64 *pid) |
Loads PIDF64 tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updatePIDF64NoCheck (DCL_PIDF64 *pid) |
Updates PID parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updatePIDF64 (DCL_PIDF64 *pid) |
A conditional update based on the update flag. If the update status is set, the function will update PIDF64 parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CODE_ACCESS void | DCL_setPIDF64filterBW (DCL_PIDF64 *pid, float64_t fc) |
Loads the derivative path filter shadow coefficients. More... | |
_DCL_CODE_ACCESS void | DCL_setActivePIDF64filterBW (DCL_PIDF64 *pid, float64_t fc, float64_t T) |
Loads the PID64 derivative path filter active coefficients. More... | |
_DCL_CODE_ACCESS float64_t | DCL_getPIDF64filterBW (DCL_PIDF64 *pid) |
Returns the active derivative path filter bandwidth in Hz. More... | |
_DCL_CODE_ACCESS void | DCL_loadSeriesPIDF64asZPK (DCL_PIDF64 *pid, DCL_ZPK3F64 *zpk) |
Configures a series PID controller parameter in ZPK form. More... | |
_DCL_CODE_ACCESS void | DCL_loadParallelPIDF64asZPK (DCL_PIDF64 *pid, DCL_ZPK3 *zpk) |
Configures a parallel PID controller in ZPK form. More... | |
_DCL_CRIT_ACCESS float64_t | DCL_runPIDF64Series (DCL_PIDF64 *pid, float64_t rk, float64_t yk, float64_t lk) |
Executes an ideal form PID64 controller. More... | |
_DCL_CRIT_ACCESS float64_t | DCL_runPIDF64Parallel (DCL_PIDF64 *pid, float64_t rk, float64_t yk, float64_t lk) |
Executes an parallel form PID64 controller. More... | |
_DCL_CODE_ACCESS void | DCL_resetDF11 (DCL_DF11 *df) |
Resets DF11 internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdateDF11 (DCL_DF11 *df) |
Loads DF11 tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updateDF11NoCheck (DCL_DF11 *df) |
Loads DF11 tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updateDF11 (DCL_DF11 *df) |
A conditional update based on the update flag. If the update status is set, the function will update DF11 parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CODE_ACCESS bool | DCL_isStableDF11 (DCL_DF11 *df) |
Determines stability of the shadow DF11 compensator. More... | |
_DCL_CODE_ACCESS void | DCL_loadDF11asZPK (DCL_DF11 *df, DCL_ZPK3 *zpk) |
Loads the DF11 shadow coefficients from a ZPK3 description. More... | |
_DCL_CODE_ACCESS void | DCL_loadDF11asPI (DCL_DF11 *df, float32_t Kp, float32_t Ki) |
Loads compensator coefficients to emulate series form PI. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF11 (DCL_DF11 *df, float32_t ek) |
Executes a 1st order Direct Form 1 controller. More... | |
_DCL_CODE_ACCESS void | DCL_resetDF13 (DCL_DF13 *df) |
Resets DF13 internal storage data with interrupt protection Implemented as inline C function. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdateDF13 (DCL_DF13 *df) |
Loads DF13 tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updateDF13NoCheck (DCL_DF13 *df) |
Loads DF13 tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updateDF13 (DCL_DF13 *df) |
A conditional update based on the update flag. If the update status is set, the function will update DF13 parameter from its SPS parameter and clear the status flag on completion.. More... | |
_DCL_CODE_ACCESS bool | DCL_isStableDF13 (DCL_DF13 *df) |
Determines stability of the shadow compensator. More... | |
_DCL_CODE_ACCESS void | DCL_loadDF13asZPK (DCL_DF13 *df, DCL_ZPK3 *zpk) |
Loads the DF13 shadow coefficients from a ZPK3 description. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF13 (DCL_DF13 *df, float32_t ek) |
Executes a 3rd order Direct Form 1 controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF13PartialCompute (DCL_DF13 *df, float32_t ek) |
Immediate computation to obtain DF13 servo error without updating the controller. More... | |
_DCL_CRIT_ACCESS void | DCL_runDF13PartialUpdate (DCL_DF13 *df, float32_t ek, float32_t uk) |
Update DF13 controller based on pre-computed control effort. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF13Clamp (DCL_DF13 *df, float32_t ek, float32_t Umax, float32_t Umin) |
Executes a 3rd order Direct Form 1 controller with clamp. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF13_C5 (DCL_DF13 *p, float32_t ek, float32_t vk) |
Legacy C28 Function for maintaining backwards compatibility. It Executes an immediate 3rd order Direct Form 1 controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF13_C6 (DCL_DF13 *p, float32_t ek, float32_t uk) |
Legacy C28 Function for maintaining backwards compatibility. It executes a partial pre-computed 3rd order Direct Form 1 controller. More... | |
_DCL_CODE_ACCESS void | DCL_resetDF22 (DCL_DF22 *df) |
Resets DF22 internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdateDF22 (DCL_DF22 *df) |
Loads DF22 tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updateDF22NoCheck (DCL_DF22 *df) |
Loads DF22 tuning parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updateDF22 (DCL_DF22 *df) |
A conditional update based on the update flag. If the update status is set, the function will update DF22 parameter from its SPS parameter and clear the status flag on completion. 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. 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. 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. 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. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF22 (DCL_DF22 *df, float32_t ek) |
Executes a 2nd order Direct Form 2 controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF22PartialCompute (DCL_DF22 *df, float32_t ek) |
Immediate computation to obtain DF22 servo error without updating the controller. More... | |
_DCL_CRIT_ACCESS void | DCL_runDF22PartialUpdate (DCL_DF22 *df, float32_t ek, float32_t uk) |
Update DF22 controller based on pre-computed control effort. More... | |
_DCL_CRIT_ACCESS 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... | |
_DCL_CODE_ACCESS void | DCL_resetDF23 (DCL_DF23 *df) |
Resets DF23 internal storage data with interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_forceUpdateDF23 (DCL_DF23 *df) |
Loads DF23 tuning parameter from its SPS parameter without interrupt protection. More... | |
_DCL_CODE_ACCESS void | DCL_updateDF23NoCheck (DCL_DF23 *df) |
Updates DF23 parameter from its SPS parameter with interrupt protection. More... | |
_DCL_CODE_ACCESS bool | DCL_updateDF23 (DCL_DF23 *df) |
A conditional update based on the update flag. If the update status is set, the function will update DF23 parameter from its SPS parameter and clear the status flag on completion. More... | |
_DCL_CODE_ACCESS bool | DCL_isStableDF23 (DCL_DF23 *df) |
Determines stability of the shadow compensator. More... | |
_DCL_CODE_ACCESS void | DCL_loadDF23asZPK (DCL_DF23 *df, DCL_ZPK3 *zpk) |
Loads the DF23 shadow coefficients from a ZPK3 description. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF23 (DCL_DF23 *df, float32_t ek) |
Executes a 3rd order Direct Form 2 controller. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF23PartialCompute (DCL_DF23 *df, float32_t ek) |
Immediate computation to obtain DF23 servo error without updating the controller. More... | |
_DCL_CRIT_ACCESS void | DCL_runDF23PartialUpdate (DCL_DF23 *df, float32_t ek, float32_t uk) |
Update DF22 controller based on pre-computed control effort. More... | |
_DCL_CRIT_ACCESS float32_t | DCL_runDF23Clamp (DCL_DF23 *df, float32_t ek, float32_t Umax, float32_t Umin) |
Executes a 3rd order Direct Form 2 controller with clamp. More... | |
_DCL_CODE_ACCESS bool | DCL_runClamp (float32_t *data, float32_t Umax, float32_t Umin) |
Saturates a control variable and returns true if either limit is exceeded. More... | |
_DCL_CODE_ACCESS bool | DCL_runClampF64 (float64_t *data, float64_t Umax, float64_t Umin) |
Saturates a control variable and returns true if either limit is exceeded. More... | |
_DCL_CODE_ACCESS bool | DCL_isStablePn1 (float32_t a1) |
Determines stability of a first order real polynomial P(z) = z + a1. More... | |
_DCL_CODE_ACCESS bool | DCL_isStablePn2 (float32_t a0, float32_t a1, float32_t a2) |
Determines stability of a second order polynomial with real coefficients P(z) = a0 z^2 + a1 z + a2. More... | |
_DCL_CODE_ACCESS bool | DCL_isStablePn3 (float32_t a0, float32_t a1, float32_t a2, float32_t a3) |
Determines stability of a third order polynomial with real coefficients P(z) = a0 z^3 + a1 z^2 + a2 z + a3. More... | |
_DCL_CODE_ACCESS bool | DCL_isStableZpk3 (DCL_ZPK3 *q) |
Determines stability of a ZPK3 representation by checking pole magnitude. More... | |
_DCL_CODE_ACCESS bool | DCL_isStableZpk3F64 (DCL_ZPK3 *q) |
Determines stability of a ZPK3F64 representation by checking pole magnitude. More... | |
_DCL_CODE_ACCESS void | DCL_setLogIndex (DCL_FDLOG *buf, uint32_t idx) |
Sets index of the current pointer (zero-indexed) More... | |
_DCL_CODE_ACCESS void | DCL_deleteLog (DCL_FDLOG *buf) |
Resets all structure pointers to null value. More... | |
_DCL_CODE_ACCESS void | DCL_resetLog (DCL_FDLOG *buf) |
Resets the data index pointer to start of buffer. More... | |
_DCL_CODE_ACCESS void | DCL_fillLog (DCL_FDLOG *buf, float32_t data) |
Fills the buffer with a given data value and resets the data index pointer to the start of the buffer. More... | |
_DCL_CODE_ACCESS void | DCL_initLog (DCL_FDLOG *buf, float32_t *addr, uint32_t size) |
Assigns the buffer pointers to a memory block or array and sets the data index pointer to the first address. More... | |
_DCL_CODE_ACCESS float32_t | DCL_writeLog (DCL_FDLOG *buf, float32_t data) |
Writes a data point into the buffer and advances the indexing pointer, wrapping if necessary. Returns the over-written data value for delay line or FIFO implementation. More... | |
_DCL_CODE_ACCESS float32_t | DCL_readLog (DCL_FDLOG *buf) |
Reads a data point from the buffer and then advances the indexing pointer, wrapping if necessary. More... | |
_DCL_CODE_ACCESS void | DCL_copyLog (DCL_FDLOG *src, DCL_FDLOG *dst) |
Copies the contents of one log (src) into another (dst). Both logs must have the same size. More... | |
_DCL_CODE_ACCESS void | DCL_initMLOG (DCL_MLOG *q, float32_t *addr, uint32_t size, float32_t tmax, float32_t tmin, uint32_t div) |
Initializes the MLOG module. More... | |
_DCL_CODE_ACCESS void | DCL_resetMLOG (DCL_MLOG *q) |
Resets the MLOG module: clears all frame buffers and sets idle mode. More... | |
_DCL_CODE_ACCESS uint16_t | DCL_armMLOG (DCL_MLOG *q) |
Changes the MLOG mode to "MLOG_ARMED". Only valid if current operating mode is "MLOG_IDLE". More... | |
_DCL_CODE_ACCESS uint16_t | DCL_runMLOG (DCL_MLOG *q) |
Runs the MLOG module. More... | |
_DCL_CODE_ACCESS void | DCL_resetRefgen (DCL_REFGEN *p) |
Resets DCL_REFGEN dynamic data. More... | |
_DCL_CODE_ACCESS void | DCL_setRefgenRamp (DCL_REFGEN *p, float32_t tgt, float32_t tr) |
Loads the REFGEN ramp parameters. More... | |
_DCL_CODE_ACCESS void | DCL_setRefgenAmpl (DCL_REFGEN *p, float32_t ampl, float32_t tr) |
Loads the REFGEN dynamic amplitude. More... | |
_DCL_CODE_ACCESS void | DCL_setRefgenFreq (DCL_REFGEN *p, float32_t freq, float32_t tr) |
Loads the REFGEN frequency. More... | |
_DCL_CODE_ACCESS void | DCL_setRefgenDuty (DCL_REFGEN *p, float32_t duty) |
Loads the REFGEN pulse duty cycle. More... | |
_DCL_CODE_ACCESS void | DCL_setRefgenClamp (DCL_REFGEN *p, float32_t max, float32_t min) |
Loads the REFGEN output clam limits. More... | |
_DCL_CODE_ACCESS void | DCL_setRefgenMode (DCL_REFGEN *p, int16_t mode) |
Sets the REFGEN operating mode. More... | |
_DCL_CODE_ACCESS void | DCL_runRefgen (DCL_REFGEN *p) |
Runs the REFGEN module. More... | |
_DCL_CODE_ACCESS float32_t | DCL_getRefgenPhaseA (DCL_REFGEN *p) |
Returns the phase reference output. More... | |
_DCL_CODE_ACCESS float32_t | DCL_getRefgenPhaseB (DCL_REFGEN *p) |
Returns the phase reference output. More... | |
_DCL_CODE_ACCESS float32_t | DCL_getRefgenPhaseC (DCL_REFGEN *p) |
Returns the phase reference output. More... | |
_DCL_CODE_ACCESS void | DCL_initTCM (DCL_TCM *q, float32_t *addr, uint32_t size, uint32_t lead, float32_t tmin, float32_t tmax) |
Resets the TCM module: clears buffers and sets idle mode. More... | |
_DCL_CODE_ACCESS void | DCL_resetTCM (DCL_TCM *q) |
Resets the TCM module: clears all frame buffers and sets idle mode. More... | |
_DCL_CODE_ACCESS uint16_t | DCL_armTCM (DCL_TCM *q) |
Changes the TCM mode to "TCM_ARMED". More... | |
_DCL_CODE_ACCESS uint16_t | DCL_runTCM (DCL_TCM *q, float32_t data) |
Runs the TCM module. More... | |
_DCL_CODE_ACCESS float32_t | DCL_runITAE (DCL_FDLOG *elog, float32_t prd) |
Computes ITAE performance index from a log of servo error. More... | |
_DCL_CODE_ACCESS float32_t | DCL_runIAE (DCL_FDLOG *elog) |
Computes IAE performance index from a log of servo error. More... | |
_DCL_CODE_ACCESS float32_t | DCL_runIES (DCL_FDLOG *elog) |
Computes IES performance index from a log of servo error. More... | |
Typedefs | |
typedef float | float32_t |
typedef double | float64_t |
typedef uint32_t | dcl_interrupt_t |
typedef _DCL_VOLATILE struct dcl_pi | DCL_PI |
typedef _DCL_VOLATILE struct dcl_pi2 | DCL_PI2 |
typedef _DCL_VOLATILE struct dcl_pid | DCL_PID |
typedef _DCL_VOLATILE struct dcl_nlpid | DCL_NLPID |
typedef _DCL_VOLATILE struct dcl_pidf64 | DCL_PIDF64 |
typedef _DCL_VOLATILE struct dcl_df11 | DCL_DF11 |
typedef _DCL_VOLATILE struct dcl_df13 | DCL_DF13 |
typedef _DCL_VOLATILE struct dcl_df22 | DCL_DF22 |
typedef _DCL_VOLATILE struct dcl_df23 | DCL_DF23 |
typedef _DCL_VOLATILE struct dcl_fdlog | DCL_FDLOG |
typedef _DCL_VOLATILE struct dcl_fdlog | FDLOG |
typedef _DCL_VOLATILE struct dcl_mlog | DCL_MLOG |
typedef _DCL_VOLATILE struct dcl_mlog | MLOG |
typedef _DCL_VOLATILE struct dcl_refgen | DCL_REFGEN |
typedef _DCL_VOLATILE struct dcl_tcm | DCL_TCM |
typedef _DCL_VOLATILE struct dcl_tcm | TCM |
Enumerations | |
enum | DCL_status_bits { DCL_STS_NONE = 0U, DCL_STS_PARAM_UPDATE = (1U << 0), DCL_STS_CTRL_RUNNING = (1U << 1) } |
Defines the library enumerated status bits. More... | |
enum | DCL_error_codes { dcl_none = 0U, dcl_param_range_err = (1U << 0), dcl_param_invalid_err = (1U << 1), dcl_param_warn_err = (1U << 2), dcl_input_range_err = (1U << 3), dcl_overflow_err = (1U << 4), dcl_underflow_err = (1U << 5), dcl_controller_err = (1U << 6), dcl_timing_err = (1U << 7), dcl_comp_err = (1U << 8) } |
Defines the library enumerated error codes. These will be applied as bit masks in the error handler. More... | |
enum | DCL_mlog_states { MLOG_INVALID = 0, MLOG_IDLE = 1, MLOG_ARMED = 2, MLOG_CAPTURE = 3, MLOG_COMPLETE = 4 } |
Enumerated MLOG operating modes. More... | |
enum | DCL_refgen_modes { REFGEN_OFF = 0, REFGEN_STATIC = 1, REFGEN_SINE = 2, REFGEN_SQUARE = 3, REFGEN_SAW = 4, REFGEN_TRIANGLE = 5, REFGEN_PULSE = 6, REFGEN_SINE2 = 7, REFGEN_SINE3 = 8 } |
Defines the REFGEN operating modes. More... | |
enum | DCL_tcm_states { TCM_INVALID = 0, TCM_IDLE = 1, TCM_ARMED = 2, TCM_CAPTURE = 3, TCM_COMPLETE = 4 } |
Enumerated TCM operating modes. More... | |
Macros | |
#define | DCL_VERSION 4020000 |
Library version number formatted for numerical comparison v4.02.00.00. More... | |
#define | IEEE754_TYPES |
Defines single,double precision data type. More... | |
#define | _DCL_CODE_ACCESS static inline |
Defines the scope of dcl functions. More... | |
#define | _DCL_CRIT_ACCESS static __attribute__((always_inline)) |
Defines the scope of critical dcl functions. More... | |
#define | _DCL_VOLATILE |
Defines volatile for DCL strctures. More... | |
#define | DCL_setBreakPoint() |
Set a software breakpoint assembly instruction. More... | |
#define | DCL_disableInts() 0 |
Define enable and disable interrupt operations. More... | |
#define | DCL_restoreInts(v) |
#define | PI_SPS_DEFAULTS { 1.0f, 0.0f, 1.0f, -1.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, .Imax = 0.0f, .Imin = 0.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);. 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... | |
#define | PI2_SPS_DEFAULTS { 1.0f, 0.0f, 1.0f, -1.0f } |
Defines default values to initialize DCL_PI2_SPS. More... | |
#define | PI2_DEFAULTS |
Defines default values to initialize DCL_PI2. More... | |
#define | PI2_INT_DEFAULTS |
Macro for internal default values to initialize DCL_PI2 Example: DCL_PI2 pi2_ctrl = { .Kp = 1.0f, .Ki = 0.0f, .Umax = 1.0f, .Umin = -1.0f, PI2_INT_DEFAULTS };. More... | |
#define | DCL_initPI2() &(DCL_PI2)PI2_DEFAULTS |
Initialize DCL_PI2 struct with default parameters Example: DCL_PI2 pi2_ctrl = DCL_initPI2();. More... | |
#define | DCL_initPI2asParam(kp, ki, umax, umin) |
Initialize DCL_PI2 struct with input controller parameters Example: DCL_PI2* pi2_ctrl = DCL_initPI2asParam(1.0f,0.0f,1.0f,-1.0f);. More... | |
#define | DCL_initPI2asSPS(pi2_ptr, sps_ptr) |
Initialize DCL_PI2 struct with sps parameters Example: DCL_PI2_SPS pi2_sps = { .Kp = , .Ki = , ...}; DCL_PI2 pi2_ctrl; DCL_initPI2asSPS(&pi2_ctrl,&pi2_sps);. More... | |
#define | PID_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, -1.0f } |
Defines default values to initialize DCL_PID_SPS. More... | |
#define | PID_DEFAULTS |
Defines default values to initialize the DCL_PID structure. More... | |
#define | PID_INT_DEFAULTS |
Macro for internal default values to initialize DCL_PID Example: DCL_PID pid_ctrl = { .Kp = 1.0f, .Ki = 0.0f, ... .Umin = -1.0f, PID_INT_DEFAULTS };. More... | |
#define | DCL_initPID() &(DCL_PID)PID_DEFAULTS |
Initialize DCL_PID struct with default parameters Example: DCL_PID* pid_ctrl = DCL_initPID();. More... | |
#define | DCL_initPIDasParam(kp, ki, kd, kr, _c1, _c2, umax, umin) |
Initialize DCL_PID struct with input controller parameters Example: DCL_PID* pid_ctrl = DCL_initPIDasParam(1.0f,0.0f,0.0f,1.0f,1.0f,0.0f,1.0f,-1.0f);. More... | |
#define | DCL_initPIDasSPS(pid_ptr, sps_ptr) |
Initialize DCL_PID struct with SPS parameters Example: DCL_PID_SPS pid_sps = { .Kp = , .Ki = , ...}; //initial parameter DCL_PID pid_ctrl; DCL_initPIasSPS(&pid_ctrl,&pid_sps);. More... | |
#define | DCL_DELTA_MIN 1.0e-04f |
Sets the lower bound on the linear region semi-width. More... | |
#define | DCL_GAMMA_MAX 100 |
Sets an upper bound on allowable controller gain, and therefore fixes the minimum linear region semi-width. More... | |
#define | NLPID_SPS_DEFAULTS |
Defines default values to initialize the DCL_NLPID structure. More... | |
#define | NLPID_DEFAULTS |
Defines default values to initialize the DCL_NLPID structure. More... | |
#define | PIDF64_SPS_DEFAULTS { 1.0L, 0.0L, 0.0L, 1.0L, 1.0L, 0.0L, 1.0L, -1.0L } |
Defines default values to initialize the DCL_PIDF64 shadow structure. More... | |
#define | PIDF64_DEFAULTS |
Defines default values to initialize the DCL_PID64 active structure. More... | |
#define | PIDF64_INT_DEFAULTS |
Macro for internal default values to initialize DCL_PIDF64 Example: DCL_PIDF64 pid_ctrl = { .Kp = 1.0L, .Ki = 0.0L, ... .Umin = -1.0L, PIDF64_INT_DEFAULTS };. More... | |
#define | DCL_initPIDF64() &(DCL_PIDF64)PIDF64_DEFAULTS |
Initialize DCL_PIDF64 struct with default parameters Example: DCL_PIDF64* pid_ctrl = DCL_initPID();. More... | |
#define | DCL_initPIDF64asParam(kp, ki, kd, kr, _c1, _c2, umax, umin) |
Initialize DCL_PIDF64 struct with input controller parameters Example: DCL_PIDF64* pid_ctrl = DCL_initPIDF64asParam(1.0L,0.0L,0.0L,1.0L,1.0L,0.0L,1.0L,-1.0L);. More... | |
#define | DCL_initPIDF64asSPS(pid_ptr, sps_ptr) |
Initialize DCL_PIDF64 struct with sps parameters Example: DCL_PIDF64_SPS pid_sps = { .Kp = , .Ki = , ...}; //initial parameter DCL_PIDF64 pid_ctrl; DCL_initPIasSPS(&pid_ctrl,&pid_sps);. More... | |
#define | DF11_SPS_DEFAULTS { 0.5f, 0.5f, 1.0f } |
#define | DF11_DEFAULTS |
Defines default values to initialize DCL_DF11. More... | |
#define | DF11_INT_DEFAULTS .d1=0.0f, .d2=0.0f, .sps=&(DCL_DF11_SPS)DF11_SPS_DEFAULTS, .css=&(DCL_CSS)DCL_CSS_DEFAULTS |
Macro for internal default values to initialize DCL_DF11 Example: DCL_DF11 df11_ctrl = { .b0 = 0.5f, .b1 = 0.5f, .a1 = 1.0f, DF11_INT_DEFAULTS };. More... | |
#define | DCL_initDF11() &(DCL_DF11)DF11_DEFAULTS |
Initialize DCL_DF11 struct with default parameters Example: DCL_DF11* df11_ctrl = DCL_initDF11();. More... | |
#define | DCL_initDF11asParam(_b0, _b1, _a1) |
Initialize DCL_DF11 struct with input compensator parameters Example: DCL_DF11* DF11_ctrl = DCL_initDF11asParam(0.5f,0.5f,1.0f);. More... | |
#define | DCL_initDF11asSPS(df_ptr, sps_ptr) |
Initialize DCL_DF11 struct with sps parameters Example: DCL_DF11_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF11 df_ctrl; DCL_initDF11asSPS(&df_ctrl,&df_sps);. More... | |
#define | DF13_SPS_DEFAULTS { 0.25f, 0.25f, 0.25f, 0.25f, 0.0f, 0.0f, 0.0f, 0.0f } |
#define | DF13_DEFAULTS |
Defines default values to initialize DCL_DF13. More... | |
#define | DF13_INT_DEFAULTS |
Macro for internal default values to initialize DCL_DF13 Example: DCL_DF13 df13_ctrl = { .b0 = 0.25f, .b1 = 0.25f, ... .a3 = 0.0f, DF13_INT_DEFAULTS };. More... | |
#define | DCL_initDF13() &(DCL_DF13)DF13_DEFAULTS |
Initialize DCL_DF13 struct with default parameters Example: DCL_DF13* df13_ctrl = DCL_initDF13();. More... | |
#define | DCL_initDF13asParam(_b0, _b1, _b2, _b3, _a1, _a2, _a3) |
Initialize DCL_DF13 struct with input compensator parameters Example: DCL_DF13* DF13_ctrl = DCL_initDF13asParam(0.25f,0.25f,0.25f,0.25f,0.0f,0.0f,0.0f);. More... | |
#define | DCL_initDF13asSPS(df_ptr, sps_ptr) |
Initialize DCL_DF13 struct with sps parameters Example: DCL_DF13_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF13 df_ctrl; DCL_initDF13asSPS(&df_ctrl,&df_sps);. More... | |
#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);. 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... | |
#define | DF23_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } |
#define | DF23_DEFAULTS |
Defines default values to initialize DCL_DF23. More... | |
#define | DF23_INT_DEFAULTS |
Macro for internal default values to initialize DCL_DF23 Example: DCL_DF23 df23_ctrl = { .b0 = 1.0f, .b1 = 0.0f, ... .a3 = 0.0f, DF23_INT_DEFAULTS };. More... | |
#define | DCL_initDF23() &(DCL_DF23)DF23_DEFAULTS |
Initialize DCL_DF23 struct with default parameters Example: DCL_DF23* df23_ctrl = DCL_initDF23();. More... | |
#define | DCL_initDF23asParam(_b0, _b1, _b2, _b3, _a1, _a2, _a3) |
Initialize DCL_DF23 struct with input compensator parameters Example: DCL_DF23* DF23_ctrl = DCL_initDF23asParam(1.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f);. More... | |
#define | DCL_initDF23asSPS(df_ptr, sps_ptr) |
Initialize DCL_DF23 struct with sps parameters Example: DCL_DF23_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF23 df_ctrl; DCL_initDF23asSPS(&df_ctrl,&df_sps);. More... | |
#define | NULL 0 |
#define | CONST_PI 3.14159265358979323846f |
Local definitions of the mathematical constant pi. More... | |
#define | CONST_2PI 2.0f * CONST_PI |
#define | CONST_PI_F64 3.1415926535897932384626433832795028841971693993751058209749445923078164062L |
#define | CONST_2PI_F64 2.0L * CONST_PI_F64 |
#define | DCL_FPU32_TOL 1.0e-06f |
Define the acceptable FPU numerical tolerances. More... | |
#define | DCL_FPU64_TOL 1.0e-10L |
#define | DCL_DEFAULT_PERIOD_S 100.0e-06f |
Define the default control period in seconds. More... | |
#define | DCL_DEFAULT_PERIODF64_S 100.0e-06L |
#define | DCL_isValue(x, y) (((x < (y + DCL_FPU32_TOL)) && (x > (y - DCL_FPU32_TOL))) ? 1U : 0U) |
Determines numerical proximity to specified value. More... | |
#define | DCL_isValueF64(x, y) (((x < (y + DCL_FPU64_TOL)) && (x > (y - DCL_FPU64_TOL))) ? 1U : 0U) |
#define | DCL_isZero(x) DCL_isValue(x,0.0f) |
Determines floating point numerical proximity to zero. More... | |
#define | DCL_isZeroF64(x) DCL_isValueF64(x,0.0L) |
#define | DCL_rand(a) (a * ((float32_t) rand() / (float32_t) (RAND_MAX >> 1) - 1.0f)) |
Returns a random floating point result between -1.0 and +1.0 where 'a' is the multiplier in single or double precision. Useful for initialization of arrays and matrices during test. More... | |
#define | DCL_randF64(a) (a * ((float64_t) rand() / (float64_t) (RAND_MAX >> 1) - 1.0L)) |
#define | DCL_c2Limit ((2.0f - CONST_PI) / (2.0f + CONST_PI)) |
Defines the lower limit on derivative filter coefficient c2 in order for fc to lie below the Nyquist frequency. More... | |
#define | DCL_c2LimitF64 ((2.0L - CONST_PI_F64) / (2.0L + CONST_PI_F64)) |
#define | DCL_runSat(data, Umax, Umin) (data > Umax) ? Umax : (data < Umin) ? Umin : data |
Macro to saturate a control variable but does not change the data itself unlike runClamp() More... | |
#define | DCL_CSS_DEFAULTS { 0.0f, DCL_DEFAULT_PERIOD_S, 0U, 0U, 0U, NULL } |
Default values to initialize the CSS structure. More... | |
#define | DCL_CSSF64_DEFAULTS { 0.0L, DCL_DEFAULT_PERIODF64_S, 0U, 0U, 0U, NULL } |
Default values to initialize the CSS 64bit structure. More... | |
#define | DCL_setControllerPeriod(p, t_sec) ((p)->css->T = t_sec) |
Loads the controller period in the CSS CSS pointer must be configured first. More... | |
#define | DCL_setUpdateStatus(p) ((p)->css->sts |= DCL_STS_PARAM_UPDATE) |
Macros to set and clear the update-in-progress flag. More... | |
#define | DCL_clearUpdateStatus(p) ((p)->css->sts &= ~DCL_STS_PARAM_UPDATE) |
#define | DCL_getUpdateStatus(p) (0U != ((p)->css->sts & DCL_STS_PARAM_UPDATE)) |
Determine whether a parameter update-in-progress flag is set. More... | |
#define | DCL_setControllerStatus(p) ((p)->css->sts |= DCL_STS_CTRL_RUNNING) |
Macros placed at the beginning and end of the controller so that other functions know a control operation is in progress. Typically only used with complex controllers which may not be atomic. More... | |
#define | DCL_clearControllerStatus(p) ((p)->css->sts &= ~DCL_STS_CTRL_RUNNING) |
#define | DCL_getControllerStatus(p) (0U != ((p)->css->sts & DCL_STS_CTRL_RUNNING)) |
Determine whether a controller operation-in-progress flag is set. More... | |
#define | ZPK3_DEFAULTS |
Defines default values to initialize the DCL_ZPK3 structure. More... | |
#define | ZPK3F64_DEFAULTS |
Defines default values to initialize the DCL_ZPK3F64 structure. More... | |
#define | DCL_clearError(ptr) ((ptr)->css->err = dcl_none) |
Macro to clear stored error code in CSS. More... | |
#define | DCL_setError(ptr, code) ((ptr)->css->err |= code) |
Macro to set error code in CSS. More... | |
#define | DCL_getErrorLine(ptr) ((ptr)->css->err_line = ((ptr)->css->err) ? __LINE__ : 0) |
Macro to store line location of error in CSS. More... | |
#define | DCL_getErrorFunc(ptr) ((ptr)->css->err_func = ((ptr)->css->err) ? __FUNCTION__ : NULL) |
Macro to store function location of error in CSS. More... | |
#define | DCL_getErrorInfo(ptr) |
Macro to store error info in CSS. More... | |
#define | DCL_runErrorHandler(ptr) |
Prototype for basic error handler. More... | |
#define | FDLOG_DEFAULTS {0x0,0x0,0x0,0} |
Default initialization of DCL_FDLOG. More... | |
#define | DCL_getLogSize(buf) ((buf)->size) |
Obtain the total size of buffer. More... | |
#define | DCL_getLogIndex(buf) ((uint32_t)((buf)->dptr - (buf)->fptr)) |
Index of the current pointer (zero-indexed) More... | |
#define | DCL_getLogRemain(buf) ((int32_t)((buf)->lptr - (buf)->dptr)) |
Remaining space left from indexed pointer to end of buffer. More... | |
#define | DCL_clearLog(buf) DCL_fillLog(buf,0.0f) |
Clears the buffer contents by writing 0 to all elements and resets the data index pointer to the start of the buffer. More... | |
#define | MLOG_CHANS 4 |
Defines the number of MLOG channels. More... | |
#define | MLOG_DEFAULTS |
Defines default values to initialise the MLOG structure Note: modify to match number of channels. More... | |
#define | DCL_REFGEN_MIN_INC 1.0e-06f |
Defines the minimum normalized increment. More... | |
#define | DCL_REFGEN_DEFAULTS |
Defines default values to initialize the DCL_REFGEN structure. More... | |
#define | TCM_DEFAULTS { FDLOG_DEFAULTS, FDLOG_DEFAULTS, FDLOG_DEFAULTS, 0.1, -0.1, 0, 10 } |
Defines default values to initialize the TCM structure. More... | |
#define DCL_VERSION 4020000 |
Library version number formatted for numerical comparison v4.02.00.00.
#define IEEE754_TYPES |
Defines single,double precision data type.
#define _DCL_CODE_ACCESS static inline |
Defines the scope of dcl functions.
#define _DCL_CRIT_ACCESS static __attribute__((always_inline)) |
Defines the scope of critical dcl functions.
#define _DCL_VOLATILE |
#define DCL_setBreakPoint | ( | ) |
Set a software breakpoint assembly instruction.
#define DCL_disableInts | ( | ) | 0 |
Define enable and disable interrupt operations.
#define DCL_restoreInts | ( | v | ) |
#define PI_SPS_DEFAULTS { 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, -1.0f } |
Defines default values to initialize DCL_PI_SPS.
#define PI_DEFAULTS |
Defines default values to initialize DCL_PI.
#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, .Imax = 0.0f, .Imin = 0.0f, PI_INT_DEFAULTS };.
#define DCL_initPI | ( | ) | &(DCL_PI)PI_DEFAULTS |
Initialize DCL_PI struct with default parameters Example: DCL_PI* pi_ctrl = DCL_initPI();.
#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);.
#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);.
[in] | pi_ptr | DCL_PI* pointer that needs to be initialized |
[in] | sps_ptr | DCL_PI_SPS* pointer with assigned parameters |
#define PI2_SPS_DEFAULTS { 1.0f, 0.0f, 1.0f, -1.0f } |
Defines default values to initialize DCL_PI2_SPS.
#define PI2_DEFAULTS |
Defines default values to initialize DCL_PI2.
#define PI2_INT_DEFAULTS |
Macro for internal default values to initialize DCL_PI2 Example: DCL_PI2 pi2_ctrl = { .Kp = 1.0f, .Ki = 0.0f, .Umax = 1.0f, .Umin = -1.0f, PI2_INT_DEFAULTS };.
#define DCL_initPI2 | ( | ) | &(DCL_PI2)PI2_DEFAULTS |
Initialize DCL_PI2 struct with default parameters Example: DCL_PI2 pi2_ctrl = DCL_initPI2();.
#define DCL_initPI2asParam | ( | kp, | |
ki, | |||
umax, | |||
umin | |||
) |
Initialize DCL_PI2 struct with input controller parameters Example: DCL_PI2* pi2_ctrl = DCL_initPI2asParam(1.0f,0.0f,1.0f,-1.0f);.
#define DCL_initPI2asSPS | ( | pi2_ptr, | |
sps_ptr | |||
) |
Initialize DCL_PI2 struct with sps parameters Example: DCL_PI2_SPS pi2_sps = { .Kp = , .Ki = , ...}; DCL_PI2 pi2_ctrl; DCL_initPI2asSPS(&pi2_ctrl,&pi2_sps);.
[in] | pi2_ptr | DCL_PI2* pointer that needs to be initialized |
[in] | sps_ptr | DCL_PI2_SPS* pointer with assigned parameters |
#define PID_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, -1.0f } |
Defines default values to initialize DCL_PID_SPS.
#define PID_DEFAULTS |
Defines default values to initialize the DCL_PID structure.
#define PID_INT_DEFAULTS |
Macro for internal default values to initialize DCL_PID Example: DCL_PID pid_ctrl = { .Kp = 1.0f, .Ki = 0.0f, ... .Umin = -1.0f, PID_INT_DEFAULTS };.
#define DCL_initPID | ( | ) | &(DCL_PID)PID_DEFAULTS |
Initialize DCL_PID struct with default parameters Example: DCL_PID* pid_ctrl = DCL_initPID();.
#define DCL_initPIDasParam | ( | kp, | |
ki, | |||
kd, | |||
kr, | |||
_c1, | |||
_c2, | |||
umax, | |||
umin | |||
) |
Initialize DCL_PID struct with input controller parameters Example: DCL_PID* pid_ctrl = DCL_initPIDasParam(1.0f,0.0f,0.0f,1.0f,1.0f,0.0f,1.0f,-1.0f);.
#define DCL_initPIDasSPS | ( | pid_ptr, | |
sps_ptr | |||
) |
Initialize DCL_PID struct with SPS parameters Example: DCL_PID_SPS pid_sps = { .Kp = , .Ki = , ...}; //initial parameter DCL_PID pid_ctrl; DCL_initPIasSPS(&pid_ctrl,&pid_sps);.
[in] | pid_ptr | DCL_PID* pointer that needs to be initialized |
[in] | sps_ptr | DCL_PID_SPS* pointer with assigned parameters |
#define DCL_DELTA_MIN 1.0e-04f |
Sets the lower bound on the linear region semi-width.
#define DCL_GAMMA_MAX 100 |
Sets an upper bound on allowable controller gain, and therefore fixes the minimum linear region semi-width.
#define NLPID_SPS_DEFAULTS |
Defines default values to initialize the DCL_NLPID structure.
#define NLPID_DEFAULTS |
Defines default values to initialize the DCL_NLPID structure.
#define PIDF64_SPS_DEFAULTS { 1.0L, 0.0L, 0.0L, 1.0L, 1.0L, 0.0L, 1.0L, -1.0L } |
Defines default values to initialize the DCL_PIDF64 shadow structure.
#define PIDF64_DEFAULTS |
Defines default values to initialize the DCL_PID64 active structure.
#define PIDF64_INT_DEFAULTS |
Macro for internal default values to initialize DCL_PIDF64 Example: DCL_PIDF64 pid_ctrl = { .Kp = 1.0L, .Ki = 0.0L, ... .Umin = -1.0L, PIDF64_INT_DEFAULTS };.
#define DCL_initPIDF64 | ( | ) | &(DCL_PIDF64)PIDF64_DEFAULTS |
Initialize DCL_PIDF64 struct with default parameters Example: DCL_PIDF64* pid_ctrl = DCL_initPID();.
#define DCL_initPIDF64asParam | ( | kp, | |
ki, | |||
kd, | |||
kr, | |||
_c1, | |||
_c2, | |||
umax, | |||
umin | |||
) |
Initialize DCL_PIDF64 struct with input controller parameters Example: DCL_PIDF64* pid_ctrl = DCL_initPIDF64asParam(1.0L,0.0L,0.0L,1.0L,1.0L,0.0L,1.0L,-1.0L);.
#define DCL_initPIDF64asSPS | ( | pid_ptr, | |
sps_ptr | |||
) |
Initialize DCL_PIDF64 struct with sps parameters Example: DCL_PIDF64_SPS pid_sps = { .Kp = , .Ki = , ...}; //initial parameter DCL_PIDF64 pid_ctrl; DCL_initPIasSPS(&pid_ctrl,&pid_sps);.
[in] | pid_ptr | DCL_PIDF64* pointer that needs to be initialized |
[in] | sps_ptr | DCL_PIDF64_SPS* pointer with assigned parameters |
#define DF11_SPS_DEFAULTS { 0.5f, 0.5f, 1.0f } |
#define DF11_DEFAULTS |
Defines default values to initialize DCL_DF11.
#define DF11_INT_DEFAULTS .d1=0.0f, .d2=0.0f, .sps=&(DCL_DF11_SPS)DF11_SPS_DEFAULTS, .css=&(DCL_CSS)DCL_CSS_DEFAULTS |
Macro for internal default values to initialize DCL_DF11 Example: DCL_DF11 df11_ctrl = { .b0 = 0.5f, .b1 = 0.5f, .a1 = 1.0f, DF11_INT_DEFAULTS };.
#define DCL_initDF11 | ( | ) | &(DCL_DF11)DF11_DEFAULTS |
Initialize DCL_DF11 struct with default parameters Example: DCL_DF11* df11_ctrl = DCL_initDF11();.
#define DCL_initDF11asParam | ( | _b0, | |
_b1, | |||
_a1 | |||
) |
Initialize DCL_DF11 struct with input compensator parameters Example: DCL_DF11* DF11_ctrl = DCL_initDF11asParam(0.5f,0.5f,1.0f);.
#define DCL_initDF11asSPS | ( | df_ptr, | |
sps_ptr | |||
) |
Initialize DCL_DF11 struct with sps parameters Example: DCL_DF11_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF11 df_ctrl; DCL_initDF11asSPS(&df_ctrl,&df_sps);.
[in] | df_ptr | DCL_DF11* pointer that needs to be initialized |
[in] | sps_ptr | DCL_DF11_SPS* pointer with assigned parameters |
#define DF13_SPS_DEFAULTS { 0.25f, 0.25f, 0.25f, 0.25f, 0.0f, 0.0f, 0.0f, 0.0f } |
#define DF13_DEFAULTS |
Defines default values to initialize DCL_DF13.
#define DF13_INT_DEFAULTS |
Macro for internal default values to initialize DCL_DF13 Example: DCL_DF13 df13_ctrl = { .b0 = 0.25f, .b1 = 0.25f, ... .a3 = 0.0f, DF13_INT_DEFAULTS };.
#define DCL_initDF13 | ( | ) | &(DCL_DF13)DF13_DEFAULTS |
Initialize DCL_DF13 struct with default parameters Example: DCL_DF13* df13_ctrl = DCL_initDF13();.
#define DCL_initDF13asParam | ( | _b0, | |
_b1, | |||
_b2, | |||
_b3, | |||
_a1, | |||
_a2, | |||
_a3 | |||
) |
Initialize DCL_DF13 struct with input compensator parameters Example: DCL_DF13* DF13_ctrl = DCL_initDF13asParam(0.25f,0.25f,0.25f,0.25f,0.0f,0.0f,0.0f);.
#define DCL_initDF13asSPS | ( | df_ptr, | |
sps_ptr | |||
) |
Initialize DCL_DF13 struct with sps parameters Example: DCL_DF13_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF13 df_ctrl; DCL_initDF13asSPS(&df_ctrl,&df_sps);.
[in] | df_ptr | DCL_DF13* pointer that needs to be initialized |
[in] | sps_ptr | DCL_DF13_SPS* pointer with assigned parameters |
#define DF22_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f } |
#define DF22_DEFAULTS |
Defines default values to initialize DCL_DF22.
#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 };.
#define DCL_initDF22 | ( | ) | &(DCL_DF22)DF22_DEFAULTS |
Initialize DCL_DF22 struct with default parameters Example: DCL_DF22* df22_ctrl = DCL_initDF22();.
#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);.
#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);.
[in] | df_ptr | DCL_DF22* pointer that needs to be initialized |
[in] | sps_ptr | DCL_DF22_SPS* pointer with assigned parameters |
#define DF23_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f } |
#define DF23_DEFAULTS |
Defines default values to initialize DCL_DF23.
#define DF23_INT_DEFAULTS |
Macro for internal default values to initialize DCL_DF23 Example: DCL_DF23 df23_ctrl = { .b0 = 1.0f, .b1 = 0.0f, ... .a3 = 0.0f, DF23_INT_DEFAULTS };.
#define DCL_initDF23 | ( | ) | &(DCL_DF23)DF23_DEFAULTS |
Initialize DCL_DF23 struct with default parameters Example: DCL_DF23* df23_ctrl = DCL_initDF23();.
#define DCL_initDF23asParam | ( | _b0, | |
_b1, | |||
_b2, | |||
_b3, | |||
_a1, | |||
_a2, | |||
_a3 | |||
) |
Initialize DCL_DF23 struct with input compensator parameters Example: DCL_DF23* DF23_ctrl = DCL_initDF23asParam(1.0f,0.0f,0.0f,0.0f,0.0f,0.0f,0.0f);.
#define DCL_initDF23asSPS | ( | df_ptr, | |
sps_ptr | |||
) |
Initialize DCL_DF23 struct with sps parameters Example: DCL_DF23_SPS df_sps = { .b0 = , .b1 = , ...}; //initial parameter DCL_DF23 df_ctrl; DCL_initDF23asSPS(&df_ctrl,&df_sps);.
[in] | df_ptr | DCL_DF23* pointer that needs to be initialized |
[in] | sps_ptr | DCL_DF23_SPS* pointer with assigned parameters |
#define NULL 0 |
#define CONST_PI 3.14159265358979323846f |
Local definitions of the mathematical constant pi.
#define CONST_2PI 2.0f * CONST_PI |
#define CONST_PI_F64 3.1415926535897932384626433832795028841971693993751058209749445923078164062L |
#define CONST_2PI_F64 2.0L * CONST_PI_F64 |
#define DCL_FPU32_TOL 1.0e-06f |
Define the acceptable FPU numerical tolerances.
#define DCL_FPU64_TOL 1.0e-10L |
#define DCL_DEFAULT_PERIOD_S 100.0e-06f |
Define the default control period in seconds.
#define DCL_DEFAULT_PERIODF64_S 100.0e-06L |
#define DCL_isValue | ( | x, | |
y | |||
) | (((x < (y + DCL_FPU32_TOL)) && (x > (y - DCL_FPU32_TOL))) ? 1U : 0U) |
Determines numerical proximity to specified value.
#define DCL_isValueF64 | ( | x, | |
y | |||
) | (((x < (y + DCL_FPU64_TOL)) && (x > (y - DCL_FPU64_TOL))) ? 1U : 0U) |
#define DCL_isZero | ( | x | ) | DCL_isValue(x,0.0f) |
Determines floating point numerical proximity to zero.
#define DCL_isZeroF64 | ( | x | ) | DCL_isValueF64(x,0.0L) |
Defines the lower limit on derivative filter coefficient c2 in order for fc to lie below the Nyquist frequency.
#define DCL_c2LimitF64 ((2.0L - CONST_PI_F64) / (2.0L + CONST_PI_F64)) |
#define DCL_runSat | ( | data, | |
Umax, | |||
Umin | |||
) | (data > Umax) ? Umax : (data < Umin) ? Umin : data |
Macro to saturate a control variable but does not change the data itself unlike runClamp()
[in] | data | The data value |
[in] | Umax | The upper limit |
[in] | Umin | The lower limit |
#define DCL_CSS_DEFAULTS { 0.0f, DCL_DEFAULT_PERIOD_S, 0U, 0U, 0U, NULL } |
Default values to initialize the CSS structure.
#define DCL_CSSF64_DEFAULTS { 0.0L, DCL_DEFAULT_PERIODF64_S, 0U, 0U, 0U, NULL } |
Default values to initialize the CSS 64bit structure.
#define DCL_setControllerPeriod | ( | p, | |
t_sec | |||
) | ((p)->css->T = t_sec) |
Loads the controller period in the CSS CSS pointer must be configured first.
[in] | p | Pointer to the controller structure |
[in] | t_sec | Controller period in seconds |
#define DCL_setUpdateStatus | ( | p | ) | ((p)->css->sts |= DCL_STS_PARAM_UPDATE) |
Macros to set and clear the update-in-progress flag.
#define DCL_clearUpdateStatus | ( | p | ) | ((p)->css->sts &= ~DCL_STS_PARAM_UPDATE) |
#define DCL_getUpdateStatus | ( | p | ) | (0U != ((p)->css->sts & DCL_STS_PARAM_UPDATE)) |
Determine whether a parameter update-in-progress flag is set.
#define DCL_setControllerStatus | ( | p | ) | ((p)->css->sts |= DCL_STS_CTRL_RUNNING) |
Macros placed at the beginning and end of the controller so that other functions know a control operation is in progress. Typically only used with complex controllers which may not be atomic.
#define DCL_clearControllerStatus | ( | p | ) | ((p)->css->sts &= ~DCL_STS_CTRL_RUNNING) |
#define DCL_getControllerStatus | ( | p | ) | (0U != ((p)->css->sts & DCL_STS_CTRL_RUNNING)) |
Determine whether a controller operation-in-progress flag is set.
#define ZPK3_DEFAULTS |
Defines default values to initialize the DCL_ZPK3 structure.
#define ZPK3F64_DEFAULTS |
Defines default values to initialize the DCL_ZPK3F64 structure.
#define DCL_clearError | ( | ptr | ) | ((ptr)->css->err = dcl_none) |
Macro to clear stored error code in CSS.
[in] | ptr | DCL controller object that contains css |
#define DCL_setError | ( | ptr, | |
code | |||
) | ((ptr)->css->err |= code) |
Macro to set error code in CSS.
[in] | ptr | DCL controller object that contains css |
[in] | code | enum dcl_error_codes |
#define DCL_getErrorLine | ( | ptr | ) | ((ptr)->css->err_line = ((ptr)->css->err) ? __LINE__ : 0) |
Macro to store line location of error in CSS.
[in] | ptr | DCL controller object that contains css |
#define DCL_getErrorFunc | ( | ptr | ) | ((ptr)->css->err_func = ((ptr)->css->err) ? __FUNCTION__ : NULL) |
Macro to store function location of error in CSS.
[in] | ptr | DCL controller object that contains css |
#define DCL_getErrorInfo | ( | ptr | ) |
Macro to store error info in CSS.
[in] | ptr | DCL controller object that contains css |
#define DCL_runErrorHandler | ( | ptr | ) |
Prototype for basic error handler.
[in] | ptr | DCL controller object that contains css |
#define FDLOG_DEFAULTS {0x0,0x0,0x0,0} |
Default initialization of DCL_FDLOG.
#define DCL_getLogSize | ( | buf | ) | ((buf)->size) |
Obtain the total size of buffer.
[in] | buf | Pointer to DCL_FDLOG |
#define DCL_getLogIndex | ( | buf | ) | ((uint32_t)((buf)->dptr - (buf)->fptr)) |
Index of the current pointer (zero-indexed)
[in] | buf | Pointer to DCL_FDLOG |
#define DCL_getLogRemain | ( | buf | ) | ((int32_t)((buf)->lptr - (buf)->dptr)) |
Remaining space left from indexed pointer to end of buffer.
[in] | buf | Pointer to DCL_FDLOG |
#define DCL_clearLog | ( | buf | ) | DCL_fillLog(buf,0.0f) |
Clears the buffer contents by writing 0 to all elements and resets the data index pointer to the start of the buffer.
#define MLOG_CHANS 4 |
Defines the number of MLOG channels.
#define MLOG_DEFAULTS |
Defines default values to initialise the MLOG structure Note: modify to match number of channels.
#define DCL_REFGEN_MIN_INC 1.0e-06f |
Defines the minimum normalized increment.
#define DCL_REFGEN_DEFAULTS |
Defines default values to initialize the DCL_REFGEN structure.
#define TCM_DEFAULTS { FDLOG_DEFAULTS, FDLOG_DEFAULTS, FDLOG_DEFAULTS, 0.1, -0.1, 0, 10 } |
Defines default values to initialize the TCM structure.
typedef float float32_t |
typedef double float64_t |
typedef uint32_t dcl_interrupt_t |
typedef _DCL_VOLATILE struct dcl_pi DCL_PI |
typedef _DCL_VOLATILE struct dcl_pi2 DCL_PI2 |
typedef _DCL_VOLATILE struct dcl_pid DCL_PID |
typedef _DCL_VOLATILE struct dcl_nlpid DCL_NLPID |
typedef _DCL_VOLATILE struct dcl_pidf64 DCL_PIDF64 |
typedef _DCL_VOLATILE struct dcl_df11 DCL_DF11 |
typedef _DCL_VOLATILE struct dcl_df13 DCL_DF13 |
typedef _DCL_VOLATILE struct dcl_df22 DCL_DF22 |
typedef _DCL_VOLATILE struct dcl_df23 DCL_DF23 |
typedef _DCL_VOLATILE struct dcl_fdlog DCL_FDLOG |
typedef _DCL_VOLATILE struct dcl_fdlog FDLOG |
typedef _DCL_VOLATILE struct dcl_mlog DCL_MLOG |
typedef _DCL_VOLATILE struct dcl_mlog MLOG |
typedef _DCL_VOLATILE struct dcl_refgen DCL_REFGEN |
typedef _DCL_VOLATILE struct dcl_tcm DCL_TCM |
typedef _DCL_VOLATILE struct dcl_tcm TCM |
enum DCL_status_bits |
Defines the library enumerated status bits.
To perform a safe parameter update, the user first loads new parameter into the controller's SPS. Then either invoke DCL_update() for an one-time update, or in the case of an ISR routine update, the user could use DCL_setPendingStatus() to indicate an pending update. In which the next call to DCL_pendingUpdate() would update the controller parameter and clear the flag.
Both DCL_update() and DCL_pendingUpdate() disables global interrupts to ensure a safe update.
enum DCL_error_codes |
Defines the library enumerated error codes. These will be applied as bit masks in the error handler.
enum DCL_mlog_states |
Enumerated MLOG operating modes.
enum DCL_refgen_modes |
enum DCL_tcm_states |
Enumerated TCM operating modes.
_DCL_CODE_ACCESS void DCL_resetPI | ( | DCL_PI * | pi | ) |
Resets PI internal storage data with interrupt protection.
[in] | pi | Pointer to the DCL_PI structure |
_DCL_CODE_ACCESS void DCL_forceUpdatePI | ( | DCL_PI * | pi | ) |
Loads PI tuning parameter from its SPS parameter without interrupt protection
[in] | pi | Pointer to the DCL_PI controller structure |
_DCL_CODE_ACCESS void DCL_updatePINoCheck | ( | DCL_PI * | pi | ) |
Loads PI tuning parameter from its SPS parameter with interrupt protection.
[in] | pi | Pointer to the DCL_PI controller structure |
_DCL_CODE_ACCESS bool DCL_updatePI | ( | DCL_PI * | pi | ) |
A conditional update based on the update flag. If the update status is set, the function will update PI parameter from its SPS parameter and clear the status flag on completion.
[in] | pi | Pointer to the DCL_PI controller structure |
_DCL_CODE_ACCESS void DCL_loadSeriesPIasZPK | ( | DCL_PI * | pi, |
DCL_ZPK3 * | zpk | ||
) |
Configures a series PI controller in "zero-pole-gain" form.
[in] | pi | Pointer to the DCL_PI controller structure |
[in] | zpk | Pointer to the ZPK3 structure |
_DCL_CODE_ACCESS void DCL_loadParallelPIasZPK | ( | DCL_PI * | pi, |
DCL_ZPK3 * | zpk | ||
) |
Configures a parallel PI controller in "zero-pole-gain" form.
[in] | pi | Pointer to the active DCL_PI controller structure |
[in] | zpk | Pointer to the ZPK3 structure |
_DCL_CRIT_ACCESS float32_t DCL_runPISeries | ( | DCL_PI * | pi, |
float32_t | rk, | ||
float32_t | yk | ||
) |
Executes an inline series form PI controller.
[in] | pi | Pointer to the DCL_PI structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
_DCL_CRIT_ACCESS float32_t DCL_runPIParallel | ( | DCL_PI * | pi, |
float32_t | rk, | ||
float32_t | yk | ||
) |
Executes a parallel form PI controller Implemented as inline C function.
[in] | pi | Pointer to the DCL_PI structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
_DCL_CRIT_ACCESS float32_t DCL_runPIParallelEnhanced | ( | DCL_PI * | pi, |
float32_t | rk, | ||
float32_t | yk | ||
) |
Executes a parallel form PI controller with enhanced anti-windup logic incorporating an additional integrator saturation clamp.
[in] | pi | Pointer to the DCL_PI structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
_DCL_CRIT_ACCESS float32_t DCL_runPISeriesTustin | ( | DCL_PI * | pi, |
float32_t | rk, | ||
float32_t | yk | ||
) |
Executes a series form PI controller with Tustin integrator.
[in] | pi | Pointer to the DCL_PI structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
_DCL_CODE_ACCESS void DCL_resetPI2 | ( | DCL_PI2 * | pi2 | ) |
Resets PI2 internal storage data with interrupt protection.
[in] | pi2 | Pointer to the DCL_PI2 structure |
_DCL_CODE_ACCESS void DCL_forceUpdatePI2 | ( | DCL_PI2 * | pi2 | ) |
Loads PI2 tuning parameter from its SPS parameter without interrupt protection.
[in] | pi2 | Pointer to the DCL_PI2 controller structure |
_DCL_CODE_ACCESS void DCL_updatePI2NoCheck | ( | DCL_PI2 * | pi2 | ) |
Loads PI2 tuning parameter from its SPS parameter with interrupt protection.
[in] | pi2 | Pointer to the DCL_PI2 controller structure |
_DCL_CODE_ACCESS bool DCL_updatePI2 | ( | DCL_PI2 * | pi2 | ) |
A conditional update based on the update flag. If the update status is set, the function will update PI2 parameter from its SPS parameter and clear the status flag on completion.
[in] | pi2 | Pointer to the DCL_PI2 controller structure |
_DCL_CRIT_ACCESS float32_t DCL_runPI2Series | ( | DCL_PI2 * | pi2, |
float32_t | rk, | ||
float32_t | yk | ||
) |
Executes an inline series form PI2 controller on the FPU32.
[in] | pi2 | Pointer to the DCL_PI2 structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback |
_DCL_CODE_ACCESS void DCL_resetPID | ( | DCL_PID * | pid | ) |
Resets PID internal storage data with interrupt protection.
[in] | pid | Pointer to the DCL_PID structure |
_DCL_CODE_ACCESS void DCL_forceUpdatePID | ( | DCL_PID * | pid | ) |
Loads PID tuning parameter from its SPS parameter without interrupt protection.
[in] | pid | Pointer to the active DCL_PID controller structure |
_DCL_CODE_ACCESS void DCL_updatePIDNoCheck | ( | DCL_PID * | pid | ) |
Loads PID tuning parameter from its SPS parameter with interrupt protection.
[in] | pid | Pointer to the active DCL_PID controller structure |
_DCL_CODE_ACCESS bool DCL_updatePID | ( | DCL_PID * | pid | ) |
A conditional update based on the update flag. If the update status is set, the function will update PID parameter from its SPS parameter and clear the status flag on completion.
[in] | pid | Pointer to the DCL_PID controller structure |
_DCL_CODE_ACCESS void DCL_setPIDfilterBW | ( | DCL_PID * | pid, |
float32_t | fc | ||
) |
Loads the derivative path filter shadow coefficients.
[in] | pid | Pointer to the DCL_PID structure |
[in] | fc | The desired filter bandwidth in Hz |
_DCL_CODE_ACCESS void DCL_setActivePIDfilterBW | ( | DCL_PID * | pid, |
float32_t | fc, | ||
float32_t | T | ||
) |
Loads the PID derivative path filter active coefficients.
[in] | pid | Pointer to the DCL_PID structure |
[in] | fc | The desired filter bandwidth in Hz |
[in] | T | The controller update rate in seconds |
_DCL_CODE_ACCESS float32_t DCL_getPIDfilterBW | ( | DCL_PID * | pid | ) |
Calculates the active derivative path filter bandwidth in Hz.
[in] | pid | Pointer to the DCL_PID structure |
_DCL_CODE_ACCESS void DCL_loadSeriesPIDasZPK | ( | DCL_PID * | pid, |
DCL_ZPK3 * | zpk | ||
) |
Configures a series PID controller parameter in ZPK form.
[in] | pid | Pointer to the active DCL_PID controller structure |
[in] | zpk | Pointer to the DCL_ZPK3 structure |
_DCL_CODE_ACCESS void DCL_loadParallelPIDasZPK | ( | DCL_PID * | pid, |
DCL_ZPK3 * | zpk | ||
) |
Configures a parallel PID controller in ZPK form.
[in] | pid | Pointer to the active DCL_PID controller structure |
[in] | zpk | Pointer to the DCL_ZPK3 structure |
_DCL_CRIT_ACCESS float32_t DCL_runPIDSeries | ( | DCL_PID * | pid, |
float32_t | rk, | ||
float32_t | yk, | ||
float32_t | lk | ||
) |
Executes an ideal form PID controller.
[in] | pid | Pointer to the DCL_PID structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
[in] | lk | External output clamp flag |
_DCL_CRIT_ACCESS float32_t DCL_runPIDParallel | ( | DCL_PID * | pid, |
float32_t | rk, | ||
float32_t | yk, | ||
float32_t | lk | ||
) |
Executes a parallel form PID controller.
[in] | pid | Pointer to the DCL_PID structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
[in] | lk | External output clamp flag |
_DCL_CODE_ACCESS void DCL_resetNLPID | ( | DCL_NLPID * | pid | ) |
Resets NLPID internal storage data with interrupt protection.
[in] | pid | Pointer to the DCL_NLPID structure |
_DCL_CODE_ACCESS void DCL_forceUpdateNLPID | ( | DCL_NLPID * | pid | ) |
Loads NLPID tuning parameter from its SPS parameter without interrupt protection.
[in] | pid | Pointer to the active DCL_NLPID controller structure |
_DCL_CODE_ACCESS void DCL_updateNLPIDNoCheck | ( | DCL_NLPID * | pid | ) |
Loads PID tuning parameter from its SPS parameter with interrupt protection.
[in] | pid | Pointer to the DCL_NLPID structure |
_DCL_CODE_ACCESS bool DCL_updateNLPID | ( | DCL_NLPID * | pid | ) |
A conditional update based on the update flag. If the update status is set, the function will update NLPID parameter from its SPS parameter and clear the status flag on completion.
[in] | pid | Pointer to the DCL_NLPID structure |
_DCL_CODE_ACCESS void DCL_setNLPIDfilterBW | ( | DCL_NLPID * | pid, |
float32_t | fc | ||
) |
Loads the shadow derivative LP filter coefficients.
[in] | pid | Pointer to the DCL_NLPID structure |
[in] | fc | The desired filter bandwidth in Hz |
_DCL_CODE_ACCESS void DCL_setActiveNLPIDfilterBW | ( | DCL_NLPID * | pid, |
float32_t | fc, | ||
float32_t | T | ||
) |
Loads the NLPID derivative path filter active coefficients.
[in] | pid | Pointer to the DCL_NLPID structure |
[in] | fc | The desired filter bandwidth in Hz |
[in] | T | The controller update rate in seconds |
_DCL_CODE_ACCESS float32_t DCL_getNLPIDfilterBW | ( | DCL_NLPID * | pid | ) |
Returns the derivative LP filter bandwidth in Hz.
[in] | pid | Pointer to the DCL_NLPID structure |
_DCL_CODE_ACCESS float32_t DCL_getNLPIDgamma | ( | float32_t | alpha, |
float32_t | delta | ||
) |
Returns the linearized region gain for specified (alpha,delta)
[in] | alpha | The non-linear gain |
[in] | delta | The linear region semi-width |
_DCL_CODE_ACCESS float32_t DCL_getNLPIDdelta | ( | float32_t | alpha, |
float32_t | gamma | ||
) |
Returns the semi-width of the linear gain region for specified (alpha,gamma)
[in] | alpha | The non-linear gain |
[in] | gamma | The linear region gain |
_DCL_CODE_ACCESS void DCL_setNLPIDgamma | ( | DCL_NLPID * | pid | ) |
Computes the linearized gains for each path Note: active coefficients not update DCL_updateNLPID() called.
[in] | pid | Pointer to the DCL_NLPID structure |
_DCL_CODE_ACCESS void DCL_setActiveNLPIDgamma | ( | DCL_NLPID * | pid | ) |
Computes the linearized gains for each path and loads the parameters in the active NLPID structure.
[in] | pid | Pointer to the DCL_NLPID structure |
_DCL_CRIT_ACCESS float32_t DCL_runNLPIDParallel | ( | DCL_NLPID * | pid, |
float32_t | rk, | ||
float32_t | yk, | ||
float32_t | lk | ||
) |
Executes a parallel form non-linear PID controller.
[in] | pid | Pointer to the DCL_NLPID structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
[in] | lk | External output clamp flag |
_DCL_CRIT_ACCESS float32_t DCL_runNLPIDSeries | ( | DCL_NLPID * | pid, |
float32_t | rk, | ||
float32_t | yk, | ||
float32_t | lk | ||
) |
Executes a series form non-linear PID controller.
[in] | pid | Pointer to the DCL_NLPID structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
[in] | lk | External output clamp flag |
_DCL_CRIT_ACCESS float32_t DCL_runNLF | ( | float32_t | x, |
float32_t | alpha, | ||
float32_t | delta | ||
) |
Executes a basic non-linear control function.
[in] | x | The input variable |
[in] | alpha | The non-linear exponent |
[in] | delta | The linear region semi-width |
_DCL_CODE_ACCESS void DCL_resetPIDF64 | ( | DCL_PIDF64 * | pid | ) |
Resets PID64 internal storage data with interrupt protection.
[in] | pid | Pointer to the DCL_PID64 structure |
_DCL_CODE_ACCESS void DCL_forceUpdatePIDF64 | ( | DCL_PIDF64 * | pid | ) |
Loads PIDF64 tuning parameter from its SPS parameter without interrupt protection.
[in] | pid | Pointer to the active DCL_PID64 controller structure |
_DCL_CODE_ACCESS void DCL_updatePIDF64NoCheck | ( | DCL_PIDF64 * | pid | ) |
Updates PID parameter from its SPS parameter with interrupt protection.
[in] | pid | Pointer to the DCL_PID64 controller structure |
_DCL_CODE_ACCESS bool DCL_updatePIDF64 | ( | DCL_PIDF64 * | pid | ) |
A conditional update based on the update flag. If the update status is set, the function will update PIDF64 parameter from its SPS parameter and clear the status flag on completion.
[in] | pid | Pointer to the DCL_PIDF64 controller structure |
_DCL_CODE_ACCESS void DCL_setPIDF64filterBW | ( | DCL_PIDF64 * | pid, |
float64_t | fc | ||
) |
Loads the derivative path filter shadow coefficients.
[in] | pid | Pointer to the DCL_PID64 structure |
[in] | fc | The desired filter bandwidth in Hz |
_DCL_CODE_ACCESS void DCL_setActivePIDF64filterBW | ( | DCL_PIDF64 * | pid, |
float64_t | fc, | ||
float64_t | T | ||
) |
Loads the PID64 derivative path filter active coefficients.
[in] | pid | Pointer to the DCL_PID64 structure |
[in] | fc | The desired filter bandwidth in Hz |
[in] | T | The controller period in seconds |
_DCL_CODE_ACCESS float64_t DCL_getPIDF64filterBW | ( | DCL_PIDF64 * | pid | ) |
Returns the active derivative path filter bandwidth in Hz.
[in] | pid | Pointer to the DCL_PID64 structure |
_DCL_CODE_ACCESS void DCL_loadSeriesPIDF64asZPK | ( | DCL_PIDF64 * | pid, |
DCL_ZPK3F64 * | zpk | ||
) |
Configures a series PID controller parameter in ZPK form.
[in] | pid | Pointer to the active DCL_PIDF64 controller structure |
[in] | zpk | Pointer to the DCL_ZPK3F64 structure |
_DCL_CODE_ACCESS void DCL_loadParallelPIDF64asZPK | ( | DCL_PIDF64 * | pid, |
DCL_ZPK3 * | zpk | ||
) |
Configures a parallel PID controller in ZPK form.
[in] | pid | Pointer to the active DCL_PIDF64 controller structure |
[in] | zpk | Pointer to the DCL_ZPK3 structure |
_DCL_CRIT_ACCESS float64_t DCL_runPIDF64Series | ( | DCL_PIDF64 * | pid, |
float64_t | rk, | ||
float64_t | yk, | ||
float64_t | lk | ||
) |
Executes an ideal form PID64 controller.
[in] | pid | Pointer to the DCL_PID64 structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
[in] | lk | External output clamp flag |
_DCL_CRIT_ACCESS float64_t DCL_runPIDF64Parallel | ( | DCL_PIDF64 * | pid, |
float64_t | rk, | ||
float64_t | yk, | ||
float64_t | lk | ||
) |
Executes an parallel form PID64 controller.
[in] | pid | Pointer to the DCL_PID64 structure |
[in] | rk | The controller set-point reference |
[in] | yk | The measured feedback value |
[in] | lk | External output clamp flag |
_DCL_CODE_ACCESS void DCL_resetDF11 | ( | DCL_DF11 * | df | ) |
Resets DF11 internal storage data with interrupt protection.
[in] | df | Pointer to the DCL_DF11 structure |
_DCL_CODE_ACCESS void DCL_forceUpdateDF11 | ( | DCL_DF11 * | df | ) |
Loads DF11 tuning parameter from its SPS parameter without interrupt protection.
[in] | df | Pointer to the active DCL_DF11 controller structure |
_DCL_CODE_ACCESS void DCL_updateDF11NoCheck | ( | DCL_DF11 * | df | ) |
Loads DF11 tuning parameter from its SPS parameter with interrupt protection.
[in] | df | Pointer to the DCL_DF11 controller structure |
_DCL_CODE_ACCESS bool DCL_updateDF11 | ( | DCL_DF11 * | df | ) |
A conditional update based on the update flag. If the update status is set, the function will update DF11 parameter from its SPS parameter and clear the status flag on completion.
[in] | df | Pointer to the DCL_DF11 controller structure |
_DCL_CODE_ACCESS bool DCL_isStableDF11 | ( | DCL_DF11 * | df | ) |
Determines stability of the shadow DF11 compensator.
[in] | df | Pointer to the DCL_DF11 controller structure |
_DCL_CODE_ACCESS void DCL_loadDF11asZPK | ( | DCL_DF11 * | df, |
DCL_ZPK3 * | zpk | ||
) |
Loads the DF11 shadow coefficients from a ZPK3 description.
[in] | df | Pointer to the DCL_DF11 controller structure |
[in] | zpk | Pointer to the ZPK3 structure |
_DCL_CODE_ACCESS void DCL_loadDF11asPI | ( | DCL_DF11 * | df, |
float32_t | Kp, | ||
float32_t | Ki | ||
) |
Loads compensator coefficients to emulate series form PI.
[in] | df | Pointer to the DCL_DF11 controller structure |
[in] | Kp | Proportional gain |
[in] | Ki | Integral gain |
_DCL_CRIT_ACCESS float32_t DCL_runDF11 | ( | DCL_DF11 * | df, |
float32_t | ek | ||
) |
Executes a 1st order Direct Form 1 controller.
[in] | df | Pointer to the DCL_DF11 controller structure |
[in] | ek | The servo error |
_DCL_CODE_ACCESS void DCL_resetDF13 | ( | DCL_DF13 * | df | ) |
Resets DF13 internal storage data with interrupt protection Implemented as inline C function.
[in] | df | Pointer to the DCL_DF13 controller structure |
_DCL_CODE_ACCESS void DCL_forceUpdateDF13 | ( | DCL_DF13 * | df | ) |
Loads DF13 tuning parameter from its SPS parameter without interrupt protection.
[in] | df | Pointer to the active DCL_DF13 controller structure |
_DCL_CODE_ACCESS void DCL_updateDF13NoCheck | ( | DCL_DF13 * | df | ) |
Loads DF13 tuning parameter from its SPS parameter with interrupt protection.
[in] | df | Pointer to the DCL_DF13 controller structure |
_DCL_CODE_ACCESS bool DCL_updateDF13 | ( | DCL_DF13 * | df | ) |
A conditional update based on the update flag. If the update status is set, the function will update DF13 parameter from its SPS parameter and clear the status flag on completion..
[in] | df | Pointer to the DCL_DF13 controller structure |
_DCL_CODE_ACCESS bool DCL_isStableDF13 | ( | DCL_DF13 * | df | ) |
Determines stability of the shadow compensator.
[in] | df | Pointer to the DCL_DF13 controller structure |
_DCL_CODE_ACCESS void DCL_loadDF13asZPK | ( | DCL_DF13 * | df, |
DCL_ZPK3 * | zpk | ||
) |
Loads the DF13 shadow coefficients from a ZPK3 description.
[in] | df | Pointer to the DCL_DF13 controller structure |
[in] | zpk | Pointer to the DCL_ZPK3 structure |
_DCL_CRIT_ACCESS float32_t DCL_runDF13 | ( | DCL_DF13 * | df, |
float32_t | ek | ||
) |
Executes a 3rd order Direct Form 1 controller.
[in] | df | Pointer to the DCL_DF13 controller structure |
[in] | ek | The servo error |
_DCL_CRIT_ACCESS float32_t DCL_runDF13PartialCompute | ( | DCL_DF13 * | df, |
float32_t | ek | ||
) |
Immediate computation to obtain DF13 servo error without updating the controller.
[in] | df | Pointer to the DCL_DF13 controller structure |
[in] | ek | The servo error |
_DCL_CRIT_ACCESS void DCL_runDF13PartialUpdate | ( | DCL_DF13 * | df, |
float32_t | ek, | ||
float32_t | uk | ||
) |
Update DF13 controller based on pre-computed control effort.
[in] | df | Pointer to the DCL_DF13 controller structure |
[in] | ek | The servo error |
[in] | uk | The controller output in the previous sample interval |
_DCL_CRIT_ACCESS float32_t DCL_runDF13Clamp | ( | DCL_DF13 * | df, |
float32_t | ek, | ||
float32_t | Umax, | ||
float32_t | Umin | ||
) |
Executes a 3rd order Direct Form 1 controller with clamp.
[in] | df | Pointer to the DCL_DF13 controller structure |
[in] | ek | The servo error |
[in] | Umax | Upper saturation limit |
[in] | Umin | Lower saturation limit |
_DCL_CRIT_ACCESS float32_t DCL_runDF13_C5 | ( | DCL_DF13 * | p, |
float32_t | ek, | ||
float32_t | vk | ||
) |
Legacy C28 Function for maintaining backwards compatibility. It Executes an immediate 3rd order Direct Form 1 controller.
[in] | p | Pointer to the DCL_DF13 controller structure |
[in] | ek | The servo error |
[in] | vk | The partial pre-computed control effort |
_DCL_CRIT_ACCESS float32_t DCL_runDF13_C6 | ( | DCL_DF13 * | p, |
float32_t | ek, | ||
float32_t | uk | ||
) |
Legacy C28 Function for maintaining backwards compatibility. It executes a partial pre-computed 3rd order Direct Form 1 controller.
[in] | p | Pointer to the DCL_DF13 controller structure |
[in] | ek | The servo error |
[in] | uk | The controller output in the previous sample interval |
_DCL_CODE_ACCESS void DCL_resetDF22 | ( | DCL_DF22 * | df | ) |
Resets DF22 internal storage data with interrupt protection.
[in] | df | Pointer to the DCL_DF22 controller structure |
_DCL_CODE_ACCESS void DCL_forceUpdateDF22 | ( | DCL_DF22 * | df | ) |
Loads DF22 tuning parameter from its SPS parameter without interrupt protection.
[in] | df | Pointer to the active DCL_DF22 controller structure |
_DCL_CODE_ACCESS void DCL_updateDF22NoCheck | ( | DCL_DF22 * | df | ) |
Loads DF22 tuning parameter from its SPS parameter with interrupt protection.
[in] | df | Pointer to the DCL_DF22 controller structure |
_DCL_CODE_ACCESS bool DCL_updateDF22 | ( | DCL_DF22 * | df | ) |
A conditional update based on the update flag. If the update status is set, the function will update DF22 parameter from its SPS parameter and clear the status flag on completion.
[in] | df | Pointer to the DCL_DF22 controller structure |
_DCL_CODE_ACCESS bool DCL_isStableDF22 | ( | DCL_DF22 * | df | ) |
Determines stability of the shadow compensator.
[in] | df | Pointer to the DCL_DF22 controller structure |
_DCL_CODE_ACCESS void DCL_loadDF22asZPK | ( | DCL_DF22 * | df, |
DCL_ZPK3 * | zpk | ||
) |
Loads the DF22 shadow coefficients from a ZPK3 description.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | zpk | Pointer to the DCL_ZPK3 structure |
_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.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | z | The damping ratio |
[in] | wn | The un-damped natural frequency in rad/s |
_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.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | Kp | Proportional gain |
[in] | Ki | Integral gain |
[in] | Kd | Derivative gain |
[in] | fc | Derivative path filter bandwidth in Hz |
_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.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | Kp | Proportional gain |
[in] | Ki | Integral gain |
[in] | Kd | Derivative gain |
[in] | fc | Derivative path filter bandwidth in Hz |
_DCL_CRIT_ACCESS float32_t DCL_runDF22 | ( | DCL_DF22 * | df, |
float32_t | ek | ||
) |
Executes a 2nd order Direct Form 2 controller.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | ek | The servo error |
_DCL_CRIT_ACCESS float32_t DCL_runDF22PartialCompute | ( | DCL_DF22 * | df, |
float32_t | ek | ||
) |
Immediate computation to obtain DF22 servo error without updating the controller.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | ek | The servo error |
_DCL_CRIT_ACCESS void DCL_runDF22PartialUpdate | ( | DCL_DF22 * | df, |
float32_t | ek, | ||
float32_t | uk | ||
) |
Update DF22 controller based on pre-computed control effort.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | ek | The servo error |
[in] | uk | The controller output in the previous sample interval |
_DCL_CRIT_ACCESS 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.
[in] | df | Pointer to the DCL_DF22 controller structure |
[in] | ek | The servo error |
[in] | Umax | Upper saturation limit |
[in] | Umin | Lower saturation limit |
_DCL_CODE_ACCESS void DCL_resetDF23 | ( | DCL_DF23 * | df | ) |
Resets DF23 internal storage data with interrupt protection.
[in] | df | Pointer to the DCL_DF23 controller structure |
_DCL_CODE_ACCESS void DCL_forceUpdateDF23 | ( | DCL_DF23 * | df | ) |
Loads DF23 tuning parameter from its SPS parameter without interrupt protection.
[in] | df | Pointer to the active DCL_DF23 controller structure |
_DCL_CODE_ACCESS void DCL_updateDF23NoCheck | ( | DCL_DF23 * | df | ) |
Updates DF23 parameter from its SPS parameter with interrupt protection.
[in] | df | Pointer to the DCL_DF23 controller structure |
_DCL_CODE_ACCESS bool DCL_updateDF23 | ( | DCL_DF23 * | df | ) |
A conditional update based on the update flag. If the update status is set, the function will update DF23 parameter from its SPS parameter and clear the status flag on completion.
[in] | df | Pointer to the DCL_DF23 controller structure |
_DCL_CODE_ACCESS bool DCL_isStableDF23 | ( | DCL_DF23 * | df | ) |
Determines stability of the shadow compensator.
[in] | df | Pointer to the DCL_DF23 controller structure |
_DCL_CODE_ACCESS void DCL_loadDF23asZPK | ( | DCL_DF23 * | df, |
DCL_ZPK3 * | zpk | ||
) |
Loads the DF23 shadow coefficients from a ZPK3 description.
[in] | df | Pointer to the DCL_DF23 controller structure |
[in] | zpk | Pointer to the DCL_ZPK3 structure |
_DCL_CRIT_ACCESS float32_t DCL_runDF23 | ( | DCL_DF23 * | df, |
float32_t | ek | ||
) |
Executes a 3rd order Direct Form 2 controller.
[in] | df | Pointer to the DCL_DF23 controller structure |
[in] | ek | The servo error |
_DCL_CRIT_ACCESS float32_t DCL_runDF23PartialCompute | ( | DCL_DF23 * | df, |
float32_t | ek | ||
) |
Immediate computation to obtain DF23 servo error without updating the controller.
[in] | df | Pointer to the DCL_DF23 controller structure |
[in] | ek | The servo error |
_DCL_CRIT_ACCESS void DCL_runDF23PartialUpdate | ( | DCL_DF23 * | df, |
float32_t | ek, | ||
float32_t | uk | ||
) |
Update DF22 controller based on pre-computed control effort.
[in] | df | Pointer to the DCL_DF23 controller structure |
[in] | ek | The servo error |
[in] | uk | The controller output in the previous sample interval |
_DCL_CRIT_ACCESS float32_t DCL_runDF23Clamp | ( | DCL_DF23 * | df, |
float32_t | ek, | ||
float32_t | Umax, | ||
float32_t | Umin | ||
) |
Executes a 3rd order Direct Form 2 controller with clamp.
[in] | df | Pointer to the DCL_DF23 controller structure |
[in] | ek | The servo error |
[in] | Umax | Upper saturation limit |
[in] | Umin | Lower saturation limit |
_DCL_CODE_ACCESS bool DCL_runClamp | ( | float32_t * | data, |
float32_t | Umax, | ||
float32_t | Umin | ||
) |
Saturates a control variable and returns true if either limit is exceeded.
[in] | data | The address of the data variable |
[in] | Umax | The upper limit |
[in] | Umin | The lower limit |
_DCL_CODE_ACCESS bool DCL_runClampF64 | ( | float64_t * | data, |
float64_t | Umax, | ||
float64_t | Umin | ||
) |
Saturates a control variable and returns true if either limit is exceeded.
[in] | data | The address of the data variable |
[in] | Umax | The upper limit |
[in] | Umin | The lower limit |
_DCL_CODE_ACCESS bool DCL_isStablePn1 | ( | float32_t | a1 | ) |
Determines stability of a first order real polynomial P(z) = z + a1.
[in] | a1 | Coefficient a1 |
_DCL_CODE_ACCESS bool DCL_isStablePn2 | ( | float32_t | a0, |
float32_t | a1, | ||
float32_t | a2 | ||
) |
Determines stability of a second order polynomial with real coefficients P(z) = a0 z^2 + a1 z + a2.
[in] | a0 | Second order coefficient a1 |
[in] | a1 | First order coefficient a1 |
[in] | a2 | Coefficient a2 |
_DCL_CODE_ACCESS bool DCL_isStablePn3 | ( | float32_t | a0, |
float32_t | a1, | ||
float32_t | a2, | ||
float32_t | a3 | ||
) |
Determines stability of a third order polynomial with real coefficients P(z) = a0 z^3 + a1 z^2 + a2 z + a3.
[in] | a0 | Third order coefficient a1 |
[in] | a1 | Second order coefficient a1 |
[in] | a2 | First order coefficient a2 |
[in] | a3 | Coefficient a3 |
_DCL_CODE_ACCESS bool DCL_isStableZpk3 | ( | DCL_ZPK3 * | q | ) |
Determines stability of a ZPK3 representation by checking pole magnitude.
_DCL_CODE_ACCESS bool DCL_isStableZpk3F64 | ( | DCL_ZPK3 * | q | ) |
Determines stability of a ZPK3F64 representation by checking pole magnitude.
_DCL_CODE_ACCESS void DCL_setLogIndex | ( | DCL_FDLOG * | buf, |
uint32_t | idx | ||
) |
Sets index of the current pointer (zero-indexed)
[in] | buf | Pointer to DCL_FDLOG |
[in] | idx | Index number |
_DCL_CODE_ACCESS void DCL_deleteLog | ( | DCL_FDLOG * | buf | ) |
Resets all structure pointers to null value.
[in] | buf | The DCL_FDLOG structure |
_DCL_CODE_ACCESS void DCL_resetLog | ( | DCL_FDLOG * | buf | ) |
Resets the data index pointer to start of buffer.
[in] | buf | The DCL_FDLOG structure |
_DCL_CODE_ACCESS void DCL_fillLog | ( | DCL_FDLOG * | buf, |
float32_t | data | ||
) |
Fills the buffer with a given data value and resets the data index pointer to the start of the buffer.
[in] | buf | The DCL_FDLOG structure |
[in] | data | The fill data value |
_DCL_CODE_ACCESS void DCL_initLog | ( | DCL_FDLOG * | buf, |
float32_t * | addr, | ||
uint32_t | size | ||
) |
Assigns the buffer pointers to a memory block or array and sets the data index pointer to the first address.
[in] | buf | The DCL_FDLOG structure |
[in] | addr | The start address of the memory block |
[in] | size | The length of the memory block in 32-bit words |
_DCL_CODE_ACCESS float32_t DCL_writeLog | ( | DCL_FDLOG * | buf, |
float32_t | data | ||
) |
Writes a data point into the buffer and advances the indexing pointer, wrapping if necessary. Returns the over-written data value for delay line or FIFO implementation.
[in] | buf | The DCL_FDLOG structure |
[in] | data | The input data value |
_DCL_CODE_ACCESS float32_t DCL_readLog | ( | DCL_FDLOG * | buf | ) |
Reads a data point from the buffer and then advances the indexing pointer, wrapping if necessary.
[in] | buf | The DCL_FDLOG structure |
_DCL_CODE_ACCESS void DCL_copyLog | ( | DCL_FDLOG * | src, |
DCL_FDLOG * | dst | ||
) |
Copies the contents of one log (src) into another (dst).
Both logs must have the same size.
[in] | src | The destination DCL_FDLOG structure |
[in] | dst | The source DCL_FDLOG structure |
_DCL_CODE_ACCESS void DCL_initMLOG | ( | DCL_MLOG * | q, |
float32_t * | addr, | ||
uint32_t | size, | ||
float32_t | tmax, | ||
float32_t | tmin, | ||
uint32_t | div | ||
) |
Initializes the MLOG module.
[in] | q | The MLOG structure |
[in] | addr | The start address of the memory block (must be a continous memory block size of MLOG_CHANS * size * 32bit) |
[in] | size | The size of each memory block in 32-bit words |
[in] | tmin | The upper trigger threshold |
[in] | tmax | The lower trigger threshold |
[in] | div | The divider count, for example, 2 means capture frames everything second occurance of running DCL_runMLOG. |
_DCL_CODE_ACCESS void DCL_resetMLOG | ( | DCL_MLOG * | q | ) |
Resets the MLOG module: clears all frame buffers and sets idle mode.
[in] | q | The MLOG structure |
_DCL_CODE_ACCESS uint16_t DCL_armMLOG | ( | DCL_MLOG * | q | ) |
Changes the MLOG mode to "MLOG_ARMED". Only valid if current operating mode is "MLOG_IDLE".
[in] | q | The MLOG structure |
_DCL_CODE_ACCESS uint16_t DCL_runMLOG | ( | DCL_MLOG * | q | ) |
Runs the MLOG module.
[in] | q | The MLOG structure |
_DCL_CODE_ACCESS void DCL_resetRefgen | ( | DCL_REFGEN * | p | ) |
Resets DCL_REFGEN dynamic data.
[in] | p | Pointer to the DCL_REFGEN structure |
_DCL_CODE_ACCESS void DCL_setRefgenRamp | ( | DCL_REFGEN * | p, |
float32_t | tgt, | ||
float32_t | tr | ||
) |
Loads the REFGEN ramp parameters.
[in] | p | Pointer to the DCL_REFGEN structure |
[in] | tgt | The new static reference target |
[in] | tr | The time interval to reach the new target |
_DCL_CODE_ACCESS void DCL_setRefgenAmpl | ( | DCL_REFGEN * | p, |
float32_t | ampl, | ||
float32_t | tr | ||
) |
Loads the REFGEN dynamic amplitude.
[in] | p | Pointer to the DCL_REFGEN structure |
[in] | ampl | The new target amplitude |
[in] | tr | The time interval to reach the new target |
_DCL_CODE_ACCESS void DCL_setRefgenFreq | ( | DCL_REFGEN * | p, |
float32_t | freq, | ||
float32_t | tr | ||
) |
Loads the REFGEN frequency.
[in] | p | Pointer to the DCL_REFGEN structure |
[in] | freq | The new frequency in Hz |
[in] | tr | The time interval to reach the new target |
_DCL_CODE_ACCESS void DCL_setRefgenDuty | ( | DCL_REFGEN * | p, |
float32_t | duty | ||
) |
Loads the REFGEN pulse duty cycle.
[in] | p | Pointer to the DCL_REFGEN structure |
[in] | duty | The new per-unit duty cycle |
_DCL_CODE_ACCESS void DCL_setRefgenClamp | ( | DCL_REFGEN * | p, |
float32_t | max, | ||
float32_t | min | ||
) |
Loads the REFGEN output clam limits.
[in] | p | Pointer to the DCL_REFGEN structure |
[in] | max | The upper limit |
[in] | min | The lower limit |
_DCL_CODE_ACCESS void DCL_setRefgenMode | ( | DCL_REFGEN * | p, |
int16_t | mode | ||
) |
Sets the REFGEN operating mode.
[in] | p | Pointer to the DCL_REFGEN structure |
[in] | mode | The new operating mode |
_DCL_CODE_ACCESS void DCL_runRefgen | ( | DCL_REFGEN * | p | ) |
Runs the REFGEN module.
[in] | p | Pointer to the DCL_REFGEN structure |
_DCL_CODE_ACCESS float32_t DCL_getRefgenPhaseA | ( | DCL_REFGEN * | p | ) |
Returns the phase reference output.
[in] | p | Pointer to the active DCL_REFGEN structure |
_DCL_CODE_ACCESS float32_t DCL_getRefgenPhaseB | ( | DCL_REFGEN * | p | ) |
Returns the phase reference output.
[in] | p | Pointer to the active DCL_REFGEN structure |
_DCL_CODE_ACCESS float32_t DCL_getRefgenPhaseC | ( | DCL_REFGEN * | p | ) |
Returns the phase reference output.
[in] | p | Pointer to the active DCL_REFGEN structure |
_DCL_CODE_ACCESS void DCL_initTCM | ( | DCL_TCM * | q, |
float32_t * | addr, | ||
uint32_t | size, | ||
uint32_t | lead, | ||
float32_t | tmin, | ||
float32_t | tmax | ||
) |
Resets the TCM module: clears buffers and sets idle mode.
[in] | q | The TCM structure |
[in] | addr | The start address of the memory block |
[in] | size | The size of the memory block in 32-bit words |
[in] | lead | The length of the lead frame in samples |
[in] | tmin | The upper trigger threshold |
[in] | tmax | The lower trigger threshold |
_DCL_CODE_ACCESS void DCL_resetTCM | ( | DCL_TCM * | q | ) |
Resets the TCM module: clears all frame buffers and sets idle mode.
[in] | q | The TCM structure |
_DCL_CODE_ACCESS uint16_t DCL_armTCM | ( | DCL_TCM * | q | ) |
Changes the TCM mode to "TCM_ARMED".
[in] | q | The TCM structure |
_DCL_CODE_ACCESS uint16_t DCL_runTCM | ( | DCL_TCM * | q, |
float32_t | data | ||
) |
Runs the TCM module.
[in] | q | The TCM structure |
[in] | data | The input data |
_DCL_CODE_ACCESS float32_t DCL_runITAE | ( | DCL_FDLOG * | elog, |
float32_t | prd | ||
) |
Computes ITAE performance index from a log of servo error.
[in] | elog | The servo error log |
[in] | prd | The sampling period in seconds |
_DCL_CODE_ACCESS float32_t DCL_runIAE | ( | DCL_FDLOG * | elog | ) |
Computes IAE performance index from a log of servo error.
[in] | elog | The servo error log |
_DCL_CODE_ACCESS float32_t DCL_runIES | ( | DCL_FDLOG * | elog | ) |
Computes IES performance index from a log of servo error.
[in] | elog | The servo error log |