instaspin_foc
|
#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 | |
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_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} |
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 |
void main | ( | void | ) |
Definition at line 124 of file fast_obs_pm_rsol.c.
References CLARKE_init(), CPU_USAGE_init(), CPU_USAGE_setParams(), EST_disable(), EST_enable(), EST_initEst(), EST_setFlag_enableForceAngle(), EST_setFlag_enableRsOnLine(), EST_setFlag_enableRsRecalc(), EST_setFlag_updateRs(), EST_setParams(), EST_setRsOnLine_beta_rad(), EST_setRsOnLineAngleDelta_rad(), EST_setRsOnLineId_mag_A(), EST_updateState(), estHandle, gFlag_enableForceAngle, gFlag_enableRsOnLine, gFlag_enableSys, gFlag_runOnLine, gFlag_updateRs, gId_ref_A, gIq_ref_A, gRsOnLineFreq_Hz, gRsOnLineId_mag_A, gRsOnLinePole_Hz, gSpeed_Ki, gSpeed_Kp, HAL_disableGlobalInts(), HAL_disablePwm(), HAL_enableAdcInts(), HAL_enableDebugInt(), HAL_enableDrv(), HAL_enableGlobalInts(), HAL_enablePwm(), HAL_init(), HAL_initIntVectorTable(), HAL_readDrvData(), HAL_setParams(), HAL_setupDrvSpi(), HAL_setupFaults(), HAL_writeDrvData(), IPARK_init(), MATH_TWO_PI, _USER_Params_::numCurrentSensors, _USER_Params_::numVoltageSensors, PARK_init(), PI_init(), PI_setGains(), PI_setUi(), setupClarke_I(), setupClarke_V(), setupControllers(), SVGEN_init(), updateCPUusage(), updateGlobalVariables_motor(), USER_EST_FREQ_Hz, USER_ISR_FREQ_Hz, USER_setParams(), USER_SYSTEM_FREQ_MHz, _HAL_PwmData_t_::Vabc_pu, and _MATH_vec3_::value.
CLARKE_Obj clarke_I |
the current Clarke transform object
Definition at line 82 of file fast_obs_pm_rsol.c.
CLARKE_Obj clarke_V |
the voltage Clarke transform object
Definition at line 85 of file fast_obs_pm_rsol.c.
CLARKE_Handle clarkeHandle_I |
the handle for the current Clarke transform
Definition at line 81 of file fast_obs_pm_rsol.c.
CLARKE_Handle clarkeHandle_V |
the handle for the voltage Clarke transform
Definition at line 84 of file fast_obs_pm_rsol.c.
CPU_USAGE_Obj cpu_usage |
Definition at line 116 of file fast_obs_pm_rsol.c.
CPU_USAGE_Handle cpu_usageHandle |
Definition at line 115 of file fast_obs_pm_rsol.c.
EST_Handle estHandle |
the handle for the estimator
Definition at line 90 of file fast_obs_pm_rsol.c.
uint16_t gCounter_speed = 0 |
Definition at line 55 of file fast_obs_pm_rsol.c.
Referenced by mainISR().
float_t gCpuUsagePercentageAvg = 0.0 |
Definition at line 118 of file fast_obs_pm_rsol.c.
Referenced by updateCPUusage().
float_t gCpuUsagePercentageMax = 0.0 |
Definition at line 119 of file fast_obs_pm_rsol.c.
Referenced by updateCPUusage().
float_t gCpuUsagePercentageMin = 0.0 |
Definition at line 117 of file fast_obs_pm_rsol.c.
Referenced by updateCPUusage().
EST_InputData_t gEstInputData |
Definition at line 63 of file fast_obs_pm_rsol.c.
EST_OutputData_t gEstOutputData |
Definition at line 65 of file fast_obs_pm_rsol.c.
volatile bool gFlag_enableForceAngle = true |
Definition at line 27 of file fast_obs_pm_rsol.c.
Referenced by main().
volatile bool gFlag_enableRsOnLine = false |
Definition at line 29 of file fast_obs_pm_rsol.c.
Referenced by main().
volatile bool gFlag_runOnLine = false |
Definition at line 25 of file fast_obs_pm_rsol.c.
Referenced by main().
volatile bool gFlag_updateRs = false |
Definition at line 31 of file fast_obs_pm_rsol.c.
Referenced by main().
volatile float_t gId_ref_A = 0.0 |
Definition at line 51 of file fast_obs_pm_rsol.c.
float_t gIq_ref_A = 0.0 |
Definition at line 53 of file fast_obs_pm_rsol.c.
MATH_vec3 gOffsets_I_A = {0.0, 0.0, 0.0} |
Definition at line 77 of file fast_obs_pm_rsol.c.
MATH_vec3 gOffsets_V_V = {0.0, 0.0, 0.0} |
Definition at line 79 of file fast_obs_pm_rsol.c.
float_t gRs_Ohm = 0.0 |
Definition at line 41 of file fast_obs_pm_rsol.c.
Referenced by updateGlobalVariables_motor().
float_t gRsOnLine_Ohm = 0.0 |
Definition at line 39 of file fast_obs_pm_rsol.c.
Referenced by updateGlobalVariables_motor().
volatile float_t gRsOnLineFreq_Hz = 0.2 |
Definition at line 67 of file fast_obs_pm_rsol.c.
Referenced by main().
volatile float_t gRsOnLineId_mag_A = 0.5 |
Definition at line 69 of file fast_obs_pm_rsol.c.
Referenced by main().
volatile float_t gRsOnLinePole_Hz = 0.2 |
Definition at line 71 of file fast_obs_pm_rsol.c.
Referenced by main().
float_t gSpeed_Hz = 0.0 |
Definition at line 43 of file fast_obs_pm_rsol.c.
Referenced by updateGlobalVariables_motor().
volatile float_t gSpeed_Ki = 0.001 |
Definition at line 49 of file fast_obs_pm_rsol.c.
Referenced by main(), and setupControllers().
volatile float_t gSpeed_Kp = 0.01 |
Definition at line 47 of file fast_obs_pm_rsol.c.
Referenced by main(), and setupControllers().
float_t gSpeed_ref_Hz = 10.0 |
Definition at line 45 of file fast_obs_pm_rsol.c.
Referenced by mainISR().
HAL_Obj hal |
the hardware abstraction layer object
Definition at line 88 of file fast_obs_pm_rsol.c.
IPARK_Obj ipark |
the inverse Park transform object
Definition at line 93 of file fast_obs_pm_rsol.c.
IPARK_Handle iparkHandle |
the handle for the inverse Park transform
Definition at line 92 of file fast_obs_pm_rsol.c.
PARK_Obj park |
the Park transform object
Definition at line 96 of file fast_obs_pm_rsol.c.
PARK_Handle parkHandle |
the handle for the Park object
Definition at line 95 of file fast_obs_pm_rsol.c.
PI_Obj pi_Id |
the Id PI controller object
Definition at line 99 of file fast_obs_pm_rsol.c.
PI_Obj pi_Iq |
the Iq PI controller object
Definition at line 102 of file fast_obs_pm_rsol.c.
PI_Obj pi_spd |
the speed PI controller object
Definition at line 105 of file fast_obs_pm_rsol.c.
PI_Handle piHandle_Id |
the handle for the Id PI controller
Definition at line 98 of file fast_obs_pm_rsol.c.
PI_Handle piHandle_Iq |
the handle for the Iq PI controller
Definition at line 101 of file fast_obs_pm_rsol.c.
PI_Handle piHandle_spd |
the handle for the speed PI controller
Definition at line 104 of file fast_obs_pm_rsol.c.
SVGEN_Obj svgen |
the space vector generator object
Definition at line 108 of file fast_obs_pm_rsol.c.
SVGEN_Handle svgenHandle |
the handle for the space vector generator
Definition at line 107 of file fast_obs_pm_rsol.c.