|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
We are trying to set up PID
This is the first year where we are
actually trying to do some of the more "complex" stuff. We are having a lot of trouble with PID loops, attached are some pictures of our teleop and begin code. ![]() ![]() ![]() |
|
#2
|
||||
|
||||
|
Re: We are trying to set up PID
P is proportional gain. That gain pushes back based on how far off you are. I is integral gain. It pushes back based on how long you've been how far away. Finally, D is derivative gain. It pushes back based on how fast you're going away.
In LabVIEW, it works a little weird, as you'll notice you have proportional gain, integral "time" and derivative "time." The way this works is that when you increase the P gain, all three gains are actually being increased, and the "time" values are multiplied by the P values to get their respective gain values (in a very weird way, there are extra multipliers in there, so don't go trying to figure out what your gains are, just roll with it) You have to tune PID loops no matter what, it takes time, it's slightly dangerous (integral gain can run away from you fast, so have your hand on the E-stop), and honestly it's far from easy. Good luck! |
|
#3
|
|||
|
|||
|
Re: We are trying to set up PID
I am also part of this team. We understand the theory of the PID loop, but are having a hard time understanding if our application is correct. We have a PID loop to rotate the robot with a gyro to a set point and the PID works fine it that situation. At least with a tolerance of about 5 degrees. But getting the encoders to rotate at a constant speed is the issue. We are wondering, if there is an issue with how we are getting our rate. If our rate is outputting a value that makes sense. Why our PID loop does not reach our setpoint.
|
|
#4
|
||||
|
||||
|
Re: We are trying to set up PID
If your robot doesn't complete the movement, try raising your integral gain.
|
|
#5
|
|||
|
|||
|
Re: We are trying to set up PID
Quote:
Leave the P value at a value thay does produce erractic behavior, such as the value above, and increasing the I anywhere from 1000 to 1 will also produce erractic rate changes and sometimes stop producing a motor output. |
|
#6
|
||||
|
||||
|
Re: We are trying to set up PID
Quote:
Also, if the motor overshoots an oscillates, increase derivative gain. |
|
#7
|
||||
|
||||
|
Re: We are trying to set up PID
As stated, the Labview PIDs are weird and, for us, have always defied tuning in a way that we understand.
Though you may not wish such a change, I have attached our PID VI. It has inputs consistent with common PID control practice (i.e. not coupled). It is a re-entrant VI so you can use it multiple times, and there are comment statements in it to explain its use, but feel free to PM me. |
|
#8
|
||||
|
||||
|
Re: We are trying to set up PID
We too are using PID this year and are having some luck with it for a change.
I've attached a couple of images of some helper VIs we created. The drive VI uses the NI LabView PID. We didn't have much luck controlling turns with it so we created our own PID using Proportional only. Seems to work pretty well too. For driving we only use the encoders to tell us when to stop, the gyro works with PID to keep us going straight. Last edited by BitTwiddler : 05-02-2017 at 18:44. Reason: More info. |
|
#9
|
|||||
|
|||||
|
Re: We are trying to set up PID
Looks nice.
Do you realize that the In Range and Coerce function has it's upper limit disabled (by default)? That's why it's a clear box, rather than a filled box like the lower limit has. Right-click on the function and choose Include upper limit Last edited by Mark McLeod : 05-02-2017 at 19:03. |
|
#10
|
||||
|
||||
|
Re: We are trying to set up PID
Wow! As many times as I've used it I never noticed that. Something new every day.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|