Skip to content

Development Environment

Peter Kazanzides edited this page Apr 12, 2021 · 18 revisions

1 Overview

The ''FPGA Quad-Linear-Amplifier Controller'' (FPGA1394-QLA) is an IEEE1394 based controller board set that comprises one general purpose FPGA controller board, with IEEE-1394a interface (and Ethernet, starting with Rev 2.0), and one linear power amplifier board, that supports up to 4 DC brush motors. The power amplifier has a linear design that is based on the TI/Burr-Brown OPA549 power amplifier, which provides up to 6A continuous current at a maximum supply voltage of 48V. The controller board contains a field programmable gate array (FPGA) that provides the IEEE1394 interface to the different I/O components:

  • D/A converter to control the motor current
  • A/D converter to read the motor current feedback
  • A/D converter to read potentiometer feedback
  • A/D converter to read temperature sensor feedback
  • Quadrature encoder circuits (implemented in the FPGA) to provide position/velocity feedback from incremental encoders (optional index pulse count is also available)
  • Digital inputs for motor and board (power supply) status
  • Digital output to disable motor power
  • Digital inputs to for Positive - Negative Limits and Home signals

In the software and the FPGA design, channel numbering starts at 0 so the 4 axes are labeled 0,1,2,3. In the electrical schematic, numbering starts at 1 (this was done to avoid an apparent bug in the Protel design software when doing a multi-channel design starting with channel 0). The PCB silkscreen also labels the 4 channels as Axis 1-4. To avoid confusion, this document uses the software convention of starting the numbering at 0.

2 Hardware

2.1 FPGA1394_QLA board set

As mentioned in the overview, the controller set has one FPGA board and one QLA board (See Fig. 1 ).

fpga qla boradset

2.2 Interface

The board is connected to computer using an IEEE-1394 (FireWire) cable and the digital power is either from an external power supply or from the cable. Rev 2.x FPGA boards also contain an Ethernet interface, which can alternatively be used to connect to the computer (FPGA Firmware Rev 7+ required).

interface.png

2.3 Breakout Board

The FPGA1394 QLA controller board can be connected to individual motors via a breakout board. One DB9M to DB9F and one VHDCI 68-pin Male to SCSI-3 68-pin Male cable connect the breakout board and the controller board together.

breakout.png   connect.png

3 Development Environment Setup

The current software is written in C/C++ and uses the libraw1394 library under Linux for the Firewire interface. See http://www.dennedy.org/libraw1394/ for libraw1394 documentation.

3.0 Install Ubuntu

(October 30, 2017) We recommend Ubuntu 16.04 LTS, which is a long term support version. For ROS, we recommend Kinetic.

3.1 Install libraw1394 on Ubuntu

You can use Synaptic to install packages or the command line.

  • Synaptic: Search for raw1394 and install the libraw1394-dev package.
  • Terminal: On the command line, install it with:
   sudo apt-get install libraw1394-dev

3.2 Set permission for 1394 device

If you installed linux recently, you are likely to have Kernel 3.x with the new Juju firewire driver stack, which means the firewire device would be /dev/fw* instead of the old /dev/raw1394*. In order to run the control software without root permission, please do the following steps:

  • Create /etc/udev/rules.d folder if it's not there
  • Add rules for /dev/fw* devices (or /dev/raw1394* for Ubuntu versions prior to 10.04)
  • Create Group fpgaqla
  • Add current User to Group fpgaqla
  • Restart computer
   sudo mkdir /etc/udev/rules.d
   cd
   echo 'KERNEL=="fw*", GROUP="fpgaqla", MODE="0660"' > ~/80-firewire-fpgaqla.rules
   sudo mv ~/80-firewire-fpgaqla.rules /etc/udev/rules.d/80-firewire-fpgaqla.rules 
   sudo addgroup fpgaqla  
   sudo adduser `whoami` fpgaqla

For more information about Juju migration: https://ieee1394.wiki.kernel.org/index.php/Juju_Migration

For Ubuntu versions prior to 10.04

  • Replace the fw* line above by raw1394*.
  • Autoload kernel module raw1394 at startup: add raw1394 to the end of /etc/modules file
    sudo sh -c 'echo "raw1394" >> /etc/modules'

3.2 Run Test Code

This section is only needed to debug complex issues. In most cases, skip this and start using the dVRK examples and/or the command line qladisp

Check Firewire Module:

To make sure the Firewire driver stacks are loaded, run this command:

   lsmod |grep 'firewire\|1394'

On Lucid or older (raw1394 stack), it should return something like this:

   ~@: lsmod | grep 'firewire\|1394'
       dv1394 18602 0
       ochi1394 30338 1 dv1394
       raw1394 25814 0
       ieee1394 95219 3 dv1394,ohci1394,raw1394

On Maverick or newer (Juju stack), it should return this:

   ~@: lsmod | grep 'firewire\|1394'
       firewire_ohci 24679 0
       firewire_core 54327 1 firewire_ohci
       crc_itu_t 1739 1 firewire_core

NOTE: the numbers in second column are SIZE and may be different from the values listed here.
If the return value (first and third columns) is not correct, please load the corresponding Firewire stacks. See Ubuntu Firewire wiki https://help.ubuntu.com/community/FireWire for details.

Test code: Next checkout, compile and run the IEEE 1394 utilities from the Mechatronics GIT repository (https://github.com/jhu-cisst/mechatronics-software/tree/master/util)

    svn co https://github.com/jhu-cisst/mechatronics-software/trunk/util
    cd util
    make
  • Run test code:
    Table 1: list of utility functions
Name Description
info1394 display information about IEEE-1394 devices
quad1394 quadlet transfer read / write
block1394 block transfer read / write
time1394 perform timing tests of read / write

Example:

    ~@: ./quad1394 0x05 
        0x00003F3F

Navigation

  • Go to the NEXT section (Interface Specification) or
  • Return to the INDEX