![]() |
Re: PID vs Normal loops
Quote:
|
Re: PID vs Normal loops
A cool idea would be to "learn" the (approximately) optimum PID constants over time...
You can simulate your robot arm pretty easily using a set of equations characterizing the mass distribution, and motor torques. Next create several test goal and end states within reachable bounds of the system (a state would be angle + angular momentum for each arm segment) Do a search through the set of all PID combinations to find the best one.To test optimality, simply use the PID constants and run them on your simulation, use a metric for how good the performance is (power usage, time to reach goal etc..) . It shouldn't take more than a few minutes on a modern computer. (of course you don't want to try every possible combination since it's infinte, but discretize the selection based on how large or small the term is probably going to end up being) If you need help programming this feel free to post, it isn't half as complicated as it seems. In fact maybe I will make something that does this over winter break lol. |
Re: PID vs Normal loops
Or you could just use a rough-tuning method that's been used for decades: Ziegler-Nichols
Or, you could do something kind of like Salik said: If you have a decent physical sense about you, or just happen to have a physics book, a four-function calculator (or pad and paper) and rougly figure out what kind of numbers you need for the constants. For instance: set your P term based on how fast you want something to move for a maximum speed, with the biggest motion you might give it... aka if you are doing just a positional servo (for an arm or something) the biggest move you make you'll want to output the maximum control output for the motor... so you'd multiply (or divide) by whatever number you need to get your error to around 127 (or whatever max plant value you might have). D terms can be done similarly, but I terms are usually more of a gut feel if your doing "Tune by Feel" though they can be calculated relatively easily as well if you factor in your cycle times and characterists of your motor and the load it's moving. See previous post for more on augmentations of PID. -q |
Re: PID vs Normal loops
Q,
The idea of using the preferred response to tune a PID is interesting. Once I'm done getting other components of our coprocessor up and running I will probably try that as a tuning method and see how well it works. Your idea detailed last page is also very interesting. I think it's important to decide what your goals are - lowest time to reach the target or reaching it smmothly. I don't know yet which will seem more important for this year's challenge, but until now I am tempted to say that the time it takes to go from position a to position b might be more important than the smoothness, particularly for a servo or autonomous position control. However, I am wondering about human controlled velocity PID - would you rather have a slight overshoot as you attempt to reach the target velocity, or would you prefer to reach it slower but more smoothly, perhaps taking a bit longer to get there. The idea of having a fully mathematical computation of to handle constant accceleration and constant velocity is interesting. Again, I might mess around with that a bit before or during the build season, depending on how much time I end up having. If I do, I'll be sure to let you know what results I get. I'm also currently reading about Laplace transforms and State-Space controls (amongst other control systems) to see maybe there's a reasonably easy alternative to PID. |
Re: PID vs Normal loops
Quote:
On the human control side... has anyone actually implemented this with success in competition? I've found that drivers always say it 'feels wierd'... so usualy what ends up happening is I write code so that if the robot has neutral control input for a set period of time, a servo kicks in to hold it in that spot. Has anyone successfully implemented this? Wow I can't wait to see what the challenge is... I really hope it's more exciting that the game last year... -q |
Re: PID vs Normal loops
Our current drive train design is a six-wheel with a lowered middle wheel, so I hope smoothness of acceleration/deceleration isn't a factor, as I'd like to tune the position PID to get to the postition as fast as possible, and the velocity one similarly to hit the maximal velocity as fast as possible. Assuming I can tune both correctly, I'll probably use the position PID to control the velocity one in autonomous - the position loop will send a value to the velocity loop which will compute the correct PID value. Hopefully this will work, but I first have to get our coprocessor working and then the encoders. If it does work though, it should work pretty well.
That's a very good question. We've never tried to implement velocity control, so I have no idea how comfortable our driver will be with it. I guess that if it is tuned well and he is not comfortable with it, I will just use ut for autonomous, and maybe use it situationally. To hold a position possibly like you suggest. Any other interesting ideas? I can't wait either. I can't wait to see the challenge. Hopefully they also made autonomous as big as it deserves :) |
| All times are GMT -5. The time now is 19:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi