When using the calibration method with the CalibratedSensor, the computed zero electrical angle is incorrect if the sensor direction is CCW. This is fixed by negating the computed zero electrical angle if the sensor is CCW (followed by normalizing it to 0-2*PI). After this change, calibrate in CalibratedSensor returns the same electrical angle as alignSensor in BLDCMotor for CW and CCW sensor directions.
Fix for #24.
When using the calibration method with the
CalibratedSensor
, the computed zero electrical angle is incorrect if the sensor direction is CCW. This is fixed by negating the computed zero electrical angle if the sensor is CCW (followed by normalizing it to 0-2*PI). After this change,calibrate
inCalibratedSensor
returns the same electrical angle asalignSensor
inBLDCMotor
for CW and CCW sensor directions.