![]() |
Re: PID Loop Question
Quote:
|
Re: PID Loop Question
The topic of doing speed control via PID has come up several times in recent weeks. I have referred people to this thread: http://www.chiefdelphi.com/forums/sh...&highlight=PID
To quote myself: Quote:
In simpler terms, position PID uses motor PWM (~= speed, the time derivative of position) as the quantity being output. Thus, velocity PID uses motor acceleration (the time derivative, or DELTA in motor PWM) as the quantity being output. |
Re: PID Loop Question
So how would one go about tuning a speed-based PID? I mean, the thing is on the ground and moving, and if you have multiple PID loops going, each one will affect the others, right? It just seems like it would be a huge pain to tune. Someone have a method they wouldn't mind sharing?
|
Re: PID Loop Question
Quote:
Now, to specifically answer your question I'd probably do something like the following. Note that I haven't done this specifically for multiple loops so take it all with a grain of salt. I'm sure someone here has more experience in this regards as most of my experience with successful loops has come with a fully modeled system. Most importantly you are going to want telemetry data on the system's response as you are tuning. Without this you'll be taking a stab in the dark saying "I think that was better..". 1. Assuming multiple control loops, tune them using the same constants throughout. Unless the system each controller is controlling is vastly different, this should get you pretty close. 2. Once you've gotten pretty close with each controller, analyze your telemetry data and tune from that making only ONE change at a time and proceeding to test and analyze. Rinse and repeat as needed. For example, lets say you have two control loops, one for the speed of the left drive wheels and one for the right drive wheels. You've tuned them using the same constants, however your telemetry (and probably physical observations) indicate that your right drive wheels speed up slightly slower than the left leading to the robot veering to the left before the right wheels catch up and straighten out. In this situation I would probably increase Kp slightly to improve the rise time. Again, this is all in theory and assumes an understanding of manually tuning of a PID controller. If I remember correctly back in 2005 my team used a control loops on the speed of our drive wheels. We only used one controller for both however and achieved acceptable results. The robot was fairly equally balanced though so your mileage may vary. I'd definitely suggest trying to tune them the same first and then if that doesn't work, go for individual tuning of the loops. |
Re: PID Loop Question
How I tuned the gain of our drivetrain, on a practice bot (to get the code right):
1. Run the robot in each direction to determine the maximum forward/reverse speed of the slower side (since that limits the forward/reverse speed) 2. Setup LabVIEW to graph the Sensor, Setpoint, Delta, and Output (basically just open the VI that shows the graph, and open the constants VI as well) 3. Set the gain to a known in-range number (in my case, that was 0.01) 4. Jack up the gain until the graphs show a reasonable rise time and minimum overshoot. 5. Decide if I need to write a gain scheduler (and I decided to, so I did write a linear gain scheduler) 6. Tune the gains again (go back to 4) for each end of the spectrum, and check that the performance is good in all zones 7. See how the extreme and precise response is, and decide what to do about those. I found that with an I only, the robot backs up slightly when stopping (integral windup), so I wrote some code to handle sign mismatches between setpoint and sensor differently. 8. Drive it again and tune, repeat until perfect. On the chassis I tested (34 lbs chassis w/ everything but 1 front bumper and the battery, + 50lbs in weights) with 6" kit wheels and a 1-speed, I was fine with 1 set of constants. I assume I will need to tune High and Low separately, but that comes when the robot is done. |
| All times are GMT -5. The time now is 23:44. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi