Vector Clarke Transform
- __STATIC_FORCEINLINE void riscv_clarke_f32 (float32_t Ia, float32_t Ib, float32_t *pIalpha, float32_t *pIbeta)
- __STATIC_FORCEINLINE void riscv_clarke_q31 (q31_t Ia, q31_t Ib, q31_t *pIalpha, q31_t *pIbeta)
- group Vector Clarke Transform
Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. Generally the Clarke transform uses three-phase currents
Ia, Ib and Icto calculate currents in the two-phase orthogonal stator axisIalphaandIbeta. WhenIalphais superposed withIaas shown in the figure below
and
Ia + Ib + Ic = 0, in this conditionIalphaandIbetacan be calculated using onlyIaandIb.
The function operates on a single sample of data and each call to the function returns the processed output. The library provides separate functions for Q31 and floating-point data types.
- Algorithm
where
IaandIbare the instantaneous stator phases andpIalphaandpIbetaare the two coordinates of time invariant vector.
- Fixed-Point Behavior
Care must be taken when using the Q31 version of the Clarke transform. In particular, the overflow and saturation behavior of the accumulator used must be considered. Refer to the function specific documentation below for usage guidelines.
Functions
- __STATIC_FORCEINLINE void riscv_clarke_f32 (float32_t Ia, float32_t Ib, float32_t *pIalpha, float32_t *pIbeta)
Floating-point Clarke transform.
- Parameters:
Ia – [in] input three-phase coordinate
aIb – [in] input three-phase coordinate
bpIalpha – [out] points to output two-phase orthogonal vector axis alpha
pIbeta – [out] points to output two-phase orthogonal vector axis beta
- __STATIC_FORCEINLINE void riscv_clarke_q31 (q31_t Ia, q31_t Ib, q31_t *pIalpha, q31_t *pIbeta)
Clarke transform for Q31 version.
- Scaling and Overflow Behavior
The function is implemented using an internal 32-bit accumulator. The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. There is saturation on the addition, hence there is no risk of overflow.
- Parameters:
Ia – [in] input three-phase coordinate
aIb – [in] input three-phase coordinate
bpIalpha – [out] points to output two-phase orthogonal vector axis alpha
pIbeta – [out] points to output two-phase orthogonal vector axis beta