I am building a 3phase BLDC motor controller based on an STM32 MCU, a high resolution 26 bit optical encoder and a DRV8301 motor driver from TI.
This is a for a high precision rotary stage for an optical project.
My question is about the strategy to control the motor. I have tried multiple different techniques but at the end of the day I am not able to tune the system for the various operating modes I will need when using the rotary stage.
The modes I will be needing are: position hold, very slow speed control (from 100 to 1000 counts per second) to moderate speeds (a few degrees per seconds), up to high speed (relative to my application) or about 60 degrees per second.
In other words we are talking a wide range of speeds from 100 or counts per second to about 10 million counts per second.
Position data is polled at 8KHz and the noise is roughly 2 counts RMS which is pretty good.
I initially tried a P-PI cascade controller (a position controller feeding a velocity controller). it worked, but this technique didn't yield the best tracking accuracy mainly because the velocity measurements are derived from the position and the delta position between two periods is roughly equivalent to noise. Boosting the filtering helped but not enough.
I tried variations of this cascade controller, by adding I and D terms. Which didn't really help.
I then tried to do a simple position controller (PI, and PID) which gave me the best results in terms of tracking accuracy. The biggest challenge with this one is that there is realistically no way of tuning for one specific speed without significantly damaging the other speeds I am interested in.
Of course I could retune or create various presets, or even try to correlate PID gains to the velocity I want to track at.
My question is this: what is the best approach to this problem? Is there a better strategy than any of the ones I mentioned?
Cheers SM