Go to Post I worship whoever cleans the robotics room. - John Gutmann [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 30-01-2011, 10:56
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,125
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 30-01-2011, 13:51
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 30-01-2011, 15:16
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,125
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 30-01-2011, 15:35
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 688
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 30-01-2011, 16:33
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 30-01-2011, 20:54
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 30-01-2011, 21:03
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 02-03-2015, 00:06
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,511
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by EricVanWyk View Post
By definition, it is impossible to stably hit your set point with a P only control loop. You must have an I term.
It is possible to have an accurate feed-forward and achieve this. Not likely, for sure.

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.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #9   Spotlight this post!  
Unread 02-03-2015, 08:46
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,995
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



This thread is about speed control using the Jag firmware PID, which does not have a feedforward term.


Reply With Quote
  #10   Spotlight this post!  
Unread 30-01-2011, 21:41
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,125
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
  #11   Spotlight this post!  
Unread 30-01-2011, 22:04
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,620
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 : 30-01-2011 at 22:10.
Reply With Quote
  #12   Spotlight this post!  
Unread 30-01-2011, 22:21
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,544
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
  #13   Spotlight this post!  
Unread 31-01-2011, 03:58
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,620
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 : 31-01-2011 at 04:02.
Reply With Quote
  #14   Spotlight this post!  
Unread 31-01-2011, 11:25
dyanoshak dyanoshak is offline
Registered User
AKA: David Yanoshak
FRC #2158 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Austin, TX
Posts: 189
dyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond reputedyanoshak has a reputation beyond repute
Re: Jaguar Speed Control Only Reaches 50% of Setpoint

Quote:
Originally Posted by techhelpbb View Post
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).
FIRST firmware versions implement safety features that allow the cRIO to disable the Jaguars when it needs to. All the operation code (PID, H-Bridge, etc.) is the same as the non-FIRST release and is available for download off of www.ti.com/rdk-bdc24.

Quote:
Originally Posted by techhelpbb View Post
Is it just me or does this link not work:
"Stellaris® RDK-BDC24 Brushed DC Motor Control Module User's Manual"
The broken links are happening because we are slowly transitioning to TI web. You can find the getting started guides and manuals on the Jaguar Microsite either at www.luminarymicro.com/jaguar or www.ti.com/jaguar. You can also find the most up-to-date product pages at www.ti.com/mdl-bdc24 and www.ti.com/rdk-bdc24.

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.
Reply With Quote
  #15   Spotlight this post!  
Unread 31-01-2011, 11:42
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,620
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 dyanoshak View Post
FIRST firmware versions implement safety features that allow the cRIO to disable the Jaguars when it needs to. All the operation code (PID, H-Bridge, etc.) is the same as the non-FIRST release and is available for download off of www.ti.com/rdk-bdc24.



The broken links are happening because we are slowly transitioning to TI web. You can find the getting started guides and manuals on the Jaguar Microsite either at www.luminarymicro.com/jaguar or www.ti.com/jaguar. You can also find the most up-to-date product pages at www.ti.com/mdl-bdc24 and www.ti.com/rdk-bdc24.

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.
Just hold on a second here.

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.
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 20:06.

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


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