New board and motor bring-up into FOC

I am doing bring-up on a new board and motor which is running velocity openloop but not FOC.
Is there an new equipment bringup guide?

For a short while I had it running velocity with voltage based torque control.
Using FOC current results in the motor being locked into one position. Raising the drive current doesn’t help.

Startup reporting shows current sensor and hall sensor alignment success.
Current sense detect result = 3 : Inverted gains.
Hall sensor electrical offset = 1.05
Motor PP check fails.
Using 12pole/6pairs with the hall sensor gives correct rotation rate.
Reported PP can be 7.5 → 12 but never 6.

Hall position sensing doesn’t feel particularly smooth. With smooth rotation it jumps and pauses.
Hall sensors are mounted radially on the outside of an outrunner motor.
SimpleFOC config tool shows a sawtooth ramp of angle when driving openloop velocity.
Ia there a better way to verify hall sensors are correct?

Current measurement is low side. It seems to be behaving properly and calibration offset is ok.

Board is a home brew something with ESP32. More about that later.

EDIT: The hall sensors have too much hysteresis resulting in lots of backlash in the sensed position. This will not FOC

Hall sensors arranged on adapter boards on the outside of a small outrunner.

hackaday post describing arrangement of hall sensors
This link is not my project but is using a motor with the same configuration.

Hall sensor at end of mounting board

Have you seen 40 cent magnetic angle sensing technique?

Your project might be a great candidate for this sensing technique. There is only so much precision you can get with digital hall sensors.

1 Like

A magnetic encoder but for electrical angle instead of rotational angle.
My Hall V and W channels happen to be on ADC channels. This would be easy to test.

I don’t know if my problems are due to hall sensors, bad configuration of something or wrong expectations.


Is low-side current sense FOC a working feature yet?


1 Like

Problem identified by doing a simple debug of the hall sensor states. The hall sensors have terrible hysteresis resulting in something like backlash. This is not going to work.

Yes, for the ESP32.

For smooth behavior at lower speeds you want a different sensing technique.

@David_Gonzalez What is considered too low speed for hall sensors?
My target is 300rpm, maybe down to 100rpm for a smoother start/stop.

I think 100 rpm should still be smooth. I would suggest you try voltage mode before trying velocity mode to rule out the control loops and make sure everything is working as intended.

Thanks David.
Thought of a cheap and simple hack to boost the magnetic field towards external hall sensors. If this works I can try the linear hall sensor idea.