DCL Gain Scheduler Module (GSM) Functions

Module: Digital Control Library (DCL)

More…

Structures

Name

struct

DCL_GSM_SPS
Defines DCL_GSM shadow parameter set used for updating parameters.

Types

Name

typedef _DCL_VOLATILE struct

DCL_GSM
Defines the TCM structure.

Functions

Name

_DCL_CODE_ACCESS void

DCL_resetGSM(DCL_GSM * gsm)
Resets the active GSM parameters to unity gain.

_DCL_CODE_ACCESS void

DCL_forceUpdateGSM(DCL_GSM * gsm)
Loads the active GSM parameters from its SPS parameter without interrupt protection.

_DCL_CODE_ACCESS void

DCL_updateGSMNoCheck(DCL_GSM * gsm)
Loads the active GSM parameters from its SPS parameter with interrupt protection.

_DCL_CODE_ACCESS bool

DCL_updateGSM(DCL_GSM * gsm)
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.

_DCL_CODE_ACCESS void

DCL_loadGSMgains(DCL_GSM * gsm)
Computes the shadow scheduler gains from the offset selection Active gains are unaffected until DCL_updateGSM() is called.

_DCL_CODE_ACCESS void

DCL_loadGSMoffsets(DCL_GSM * gsm)
Computes the shadow scheduler offsets from the gain selection Active offsets are unaffected until DCL_updateGSM() is called.

_DCL_CRIT_ACCESSfloat32_t

DCL_runGSM(DCL_GSM * gsm, float32_t x)
Runs the Gain Scheduler Module.

Defines

Name

GSM_N
Number of piecewise linear sections.

GSM_SPS_DEFAULTS
Defines default values to initialize the DCL_GSM shadow structure (GSM_N=8)

GSM_DEFAULTS
Defines default values for the GSM structure (GSM_N=8)

Detailed Description

Defines the interface to the Gain Scheduler Module (GSM)

Types Documentation

typedef DCL_GSM

typedef _DCL_VOLATILE struct  DCL_GSM;

Defines the TCM structure.

Functions Documentation

function DCL_resetGSM

_DCL_CODE_ACCESS void DCL_resetGSM(
    DCL_GSM * gsm
)

Resets the active GSM parameters to unity gain.

Parameters:

  • gsm Pointer to the active DCL_GSM controller structure

function DCL_forceUpdateGSM

_DCL_CODE_ACCESS void DCL_forceUpdateGSM(
    DCL_GSM * gsm
)

Loads the active GSM parameters from its SPS parameter without interrupt protection.

Parameters:

  • gsm Pointer to the active DCL_GSM controller structure

function DCL_updateGSMNoCheck

_DCL_CODE_ACCESS void DCL_updateGSMNoCheck(
    DCL_GSM * gsm
)

Loads the active GSM parameters from its SPS parameter with interrupt protection.

Parameters:

  • gsm Pointer to the active DCL_GSM controller structure

function DCL_updateGSM

_DCL_CODE_ACCESS bool DCL_updateGSM(
    DCL_GSM * gsm
)

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.

Parameters:

  • gsm Pointer to the active DCL_GSM controller structure

Return: ‘true’ if an update is applied, otherwise ‘false’

Note: Note: Use DCL_setUpdateStatus(gsm) to set the update status.

function DCL_loadGSMgains

_DCL_CODE_ACCESS void DCL_loadGSMgains(
    DCL_GSM * gsm
)

Computes the shadow scheduler gains from the offset selection Active gains are unaffected until DCL_updateGSM() is called.

Parameters:

function DCL_loadGSMoffsets

_DCL_CODE_ACCESS void DCL_loadGSMoffsets(
    DCL_GSM * gsm
)

Computes the shadow scheduler offsets from the gain selection Active offsets are unaffected until DCL_updateGSM() is called.

Parameters:

function DCL_runGSM

_DCL_CRIT_ACCESSfloat32_t DCL_runGSM(
    DCL_GSM * gsm,
    float32_t x
)

Runs the Gain Scheduler Module.

Parameters:

  • gsm Pointer to DCL_GSM structure

  • x Input

Return: Control effort

Macros Documentation

define GSM_N

#define GSM_N 8

Number of piecewise linear sections.

define GSM_SPS_DEFAULTS

#define GSM_SPS_DEFAULTS     {{1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, {0.0f, 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.75f, 0.875f, 1.0f}}

Defines default values to initialize the DCL_GSM shadow structure (GSM_N=8)

define GSM_DEFAULTS

#define GSM_DEFAULTS     {{1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f},                 \
     {0.0f, 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.75f, 0.875f, 1.0f}, \
     1.0f / GSM_N,                                                     \
     &(DCL_GSM_SPS)GSM_SPS_DEFAULTS,                                   \
     &(DCL_CSS)DCL_CSS_DEFAULTS}

Defines default values for the GSM structure (GSM_N=8)