TAMU Robot Controller (TRC)


The TAMUBot V 3.0  uses a custom made control board called the TAMU Robot Controller (TRC) . The TRC has 3 AVR 8 bit micro-controllers on board and an attachable Gumstick controller.
The TRC boasts multiple communication interfaces including I2C that is used for communication between the TRC and the Motor Controller and SPI communication which is used for data transfers between the AVR micro-controllers and AVR to Gumstix communication.
The AVR micro-controllers on the TRC runs a PI controller. To close the feedback loop it receives input from the Encoders as feedback for the controller.
Higher level processing and intelligence is handled by the GumStick
The TAMUBot V3.0 (Parker01) uses the TAMU Robot Controller version 3.0.

It boasts I2C, UART, WLAN, Bluetooth, USB, SPI, Zigbee as well as 6 GPIO (General Purpose Input-Ouput) ports.
The parts used are given in the Parts list section below:

Most of the information including the diagrams are provided on this page is by Chang-Young Kim of Texas A&M University.


Parts List and Ordering Information:


The parts are ordered from Digikey. The ordering information as well as the price for the various parts are given below


Diagrams and Schematics of Control Board


Fig1. TAMU Robot Controller mounted on Parker01. The Gumstick Controller is not attached to the controller at this time allowing a view of all three AVR micro-controllers

The schematics of version 3 of the control board are given in the PDF attachment below.
The layout of the control board is given in the DOB file DC_CONTROL_BD_3_0.BOM  which can be opened using OrCAD design software.


Working of Component


The TRC is designed and made by the Robotics Laboratory is the heart of the Parker01 robot. The motor controller and the Gumstix communicate with the TRC to make the Parker01 Robot work.

The TRC is designed to be a flexible platform to allow the Parker01 robot to have:
    1) The ability to integrate sensory information
    2) The ability to integrate other controllers and computer such as Gumstix or even a laptop computer
    3) The ability to control upto six motors/actuators

Figure 2: System diagram for the TRC. The diagram shows the different modules and communication buses that are available to the different modules

We shall now look at the working of the TRC

At its heart the TRC has 3 AVR ATMEGA128, 8 bit RISC micro-controllers. These AVR micro-controllers control the motor speeds by communicating with the H-Bridge using I2C communication. The AVR controllers also act like slaves to the Gumstix which uses SPI communication (SPI communication uses a master/slave system, this will be explained in section two "AVR module as a master to Gumstix"). We shall now divide up the working of the TRC into two sections:
1) AVR module as a motor controller
2) AVR module as a master to Gumstix


AVR module as a motor controller:

The AVR module is shown the figure to the right. The AVR micro-controller
is used as the PI controller. 
To communicate with the MD22 H Bridge it uses I2C as a communication protocol.
The MD22 then converts the I2C information to PWM information to control the angular speed of the DC motors
As the DC motors turn the rotatory encoders attached to the DC motors
send back information to the AVR micro-controller.
Conceptually we can think of each encoder sending information to a Direction Finder Module and a Counter Module.
The Direction Finder Module combined with the counter allows us to computer the angular velocity of each wheel.

As can be seen in the figure to the right once the angular velocity of the  wheels are computed it can get information from the SPI communications bus to set
different angular velocity the wheel.
This reference velocity information combined with the current speed of the
The PI controller then corrects for the error between the computer velocity
and the desired velocity.



AVR module as a master to the Gumstix


The SPI communication protocol is a  synchonous serial data communication system that works in a master/slave mode. It is operates in fully duplex modes
The Conceptual diagram to the right shows that the AVR micro-controller receiving the SPI communication packet.
The module then computes the reference speed which is sent to the PI controller

                                                                                                                                                                                                                                            Figure 3) Top part of the figure shows the AVR module and the bottom shows the conceptual diagram                                                                                                                                           for the AVR module's working
Now that we know what the master side of the SPI bus looks like we can look at what role the Gumstix plays at the slave side of the SPI protocol.
The Gumstix can incorporate sensors such as digital compasses and due to its
processing power can also use camera data to plan a path for the TAMUbot V 3.0

SPI communication system uses four logic signals.
1) Clock signal
2) Master Output, Slave Input (output from master) [MOSI]
3) Master Input, Slave Output (input to master) [MISO]
4) Slave Select (to chose which slave to communicate to) [SS]

SPI is a synchronous bus. Hence for both transmission and reception must be synchronized using the same clock signal.
The master is responsible for providing the clock signals for the data cycles. Thus
the master has control of the speed of the data transfer.
Since the AVR modules are all synchronized using an external 16MHz crystal
synchronizing the SPI communication done with relative ease.

During each clock cycle the Gumstix and the AVR modules can communicate
with each other in full duplex mode where both MOSI and MISO can occur.

Unlike the I2C communication protocol the SPI communication is not limited to and 8  bit word. The message size and content can be varied in the SPI communications protocol.

We will now look at the packet the TRC uses for its SPI communication protocol.

As the size and content of the SPI packet can be any arbitrary value, we can set the packet to hold any information we need.
Since the Gumstix and the AVR module needs to read this packet we can see the need for a packet parser to understand what the packet means.

The figure to the right shows the Packet structure and the information contained in each type of packet.
The 1st 4 bits tells us what type of packet is being sent or received
The 2nd four bits tells us how much information is being sent or received
Using these two 4 bits we can then read the data to be:
  •  Speed data
  •  Setting for the PI Gain (of the PI controller)
  •  Encoder data
  •  Debug data

                                                                                                                        Figure 4) The SPI packets and description of each packet

The PI controller settings need to be changed when the controller is uploaded to a different robot.
  1. Compile the code given in the file DCB_linux041008.zip
  2. Power up the TRC
  3. Connect the TRC to the computer using the USB port
  4. Run the program that was compiled in step 1
  5. The setting for the PI controller can now be changed using this program
Flashing the AVR Atmel128

The PI controller needs to be uploaded and flashed to the memory for the AVR micro-controller to enable it to be a PI controller for the TAMUBot V 3.0

The PI code needs to be compiled to allow it to run on the AVR micro-controller
Using Windows XP we can follow the steps given below:

1.    Install AVR Compile Environment on the Window XP.

-      AVR Studio 4.12 (build 460)

-    AVR Studio 4.12 Service Pack 4 (build 498)

2.   Install WinAVR ( AVR compiler)

3. Connect the TRC to the computer using the USB port
4. Open the program provided in dcb050208.zip in the attachments in AVR studio and connect to the AVR programmer using the button provided as shown below

5. Program the AVR module using the program button as shown below. Use the settings as given in the figure below.

6. And you are done :)
A good tutorial with MatLab code for the PID controller along with its relevance to motor speed and position is given at the University Michigan Engineering website:

Unknown user,
May 9, 2008, 11:02 PM
Unknown user,
May 7, 2008, 12:26 PM
Unknown user,
May 7, 2008, 12:08 PM
Unknown user,
Apr 21, 2008, 11:26 AM
Unknown user,
May 9, 2008, 11:02 PM