Go to Post Apparently he felt that wearing ringers is akin to "being surrounded by safety." - DanDon [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 26-12-2013, 08:06
DavisDad's Avatar
DavisDad DavisDad is offline
MechE
AKA: Craig Rochester
FTC #8470 (Team Technado)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Boston
Posts: 317
DavisDad will become famous soon enoughDavisDad will become famous soon enough
Jaguar Speed & Position Control with Encoders

Last year we tried to use the Jaguar Motor Controller's position and speed control functions in our Ultimate Accent bot. We got the BDC-COMM utility to work but couldn't work out the "C" programming.

We've had good success on the FTC team using the Matrix motor controller and would like to achieve a similar performance with Jaguars.

I'd appreciate any feedback or point me to a thread where this is discussed.
  #2   Spotlight this post!  
Unread 26-12-2013, 14:14
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Jaguar Speed & Position Control with Encoders

Quote:
Originally Posted by DavisDad View Post
We got the BDC-COMM utility to work but couldn't work out the "C" programming.
I'm going to operate with the assumption that by "C programming," you mean the C++ programming on the cRIO.

While we use Java, that should be similar to the API we use, which can be found here for all of the classes used in WPILibJ, or here for the CANJag class.

Does anyone know of similar documentation for C++?
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
  #3   Spotlight this post!  
Unread 26-12-2013, 16:38
DavisDad's Avatar
DavisDad DavisDad is offline
MechE
AKA: Craig Rochester
FTC #8470 (Team Technado)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Boston
Posts: 317
DavisDad will become famous soon enoughDavisDad will become famous soon enough
Re: Jaguar Speed & Position Control with Encoders

Quote:
Originally Posted by brennonbrimhall View Post
I'm going to operate with the assumption that by "C programming," you mean the C++ programming on the cRIO.

While we use Java, that should be similar to the API we use, which can be found here for all of the classes used in WPILibJ, or here for the CANJag class.

Does anyone know of similar documentation for C++?
I'm not a C++ programmer and will relay any info about this to my son who knows that stuff. I'm mechanical and would understand mechanism and controls hardware. I've worked with industrial PLCs using ladder logic and have some understanding of controls systems. The big questions for me are:
  • Do the Jaguar on-board speed and position controls work? If so, looking for examples of successful controls strategy?
  • Is my assumption correct that using the Jaguar's micro-controller PID loops faster and more efficient than running feedback/feed-forward loops from the CReo?
  • Is the CAN Bus route worth the effort?
  • What questions have I forgotten to ask?
  #4   Spotlight this post!  
Unread 26-12-2013, 16:57
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Jaguar Speed & Position Control with Encoders

The PID functionality of the Jaguars does work, but adding CAN can be expensive depending on which adapter you use.

The PID on the cRIO is just as fast and as powerful as the one on the jaguar, but works with all types of speed controllers and sensors. If you're looking for basic getting started examples, there are plenty for PID on the cRIO.
  #5   Spotlight this post!  
Unread 26-12-2013, 17:04
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Jaguar Speed & Position Control with Encoders

Quote:
Originally Posted by DavisDad View Post
I'm not a C++ programmer and will relay any info about this to my son who knows that stuff. I'm mechanical and would understand mechanism and controls hardware. I've worked with industrial PLCs using ladder logic and have some understanding of controls systems. The big questions for me are:
  • Do the Jaguar on-board speed and position controls work? If so, looking for examples of successful controls strategy?
  • Is my assumption correct that using the Jaguar's micro-controller PID loops faster and more efficient than running feedback/feed-forward loops from the CReo?
  • Is the CAN Bus route worth the effort?
  • What questions have I forgotten to ask?
  • Yes. However, it is the opinion of some (myself included) has been that the physical connections and mechanical implementation in the Jaguar motor controller are unreliable.
  • Yes.
  • In my experience, I'd say that doing PID on the cRIO is much less of a headache and much easier to implement than CANBus. I personally find the CAN interface on the Jaguar to be much more trouble than it's worth. That being said, there are several teams who have used the CANBus route successfully and prefer it (according to my friends on 195, it can have cleaner wiring if you do it right, and it is more computationally efficeint than doing it on the cRIO). Whether or not it is a success on your team is a function of your determination, human resources, experience, and time.
  • It's worth noting that there is not an insignificant chance that the interface for CAN in 2015 will be much different than it was in 2013 (with new roboRIO, and with a new CAN-based Talon). I'd read the following documents/forum discussion. Hopefully they'll answer more questions than they raise, but as always, feel free to ask any new questions you might have. That's what ChiefDelphi is all about.
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
  #6   Spotlight this post!  
Unread 26-12-2013, 17:18
DavisDad's Avatar
DavisDad DavisDad is offline
MechE
AKA: Craig Rochester
FTC #8470 (Team Technado)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Boston
Posts: 317
DavisDad will become famous soon enoughDavisDad will become famous soon enough
Re: Jaguar Speed & Position Control with Encoders

brennonbrimhall,

Thanks so much for the help!

I was very excited about the performance of the Jaguar/CIM running on the bench through BCD-COMM. If this can be done through the cRIO, I'm willing to forge ahead. I've read through VEX and TI manuals, read the NI forums but no joy finding a servo/motor/Jaguar set-up problem to solve the problem. I guess I'll need to delve into programming language to get the complete picture :O.

Last edited by DavisDad : 26-12-2013 at 17:23. Reason: added more
  #7   Spotlight this post!  
Unread 26-12-2013, 17:28
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Jaguar Speed & Position Control with Encoders

Quote:
Originally Posted by DavisDad View Post
brennonbrimhall,

Thanks so much for the help!
No problem. Always glad to help.

Quote:
Originally Posted by DavisDad View Post
I was very excited about the performance of the Jaguar/CIM running on the bench through BCD-COMM. If this can be done through the cRIO, I'm willing to forge ahead.
Best of luck. You're far braver than I am...

Quote:
Originally Posted by DavisDad View Post
I've read through VEX and TI manuals, read the NI forums but no joy finding a servo/motor/Jaguar set-up problem to solve the problem.
What do you mean by a set-up problem? Are you referring to the PID coefficients, or a simple set-up diagram of sorts?

Quote:
Originally Posted by DavisDad View Post
I guess I'll need to delve into programming language to get the complete picture :O.
Yes, I would recommend that. What language do you use?
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
  #8   Spotlight this post!  
Unread 26-12-2013, 19:06
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,563
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 & Position Control with Encoders

Quote:
Originally Posted by Jared View Post
The PID on the cRIO is just as fast and as powerful as the one on the jaguar,
Why do you say this? I wasn't aware that anyone was running PID at 1000 hz on the cRIO. Doing PID on the cRIO is more flexible, however, since you can implement your own.

The serial CAN interface is somewhat inefficient, and you may find that if you send to many updates, it may use more cRIO throughput then running a 50 or 100hz PID on the cRIO would. One option would be to invest in the 2CAN. Another option would be to limit the amount of CAN traffic. Setting a setpoint every few seconds isn't a problem. Changing setpoints at 50hz to multiple jaguars and requesting lots of status can be a problem.

Last edited by Joe Ross : 26-12-2013 at 19:21.
  #9   Spotlight this post!  
Unread 26-12-2013, 19:32
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,563
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 & Position Control with Encoders

Quote:
Originally Posted by DavisDad View Post
Last year we tried to use the Jaguar Motor Controller's position and speed control functions in our Ultimate Accent bot. We got the BDC-COMM utility to work but couldn't work out the "C" programming.
This thread shows the required calls for setting up a CAN Jaguar in position mode. http://www.chiefdelphi.com/forums/sh...d.php?t=102909 You also need to using the imaging tool to set the appropriate CAN Jaguar plugin (Serial or 2CAN).
  #10   Spotlight this post!  
Unread 26-12-2013, 21:04
ronbaer ronbaer is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Chantilly, VA
Posts: 8
ronbaer is an unknown quantity at this point
Re: Jaguar Speed & Position Control with Encoders

We successfully utilized Jags last year with CAN bus and a position sensor. We were going to also use the speed sensor but had wired a hall-effect sensor for speed vice an encoder. The Jag could not utilize the hall-effect sensor.

Couple of things we learned.
1. Wire the serial port of the cRio to the first Jag, than CAN to the other Jags
2. Don't forget the terminator on the last Jag
3. ReImage the cRio with CAN support (that one took us a while to learn
4. Write simple test programs to exercise the Jag before integrating Jag support into your overall robot code. Its MUCH easier to debug.

Don't forget, Jags also work well with limit switches (CAN and PWM control).

Good luck with the Jags this year.
__________________
Ron Baer
Team 612 - Chantilly Robotics
  #11   Spotlight this post!  
Unread 26-12-2013, 21:29
DavisDad's Avatar
DavisDad DavisDad is offline
MechE
AKA: Craig Rochester
FTC #8470 (Team Technado)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Boston
Posts: 317
DavisDad will become famous soon enoughDavisDad will become famous soon enough
Re: Jaguar Speed & Position Control with Encoders

Quote:
Originally Posted by brennonbrimhall View Post
...What do you mean by a set-up problem? Are you referring to the PID coefficients, or a simple set-up diagram of sorts?
Hooking up to the BCD-COMM wasn't easy for us:
  • I had some quad encoders with index and it took some time to realize that the index was resetting the counter when trying position control
  • Struggled a bit with USB/Serial converter to Jaguar; PC serial software
  • Didn't have documentation about PID (PI only) constants; had to trial-and-error the integral.
  • "Bricked" a Jaguar by failed firmware update (VEX had good support and fixed it for free)

I know none of these are that big a deal individually, but when you're dealing with multiple snags it can get daunting. What I meant is: I wanted to make sure there wasn't some issue like those with the cRIO CAN setup that was preventing proper operation.
  #12   Spotlight this post!  
Unread 26-12-2013, 21:30
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Jaguar Speed & Position Control with Encoders

Quote:
Originally Posted by Joe Ross View Post
Why do you say this? I wasn't aware that anyone was running PID at 1000 hz on the cRIO. Doing PID on the cRIO is more flexible, however, since you can implement your own.
I tested this last year. I tried 800 hz to 10 hz, and everything faster than 100 hz behaves the same way as 100 hz because the victor can only be updated every ~20 ms (50 hz).

Also, I don't think that a drivetrain used in FRC will benefit from being updated 100 times a second vs 1000.

Where did you find the 1000hz number? I'm not saying it's wrong, but I couldn't find it online.
  #13   Spotlight this post!  
Unread 26-12-2013, 21:43
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,067
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 & Position Control with Encoders

Quote:
Originally Posted by Jared View Post
Where did you find the 1000hz number? I'm not saying it's wrong, but I couldn't find it online.
The point Joe was making is that the built-in PID in the Jag's firmware closes the loop at 1000 Hz. You can't do that with cRIO. You can't do that with Victor or Talon.

Quote:
everything faster than 100 hz behaves the same way as 100 hz because the victor can only be updated every ~20 ms (50 hz).
Victors will accept 200 Hz input PWM frequency.


Quote:
I don't think that a drivetrain used in FRC will benefit from being updated 100 times a second vs 1000.
Other systems might.



Last edited by Ether : 26-12-2013 at 21:50.
  #14   Spotlight this post!  
Unread 26-12-2013, 21:45
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,563
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 & Position Control with Encoders

Quote:
Originally Posted by Jared View Post
Where did you find the 1000hz number? I'm not saying it's wrong, but I couldn't find it online.
It's in the jaguar source code (not sure if it's still available online, used to be available from TI). There is a 1ms timer interrupt. It runs the PID and updates the H-bridge PWM from the same interrupt.
  #15   Spotlight this post!  
Unread 26-12-2013, 21:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,067
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 & Position Control with Encoders

Quote:
Originally Posted by Joe Ross View Post
It's in the jaguar source code (not sure if it's still available online, used to be available from TI). There is a 1ms timer interrupt. It runs the PID and updates the H-bridge PWM from the same interrupt.
Portions of the relevant source code were posted here by dyanoshak:

http://www.chiefdelphi.com/forums/sh...6&postcount=41


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 17:27.

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