instaspin_foc
Functions | Variables
fast_obs_pm_cal_rsol.c File Reference
#include "fast_obs.h"

Go to the source code of this file.

Functions

void main (void)
 
interrupt void mainISR (void)
 The main interrupt service (ISR) routine. More...
 
void setupClarke_I (CLARKE_Handle handle, const uint_least8_t numCurrentSensors)
 Sets the number of current sensors. More...
 
void setupClarke_V (CLARKE_Handle handle, const uint_least8_t numVoltageSensors)
 Sets the number of voltage sensors. More...
 
void setupControllers (void)
 Setups the controllers. More...
 
void updateGlobalVariables_motor (EST_Handle estHandle)
 Updates the global motor variables. More...
 
void updateCPUusage (void)
 Updates CPU usage. More...
 

Variables

CAL_State_e gCalState = CAL_State_Idle
 
EST_State_e gEstState = EST_State_Idle
 Global variable for the estimator state. More...
 
volatile bool gFlag_enableSys = true
 Global flag to enable/disable the system. More...
 
volatile bool gFlag_runCal = false
 
volatile bool gFlag_runOnLine = false
 
volatile bool gFlag_enableForceAngle = true
 
volatile bool gFlag_enableRsOnLine = false
 
volatile bool gFlag_updateRs = false
 
float_t gFlux_Wb = 0.0
 Global variable for the rotor flux estimate, Wb. More...
 
float_t gLs_d_H = 0.0
 Global variable for the stator inductance in the direct coordinate direction, Henry. More...
 
float_t gLs_q_H = 0.0
 Global variable for the stator inductance in the quadrature coordinate direction, Henry. More...
 
float_t gRsOnLine_Ohm = 0.0
 
float_t gRs_Ohm = 0.0
 
float_t gSpeed_Hz = 0.0
 
float_t gSpeed_ref_Hz = 10.0
 
volatile float_t gSpeed_Kp = 0.01
 
volatile float_t gSpeed_Ki = 0.001
 
volatile float_t gId_ref_A = 0.0
 
float_t gIq_ref_A = 0.0
 
uint16_t gCounter_speed = 0
 
HAL_AdcData_t gAdcData
 Defines the ADC data. More...
 
HAL_DacData_t gDacData
 Defines the DAC data. More...
 
HAL_PwmData_t gPwmData
 Defines the PWM data. More...
 
EST_InputData_t gEstInputData
 
EST_OutputData_t gEstOutputData
 
volatile float_t gRsOnLineFreq_Hz = 0.2
 
volatile float_t gRsOnLineId_mag_A = 0.5
 
volatile float_t gRsOnLinePole_Hz = 0.2
 
float_t gTorque_Nm = 0.0
 Global variable for the estimated torque, N*m. More...
 
USER_Params gUserParams
 The user parameters. More...
 
MATH_vec3 gOffsets_I_A = {0.0, 0.0, 0.0}
 
MATH_vec3 gOffsets_V_V = {0.0, 0.0, 0.0}
 
CAL_Handle calHandle
 the handle for the calibrator More...
 
CAL_Obj cal
 the calibrator object More...
 
CLARKE_Handle clarkeHandle_I
 the handle for the current Clarke transform More...
 
CLARKE_Obj clarke_I
 the current Clarke transform object More...
 
CLARKE_Handle clarkeHandle_V
 the handle for the voltage Clarke transform More...
 
CLARKE_Obj clarke_V
 the voltage Clarke transform object More...
 
HAL_Handle halHandle
 the handle for the hardware abstraction layer More...
 
HAL_Obj hal
 the hardware abstraction layer object More...
 
EST_Handle estHandle
 the handle for the estimator More...
 
IPARK_Handle iparkHandle
 the handle for the inverse Park transform More...
 
IPARK_Obj ipark
 the inverse Park transform object More...
 
PARK_Handle parkHandle
 the handle for the Park object More...
 
PARK_Obj park
 the Park transform object More...
 
PI_Handle piHandle_Id
 the handle for the Id PI controller More...
 
PI_Obj pi_Id
 the Id PI controller object More...
 
PI_Handle piHandle_Iq
 the handle for the Iq PI controller More...
 
PI_Obj pi_Iq
 the Iq PI controller object More...
 
PI_Handle piHandle_spd
 the handle for the speed PI controller More...
 
PI_Obj pi_spd
 the speed PI controller object More...
 
SVGEN_Handle svgenHandle
 the handle for the space vector generator More...
 
SVGEN_Obj svgen
 the space vector generator object More...
 
CPU_USAGE_Handle cpu_usageHandle
 
CPU_USAGE_Obj cpu_usage
 
float_t gCpuUsagePercentageMin = 0.0
 
float_t gCpuUsagePercentageAvg = 0.0
 
float_t gCpuUsagePercentageMax = 0.0
 

Function Documentation

void main ( void  )

Variable Documentation

CAL_Obj cal

the calibrator object

Definition at line 86 of file fast_obs_pm_cal_rsol.c.

CAL_Handle calHandle

the handle for the calibrator

Definition at line 85 of file fast_obs_pm_cal_rsol.c.

CLARKE_Obj clarke_I

the current Clarke transform object

Definition at line 89 of file fast_obs_pm_cal_rsol.c.

CLARKE_Obj clarke_V

the voltage Clarke transform object

Definition at line 92 of file fast_obs_pm_cal_rsol.c.

CLARKE_Handle clarkeHandle_I

the handle for the current Clarke transform

Definition at line 88 of file fast_obs_pm_cal_rsol.c.

