|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
PIDs out of control
After getting our drive system running, we've run into some trouble with our PIDs.
We have four independent steering modules each with a potentiometer, all run by PIDs. We've gotten them successfully working as a crab drive/ being able to rotate. However, one or more motors will occasionally rotate, spinning out of control without any input from a driver. I'm not sure what would cause this issue if, for the majority of the time, the code does what it's supposed to just fine. I'm at a loss as to what would cause this issue. Any ideas? |
|
#2
|
||||
|
||||
|
Re: PIDs out of control
Quote:
|
|
#3
|
|||
|
|||
|
Re: PIDs out of control
Quote:
To Ether's point, I assume you are using one of the newer "absolute encoder" http://www.andymark.com/product-p/am-2899.htm for the feedback? If not, you should consider something similar that will not be damaged if you over rotate. Again, this device will have a "discontinuity" at the 360->0 point that needs special consideration. |
|
#4
|
||||
|
||||
|
Re: PIDs out of control
Quote:
|
|
#5
|
|||
|
|||
|
Re: PIDs out of control
(OP on a fellow programmers computer here)
We are using 5-turn potentiometers and they are only intended to rotate 180 degrees maximum. We try to make sure that the pots are set to rotate near the middle of each ones range so as to avoid over rotating them if they go a little bit beyond the desired setpoint. We are using the PotentiometerGetNormalized.vi to get our values, which return as a percentage of the total voltage, we have found. So, we are trying to return 3-4 decimal accuracy on each potentiometer. So, I'm not sure if our program trying to reach this accuracy is hitting the pots' "blind spot" or not, because I'm not absolutely sure what that means. Last edited by awallace3160 : 15-02-2015 at 22:37. |
|
#6
|
||||
|
||||
|
Re: PIDs out of control
Quote:
1) The wheel is currently at 179 degrees and it is being commanded to go to -179 degrees. The controller will rotate the wheel 358 degrees counterclockwise to get to the commanded angle, because the controller does not want to exceed 180 degrees. or 2) The wheel is currently at 179 degrees and it is being commanded to go to -179 degrees. The controller will rotate the wheel 2 degrees clockwise to get to the commanded angle, because that is less than 180 degrees movement. Which of the above descriptions is what you intended? (or something else?) Quote:
Quote:
Quote:
|
|
#7
|
|||
|
|||
|
Re: PIDs out of control
From what we've gathered, the PotentiometerGetNormalized.vi gets the voltage reading from the potentiometer and returns it as some sort of proportion of the total possible voltage. It seems that 90 degrees ~ .1 change in the returned value.
So, if we were to set our "midpoint" at the middle of the pots rotational range, we would set our setpoint to .50. Our goal then is to rotate at maximum 90 degrees in either direction from this point. Theoretically, this should change the value by .1, but it has a small variation, so we have it set to where we manually control the "maximum" and "minimum" values of the pot. None of these values we have set come up near the extreme values of rotation, which would either be "0" or "1". We haven't thrown in any limitations to rotations in the program other than how far we can change the setpoint, but I will soon implement something. |
|
#8
|
||||
|
||||
|
Re: PIDs out of control
Quote:
|
|
#9
|
|||
|
|||
|
Re: PIDs out of control
Well, regardless of it's particular function, do you have any other ideas as to why this problem is occuring?
|
|
#10
|
||||
|
||||
|
Re: PIDs out of control
Quote:
|
|
#11
|
|||||
|
|||||
|
Re: PIDs out of control
And to help figure out if it's hardware, it would help if we understood just what hardware you're using, how it's connected, and how it's supposed to work. Including links to spec sheets would also be helpful!
|
|
#12
|
|||
|
|||
|
However, one or more motors will occasionally rotate, spinning out of control without any input from a driver. I'm not sure what would cause this issue if, for the majority of the time, the code does what it's supposed to just fine.
you may want to check your PID gain values, a method you may want to use is the Ziegler-Nichols Method https://controls.engin.umich.edu/wik...uningClassical |
|
#13
|
||||||
|
||||||
|
Re: PIDs out of control
We noticed this past weekend that every so often, one of our drive motors will just start spinning at a high speed, even though we had a 0 hard-wired into the Set Motor Output VI. We still haven't figured out the cause yet. The speed controller (a Talon from last year) was green, which signifies that it thinks it is getting a valid speed command. We didn't find any short circuits of any type. We just stopped the code and restarted it, and the problem went away. This makes us a bit nervous. I'm wondering if it could be related.
|
|
#14
|
|||
|
|||
|
Re: PIDs out of control
Here are the PID Gains:
![]() Now that I am taking another look, they may be a bit high. I was uneasy about how high they were but when they were first tuned it seemed to work just fine, so I let it slide. |
|
#15
|
|||||
|
|||||
|
Re: PIDs out of control
Your P value might be a little high, but that will definitely depend on the nature of your system. Here's the implementation math, for reference:
![]() Furthermore, you should read the help doc for the PID VI - it actually uses time constants, so Ti and Td might not behave as you would intuitively belive. ![]() ![]() Images from this page Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|