Quote:
Originally Posted by Hypnotoad
I was hoping to get a higher sampling rate so that I could arc the robot's path in autonomous if i need to.
|
If you are a high school student and considering trajectory-following control, good work!
Quote:
Originally Posted by Hypnotoad
The way things are right now, PID does not work for moving setpoints.
|
This statement is vague and hard to assist without more information. How often are you changing the setpoint? My assumption is too often. A rule of thumb in control is 4-10X faster system convergence than control signal changes. Since you are limited to a ~200 Hz update rate, your setpoint should be updated only a few times a second.
To help you understand this more, I refer to the top figure on the
PID Controller page. In a stable PID Controller design, the coefficients Kp, Ki, Kd are chosen ("tuned") for the system dynamics. In general most people just guess and check until something works.
When looking at that figure, what you are doing is changing r(t). This introduces new dynamics into the e(t) signal. Thus, the given set of Kp, Ki, Kd parameters may not lead to a stable controller (because they worked with the original dynamics, and not the combination of original and new). I think this is what you are experiencing based on the "PID does not work for moving setpoints" comment. In general, PID controllers do allow for changing set points (this is why that diagram shows r(t) as a function of time and not just a constant-value r). One way is to change the three coefficients, but in your use here this isn't desirable (you can explore this more in college).
Another approach is to change the nature of the dynamics added, by which I mean to change r(t) less often. Remember the first goal of a control system is stability, not time-optimal control. Thus, introducing changes to r(t) at a slower rate should help you maintain stability and allow for trajectory following.
If you still have more stability issues, then you can also try to slow down the motor speeds. I know this is less desirable to you than faster sampling, but as you prove to yourself you can do it at slower speeds, you might then try for to increase the speed later.