Quote:
Originally Posted by Jared
3). Integral control like 2), but with a different u
u = -(K*(x - x_d) + K_i*x_i);
where x_d is a vector of desired states, not including integrator, which gives me this:
http://i.imgur.com/tf0TdcT.png
For now, I've been able to get away without an observer and just do a bit of filtering on my velocity. It probably helps that I'm sampling at several kHz.
|
Having a fast, ideal system helps a lot.
For a controller without integral or of type 2) or 3), you need a feed-forwards term . You can see it in your third plot. There is a small steady state error (though much smaller than your first plot). We can show this with the following math.
Suppose we are moving at some velocity Vel. From the motor equations, we know that under 0 torque, this takes volts =Vel / Kv to go that fast.
Vel / Kv = K (R - X)
If we are tracking perfectly, R - X = 0. The only velocity this holds for is 0 velocity. Therefore, we always need feed-forwards with a DeltaU controller or a controller which estimates the disturbance voltage. A controller of type 1) won't have this problem, but will have a time constant when the reference trajectory accelerates/decelerates.
Take a look at our intake code this year for an example of a controller of type 3). //y2016/control_loops/python/intake.py You can play with it yourself if you want.