![Logo](ti_logo.svg) |
AM243x Motor Control SDK
09.02.00
|
|
Go to the documentation of this file.
57 #include "math_types.h"
60 #define MTPA_LUT_INDEX_LD_MAX 20
64 #define MTPA_LUT_INDEX_LQ_MAX 20
67 #define MTPA_LUT_DELTA_CURRENT_LD_A 0.5
70 #define MTPA_LUT_DELTA_CURRENT_LD_A 0.5
77 typedef struct _MTPA_Obj_
129 extern MTPA_Handle
MTPA_init(
void *pMemory,
const size_t numBytes);
372 uint32_t indexLdCnt = 0;
398 uint16_t indexLqCnt = 0;
417 static __attribute__((always_inline))
457 static __attribute__((always_inline))
static float32_t MTPA_getCurrentAngle_rad(MTPA_Handle handle)
Gets the stator current phase angle value (angleCurrent_rad)
Definition: mtpa.h:182
float32_t deltaIs_Ld_A
the Is detla for Ls lookup table
Definition: mtpa.h:84
#define MTPA_LUT_INDEX_LQ_MAX
Defines the maximum length of LUT for Lq.
Definition: mtpa.h:64
static bool MTPA_getFlagEnable(MTPA_Handle handle)
Gets the enable controller flag value from the controller.
Definition: mtpa.h:224
static void MTPA_computeCurrentReference(MTPA_Handle handle, const float32_t Is_ref_A)
Compute the current reference of MTPA.
Definition: mtpa.h:418
uint32_t indexMax_Lq
the Is detla for Lq lookup table
Definition: mtpa.h:87
static void MTPA_setCurrentAngle_rad(MTPA_Handle handle, const float32_t angleCurrent_rad)
Sets the stator current phase angle value.
Definition: mtpa.h:298
static void MTPA_setFlagEnable(MTPA_Handle handle, const bool flagEnable)
Sets the enable flag.
Definition: mtpa.h:281
void MTPA_computeParameters(MTPA_Handle handle, const float32_t Ls_d_H, const float32_t Ls_q_H, const float32_t flux_Wb)
Computes the motor constant for MTPA module.
static float32_t * MTPA_getIs_ref_A_addr(MTPA_Handle handle)
Gets the stator current reference memory address.
Definition: mtpa.h:210
MTPA_Handle MTPA_init(void *pMemory, const size_t numBytes)
Initializes the maximum torque per ampere (MTPA) module.
MATH_Vec2 Idq_ref_A
the d/q-axis current reference
Definition: mtpa.h:79
float32_t kconst
the K constant for mtpa
Definition: mtpa.h:82
static float32_t * MTPA_getCurrentAnglePhase_rad_addr(MTPA_Handle handle)
Gets the stator current phase angle memory address.
Definition: mtpa.h:168
float32_t Is_ref_A
the vector stator current reference
Definition: mtpa.h:81
static void MTPA_setIq_ref_A(MTPA_Handle handle, const float32_t Iq_ref_A)
Sets the quadrature current (Iq_ref) reference value.
Definition: mtpa.h:332
static float32_t MTPA_getIs_ref_A(MTPA_Handle handle)
Gets the stator current reference value (Is_ref_A)
Definition: mtpa.h:266
float32_t gconst
the G constant for mtpa
Definition: mtpa.h:83
#define MTPA_LUT_INDEX_LD_MAX
Defines the maximum length of LUT for Ld.
Definition: mtpa.h:60
float32_t angleCurrent_rad
the vector stator current reference
Definition: mtpa.h:80
float32_t deltaIs_Lq_A
the Is detla for Ls lookup table
Definition: mtpa.h:85
static float32_t MTPA_getIq_ref_A(MTPA_Handle handle)
Gets the quadrature current reference value (Iq_ref_A)
Definition: mtpa.h:252
Defines the MTPA object.
Definition: mtpa.h:78
static void MTPA_enable(MTPA_Handle handle)
Enables the MTPA.
Definition: mtpa.h:152
static float32_t MTPA_computeCurrentAngle(MTPA_Handle handle, const float32_t Is_ref_A)
Compute the current angle of MTPA.
Definition: mtpa.h:458
static void MTPA_disable(MTPA_Handle handle)
Disables the MTPA.
Definition: mtpa.h:137
const float32_t MTPA_Ld_tableData_H[MTPA_LUT_INDEX_LD_MAX+1]
Defines the Ld array.
static float32_t MTPA_updateLs_q_withLUT(MTPA_Handle handle, const float32_t Is_A)
Update the motor inductances.
Definition: mtpa.h:394
uint32_t indexMax_Ld
the Is detla for Ld lookup table
Definition: mtpa.h:86
static void MTPA_setIs_ref_A(MTPA_Handle handle, const float32_t Is_ref_A)
Sets the stator current reference value (Is_ref)
Definition: mtpa.h:349
bool flagEnable
a flag to enable the controller
Definition: mtpa.h:88
static float32_t MTPA_getKconst(MTPA_Handle handle)
Gets the motor constant of MTPA.
Definition: mtpa.h:196
static float32_t MTPA_updateLs_d_withLUT(MTPA_Handle handle, const float32_t Is_A)
Update the motor inductances.
Definition: mtpa.h:368
static void MTPA_setId_ref_A(MTPA_Handle handle, const float32_t Id_ref_A)
Sets the direct current (Id_ref) reference vector value.
Definition: mtpa.h:315
float float32_t
Definition: dcl_common.h:58
static float32_t MTPA_getId_ref_A(MTPA_Handle handle)
Gets the direct current reference value (Id_ref_A)
Definition: mtpa.h:238
const float32_t MTPA_Lq_tableData_H[MTPA_LUT_INDEX_LQ_MAX+1]
Defines the Lq array.