OCCRA
Go to Post I think AndyMark just sold out of rabbits feet. - BRAVESaj25bd8 [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 01-30-2011, 09:56 AM
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,133
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
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.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #2   Spotlight this post!  
Unread 01-30-2011, 12:51 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
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)
__________________
-- Marshal Horn
Reply With Quote
  #3   Spotlight this post!  
Unread 01-30-2011, 02:16 PM
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,133
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
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.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #4   Spotlight this post!  
Unread 01-30-2011, 02:35 PM
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 692
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
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?
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #5   Spotlight this post!  
Unread 01-30-2011, 03:33 PM
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Mr. Lim View Post
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.
Yes, without an I coefficient, you can't expect to ever reach the setpoint; you get partway there, and then don't go any further.

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?
__________________
-- Marshal Horn
Reply With Quote
  #6   Spotlight this post!  
Unread 01-30-2011, 07:54 PM
wmarshall wmarshall is offline
Registered User
FRC #0011
 
Join Date: Jan 2011
Location: New Jersey
Posts: 8
wmarshall will become famous soon enough
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 01-30-2011, 08:03 PM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-30-2011, 08:41 PM
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,133
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by wmarshall View Post
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.
My workaround has been to tune the P-only loop to react as best as can be to exactly half the setpoint.

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!
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #9   Spotlight this post!  
Unread 01-30-2011, 09:04 PM
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,809
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Mr. Lim View Post
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?
I'm a mentor for wmarshall's team and I have a request into TI for actual documentation on the transfer function, LaPlace or block diagram for the FIRST firmware Jaguar PID functions.

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 : 01-30-2011 at 09:10 PM.
Reply With Quote
  #10   Spotlight this post!  
Unread 01-30-2011, 09:21 PM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,977
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by techhelpbb View Post
I'm a mentor for wmarshall's team and I have a request into TI for actual documentation on the transfer function, LaPlace or block diagram for the FIRST firmware Jaguar PID functions.

...

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.
The jaguar source code is available for download. http://www.luminarymicro.com/products/rdk-bdc24.html
Reply With Quote
  #11   Spotlight this post!  
Unread 01-30-2011, 09:44 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 9,126
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Mr. Lim View Post
Whether it reduces the I-term to 0 once the setpoint is hit
I've never heard of such a thing. It would seem to defeat the whole purpose of the integral controller.


Reply With Quote
  #12   Spotlight this post!  
Unread 01-31-2011, 02:58 AM
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,809
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Joe Ross View Post
The jaguar source code is available for download. http://www.luminarymicro.com/products/rdk-bdc24.html
It is my understanding, though I could be wrong, that the FIRST firmware differs from the commercial firmware.

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 : 01-31-2011 at 03:02 AM.
Reply With Quote
  #13   Spotlight this post!  
Unread 01-31-2011, 03:16 AM
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,809
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Ether View Post
I've never heard of such a thing. It would seem to defeat the whole purpose of the integral controller.

I suspect what they are hoping to communicate would be to eliminate noise induced run away. If you get noise that interferes with your return function then over a duration then...for example...you might end up 'winding up' the I in such a way that even though you've limited it...it's still way too high and because of it getting to high over and over from disturbance and noise it may never come down and the result might be perceived as erratic movement.

If you can 'reset' the I (not necessarily make the I constant 0), and do it when the I is perceived to have 'wound up' too often, then you can effectively prevent yourself from having to reset the entire PID loop to eliminate what appears to be erratic function.

As an example...
http://community.mybb.com/thread-78886.html
Reply With Quote
  #14   Spotlight this post!  
Unread 01-31-2011, 09:49 AM
Mr. Lim Mr. Lim is offline
Registered User
AKA: Mr. Lim
no team
Team Role: Leadership
 
Join Date: Jan 2004
Rookie Year: 1998
Location: Toronto, Ontario
Posts: 1,133
Mr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond reputeMr. Lim has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Ether View Post
I've never heard of such a thing. It would seem to defeat the whole purpose of the integral controller.

The crux of this issue is that the PID implementation seems to be more suited to position control, rather than speed control.

Killing the I term when the setpoint has been reached is commonly employed in position control - particularly in systems where there is a lot of resistance as you slowly reach your desired position. When you are finally reach the setpoint, your P is already 0, and it's in your best interests to 0 the I term to prevent overshoot. The I has already done its job to get to the setpoint, to overcome any resistance encountered on the way there.

Regardless, I can't 100% confirm what the I term behaviour is until later this afternoon, but I'm hoping the I-term is capped, rather than 0'ed.
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Reply With Quote
  #15   Spotlight this post!  
Unread 01-31-2011, 10:15 AM
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 1,809
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by Ether View Post
I've never heard of such a thing. It would seem
to defeat the whole purpose of the integral controller.
(I posted this last night, but it claimed it needed approval so I'll try again).

I suspect what they are hoping to communicate would be to eliminate
noise induced run away. If you get noise that interferes with your
return function then over a duration then...for example...you might
end up 'winding up' the I in such a way that even though you've
limited it...it's still way too high and because of it getting too high
over and over from disturbance and noise it may never come down and
the result might be perceived as erratic movement.

If you can 'reset' the I (not necessarily make the I constant 0), and
do it when the I is perceived to have 'wound up' too often, then you
can effectively prevent yourself from having to reset the entire PID
loop to eliminate what appears to be erratic function.

As an example...
http://community.mybb.com/thread-78886.html

When the goal is to achieve a set point of a fixed speed, then I can see how this helps when the prime concern is the change in set point.

As noted above, when the prime concern is achieving the set point position it makes sense when the loading is prone to bind at the last second. Though, the kind of binding matters. If for example the mechanism is prone to binding and then runaway (the motors are overloaded and then break free) then you're probably too close to the limits of the ideal, serial or parallel algorithms for the stable D to be achieved anyway in which case now you have a special case.

Last edited by techhelpbb : 01-31-2011 at 10:24 AM.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:24 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi