CAN Network and Jaguar Speed Controllers
From RoboWiki
Contents |
The CAN Network and Jaquar Speed Controllers
The Jaguar Speed controllers use a communication interface called a Controller Area Network or CAN. CAN is much like Ethernet or USB but greatly simplified and designed to be simple with nodes that are near each other. Historically, CAN was designed to be used as the network control system for automobiles.
Learning to use CAN with the Jaguar speed controllers has been a challenge. In the long run, CAN has proven to be useful and reliable. These notes will help to ease the pain moving forward. In particular, they highlight the problem areas that are forgotten over the year.
Understanding the long stream of moving parts is important to understanding CAN and it's complexity.
Each Jaguar contains an ARM microprocessor along with code in flash memory. The code must be kept up to date. Luminary Micro is the manufacturer of the Jaguar speed controllers. The latest firmware and instructions for flashing and otherwise initializing a Jaguar can be found there.
Each CAN network node has an address. The address is a number from 1 to 63 (0 and 64 cannot be used). Each Jaguar is factory set to address 1. However, the cRio uses address 1 and cannot be changed! Every Jaguar must have the CAN address changed in order to be used.
Follow the procedure in the Getting Started Guide (Note the address may change. The parent page is likely to remain stable.) The guide explains how to set the address of the Jaguar controller as well as update the firmware. Choose a unique address for each Jaguar and label the Jaguar with it's address. The BDC-COMM application is the only way to identify a Jaguars address.
The Jaguar network cables use RJ-11 (RJ-14) 6 pin/4 conductor (6p4c) connectors. While these cables appear to be standard phone cords they are not. These cables are reversed! The the Getting Started Guide also describes the cables and how to make them. Locating pre-manufactured cables has been challenging. In particular, the cables should only be about 1 foot in length. The Getting Started Guide refers to a Digi Key part number that is a 7 foot cable! The cables currently in use have been manufactured by hand. This can lead to additional errors. Test and examine all manufactured cables!
(We have placed an order with CableWholesale. We think that the part needed is this 1 foot RJ-11 cable)
The CAN network must be terminated at each end of the network with a 100 ohm resistor. One end of the network is terminated inside the serial-to-RJ11 adapter. This is a fairly straightforward and protected termination. The other end can be made with a bare connector, some wire and a resistor. Be sure that the termination is protected from being shorted!
The BDC-COMM program is used to set up each Jaguar. The BDC-COMM program can be downloaded from Luminary Micro. The computer communicates to the CAN network through the serial-to-RJ11 connector made for the cRio. The computer communicates using serial through a USB to serial converter. We use the USB to serial converters from the Vex programming kits. These converters require the Prolific USB-to-Serial driver. There is a driver for Windows XP as well as Windows 7. Follow the connections: USB->9-pin serial->RJ-11 CAN/Serial->Rj-11 CAN
The CAN Driver for the cRio must be installed onto the cRio. The cRio is accessed using FTP. The driver is installed and the ni-rt.ini file is edited to include the CAN driver.
It appears that the CAN driver download is part of updating the cRio. When udpating the cRiot choose CAN.
The cRio communicates with the CAN network using the serial interface. The serial interface is normally used as a console interface. The dipswitch on the cRio for the console must be disable in order to allow the cRio to communicate on the CAN network.
Networking
The cRio must communicate to the driver station in order to operate. However, the cRio only has on ethernet interface that can be used for programming and the driver station. Attach ethernet port 1 of the cRio to an ethernet hub (or switch). Attach the other devices (Driver Station and programming workstation) to the ethernet hub.
The cRio can will now operate when the Driver Station enables the cRio. The programming workstation can also download new programs to the cRio.
Summary
- Use BDC-COMM to flash each Jaguar with the latest firmware
- Use BDC-COMM to assign a unique address to each Jaguar. Label the Jaguar with the address.
- Attach a ethernet hub to the cRio interface 1.
- Attach the driver station to ethernet hub
- Attach the development workstation to the ethernet hub
- Disable cRio workstation interface
Related Links:
- Luminary Micro - First Robotics Competition
- Vex Robotics Software Downloads
- CableWholesale - Source of 1 foot RJ-11 6p4c reversed cables.
- FIRST Robotics Resource Center. WPI FirstForge.
