3.3.18.14 mcFlxI_MTPA

C


/* MTPA control */
void  mcFlxI_MTPA( tmcFlx_Parameters_s * const pParameters,
                   const tmcTypes_DQ_s * const pIdq, float32_t * const pIdref )	

Summary

Executes Maximum Torque per Ampere (MTPA) control .

Description

This function computes the d-axis current reference for Maximum Torque Per Ampere (MTPA) operation in a Permanent Magnet Synchronous Motor (PMSM) , allowing the motor to operate at maximum efficiency. The following equation is sued to compute the MTPA d-axis reference current.

Id_mtpa=ψm2(LdLq)+(ψm2(LdLq))2+Iq2

where ψm is the back emf constant in volts per electrical rad/s, Ld and Lq are d and q axis inductance values.

Precondition

The MTPA module must be initialized and enabled.

Parameters

ParamDescription
pParametersA pointer to the flux control module structure,which includes the MTPA, flux weakening, and flux control parameters.
pIDQPointer to the DQ current vector
pIdrefPointer to the output reference ID current

Returns

None

Example

// Define the flux module data structure
tmcFlx_Parameters_s fluxParameters;
tmcTypes_DQ_s iDQ ={ .d = 0.3f, .q = 0.4f };
float32_t idRef;
/* Flux weakening control */
mcFlxI_MTPA(&fluxParameters, &iDQ, &idRef);
    

Remarks

None.