I’m sorry for my poor English because I’m not a native English speaker.
I am too lazy to adjust PID parameters manually.So I want to find the best PID parameters by some magic algorithms.In the beginning, I want to use the dichotomy, but I realize it’s too inefficient.So is there any algorithms better than dichotomy?
Use the Ziegler-Nichols Method:
In fact, I think I can’t understand this paper properly.
Can you give me an example to help me understand it?
Pseudo code is ok.
Zeigler-Nichols isn’t great for vex systems where you want a drivebase to stop smoothly. Instead it tries to keep the system within a certain threshold of error and has high oscillation.
Maybe 2775V will make a PID tuning guide, but u til then this should suffice:
- Set I and D to 0; turn up the P until the system oscillates but eventually comes to rest.
- Turn up D until the system doesn’t overshoots or overshoots only slightly.
- If this is not accurate enough, then turn the I term up starting at very small values. Don’t rely on the I term or your turns will be slow and silly-looking
I have tried it, but I don’t how much I should add to kp.I used the dichotomy, but it’s too slow
Don’t be lazy then.
There is a reason why kP, kI, and kD are called “gains”. They must be tuned to fit your system.
Assuming that what you describe as “dichotomy” is something similar to binary search, tuning one constant really shouldn’t take that long. Assuming that the optimal kP is some value between 0 and 100, it takes 14 tries to find the optimal value down to 0.01 (log base 2 of 10000 is 13.28).
I think the reason for the long adjustment time is that the precision of my parameters is set too high.I will make it lower.
And ‘lazy’ is just a kidding.But I have lots of jobs to do.So I must pay more time to something else.Like doing my homework or help the machinist build the machine
Mark out half an hour of your time, and use it to tune the PID. It will not take very long.
Word of advice: don’t say this in any competitive anything. Because it gives off the vibe that you just don’t want to do the work. Which I mean I get, but like it’s necessary to be competitive.
I know some pretty simple ways to do it, but I’m too lazy to tell you.
You’re asking for a PhD thesis in a quick sound bite. The answers above are good. The Ziegler Nichols thing was described to me “caveman loop tuning” Use only P to get your device to be zippy. It will probably oscillate. Real control systems engineers will pull out poles and zeros and actually calculate the coefficients… then they’ll test because their model isn’t perfect. Rinse and repeat. The next thing you got was based on experience – they observed that a drive base on foam tile is pretty well damped. Thus you apply P until you get some overshoot and then you use D to keep it mellow. If you found that you were failing to reach your end point, I could be used to fix that. Experience will teach you how your drive base (and the mass of your robot) cause issues that might be fixed by your control system.
Here’s the thing. I’ve run into Vex competitors that could lay out a good bit of a EE Masters level class on control systems and writing practical PID code. (The next bit isn’t for them.) Almost any engineering design is a response to a problem. If you don’t start with “what problem am I solving” and then work to understand how your solution fixes that problem, you tend to learn almost zero. You’ve heard “most top teams write custom PID”, and so it is really attractive to try that. Find the code on the internet. It only kind of works, so you come to a forum and ask “how do I tune the darned thing”. This could work out, but you’re skipping a bunch of really useful ways to learn things. You implemented PID in your drive code. Why? What problem were you solving? How did your current solution fail to solve that problem? Learn stuff about this tool you’ve selected, how problems occur, and how to debug that problem.
PID is a math tool. In modern control problems, you a lot of people who kind of heard of stuff saying “let’s put a PID there” and with a little fiddling, sometimes good stuff happens. As someone who has had to come up solutions when good stuff didn’t happen, I’m always a little sad to see the “we did it because it sounded cool” solutions instead of “we understood our problem, and this seemed like a good solution”. Let’s say we were in a judging session. Why did you pick this solution? What alternatives did you consider?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.