![]() |
CAN mode question
We've never used CAN mode before - since we were rookies.
Do the Jaguar (and Talon) CAN modes have encoders built in? Lots of people say that we should use CAN, but we'd like to have cleared explanations and also some sample code (we'll be searching Github for this). Can we tell a Jaguar to make the motor make exactly 6.22 rotations - to move an arm to a certain position? Will it automatically continue to hold the position against gravity (think Aerial Assist with an arm holding up a ball)? What can CAN mode do that PWM cannot (aside from monitoring power consumption)? So ... no encoders are needed with CAN mode -- correct? The motor will tell us how much it has turned and in which direction? Thanks! |
Re: CAN mode question
From my experience with CAN and the cRIO, the Jaguar has a pinout to connect to an encoder and can handle PID control for you, CAN can still do control essentially like PWM, you can tell the controller to maintain a specific position or a specific speed (using PID).
To the last point of yours, the motor cannot know how far it has turned without some feedback like an encoder or potentiometer. Was this clear? |
Re: CAN mode question
Do you happen to know if the new Talon has both a CAN port and a PWM wire?
|
Re: CAN mode question
In order to be able to send distance (rotation commands) to a Jaguar, you would need to use an encoder. The difference between PWM and CAN is that you can connect the encoder to a jag, and reference the encoder as a part of the jaguar object, instead of as a separate object programming-wise. It can also handle PID loops internally.
Quote:
|
Re: CAN mode question
Quote:
|
Re: CAN mode question
Quote:
We haven't figured out PID loops yet. Thanks for the very clear answer. |
Re: CAN mode question
Quote:
The idea behind supporting closed loop control via CAN was to have the sensor (encoder, potentiometer, limit switch, etc.) directly connected to the motor controller so that the processing power of the CPU (MCU) within the motor controller could be harnessed to do the control loop (PID). This has some advantages: 1. Less processing run on the main robot controller means more cycles for other things. 2. The loop rate of the PID on the motor controller can be higher since there is no communication delay. The motor controller reads the sensor (directly), performs the PID computation, and updates the output to the motor. On Jaguar, this now happens at 1 kHz. Advantage 1 (above) gets reduced every time more processing power, memory, etc. gets added to the robot controller. However, advantage 2 is still there. In fact, I'd argue that if there wasn't an advantage of using closed loop control via CAN, the smart folks at Cross the Road Electronics wouldn't have made the Talon SRX. So, using CAN on Jaguar or Talon SRX to use this has some benefits. |
Re: CAN mode question
We've had a number of issues with CAN on the Jaguars in the past. The support folks at Vex were very helpful, but in the it seemed to be issues with different versions of the Jaguars so we dropped it. FWIW, part of the issue was conformal coating on the modular connectors, but changing that did not completely resolve the issue.
This year we have to use CAN to get battery voltage from the PDB as well as communicate with the pneumatics module, and want to use it for motor control, but it seems the Talon SR's in the KOP do not have CAN, but rather the Talon SRX's do. See here... http://content.vexrobotics.com/vexpr...t-20140819.pdf |
Re: CAN mode question
CAN is definitely more complicated than PWM, which is extremely simple. With PWM you just give it a -1.0 - 1.0 value. With CAN you can configure it to take speed commands (RPM), distance commands (Rotations), Percentages (-1.0 - 1.0), and others. If you use PWM though, I think you CAN (pun intended) get those functionalities, but with a little more work.
|
Re: CAN mode question
Quote:
I'll readily admit the using CAN before this year was rather more complicated, since you needed to make up the correct RJ11 cables, terminate the bus correctly, make up a (correct) serial-RJ11 adapter, and (shudder) deal with BDC Comm for assigning IDs and testing. Definitely more complicated last year. |
Re: CAN mode question
Well put Kevin. With the Talon SRX specifically, we took the lessons learnt from seasons past to make the CAN use-case a lot more robust and painless.
-With weidmuller connectors, there is no risk of bad crimps or bad connectors. -With the terminating resistor built into the roboRIO and PDP there is no risk of manually soldering resistors or hand-crimping them and not being sure they are actually in-circuit. -With the new lightening tab in the DS you can grab the CAN bus utilization (%) and error counts. -The roboRIO web-based configuration will tell you when you have multiple CAN nodes with the same devID and will let you fix it without isolating one CAN node. -boot-loaders for all new CAN nodes gracefully handle bad firmware files, losing power/CAN in middle of flash, flashing wrong product firmware, etc... This season's CAN implementation really is a new type of animal. If you really want the details checkout the Talon user's guide and Talon software ref manual at.... http://www.crosstheroadelectronics.c...ol_system.html Also the FRC screensteps page has lots of good info... http://wpilib.screenstepslive.com/s/...ribution-panel Quote:
|
Re: CAN mode question
Quote:
|
Re: CAN mode question
Quote:
By the way, Omar is the man. It's a fact. |
Re: CAN mode question
Quote:
However, I do have a few suggestions/feature requests for future firmware releases. Some are admittedly based on my assumptions about how you're doing things, since the firmware source code isn't available and we don't have our Talons or a system to test them on yet. So far it's three things that aren't mentioned in your firmware feature list in the SRM:
|
Re: CAN mode question
Quote:
Another feature I would like to see would be a way to set the distance per count. With no setting for that this year, gain numbers are going to have to be incredibly small to work with something like a 256 or 360 cpr encoder. |
| All times are GMT -5. The time now is 14:08. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi