instaspin_foc
Modules | Macros | Functions | Variables
PROJ_LAB03b

Modules

 Project Overview
 

Macros

#define LED_BLINK_FREQ_Hz   5
 

Functions

void main (void)
 
interrupt void mainISR (void)
 The main interrupt service (ISR) routine. More...
 
void updateGlobalVariables_motor (CTRL_Handle handle)
 Updates the global motor variables. More...
 
void updateCPUusage (void)
 Updates CPU usage. More...
 

Variables

uint_least16_t gCounter_updateGlobals = 0
 A counter that is denotes when to update the global variables. More...
 
bool Flag_Latch_softwareUpdate = true
 
CTRL_Handle ctrlHandle
 The controller handle. More...
 
HAL_Handle halHandle
 The hal handle. More...
 
USER_Params gUserParams
 The user parameters. More...
 
HAL_PwmData_t gPwmData = {_IQ(0.0), _IQ(0.0), _IQ(0.0)}
 Defines the PWM data. More...
 
HAL_AdcData_t gAdcData
 Defines the ADC data. More...
 
FEM_Handle femHandle
 
FEM_Obj fem
 
uint32_t gNumFreqErrors = 0
 
uint32_t gMaxDeltaCntObserved = 0
 
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
 
_iq gMaxCurrentSlope = _IQ(0.0)
 
CTRL_Obj ctrl
 Defines the CTRL object. More...
 
uint16_t gLEDcnt = 0
 
volatile MOTOR_Vars_t gMotorVars = MOTOR_Vars_INIT
 
_iq gFlux_pu_to_Wb_sf
 
_iq gFlux_pu_to_VpHz_sf
 
_iq gTorque_Ls_Id_Iq_pu_to_Nm_sf
 
_iq gTorque_Flux_Iq_pu_to_Nm_sf
 

Detailed Description

Macro Definition Documentation

#define LED_BLINK_FREQ_Hz   5

Definition at line 63 of file proj_lab03b.c.

Referenced by mainISR().

Function Documentation

void main ( void  )

Definition at line 148 of file proj_lab03b.c.

References _IQ, _IQmpy, CPU_USAGE_init(), CPU_USAGE_setParams(), CTRL_getFlag_enableUserMotorParams(), CTRL_getState(), CTRL_getVersion(), CTRL_initCtrl(), CTRL_isError(), CTRL_setFlag_enableCtrl(), CTRL_setFlag_enableDcBusComp(), CTRL_setFlag_enableOffset(), CTRL_setFlag_enablePowerWarp(), CTRL_setFlag_enableUserMotorParams(), CTRL_setMaxAccel_pu(), CTRL_setParams(), CTRL_setSpd_ref_krpm(), CTRL_updateState(), _MOTOR_Vars_t_::CtrlVersion, EST_getMaxCurrentSlope_pu(), EST_isMotorIdentified(), EST_setFlag_enableForceAngle(), EST_setFlag_enableRsRecalc(), EST_setMaxCurrentSlope_pu(), _CTRL_Obj_::estHandle, FEM_getErrorCnt(), FEM_getMaxDeltaCntObserved(), FEM_init(), FEM_isFreqError(), FEM_setParams(), _MOTOR_Vars_t_::Flag_enableForceAngle, _MOTOR_Vars_t_::Flag_enableOffsetcalc, _MOTOR_Vars_t_::Flag_enablePowerWarp, _MOTOR_Vars_t_::Flag_enableRsRecalc, _MOTOR_Vars_t_::Flag_enableSys, _MOTOR_Vars_t_::Flag_enableUserParams, Flag_Latch_softwareUpdate, _MOTOR_Vars_t_::Flag_MotorIdentified, _MOTOR_Vars_t_::Flag_Run_Identify, gCounter_updateGlobals, gFlux_pu_to_VpHz_sf, gFlux_pu_to_Wb_sf, gMaxCurrentSlope, gMaxDeltaCntObserved, gNumFreqErrors, gTorque_Flux_Iq_pu_to_Nm_sf, gTorque_Ls_Id_Iq_pu_to_Nm_sf, hal, HAL_disablePwm(), HAL_enableAdcInts(), HAL_enableDebugInt(), HAL_enableDrv(), HAL_enableGlobalInts(), HAL_enablePwm(), HAL_getBias(), HAL_init(), HAL_initIntVectorTable(), HAL_readDrvData(), HAL_reloadTimer(), HAL_setBias(), HAL_setParams(), HAL_setupDrvSpi(), HAL_setupFaults(), HAL_updateAdcBias(), HAL_writeDrvData(), I_A_offset, I_B_offset, _MOTOR_Vars_t_::I_bias, I_C_offset, MAX_ACCEL_KRPMPS_SF, _MOTOR_Vars_t_::MaxAccel_krpmps, memCopy(), _CTRL_Version_::minor, NUM_MAIN_TICKS_FOR_GLOBAL_VARIABLE_UPDATE, _MOTOR_Vars_t_::SpeedRef_krpm, updateCPUusage(), updateGlobalVariables_motor(), USER_calcPIgains(), USER_checkForErrors(), USER_computeFlux_pu_to_VpHz_sf(), USER_computeFlux_pu_to_Wb_sf(), USER_computeTorque_Flux_Iq_pu_to_Nm_sf(), USER_computeTorque_Ls_Id_Iq_pu_to_Nm_sf(), USER_CTRL_FREQ_Hz, USER_getErrorCode(), USER_ISR_FREQ_Hz, USER_setParams(), USER_softwareUpdate1p6(), USER_SYSTEM_FREQ_MHz, _MOTOR_Vars_t_::UserErrorCode, V_A_offset, V_B_offset, _MOTOR_Vars_t_::V_bias, V_C_offset, and _MATH_vec3_::value.

