1
$\begingroup$

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

$\endgroup$
3
  • 1
    $\begingroup$ D you have a predefined trajectory to track? Did you try adding a feed forward term to the cascaded controller based on the velocity of the trajectory? Do you use a torque controller(cascaded pos-vel-torque controllers)? If this is part of an optical system I assume that you can very well approximate the forces in your system so you could also add a feed forward signal to your torque controller, based on a model of your system. $\endgroup$
    – 50k4
    Sep 24, 2020 at 6:49
  • $\begingroup$ @50k4 - I want to add to your statement, but I think you've got the answer. I don't want to post answers in the comments, but I also don't want to post an answer and steal your credit. Could you please post this as an answer? $\endgroup$
    – Chuck
    Sep 24, 2020 at 14:19
  • $\begingroup$ edit away... thanks! $\endgroup$
    – 50k4
    Sep 24, 2020 at 20:43

2 Answers 2

2
$\begingroup$

Do you have a predefined trajectory to track? Did you try adding a feed forward term to the cascaded controller based on the velocity of the trajectory? Do you use a torque controller(cascaded pos-vel-torque controllers)? If this is part of an optical system I assume that you can very well approximate the forces in your system so you could also add a feed forward signal to your torque controller, based on a model of your system

$\endgroup$
0
$\begingroup$

gain scheduling

It sounds like a simple PI controller works well for this motor at any particular narrow range of speeds, but tuning it for one speed ruins the performance for other speeds. This is common when the process you are trying to control is strongly nonlinear.

This motor sounds like a good candidate for "gain scheduling". (a) (b) (c) (d)

One approach to gain scheduling: A single PI or PID controller, where the PID values are come from a lookup table, with 2 or more values for "P gain" or "D gain" or "I gain" or some combination, switching from one entry to another depending on the current speed. This is equivalent to the other approach to gain scheduling: 2 or more PI controllers or PID controllers, each one with PID values tuned for a different range of speeds, switching from one to another depending on the current speed. (I've seen one system that at high speeds counted "pulses per millisecond"; but at low speeds anywhere close to "1 pulse per millisecond" it switched to different hardware that measured "time between pulses").

This leads to the question of how exactly to switch from one range to another range. The various strategies for doing that are known as "bumpless transfer". (d) (e) (Usually "bumpless transfer" applies to switching from manual control to PID control, but the same techniques apply to switching from a main line to a bypass line (f) and gain scheduling.).

non-linear PID

With standard linear PID, there is inevitably a tradeoff: when the current speed is far away from the desired speed, it would be nice to have a fast response (fast slew rate), i.e., high P gain, but that generally leads to large overshoots. When the current speed is close to the desired speed, it would be nice to have little or no overshoot, i.e., low P gain, but that generally leads to slow response.

A variety of approaches modify the error value with some non-linear function before feeding the modified error value into the P term (or all 3 of the P,I,and D terms) of a standard PID controller.

Many people do this in hopes of getting both fast response (high gain) when the error is large, and little or no overshoot (low gain) when the error is small.

Other people add nonlinear functions to the raw sensor values (or the error value or both) to try to "cancel out" non-linearities of a strongly nonlinear system, hoping that that the result is close enough to linear that a standard PID will work great. ( See "How to control a nonlinear system with a PID controller" ).

Either way, non-linear PID requires tuning the parameters of a non-linear function. (g) (j) (h) (i) (k) (l) (m)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.