Im trying to make a haptic dial control based on simplefoc and a stepper motor.
Currently I am able to implement feelable clicks at certain degree intervals, I really like simplefoc for this
My main problem that is remaining is that you can feel clicks every 1.8 degree (for every step of the motor) Is there a way to get rid of this with the foc algorithm and make the rotation super smooth?
I had steppers on hand and like their torque.
I tried bldc a while ago and didn’t get the same performance as I’m getting with the stepper now. Also remember bldc having the same feelable clicks issue as the stepper.
I think ODrive has cogging compensation and is open source, so you could check how they did it. My guess would be to slowly rotate the motor and each time the encoder position changes, record the direction of the current vector being fed to the coils. Then during normal operation, plug your desired rotor angle into that lookup table to get the current vector that will produce it.
You may also need to do torque ripple compensation though. i.e. increase current when farther from full step positions, and decrease current when close to full steps. I’m not sure how to go about generating the lookup table for that. And you’d want to do it first, and then generate the current vector table with torque ripple compensation applied incase the different current magnitude causes the rotor to pull one way or the other from the full step position.
ATmega328 doesn’t have enough RAM for such lookup tables, so you’ll need a better microprocessor.