|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: CAN and Jaguars, any limits?
In general you can start running into trouble trying to send lots of CAN commands in your teleop loop. We offload our CAN messages into other processing loops and run them with lesser periodicity. Many motors shouldn't really need to have their speed changed more rapidly than 10-20 hz, and if you had a motor that you wanted to control the speed of more frequently than that, you could have that motor alone operate faster.
You didn't actually say whether or not you're actually doing something like this already, but in case you're not. The same basic issue is relevant and correctable regardless of what programming language you're using. |
|
#2
|
|||
|
|||
|
Re: CAN and Jaguars, any limits?
Would you be willing to provide some sample code of how you accomplish this?
|
|
#3
|
|||||
|
|||||
|
Re: CAN and Jaguars, any limits?
Quote:
As a trivial example, if in LabVIEW one were to determine in each robot mode (disabled, teleop, autonomous, etc) the command they wanted to send a motor and store it in a global variable, they could then read that global variable in timed tasks in a loop at whatever frequency they wished and call the set motor VI from there. This can help free your Teleop loop to run as fast as ds packets are received. Similar trivial examples can be constructed in C++ and Java. There are a lot better ways that this could be handled, like using an action engine in LabVIEW, or a class in any other language rather than a global variable, but the general principle remains the same. |
|
#4
|
|||
|
|||
|
Re: CAN and Jaguars, any limits?
We use C++.
After posting that comment, I did some digging and found a post from bob.wolff68 with some examples from the Janksters. Here it is: http://www.chiefdelphi.com/forums/sh...87&postcount=2 Nice, easy implementation of tasks there. Got it running last night to monitor a digitial input that was changing too quickly for the command to reliably catch. |
|
#5
|
|||
|
|||
|
Re: CAN and Jaguars, any limits?
Team 20 has had lots of ups and downs with CAN over the last two years too.
From a programming standpoint, CAN commands are routed through several different plugins from the cRIO to the Jags themselves, depending on what language you use. Some teams with really awesome software mentors have developed their own drivers for CAN. Maybe that's a route you want to pursue? |
|
#6
|
||||
|
||||
|
Re: CAN and Jaguars, any limits?
Well, this is anecdotal in nature, but after our competition at 10000 Lakes where we removed 3 of the jags from the CAN bus and put them on PWM, the other 8 worked very well.
Our bot drove well, and was responsive. I would like to revisit this someday with better diagnostic tools available, but for now, I'm just going to say that for us, the max number of jags on the bus will be 8. More than that will have to go on PWM. Thanks for all your thoughts everyone, and if I am able to better analyze this someday, I'll be sure to let you know the results. Mike |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|