Some sin/cos encoders do not provide perfec 90° phase between the two signals.
It is in particular the case of son/cos encoders made of two hall effects sensors placed in front of the rotor magnets. When working with high pole pairs number, very light placement error on the hall effect sensors can induce important electric angle phase error between sin and cos signals.
Perfect encoder would provide 90° phase between the two signals. Assuming we have a rotor angle α and a phase error θ, the encoder will output:
ADC SIN → sin(α)
ADC COS → cos(α+θ) = cos(α)cos(θ) - sin(α)sin(θ)
We can correct the output the following way:
CORRECTED COS : cos(θ) = (cos(α+θ) + sin(α)sin(θ))/cos(α)
This feature has been tested on a motor with 10 pole pairs and an identified phase error of 8 deg electrical, we can see the inpact on FOC control.
Without phase error compensation:
With phase error compensation:
Note: I am planning to provide a lisp example to help identify this phase error θ and/or working on automatic SIN/COS calibration to identify all SIN/COS parameters at the same time.
Some sin/cos encoders do not provide perfec 90° phase between the two signals.
It is in particular the case of son/cos encoders made of two hall effects sensors placed in front of the rotor magnets. When working with high pole pairs number, very light placement error on the hall effect sensors can induce important electric angle phase error between sin and cos signals.
Perfect encoder would provide 90° phase between the two signals. Assuming we have a rotor angle α and a phase error θ, the encoder will output:
We can correct the output the following way:
This feature has been tested on a motor with 10 pole pairs and an identified phase error of 8 deg electrical, we can see the inpact on FOC control. Without phase error compensation:![phase_not_compensated2](https://user-images.githubusercontent.com/4713466/205267591-8614511a-fa54-42de-a1e9-c4808313c1cf.png)
With phase error compensation:![phasecompensated](https://user-images.githubusercontent.com/4713466/205267724-2d0148ce-45b4-4d83-ad39-6590478011e2.png)
Note: I am planning to provide a lisp example to help identify this phase error θ and/or working on automatic SIN/COS calibration to identify all SIN/COS parameters at the same time.