Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   CAN (http://www.chiefdelphi.com/forums/forumdisplay.php?f=185)
-   -   CAN for dummies (http://www.chiefdelphi.com/forums/showthread.php?t=96342)

daniel_dsouza 21-07-2011 01:34

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

Ether 21-07-2011 08:29

Re: CAN for dummies
 

Quote:

Originally Posted by daniel_dsouza (Post 1069886)
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 (Post 1069886)
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/



Aren Siekmeier 21-07-2011 10:07

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.

daniel_dsouza 21-07-2011 10:51

Re: CAN for dummies
 
Quote:

Originally Posted by Ether (Post 1069915)


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.

Ether 21-07-2011 11:05

Re: CAN for dummies
 
Quote:

Originally Posted by compwiztobe (Post 1069918)
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.



Ether 21-07-2011 11:08

Re: CAN for dummies
 
Quote:

Originally Posted by daniel_dsouza (Post 1069919)

Quote:

Originally Posted by Ether (Post 1069915)
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 ?



Ether 21-07-2011 11:18

Re: CAN for dummies
 
1 Attachment(s)

Quote:

Originally Posted by compwiztobe (Post 1069918)
I'm not entirely sure how these encoders (or any others) hook up to the Jag

That information is in the datasheet.


Ether 21-07-2011 11:21

Re: CAN for dummies
 
Quote:

Originally Posted by compwiztobe (Post 1069918)
I'm not entirely sure ... how the Jag uses the data

The Jag firmware source is available for download.



daniel_dsouza 21-07-2011 12:10

Re: CAN for dummies
 
Quote:

Originally Posted by Ether (Post 1069924)
... 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?

Ether 21-07-2011 12:13

Re: CAN for dummies
 

Quote:

Originally Posted by daniel_dsouza (Post 1069932)
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.



daniel_dsouza 21-07-2011 12:17

Re: CAN for dummies
 
Quote:

Originally Posted by Ether (Post 1069933)


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?

Ether 21-07-2011 12:24

Re: CAN for dummies
 
Quote:

Originally Posted by daniel_dsouza (Post 1069936)
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.



Ether 21-07-2011 12:27

Re: CAN for dummies
 
1 Attachment(s)
Quote:

Originally Posted by daniel_dsouza (Post 1069932)
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.



daniel_dsouza 21-07-2011 12:30

Re: CAN for dummies
 
Fantastic. Thanks everyone for all your help!

Ether 21-07-2011 12:36

Re: CAN for dummies
 

Quote:

Originally Posted by daniel_dsouza (Post 1069940)
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.





All times are GMT -5. The time now is 02:52.

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