Go to Post According to my father the hint should be released sometime next week, but he's never been the most trustworthy source of info.... - Lil' Lavery [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: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 21-07-2011, 01:34
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2449 (Out of Orbit Robotics)
Team Role: Alumni
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 231
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
CAN for dummies

Wow, my first thread on CD!

My team wanted to investigate the CAN interface, and I had a few questions. I already read some of the other “getting started” threads, and the associated files. If I make any technical mistakes, don’t hesitate to correct me, as I am new to some of the terms.

1. Could someone tell me how I should set the PID if I use Position mode?
2. If I wanted to control a robot in autonomous mode, should I use position or speed?
3. If I wanted to control a robot in teleop mode, should I use position, speed, or PercentVbus?
4. Is there any difference between 2CAN and connecting the black jag to the cRIO serial port?
5. We “misplaced the encoder from the KOP”. What was the original part number, or what would be a good replacement?
6. Is there any maximum limit to the quantity of Jaguars as far as FIRST hardware goes?
7. Let’s say I don’t mind spending $25, are the cables from here worth that much versus making my own cables?
8. Is there anything else I should know?

If it makes any difference, our team programs in Java.

Thanks in advance!
-Daniel
Reply With Quote
  #2   Spotlight this post!  
Unread 21-07-2011, 08:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies


Quote:
Originally Posted by daniel_dsouza View Post
If I wanted to control a robot in autonomous mode, should I use position or speed?
If I wanted to control a robot in teleop mode, should I use position, speed, or PercentVbus?
It depends on the application (drivetrain motor? lift motor? spinning roller motor?) and what you are trying to achieve.


Quote:
Originally Posted by daniel_dsouza View Post
We “misplaced the encoder from the KOP”. What was the original part number,

http://usfirst.org/uploadedFiles/Rob...%20Rev%20E.pdf

http://usdigital.com/products/encode...rotary/kit/e4p

http://usdigital.com/first

http://www.andymark.com/product-p/am-0791.htm

http://www.austriamicrosystems.com/e...ncoders/AS5030


Quote:
or what would be a good replacement?
http://www.chiefdelphi.com/forums/sh...04&postcount=2

http://www.vishay.com/docs/57103/model981.pdf

http://www.cherrycorp.com/english/se...an8_series.pdf

http://www.usdigital.com/products/en...ary/shaft/ma3/



Last edited by Ether : 21-07-2011 at 08:32.
Reply With Quote
  #3   Spotlight this post!  
Unread 21-07-2011, 10:07
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: CAN for dummies

The first list Ether gave are optical encoders, giving a tick count for how many times the shaft has spun around. This is an incremental measure of rotation. However, the second list are all magnetic encoders that sense the absolute orientation of a permanent magnet mounted to the shaft. This is an absolute measure of rotation. Both have their uses.

I'm not entirely sure how these encoders (or any others) hook up to the Jag, or how the Jag uses the data for whatever speed or position control you off board to it, but it all works somehow.

If you're going to run any PID on a two (or more) motor gearbox, however, you probably have to do it on the cRio, because there is yet no way to sync the speed controls off of one feedback sensor. I believe this is on the TI's agenda for a new Jag firmware.

The 2CAN is significantly faster than the serial bus (about 5x, I believe). This may not be an issue, but when we tried CAN this year on a serial bus, our 7 Jags plus some calls to the limit switches on one of them bogged down our CAN bus quite a bit because the serial bus just can't get that many packets through. I'm quite sure the 2CAN would eliminate this problem (for another $200...).

Jaguars on a competition robot are only limited by the number of motors. Every year past (I can't imagine this would change) you can only have one motor per speed controller, one speed controller per motor, and motors have been pretty strictly specified, with up to 13 this year. Very few FRC robots ever have more than 10.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-07-2011, 10:51
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2449 (Out of Orbit Robotics)
Team Role: Alumni
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 231
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
Re: CAN for dummies

Quote:
Originally Posted by Ether View Post


It depends on the application (drivetrain motor? lift motor? spinning roller motor?) and what you are trying to achieve.
Sorry, we have a standard 6wheel tankdrive, 2 motors per side, for a total of 4 drive jaguars.
Reply With Quote
  #5   Spotlight this post!  
Unread 21-07-2011, 11:05
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies

Quote:
Originally Posted by compwiztobe View Post
The first list Ether gave are optical encoders, giving a tick count for how many times the shaft has spun around. This is an incremental measure of rotation.
The Austria Microsystems unit in the first list is not optical, and it is not incremental.

It is an absolute magnetic device.


Reply With Quote
  #6   Spotlight this post!  
Unread 21-07-2011, 11:08
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies

Quote:
Originally Posted by daniel_dsouza View Post

Quote:
Originally Posted by Ether View Post
It depends on the application (drivetrain motor? lift motor? spinning roller motor?) and what you are trying to achieve.
Sorry, we have a standard 6wheel tankdrive, 2 motors per side, for a total of 4 drive jaguars.
... and what are you trying to achieve ?


Reply With Quote
  #7   Spotlight this post!  
Unread 21-07-2011, 11:18
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies


Quote:
Originally Posted by compwiztobe View Post
I'm not entirely sure how these encoders (or any others) hook up to the Jag
That information is in the datasheet.

Attached Thumbnails
Click image for larger version

Name:	Jag sensor input.png
Views:	67
Size:	91.3 KB
ID:	10841  
Reply With Quote
  #8   Spotlight this post!  
Unread 21-07-2011, 11:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies

Quote:
Originally Posted by compwiztobe View Post
I'm not entirely sure ... how the Jag uses the data
The Jag firmware source is available for download.


Reply With Quote
  #9   Spotlight this post!  
Unread 21-07-2011, 12:10
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2449 (Out of Orbit Robotics)
Team Role: Alumni
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 231
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
Re: CAN for dummies

Quote:
Originally Posted by Ether View Post
... and what are you trying to achieve ?
Um...Do you mean this? In Auto. mode, we want to give our robot instructions like move forward 5 feet, then turn 60 degrees, and so on. We want to implement this by telling the jags to keep turning until they have reached that the total.
In teleop, we will have our robot controled by one joystick, and the encoders will be used to make sure that the ratio of the input values (left, right) is the same as the output (left, right).

Also, thanks for the information about encoders. I can figure out where each wire goes, but is there some sort of connector I have to wire the encoder to to connect it to the jaguar?
Reply With Quote
  #10   Spotlight this post!  
Unread 21-07-2011, 12:13
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies


Quote:
Originally Posted by daniel_dsouza View Post
Um...Do you mean this? In Auto. mode, we want to give our robot instructions like move forward 5 feet, then turn 60 degrees, and so on. We want to implement this by telling the jags to keep turning until they have reached that the total.
In teleop, we will have our robot controled by one joystick, and the encoders will be used to make sure that the ratio of the input values (left, right) is the same as the output (left, right).
Sounds like you want position control for autonomous, and speed control for TeleOp.

In case you decide to do the PID in cRIO instead of Jag, be aware that there's a bug in the cRIO's FPGA code that counts encoder pulses.



Last edited by Ether : 21-07-2011 at 12:16.
Reply With Quote
  #11   Spotlight this post!  
Unread 21-07-2011, 12:17
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2449 (Out of Orbit Robotics)
Team Role: Alumni
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 231
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
Re: CAN for dummies

Quote:
Originally Posted by Ether View Post


Sounds like you want position control for autonomous, and speed control for TeleOp.
Ok, cool. So I gather that I use rpm for speed, but what do I values should I use for position?
Reply With Quote
  #12   Spotlight this post!  
Unread 21-07-2011, 12:24
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies

Quote:
Originally Posted by daniel_dsouza View Post
Ok, cool. So I gather that I use rpm for speed, but what do I values should I use for position?
A PID controller takes a "setpoint" input and a "processVariable" input.

The setpoint is the value you want for whatever it is you are trying to control (your computed command).

The processVariable is the present measured actual value of what you are trying to control (the feedback from the sensor).

You have to scale the setpoint or the processVariable so that they are in the same units.

So if your command is in "feet", you have to scale your processVariable to be in feet. You do that by either calculating how many encoder pulses correspond to 1 foot of motion, or you can measure it experimentally.



Last edited by Ether : 21-07-2011 at 12:31.
Reply With Quote
  #13   Spotlight this post!  
Unread 21-07-2011, 12:27
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies

Quote:
Originally Posted by daniel_dsouza View Post
Also, thanks for the information about encoders. I can figure out where each wire goes, but is there some sort of connector I have to wire the encoder to to connect it to the jaguar?
Yes. I don't have the part number of the connector, but if you are using a quadrature encoder it plugs into the Jag as shown here.


Attached Thumbnails
Click image for larger version

Name:	Jag encoder input.png
Views:	64
Size:	87.3 KB
ID:	10842  
Reply With Quote
  #14   Spotlight this post!  
Unread 21-07-2011, 12:30
daniel_dsouza daniel_dsouza is offline
does what needs to be done.
FRC #2449 (Out of Orbit Robotics)
Team Role: Alumni
 
Join Date: May 2011
Rookie Year: 2011
Location: Chandler, AZ
Posts: 231
daniel_dsouza has a spectacular aura aboutdaniel_dsouza has a spectacular aura about
Re: CAN for dummies

Fantastic. Thanks everyone for all your help!
Reply With Quote
  #15   Spotlight this post!  
Unread 21-07-2011, 12:36
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,034
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: CAN for dummies


Quote:
Originally Posted by daniel_dsouza View Post
Fantastic. Thanks everyone for all your help!
There are some threads that discuss techniques for tuning speed PIDs. I will see if I can find a couple of links.




Last edited by Ether : 21-07-2011 at 17:20.
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 02:52.

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