instaspin_foc
Functions | Variables
proj_lab11.c File Reference
#include <math.h>
#include "main.h"

Go to the source code of this file.

Functions

void main (void)
 
interrupt void mainISR (void)
 The main ISR that implements the motor control. More...
 
_iq angleDelayComp (const _iq fm_pu, const _iq angleUncomp_pu)
 The angleDelayComp function compensates for the delay introduced. More...
 
void softwareUpdate1p6 (EST_Handle handle)
 Call this function to fix 1p6. This is only used for F2806xF/M. More...
 
void setupClarke_I (CLARKE_Handle handle, const uint_least8_t numCurrentSensors)
 Setup the Clarke transform for either 2 or 3 sensors. More...
 
void setupClarke_V (CLARKE_Handle handle, const uint_least8_t numVoltageSensors)
 Setup the Clarke transform for either 2 or 3 sensors. More...
 
void updateGlobalVariables (EST_Handle handle)
 Update the global variables (gMotorVars). More...
 

Variables

CLARKE_Handle clarkeHandle_I
 
CLARKE_Obj clarke_I
 the current Clarke transform object More...
 
CLARKE_Handle clarkeHandle_V
 
CLARKE_Obj clarke_V
 the voltage Clarke transform object More...
 
EST_Handle estHandle
 the handle for the estimator More...
 
PID_Obj pid [3]
 
PID_Handle pidHandle [3]
 
uint16_t pidCntSpeed
 
IPARK_Handle iparkHandle
 
IPARK_Obj ipark
 the inverse Park transform object More...
 
SVGEN_Handle svgenHandle
 the handle for the space vector generator More...
 
SVGEN_Obj svgen
 the space vector generator object More...
 
HAL_Handle halHandle
 The hal handle. 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...
 
MATH_vec3 gOffsets_I_pu = {_IQ(0.0),_IQ(0.0),_IQ(0.0)}
 the offsets for the current feedback More...
 
MATH_vec3 gOffsets_V_pu = {_IQ(0.0),_IQ(0.0),_IQ(0.0)}
 the offsets for the voltage feedback More...
 
MATH_vec2 gIdq_ref_pu = {_IQ(0.0),_IQ(0.0)}
 Iq references. More...
 
MATH_vec2 gVdq_out_pu = {_IQ(0.0),_IQ(0.0)}
 Vd and Vq from the current controllers. More...
 
MATH_vec2 gIdq_pu = {_IQ(0.0),_IQ(0.0)}
 measured values More...
 
USER_Params gUserParams
 The user parameters. More...
 
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
 
_iq gSpeed_krpm_to_pu_sf
 
_iq gSpeed_hz_to_krpm_sf