CLARKE_Handle clarkeHandle_V

the handle for the voltage Clarke transform

Definition at line 91 of file fast_obs_pm_cal_rsol.c.

CPU_USAGE_Obj cpu_usage

Definition at line 123 of file fast_obs_pm_cal_rsol.c.

CPU_USAGE_Handle cpu_usageHandle

Definition at line 122 of file fast_obs_pm_cal_rsol.c.

EST_Handle estHandle

the handle for the estimator

Definition at line 97 of file fast_obs_pm_cal_rsol.c.

Referenced by main(), and mainISR().

CAL_State_e gCalState = CAL_State_Idle

Definition at line 21 of file fast_obs_pm_cal_rsol.c.

Referenced by updateGlobalVariables_motor().

uint16_t gCounter_speed = 0

Definition at line 59 of file fast_obs_pm_cal_rsol.c.

Referenced by mainISR().

float_t gCpuUsagePercentageAvg = 0.0

Definition at line 125 of file fast_obs_pm_cal_rsol.c.

Referenced by updateCPUusage().

float_t gCpuUsagePercentageMax = 0.0

Definition at line 126 of file fast_obs_pm_cal_rsol.c.

Referenced by updateCPUusage().

float_t gCpuUsagePercentageMin = 0.0

Definition at line 124 of file fast_obs_pm_cal_rsol.c.

Referenced by updateCPUusage().

EST_InputData_t gEstInputData

Definition at line 67 of file fast_obs_pm_cal_rsol.c.

EST_OutputData_t gEstOutputData

Definition at line 69 of file fast_obs_pm_cal_rsol.c.

volatile bool gFlag_enableForceAngle = true

Definition at line 31 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile bool gFlag_enableRsOnLine = false

Definition at line 33 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile bool gFlag_runCal = false

Definition at line 27 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile bool gFlag_runOnLine = false

Definition at line 29 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile bool gFlag_updateRs = false

Definition at line 35 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile float_t gId_ref_A = 0.0

Definition at line 55 of file fast_obs_pm_cal_rsol.c.

Referenced by main(), and mainISR().

float_t gIq_ref_A = 0.0

Definition at line 57 of file fast_obs_pm_cal_rsol.c.

Referenced by main(), and mainISR().

MATH_vec3 gOffsets_I_A = {0.0, 0.0, 0.0}

Definition at line 81 of file fast_obs_pm_cal_rsol.c.

MATH_vec3 gOffsets_V_V = {0.0, 0.0, 0.0}

Definition at line 83 of file fast_obs_pm_cal_rsol.c.

float_t gRs_Ohm = 0.0

Definition at line 45 of file fast_obs_pm_cal_rsol.c.

Referenced by updateGlobalVariables_motor().

float_t gRsOnLine_Ohm = 0.0

Definition at line 43 of file fast_obs_pm_cal_rsol.c.

Referenced by updateGlobalVariables_motor().

volatile float_t gRsOnLineFreq_Hz = 0.2

Definition at line 71 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile float_t gRsOnLineId_mag_A = 0.5

Definition at line 73 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

volatile float_t gRsOnLinePole_Hz = 0.2

Definition at line 75 of file fast_obs_pm_cal_rsol.c.

Referenced by main().

float_t gSpeed_Hz = 0.0

Definition at line 47 of file fast_obs_pm_cal_rsol.c.

Referenced by updateGlobalVariables_motor().

volatile float_t gSpeed_Ki = 0.001

Definition at line 53 of file fast_obs_pm_cal_rsol.c.

Referenced by main(), and setupControllers().

volatile float_t gSpeed_Kp = 0.01

Definition at line 51 of file fast_obs_pm_cal_rsol.c.

Referenced by main(), and setupControllers().

float_t gSpeed_ref_Hz = 10.0

Definition at line 49 of file fast_obs_pm_cal_rsol.c.

Referenced by mainISR().

HAL_Obj hal

the hardware abstraction layer object

Definition at line 95 of file fast_obs_pm_cal_rsol.c.

IPARK_Obj ipark

the inverse Park transform object

Definition at line 100 of file fast_obs_pm_cal_rsol.c.

IPARK_Handle iparkHandle

the handle for the inverse Park transform

Definition at line 99 of file fast_obs_pm_cal_rsol.c.

PARK_Obj park

the Park transform object

Definition at line 103 of file fast_obs_pm_cal_rsol.c.

PARK_Handle parkHandle

the handle for the Park object

Definition at line 102 of file fast_obs_pm_cal_rsol.c.

PI_Obj pi_Id

the Id PI controller object

Definition at line 106 of file fast_obs_pm_cal_rsol.c.

PI_Obj pi_Iq

the Iq PI controller object

Definition at line 109 of file fast_obs_pm_cal_rsol.c.

PI_Obj pi_spd

the speed PI controller object

Definition at line 112 of file fast_obs_pm_cal_rsol.c.

PI_Handle piHandle_Id

the handle for the Id PI controller

Definition at line 105 of file fast_obs_pm_cal_rsol.c.

PI_Handle piHandle_Iq

the handle for the Iq PI controller

Definition at line 108 of file fast_obs_pm_cal_rsol.c.

PI_Handle piHandle_spd

the handle for the speed PI controller

Definition at line 111 of file fast_obs_pm_cal_rsol.c.

SVGEN_Obj svgen

the space vector generator object

Definition at line 115 of file fast_obs_pm_cal_rsol.c.

SVGEN_Handle svgenHandle

the handle for the space vector generator

Definition at line 114 of file fast_obs_pm_cal_rsol.c.