interrupt void mainISR ( void  )
void updateCPUusage ( void  )
void updateGlobalVariables_motor ( CTRL_Handle  handle)

Variable Documentation

CPU_USAGE_Obj cpu_usage

Definition at line 95 of file proj_lab03b.c.

CPU_USAGE_Handle cpu_usageHandle

Definition at line 94 of file proj_lab03b.c.

CTRL_Obj ctrl

Defines the CTRL object.

Defines the CTRL object.

Definition at line 108 of file proj_lab03b.c.

CTRL_Handle ctrlHandle

The controller handle.

The controller handle.

Definition at line 73 of file proj_lab03b.c.

FEM_Obj fem

Definition at line 90 of file proj_lab03b.c.

FEM_Handle femHandle

Definition at line 89 of file proj_lab03b.c.

bool Flag_Latch_softwareUpdate = true

Definition at line 71 of file proj_lab03b.c.

Referenced by main().

HAL_AdcData_t gAdcData

Defines the ADC data.

Definition at line 87 of file proj_lab03b.c.

uint_least16_t gCounter_updateGlobals = 0

A counter that is denotes when to update the global variables.

Definition at line 69 of file proj_lab03b.c.

Referenced by main().

float_t gCpuUsagePercentageAvg = 0.0

Definition at line 97 of file proj_lab03b.c.

Referenced by updateCPUusage().

float_t gCpuUsagePercentageMax = 0.0

Definition at line 98 of file proj_lab03b.c.

Referenced by updateCPUusage().

float_t gCpuUsagePercentageMin = 0.0

Definition at line 96 of file proj_lab03b.c.

Referenced by updateCPUusage().

_iq gFlux_pu_to_VpHz_sf

Definition at line 139 of file proj_lab03b.c.

Referenced by main().

_iq gFlux_pu_to_Wb_sf

Definition at line 137 of file proj_lab03b.c.

Referenced by main(), and updateGlobalVariables_motor().

uint16_t gLEDcnt = 0

Definition at line 111 of file proj_lab03b.c.

Referenced by mainISR().

_iq gMaxCurrentSlope = _IQ(0.0)

Definition at line 100 of file proj_lab03b.c.

Referenced by main().

uint32_t gMaxDeltaCntObserved = 0

Definition at line 92 of file proj_lab03b.c.

Referenced by main().

volatile MOTOR_Vars_t gMotorVars = MOTOR_Vars_INIT

Definition at line 113 of file proj_lab03b.c.

uint32_t gNumFreqErrors = 0

Definition at line 91 of file proj_lab03b.c.

Referenced by main().

HAL_PwmData_t gPwmData = {_IQ(0.0), _IQ(0.0), _IQ(0.0)}

Defines the PWM data.

Definition at line 85 of file proj_lab03b.c.

_iq gTorque_Flux_Iq_pu_to_Nm_sf

Definition at line 143 of file proj_lab03b.c.

Referenced by main(), and updateGlobalVariables_motor().

_iq gTorque_Ls_Id_Iq_pu_to_Nm_sf

Definition at line 141 of file proj_lab03b.c.

Referenced by main(), and updateGlobalVariables_motor().

USER_Params gUserParams

The user parameters.

Definition at line 83 of file proj_lab03b.c.

HAL_Handle halHandle

The hal handle.

The hal handle.

Definition at line 78 of file proj_lab03b.c.