Spring 2016 AdBot Software Design

By Don T. (Mission, Systems, and Test)
Dang Le (Project Manager)

The software block diagram shows the order that the firmware handles data and calls main functions.

Software Block Diagram

Figure 1 Software Block Diagram

Software/Firmware Design Details

In the arxrobot_firmware tab, edit just #define project TRUE. The loop() function basically calls commandDecoder(). The command tab is where the commandDecoder() function is written. It checks a command packet (several bytes of information from the Arxterra app for each kind of AdBot activity) if it is correct. It usually is; Editing the firmware does not require using CoolTerm and finding LRC byte. When the packet passes this decode checkpoint, the commandHandler() is called. This function determines what kind of operation the packet does. The packet could be for controlling a motor or moving a servo. Scroll down in the pinouts_robot tab and a list of robot operations are shown. Next to each operation is a hex value, which is equivalent to the packet’s third byte, which usually is thought of as data[2]. When the firmware is loaded onto the Arduino Uno, and the Arxterra app sends a packet to the Arduino Uno, the firmware looks at data[2], looks up the operation name in the pinouts tab, and finds in the command tab what function the operation name calls. These functions for example are move_TB6612FNG() and move_servo() and they are located in any of the available tabs. Arduino scripts that are moved to subfolders within the arxrobot_firmware folder are no longer part of the firmware code and will not load onto the Arduino Uno or show up when the arxrobot_firmware scripts open. Note: Arduino understands the compound addition operator “A += B” as a shortcut of writing, A = A + B.

AdBot Pinouts

The AdB1 tab contains functions to run the DC drive motors. The pinout connections the Arduino recognizes is listed below.

Motor Front Left

const int aIn1 = 2;
const int aIn2 = 4;
const int aPWM = 3;

Motor Front Right

const int bIn1 = 7;
const int bIn2 = 6;
const int bPWM = 5;

Motor Back Left

const int cIn1 = 8;
const int cIn2 = 9;
const int cPWM = 10;

Motor Back Right

const int dIn1 = 13;
const int dIn2 = 12;
const int dPWM = 11;

Servo

const int SERVO_1 = A0;

move_TB6612FNG and run_TB6612FNG functions

An L298 half bridges has two channels to control two motors separately. With each channel, Arduino connects to a first input pin (C), a second input pin (D), and an enable pin (Ven). When the enable pin is written to low, the corresponding motor is free running. When the enable pin is written to high, the motor can move forward, move backwards, or stop.

 L298N

Resource Files

The software block diagram is created using the full version of Shapes.

Link 1 Software Block Diagram.shapesdoc

Link 2 RoSco Arduino Sketches

Link 3 AdBot Arduino firmware