It has been a rough ride…
When sampling during pwn-off, the voltage falls outside the range of the ADC. This can be ‘fixed’ with FocMotor->modulation_centered = 0
, but this means pwm-off is limited to ~12% duty cycle.
When sampling during pwm-on time, the ADC’s return 0 if the power supply voltage is less than approximately 20V. The exact threshold is influenced by temperature, my board can reliably detect the temperature fluctuations from forced airflow (read: blowing on the board). This board is designed for 6-cell lipo (~22v), Apparently this means BEMF detection doesn’t work with less than 6 cells. Or more than 6.
Here are some traces (pwm-on, 100rad/s) with various operating conditions.
Cold board with slight under-voltage (21V):
Cold board with in-spec voltage:
Hot board with slight over-voltage:
The board works well on higher voltages, but only when cold.
The good news is that pwm-on sampling works well if an appropriate input voltage is selected, so we might not need pwm-off or expensive signal filtering.