Data Structures | Macros | Typedefs | Functions
SFRA

Data Structures

struct  SFRA_F32
 Defines the SFRA_F32 structure. More...
 

Macros

#define C2000_IEEE754_TYPES
 
#define SFRA_F32_inject   _SFRA_F32_inject
 
#define SFRA_F32_collect   _SFRA_F32_collect
 

Typedefs

typedef float float32_t
 
typedef long double float64_t
 

Functions

void SFRA_F32_reset (SFRA_F32 *SFRA_F_obj)
 Resets internal data of SFRA_F32 module. More...
 
void SFRA_F32_config (SFRA_F32 *SFRA_F_obj, float32_t isrFrequency, float32_t injectionAmplitude, int16_t noFreqPoints, float32_t fraSweepStartFreq, float32_t freqStep, float32_t *h_magVect, float32_t *h_phaseVect, float32_t *gh_magVect, float32_t *gh_phaseVect, float32_t *cl_magVect, float32_t *cl_phaseVect, float32_t *freqVect, int16_t speed)
 Configures the SFRA_F32 module. More...
 
void SFRA_F32_initFreqArrayWithLogSteps (SFRA_F32 *SFRA_F_obj, float32_t fra_sweep_start_freq, float32_t freqStep)
 Initailizes the freq vectors with points that are log step apart. More...
 
void SFRA_F32_resetFreqRespArray (SFRA_F32 *SFRA_F_obj)
 Resets the response data stored in the ol and plant phase and mag vector. More...
 
void SFRA_F32_updateInjectionAmplitude (SFRA_F32 *SFRA_F_obj, float32_t new_injection_amplitude)
 Updates injection amplitude. More...
 
float _SFRA_F32_inject (float ref)
 Injects small signal disturbance into the control loop. More...
 
void _SFRA_F32_collect (float *control_output, float *feedback)
 Collects the response of the loop because of small signal disturbance injected. More...
 
void SFRA_F32_runBackgroundTask (SFRA_F32 *SFRA_F_obj)
 Runs the background task, this routine executes the state machine when a frequency sweep is started and is responsible for changing the frequency points and saving the measured results in an array. More...
 

Detailed Description

Macro Definition Documentation

◆ C2000_IEEE754_TYPES

#define C2000_IEEE754_TYPES

◆ SFRA_F32_inject

#define SFRA_F32_inject   _SFRA_F32_inject

◆ SFRA_F32_collect

#define SFRA_F32_collect   _SFRA_F32_collect

Typedef Documentation

◆ float32_t

typedef float float32_t

◆ float64_t

typedef long double float64_t

Function Documentation

◆ SFRA_F32_reset()

void SFRA_F32_reset ( SFRA_F32 SFRA_F_obj)

Resets internal data of SFRA_F32 module.

Parameters
SFRA_F_objPointer to the SFRA_F32 structure
Returns
None

◆ SFRA_F32_config()

void SFRA_F32_config ( SFRA_F32 SFRA_F_obj,
float32_t  isrFrequency,
float32_t  injectionAmplitude,
int16_t  noFreqPoints,
float32_t  fraSweepStartFreq,
float32_t  freqStep,
float32_t h_magVect,
float32_t h_phaseVect,
float32_t gh_magVect,
float32_t gh_phaseVect,
float32_t cl_magVect,
float32_t cl_phaseVect,
float32_t freqVect,
int16_t  speed 
)

Configures the SFRA_F32 module.

Parameters
*SFRA_F_objPointer to the SFRA_F32 structure
isrFrequencyFrequency at which SFRA routine in called, typically the control ISR rate
injectionAmplitudePer Unit (PU) injection amplitude
noFreqPointsNumber of frequency points sweeped
fraSweepStartFreqStart frequency of SFRA sweep
freqStepMultiplier used to keep frequency points log step apart
*h_magVectPointer to array that stores plant FRA magnitude data
*h_phaseVectPointer to array that stores plant FRA phase data
*gh_magVectPointer to array that stores OL FRA magnitude data
*gh_phaseVectPointer to array that stores OL FRA phase data
*cl_magVectPointer to array that stores OL FRA magnitude data
*cl_phaseVectPointer to array that stores OL FRA phase data
*freqVectPointer to array that stores the freq points for the sweep
speedindiactes the speed of the sweep
Returns
None

◆ SFRA_F32_initFreqArrayWithLogSteps()

void SFRA_F32_initFreqArrayWithLogSteps ( SFRA_F32 SFRA_F_obj,
float32_t  fra_sweep_start_freq,
float32_t  freqStep 
)

Initailizes the freq vectors with points that are log step apart.

Parameters
*SFRA_F_objPointer to the SFRA_F32 structure
fra_sweep_start_freqStart frequency of SFRA sweep
freqStepMultiplier used to keep frequency points log step apart
Returns
None

◆ SFRA_F32_resetFreqRespArray()

void SFRA_F32_resetFreqRespArray ( SFRA_F32 SFRA_F_obj)

Resets the response data stored in the ol and plant phase and mag vector.

Parameters
*SFRA_F_objPointer to the SFRA_F32 structure pointer
Returns
None

◆ SFRA_F32_updateInjectionAmplitude()

void SFRA_F32_updateInjectionAmplitude ( SFRA_F32 SFRA_F_obj,
float32_t  new_injection_amplitude 
)

Updates injection amplitude.

Parameters
*SFRA_F_objPointer to the SFRA_F32 structure
new_injection_amplitudeInjection amplitude
Returns
None

◆ _SFRA_F32_inject()

float _SFRA_F32_inject ( float  ref)

Injects small signal disturbance into the control loop.

Parameters
refrefernce value on which the injection is added
Returns
Routine returns the reference plus the injection when SFRA sweep is active, when SFRA sweep is not active that is if SFRA state is 0 it returns the the refernce without any change

◆ _SFRA_F32_collect()

void _SFRA_F32_collect ( float *  control_output,
float *  feedback 
)

Collects the response of the loop because of small signal disturbance injected.

Parameters
*control_outputpointer to the variable where control output is saved note though the parameter is passed by reference it is unchanged by the module
*feedbackpointer to the variable where control output is saved note though the parameter is passed by reference it is unchanged by the module
Returns
None

◆ SFRA_F32_runBackgroundTask()

void SFRA_F32_runBackgroundTask ( SFRA_F32 SFRA_F_obj)

Runs the background task, this routine executes the state machine when a frequency sweep is started and is responsible for changing the frequency points and saving the measured results in an array.

Parameters
*SFRA_F_objPointer to the SFRA_F32 structure pointer
Returns
None

Copyright 2023, Texas Instruments Incorporated