calib_scan_distance hint for halls.

This commit is contained in:
Oskar Weigl
2021-03-03 20:06:08 -08:00
committed by GitHub
parent 75dc78c3e3
commit d795226612
+2 -1
View File
@@ -40,10 +40,11 @@ odrv0.axis0.motor.config.torque_constant = 8.27 / <measured KV>
```
If you set the encoder to hall mode (instead of incremental). See the [pinout](encoders.md#hall-effect-encoders) for instructions on how to plug in the hall feedback.
The hall feedback has 6 states for every pole pair in the motor. Since we have 15 pole pairs, we set the cpr to 15*6 = 90.
The hall feedback has 6 states for every pole pair in the motor. Since we have 15 pole pairs, we set the cpr to `15*6 = 90`. Since hall sensors are low resolution feedback, we also bump up the offset calibration displacement to get better calibration accuracy.
```txt
odrv0.axis0.encoder.config.mode = ENCODER_MODE_HALL
odrv0.axis0.encoder.config.cpr = 90
odrv0.axis0.encoder.config.calib_scan_distance = 150
```
Since the hall feedback only has 90 counts per revolution, we want to reduce the velocity tracking bandwidth to get smoother velocity estimates.