Go to Post Know what really grinds my gears? Metal Shavings. - Briansmithtown [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-04-2012, 21:41
lorem3k's Avatar
lorem3k lorem3k is offline
1 + 1 = 0 (in Z/2Z)
AKA: Andy D.
FRC #1482 (Bishop Grandin Ghosts)
Team Role: Alumni
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Calgary, AB
Posts: 165
lorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to behold
PID Control for Jaguars with PWM?

If you wish to use PID with US Digital encoders to control the speed of Jaguars for driving, do you need to use the CAN bus on the Jaguars, or will it work with PWM?
__________________
Boo! Bishop Grandin High School / GM Canada / Tenaris
2013 Western Canada - Quarterfinalists (thanks 288/4719) / 2012 GTR West - Quarterfinalists (thanks 188/1075) / 2011 GTR East - Regional Winners (thanks 1114/1503)
  #2   Spotlight this post!  
Unread 14-04-2012, 22:00
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,094
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: PID Control for Jaguars with PWM?

Quote:
Originally Posted by lorem3k View Post
If you wish to use PID with US Digital encoders to control the speed of Jaguars for driving, do you need to use the CAN bus on the Jaguars, or will it work with PWM?
If you want to use the Jag's built-in PID, you must use CAN.

If you use PWM, you can do the PID in the cRIO, either home-brew or WPILib.


  #3   Spotlight this post!  
Unread 14-04-2012, 22:31
lorem3k's Avatar
lorem3k lorem3k is offline
1 + 1 = 0 (in Z/2Z)
AKA: Andy D.
FRC #1482 (Bishop Grandin Ghosts)
Team Role: Alumni
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Calgary, AB
Posts: 165
lorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to behold
Re: PID Control for Jaguars with PWM?

Thanks. Is there any disadvantage to using the one on the cRIO? I know that CAN has its advantages, but our team is much more familiar with the PWM interface, and we already have all the resources required for it (namely, a whole boatload of cables).

Would the code for using the PID controller differ at all between the cRIO controller and the CAN Jag controller? Which one is handled by the WPILib/WPILibJ PIDController library?
__________________
Boo! Bishop Grandin High School / GM Canada / Tenaris
2013 Western Canada - Quarterfinalists (thanks 288/4719) / 2012 GTR West - Quarterfinalists (thanks 188/1075) / 2011 GTR East - Regional Winners (thanks 1114/1503)
  #4   Spotlight this post!  
Unread 14-04-2012, 22:35
chris1592's Avatar
chris1592 chris1592 is offline
Chris
no team
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2007
Location: Thailand
Posts: 48
chris1592 is a jewel in the roughchris1592 is a jewel in the roughchris1592 is a jewel in the rough
Re: PID Control for Jaguars with PWM?

Quote:
Originally Posted by lorem3k View Post
Thanks. Is there any disadvantage to using the one on the cRIO? I know that CAN has its advantages, but our team is much more familiar with the PWM interface, and we already have all the resources required for it (namely, a whole boatload of cables).

Would the code for using the PID controller differ at all between the cRIO controller and the CAN Jag controller? Which one is handled by the WPILib/WPILibJ PIDController library?
Our team used CAN with our encoder plugged directly into the Jag at our first competition and were disappointed with the results. Tuning the PID values was a lot easier when we ran PWM directly into the cRio.
  #5   Spotlight this post!  
Unread 14-04-2012, 22:46
lorem3k's Avatar
lorem3k lorem3k is offline
1 + 1 = 0 (in Z/2Z)
AKA: Andy D.
FRC #1482 (Bishop Grandin Ghosts)
Team Role: Alumni
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Calgary, AB
Posts: 165
lorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to behold
Re: PID Control for Jaguars with PWM?

Quote:
Originally Posted by chris1592 View Post
Our team used CAN with our encoder plugged directly into the Jag at our first competition and were disappointed with the results. Tuning the PID values was a lot easier when we ran PWM directly into the cRio.
If that's the case, I think I'll stick with PWM and use the cRIO's controller, having never used PID before.
__________________
Boo! Bishop Grandin High School / GM Canada / Tenaris
2013 Western Canada - Quarterfinalists (thanks 288/4719) / 2012 GTR West - Quarterfinalists (thanks 188/1075) / 2011 GTR East - Regional Winners (thanks 1114/1503)
  #6   Spotlight this post!  
Unread 14-04-2012, 23:01
galewind's Avatar
galewind galewind is offline
... more like a temperate breeze
AKA: Chris Gregory
FRC #1089 (Team Mercury)
Team Role: Teacher
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Hightstown, NJ
Posts: 410
galewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond reputegalewind has a reputation beyond repute
Send a message via AIM to galewind
Re: PID Control for Jaguars with PWM?

We had a sample program that we used to test the the adjustable PID values and the results, to verify what we would need so that our shooter wheels stayed within the desired RPM values that we set it to (or based on distance to camera targets). It took us a couple of hours and bit of network searching to find acceptable values for the variables, but once we did, it was set and we never had to deal with it again.

Over the course of our competitions, we did run into some reported "time-out" errors on our CAN network, according to our driver station output log, but they were so intermittent and quickly resolved so they never impacted the way that our shooter functioned. We stuck with it and were happy with the performance and advantages we gained by using it. (we used it so that our upper elevator section would not move to feed balls into the shooter unless we were able to determine that the wheels were moving at the desired RPM)

I would say don't dismiss the idea without experimenting -- it can be a great asset when trying to maintain something like a shooter wheel speed -- but it is not a simple plug-in-and-go solution. Like most new technologies, it will take time to learn how to configure and adjust it... but it definitely has advantages.
__________________
Chris G
Advisor, Team Mercury (1089), Hightstown High School
  #7   Spotlight this post!  
Unread 14-04-2012, 23:10
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,094
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: PID Control for Jaguars with PWM?

Quote:
Originally Posted by galewind View Post
We had a sample program that we used to test the the adjustable PID values and the results, to verify what we would need so that our shooter wheels stayed within the desired RPM values that we set it to (or based on distance to camera targets). It took us a couple of hours and bit of network searching to find acceptable values for the variables, but once we did, it was set and we never had to deal with it again.

I would say don't dismiss the idea without experimenting -- it can be a great asset when trying to maintain something like a shooter wheel speed -- but it is not a simple plug-in-and-go solution. Like most new technologies, it will take time to learn how to configure and adjust it... but it definitely has advantages.
For shooter wheel speed control, consider using this instead of PID.


  #8   Spotlight this post!  
Unread 15-04-2012, 00:01
lorem3k's Avatar
lorem3k lorem3k is offline
1 + 1 = 0 (in Z/2Z)
AKA: Andy D.
FRC #1482 (Bishop Grandin Ghosts)
Team Role: Alumni
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Calgary, AB
Posts: 165
lorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to beholdlorem3k is a splendid one to behold
Re: PID Control for Jaguars with PWM?

Quote:
Originally Posted by galewind View Post
We had a sample program that we used to test the the adjustable PID values and the results, to verify what we would need so that our shooter wheels stayed within the desired RPM values that we set it to (or based on distance to camera targets). It took us a couple of hours and bit of network searching to find acceptable values for the variables, but once we did, it was set and we never had to deal with it again.

Over the course of our competitions, we did run into some reported "time-out" errors on our CAN network, according to our driver station output log, but they were so intermittent and quickly resolved so they never impacted the way that our shooter functioned. We stuck with it and were happy with the performance and advantages we gained by using it. (we used it so that our upper elevator section would not move to feed balls into the shooter unless we were able to determine that the wheels were moving at the desired RPM)

I would say don't dismiss the idea without experimenting -- it can be a great asset when trying to maintain something like a shooter wheel speed -- but it is not a simple plug-in-and-go solution. Like most new technologies, it will take time to learn how to configure and adjust it... but it definitely has advantages.
I will consider experimenting with the CAN bus during build season if there is some extra time available, but until I'm confident with using it, the Jags on the robot itself will probably continue using the PWM interface we already know.

Quote:
Originally Posted by Ether View Post
For shooter wheel speed control, consider using this instead of PID.
Thanks for the link. I will give this a try if next year's game involves a shooter or another mechanism that requires wheels to spin at a constant speed the entire time.
__________________
Boo! Bishop Grandin High School / GM Canada / Tenaris
2013 Western Canada - Quarterfinalists (thanks 288/4719) / 2012 GTR West - Quarterfinalists (thanks 188/1075) / 2011 GTR East - Regional Winners (thanks 1114/1503)
  #9   Spotlight this post!  
Unread 15-04-2012, 22:12
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,007
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: PID Control for Jaguars with PWM?

The advantage of using the Jaguar's internal PID control loop is that the cRio does not use any CPU time for that task. Very valuable if you have a lot of PID loops or your cRio is seeing heavy utilization (e.g., over 60% CPU load). The disadvantage is that you must use the CAN interface. While not terribly difficult, unfamiliar territory in the middle of the season might be best avoided.

Running a PID loop on the cRio is slightly more effort, but PWM control should be very comfortable by now. There is a library function for this (at least in Labview), or you can write your own.

I advise building a special program that runs just this code and nothing else, so you can get familiar with it and tune it without worrying about drive/dashboard/etc. code.
__________________

I am N2IRZ - What's your callsign?
Closed Thread


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 16:07.

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