44 #include "sw/modules/math/src/32b/math.h"
46 #include "sw/modules/est/src/32b/est.h"
57 #include "sw/modules/ctrl/src/32b/ctrl.h"
68 #define NUM_MAIN_TICKS_FOR_GLOBAL_VARIABLE_UPDATE 1
72 #define MAX_ACCEL_KRPMPS_SF _IQ(USER_MOTOR_NUM_POLE_PAIRS*1000.0/USER_TRAJ_FREQ_Hz/USER_IQ_FULL_SCALE_FREQ_Hz/60.0)
76 #define MOTOR_Vars_INIT {false, \
88 USER_ErrorCode_NoError, \
89 {0,CTRL_TargetProc_Unknown,0,0}, \
97 _IQ(USER_MAX_VS_MAG_PU), \
98 _IQ(0.1 * USER_MOTOR_MAX_CURRENT), \
122 _IQ(0.8 * USER_MAX_VS_MAG_PU), \
314 #if !defined(FAST_ROM_V1p6)
333 #endif // end of _MAIN_H_ definition
float ipd_waitTime_fine_sec
void updateGlobalVariables(EST_Handle handle)
Updates the global variables.
void updateIqRef(CTRL_Handle handle)
Updates Iq reference and also sets the right sign to the speed reference for correct force angle...
USER_ErrorCode_e UserErrorCode
bool Flag_MotorIdentified
void EST_setupEstIdleState(EST_Handle handle)
void acim_Dir_qFmtCalc(CTRL_Handle handle)
Calculates Dir_qFmt for ACIM.
bool Flag_enablePowerWarp
struct _EST_Obj_ * EST_Handle
_iq SvgenMaxModulation_ticks
void softwareUpdate1p6(EST_Handle handle)
Updates version 1p6 of library.
bool Flag_enableForceAngle
void setupClarke_V(CLARKE_Handle, const uint_least8_t)
Sets up the Clarke transform for voltage.
void setFeLimitZero(CTRL_Handle handle)
Set electrical frequency limit to zero while identifying an induction motor.
void runCurrentReconstruction(void)
void recalcKpKi(CTRL_Handle handle)
Recalculate Kp and Ki gains to fix the R/L limitation of 2000.0 and Kp limitation of 0...
void recalcKpKiPmsm(CTRL_Handle handle)
Recalculate Kp and Ki gains to fix the R/L limitation of 2000.0 and Kp limitation of 0...
struct _MOTOR_Vars_t_ MOTOR_Vars_t
CTRL_Handle CTRL_init(void *pMemory, const size_t numBytes)
EST_Handle EST_init(void *pMemory, const size_t numBytes)
void CTRL_resetLs_qFmt(CTRL_Handle handle, const uint_least8_t qFmt)
Reset Ls Q format to a higher value when Ls identification starts.
_iq angleDelayComp(const _iq fm_pu, const _iq angleUncomp_pu)
The angleDelayComp function compensates for the delay introduced.
bool Flag_enableUserParams
bool Flag_enableOffsetcalc
void setupClarke_I(CLARKE_Handle, const uint_least8_t)
Sets up the Clarke transform for current.
void CTRL_calcMax_Ls_qFmt(CTRL_Handle handle, uint_least8_t *p_qFmt)
Calculates the maximum qFmt value for Ls identification, to get a more accurate Ls per unit...
interrupt void mainISR(void)
The main interrupt service (ISR) routine.
bool Flag_enableSpeedCtrl
void runCurrentIgnore(void)
void updateCPUusage(void)
Updates CPU usage.
float ipd_waitTime_coarse_sec
_iq getAbsMechAngle(_iq *pAngle_mech_poles, _iq *pAngle_z1_pu, const _iq angle_pu)
Calculates mechanical angle from electrical angle.
void updateKpKiGains(CTRL_Handle handle)
Updates Kp and Ki gains in the controller object.
void updateGlobalVariables_motor(CTRL_Handle handle)
Updates the global motor variables.
_iq getAbsElecAngle(const _iq angle_pu)
Calculates the absolute electrical angle.
void runRsOnLine(CTRL_Handle handle)
Runs Rs online.
bool Flag_enableFieldWeakening
void EST_getIdq_pu(EST_Handle handle, MATH_vec2 *pIdq_pu)
void runFieldWeakening(void)
_iq EST_runPowerWarp(EST_Handle handle, const _iq Id_int_pu, const _iq Iq_pu)
Runs PowerWarp.
void EST_setEstParams(EST_Handle handle, USER_Params *pUserParams)
void runOffsetsCalculation(void)