3.3.9 mcFoc_ParkTransformation
C
/* Floating point Park Transformation */ void mcFoc_ParkTransformation( const tmcTypes_AlphaBeta_s * const pAlphaBeta, const float32_t sine, const float32_t cosine, tmcTypes_DQ_s * const pDQ ) /* Fixed point Park Transformation */ void mcFoc_ParkTransformation(const tmcTypes_AlphaBeta_s * const pAlphaBeta, const int16_t sine, const int16_t cosine, tmcTypes_DQ_s * const pDQ)
Summary
Park Transformation.
Description
This function performs the Park transformation to convert stationary reference frame (alpha-beta) currents into rotating reference frame (D-Q) currents. When the d-axis is aligned with the rotor flux, the following mathematical equations illustrate the current vector and the relationship between the two reference frames.
where Xα and Xβ are the stationary reference frame components, Xd and Xq are rotating reference frame components and cosθe and sinθe are the cosine and sine values of theta (rotor flux position angle)
Precondition
None.
Parameters
Param | Description |
---|---|
pAlphaBeta | A pointer to the structure holding alpha-beta currents. |
sine | Sine value of the electrical angle. Refer the generated header for the exact data type. |
cosine | Cosine value of the electrical angle. Refer the generated header for the exact data type. |
pDQ | A pointer to the structure holding DQ currents. |
Returns
None. The results of the transformation are stored in the structure pointed to by pDQ.
Example
// Define the parameters for Floating point Park Transformation tmcTypes_AlphaBeta_s alphaBetaCurrents = { .alpha = 1.0f, .beta = 0.5f }; float32_t sineValue = sin(electricalAngle); float32_t cosineValue = cos(electricalAngle); tmcTypes_DQ_s dqCurrents; // Define the parameters for fixed point Park Transformation tmcTypes_AlphaBeta_s alphaBetaCurrents = { .alpha = 10, .beta = -10 }; int16_t sineValue = sin(electricalAngle); int16_t cosineValue = cos(electricalAngle); tmcTypes_DQ_s dqCurrents; mcFoc_ParkTransformation(&alphaBetaCurrents, sineValue, cosineValue, &dqCurrents);
Remarks
Refer the generated header file for the exact function signature.