instaspin_foc
Functions | Variables
fast_obs_im_pw.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

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_enablePowerWarp = false
 
MATH_vec2 gIdq_A = {0.0, 0.0}
 
float_t gIdRated_A = 0.0
 Global variable for the rated Id current current, A. More...
 
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 gRr_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
 
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
 
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...
 
TRAJ_Handle trajHandle_Id
 the handle for the Id trajectory More...
 
TRAJ_Obj traj_Id
 the Id trajectory 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

CLARKE_Obj clarke_I

the current Clarke transform object

Definition at line 76 of file fast_obs_im_pw.c.

CLARKE_Obj clarke_V

the voltage Clarke transform object

Definition at line 79 of file fast_obs_im_pw.c.

CLARKE_Handle clarkeHandle_I

the handle for the current Clarke transform

Definition at line 75 of file fast_obs_im_pw.c.

CLARKE_Handle clarkeHandle_V

the handle for the voltage Clarke transform

Definition at line 78 of file fast_obs_im_pw.c.

CPU_USAGE_Obj cpu_usage

Definition at line 113 of file fast_obs_im_pw.c.

CPU_USAGE_Handle cpu_usageHandle

Definition at line 112 of file fast_obs_im_pw.c.

EST_Handle estHandle

the handle for the estimator

Definition at line 84 of file fast_obs_im_pw.c.

Referenced by main(), and mainISR().

uint16_t gCounter_speed = 0

Definition at line 55 of file fast_obs_im_pw.c.

Referenced by mainISR().

float_t gCpuUsagePercentageAvg = 0.0

Definition at line 115 of file fast_obs_im_pw.c.

Referenced by updateCPUusage().

float_t gCpuUsagePercentageMax = 0.0

Definition at line 116 of file fast_obs_im_pw.c.

Referenced by updateCPUusage().

float_t gCpuUsagePercentageMin = 0.0

Definition at line 114 of file fast_obs_im_pw.c.

Referenced by updateCPUusage().

EST_InputData_t gEstInputData

Definition at line 63 of file fast_obs_im_pw.c.

EST_OutputData_t gEstOutputData

Definition at line 65 of file fast_obs_im_pw.c.

volatile bool gFlag_enableForceAngle = true

Definition at line 27 of file fast_obs_im_pw.c.

Referenced by main().

volatile bool gFlag_enablePowerWarp = false

Definition at line 29 of file fast_obs_im_pw.c.

Referenced by main().

volatile bool gFlag_runOnLine = false

Definition at line 25 of file fast_obs_im_pw.c.

Referenced by main().

MATH_vec2 gIdq_A = {0.0, 0.0}

Definition at line 31 of file fast_obs_im_pw.c.

float_t gIq_ref_A = 0.0

Definition at line 53 of file fast_obs_im_pw.c.

Referenced by main(), and mainISR().

MATH_vec3 gOffsets_I_A = {0.0, 0.0, 0.0}

Definition at line 71 of file fast_obs_im_pw.c.

MATH_vec3 gOffsets_V_V = {0.0, 0.0, 0.0}

Definition at line 73 of file fast_obs_im_pw.c.

float_t gRr_Ohm = 0.0

Definition at line 41 of file fast_obs_im_pw.c.

Referenced by updateGlobalVariables_motor().

float_t gRs_Ohm = 0.0

Definition at line 43 of file fast_obs_im_pw.c.

Referenced by updateGlobalVariables_motor().

float_t gSpeed_Hz = 0.0

Definition at line 45 of file fast_obs_im_pw.c.

Referenced by updateGlobalVariables_motor().

volatile float_t gSpeed_Ki = 0.001

Definition at line 51 of file fast_obs_im_pw.c.

Referenced by main(), and setupControllers().

volatile float_t gSpeed_Kp = 0.01

Definition at line 49 of file fast_obs_im_pw.c.

Referenced by main(), and setupControllers().

float_t gSpeed_ref_Hz = 10.0

Definition at line 47 of file fast_obs_im_pw.c.

Referenced by mainISR().

HAL_Obj hal

the hardware abstraction layer object

Definition at line 82 of file fast_obs_im_pw.c.

IPARK_Obj ipark

the inverse Park transform object

Definition at line 87 of file fast_obs_im_pw.c.

IPARK_Handle iparkHandle

the handle for the inverse Park transform

Definition at line 86 of file fast_obs_im_pw.c.

PARK_Obj park

the Park transform object

Definition at line 90 of file fast_obs_im_pw.c.

PARK_Handle parkHandle

the handle for the Park object

Definition at line 89 of file fast_obs_im_pw.c.

PI_Obj pi_Id

the Id PI controller object

Definition at line 93 of file fast_obs_im_pw.c.

PI_Obj pi_Iq

the Iq PI controller object

Definition at line 96 of file fast_obs_im_pw.c.

PI_Obj pi_spd

the speed PI controller object

Definition at line 99 of file fast_obs_im_pw.c.

PI_Handle piHandle_Id

the handle for the Id PI controller

Definition at line 92 of file fast_obs_im_pw.c.

PI_Handle piHandle_Iq

the handle for the Iq PI controller

Definition at line 95 of file fast_obs_im_pw.c.

PI_Handle piHandle_spd

the handle for the speed PI controller

Definition at line 98 of file fast_obs_im_pw.c.

SVGEN_Obj svgen

the space vector generator object

Definition at line 102 of file fast_obs_im_pw.c.

SVGEN_Handle svgenHandle

the handle for the space vector generator

Definition at line 101 of file fast_obs_im_pw.c.

TRAJ_Obj traj_Id

the Id trajectory object

Definition at line 105 of file fast_obs_im_pw.c.

TRAJ_Handle trajHandle_Id

the handle for the Id trajectory

Definition at line 104 of file fast_obs_im_pw.c.