|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
Jaguar Speed Control Only Reaches 50% of Setpoint
We've "successfully" gotten our CAN Jaguars working under speed control.
We've tuned the PID constants to get a system that seems to react nicely, and is stable. The only problem, our system only reaches 50% of the setpoint speed. Anyone else notice this? When we setX() at 60 RPM, getSpeed() shows only 30 RPM is attained. I'm pretty sure I know why this is happening, but I'd like to confirm others are seeing this too. |
|
#2
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
There's two possible causes:
Either you're going as fast as the motor can, or you need to include some Integral into your tuning. If you're providing full power, then the Jaguar LED will be solid green (or solid Red if you're in reverse) |
|
#3
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Can you confirm that a P-Only control loop will only get you half-way to the setpoint?
I have some concerns that the speed control mode on the Jags is missing some important functionality. If the P term doesn't accumulate in velocity control, it will go to 0 as it gets closer to the setpoint. This usually results in a P-only loop appearing stable, but only hitting about 50% of the setpoint. A workaround is to have an I term that will get you all the way to the setpoint. However, I've heard elsewhere that the I term goes to zero as soon as the setpoint is attained, so as to prevent overshoot/wind-up. I can't confirm this 100%, but based on some initial testing I'm led to believe this is the case, as an I-only loop seems to hit the setpoint, then cuts out, only to accelerate up to the setpoint and cut out again. Right now, we're using a P-only loop, setting the setpoint twice as high as we really want it. It's a sloppy workaround, but the best we've come across so far. |
|
#4
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
I've not used CAN on the Jags before, much less the PID control, but is there a configuration that has to be set for number of clicks/rev on the encoders?
|
|
#5
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
I haven't tried an I-only loop. If you're intent on using P only, what happens when you double your P coefficient? Is that the point where it starts to oscillate? |
|
#6
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
I'm in the process of tuning the Speed PID loop on my team's Jaguars, and I'm having a similar issue. Using BDC-COMM to set the PID values, I can increase P until I get to just under my setpoint, but when the loop actually hits the setpoint, the Jags start freaking out and flipping the motor direction very quickly, before faulting. This has made it nigh impossible to get anywhere, as the method I'm using to tune the loop (Wikipedia) needs the loop to hit the setpoint.
At a stable P(no sad gear grinding) the output is much lower than the setpoint, and as P is increased to hit the setpoint, the loop gets more prone to the gear grinding. I've yet to even begin to play with the I value, as I fear it may lead to more instability. |
|
#7
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
By definition, it is impossible to stably hit your set point with a P only control loop. You must have an I term.
A PID loop is calculated with respect to the error, or difference between what you want and what you have. As you approach the setpoint, the error approaches 0. Therefore, the output of the P term approaches 0. Therefore, with a P only loop you will always undershoot your target. You can jack the P gain up to reduce the undershoot, but it will never be zero. If you jack it up too high, noise will dominate and the whole thing will go unstable. Keep the P where you have it (hitting half your goal) and add a bit of I. |
|
#8
|
|||||
|
|||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
Also, for benefit of anyone reading this and not recognizing the distinction, you can stably hit a position set point with a P-only control loop. (Well, actually you need some D, but this doesn't need to be in software - a bit of friction will often do the job nicely.) As to a P-only loop only reaching 50% speed, that makes sense if you don't have a feed-forward. Thought experiment: what happens if you start at the setpoint speed, or equivalently read the current speed, and make it the setpoint? Answer: the difference is zero, so zero voltage is applied to the motor. It slows down. As it slows down, D increases and voltage is again applied, but never enough to get back up to the set point. |
|
#9
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
This thread is about speed control using the Jag firmware PID, which does not have a feedforward term. |
|
#10
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
I can confirm that when you crank the P to actually try and hit the setpoint, bad things happen. It'll get you there, only to slam in reverse, and oscillate around the setpoint... I'll get a chance to add I term to see if it will actually get me to the setpoint in a stable manner. I'm curious if anyone know exactly how the Jaguars deal with Integral wind-up. Whether it reduces the I-term to 0 once the setpoint is hit, or does it cap the accumulated I value to some kind of ceiling? Either way, I think we'll get a chance to find out tomorrow! |
|
#11
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
It's more curious to me that the P loop doesn't always reach the point of instability eventually for any given value of P. In theory, a small P should move more slowly toward the set point but still get there eventually. This does not seem to be the case and that leads me to believe this is not a parallel PID algorithm. If I get anywhere I'll let you all know. Not only do we not know how they handle integral wind up (if they handle it at all), we don't know if they have a deadzone or a D filter. Also I'm not a fan of tuning using the Ziegler Nichols method the way I suspect we're going to get told to use it. I'd not like to end up with marginal tuning. Last edited by techhelpbb : 30-01-2011 at 22:10. |
|
#12
|
||||||
|
||||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
|
|
#13
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
I know that the FIRST firmware operates in trusted mode where as I'm fairly sure the commercial firmware does not. Also I've noted that TI has mentioned to other people using the 'Jaguar' for non-FRC purpose they shouldn't use the FIRST firmware as the FIRST firmware has 'safety features' for FIRST (basically). This leads me to wonder if I'd be wasting my time reverse engineering the source code. Though frankly, in a more commercial sense, I can't imagine being told to reverse engineer the source code for a commercial controller just to get a block diagram of the transfer function or the proper tuning procedure. Is it just me or does this link not work: "Stellaris® RDK-BDC24 Brushed DC Motor Control Module User's Manual" Last edited by techhelpbb : 31-01-2011 at 04:02. |
|
#14
|
|||
|
|||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
Quote:
Note the two different pages, 'mdl' and 'rdk'. MDL is the module version (same exact firmware, but sold as an individual unit) and RDK is the Reference Design Kit that comes with more development tools to develop with Jaguar. That is why the source code is listed on the RDK page and not the MDL page. |
|
#15
|
||||
|
||||
|
Re: Jaguar Speed Control Only Reaches 50% of Setpoint
Quote:
Are you telling me I have to pay you $200+ to get the source code so I can analyze it and determine what should be a readily available piece of information to the people that programed this PID function? ![]() Please tell me that's not what you're telling me. What is the difference between the links you just provided and this: http://www.luminarymicro.com/products/rdk-bdc24.html Because on that previously provided link the RDK CD is available for free download. Last edited by techhelpbb : 31-01-2011 at 11:49. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|