You are on page 1of 9

Open-Robot Manual Control

Graphical User Interface (GUI)

The Open-Robot Manual Control GUI was created so that end-users could explore and
learn about Open-Robots various capabilities and also perform specific configuration
and setup related tasks. This document will explain how to use the Manual Control GUI
so that you can become more familiar with your Open-Robot.

Open-Robot GUI Manual. Abe Howells Robotics.

Table of Contents
Table of Contents................................................................................................................ 2
Connect to Open-Robot via MatchPort b/g or XBee .......................................................... 3
Open Loop and Closed Loop Motion Commands .............................................................. 4
RFID Commands ................................................................................................................ 5
Sensor Reflex Commands................................................................................................... 6
Get Sensor Readings ........................................................................................................... 7
Position and Velocity PID Gain Commands ...................................................................... 8
Digital I/O Commands........................................................................................................ 8
Miscellaneous Commands .................................................................................................. 9

Open-Robot GUI Manual. Abe Howells Robotics.

Connect to Open-Robot via MatchPort b/g or XBee


In this section we assume that you have already gone through the initial process of
connecting to Open-Robot for the first time. If not, then you should refer to the OpenRobot Owners Manual.

Simply enter your robots IP-Address and then select Open from the Socket menu. If you
purchased your MatchPort b/g module from Abe Howells Robotics, then it will be
configured for Ad Hoc mode with an IP Address of 169.254.0.10 and the baud rate will
be properly set to 115,200 BPS so that it matches OPEN-ROBOTs baud rate. If you
purchased your MatchPort from some place else, then you will need to scroll down to
refer to the Open-Robot Owners Manual section, Reconfigure MatchPort Network
Settings, to set the baud rate to 115200 BPS. After selecting Open, the program will
attempt to create and open a TCP-Socket connection with the MatchPort. Be sure that

Open-Robot GUI Manual. Abe Howells Robotics.

your robot is turned on before clicking Open otherwise it will take a minute or so for the
application to timeout.
If you decided to outfit your Open-Robot with an XBee wireless module instead of a
MatchPort b/g, then you can simply select the appropriate COM Port and set the baud
rate to 115,200 bps and select Open from the COM Port menu.

Once you have successfully connected to Open-Robot you will be able to experiment
with the various motion commands and/or configure specific operating parameters.

Open Loop and Closed Loop Motion Commands


Open-Robot leverages two direct-current (dc) gear motors for its differential drive
system. These motors are directly controlled by the PIC18F4520 microcontroller, but
thorough a special motor driver chip, which is more commonly known as an h-bridge.
The h-bridge can handle relatively large currents, but the PIC18F4520 is only capable of
sinking or sourcing up to a maximum of 25 milliamps (ma) of current. The two gear
motors will require several hundred milliamps of current when moving Open-Robot.
The most basic type of motor control is named open loop because the control loop is left
open and we only blindly specify a motor power level. At the PIC18F4520 level we are
setting what is called pulse width modulation (PWM) level. If we set the PWM level
higher, then the corresponding motor will rotate faster.
In closed loop control we use a sensor (wheel encoder) to measure each motors number
of rotations and/or rotation rate and we can then feed this information into the
PIC18F4520 so that it can control the speed or position of each wheel.
You have access to three different motor control commands with the Manual Control
GUI: open loop velocity, closed loop velocity, and closed loop position control.

Open-Robot GUI Manual. Abe Howells Robotics.

You can set the left and right motor values and then select the type of control. During
open loop and closed loop velocity you can set a value from 60 to 60 in increments of 1.
For position control you can set a value from 250 to 250 in increments of 1. The units
for closed loop velocity control are in tenths of an inch, so a value of 60 is equal to 6
inches per second. During position control the units are specified in terms of encoder
ticks. You can use the built-in utility to convert encoder ticks to distance or angular
rotation is degrees.

If you want to have Open-Robot rotate clockwise in a circle, then simply enter the left
wheels value as positive and then the right wheels value as negative or vice-a-versa if
you want to rotate counter-clockwise.
NOTE: To be able to leverage closed loop position control you must purchase a set of
WW-02 Wheel Encoders.

RFID Commands

Open-Robot can be setup to read and write to passive 125 kHz RFID tags. To be able to
do this you must purchase a suitable RFID kit from Abe Howells Robotics. You have
the ability to read and write a total of (4) ASCII readable characters or (4) Hex
characters. For example you could write the following characters to an in-range tag:
abcd. If you then performed a read, but with the Hex option selected you would read
the following hex characters: 61626364. The hex value of 61 refers to the ASCII letter
a. If there is a problem with your RFID module, then you can try resetting it by
clicking on the Reset button.
The process of reading an RFID tag takes a relatively long time when combined with the
added time of sending a wireless command and then waiting for a command response. To

Open-Robot GUI Manual. Abe Howells Robotics.

help end-users with this issue we have built a special function inside the PIC18F4520
firmware, Find RFID Tag. By clicking the Find Tag button you will have instructed the
PIC18F4520 to sample for in-range tags until you press the Stop Tag Search or Stop
button. You can check to see if Open-Robot has located a tag by pressing the Tag
Found? button. If Open-Robot finds a tag, then it will halt all motion immediately and
await further command from the end-user. These special functions are very useful when
you are attempting to have Open-Robot locate RFID tags in its environment.

Sensor Reflex Commands

We have spent an extensive amount time to ensure that end-users can easily operate
Open-Robot across a wireless connection. In support of this goal we decided to develop
what are named Sensor Reflex commands. A sensor reflex can be configured so that
Open-Robot will automatically stop when a specified sensor or any one of several sensors
exceed a prescribed value. For example, you can configure a sensor reflex for the front
left and front right infrared sensors. To do this you would need to specify the appropriate
8-bit binary string in the text box to the right of the Set Sensor Reflexes button. You
would also need to set the AD Reflex level by adjusting the numeric control that is to the
right of the Set Reflex Level button. With regard to the 8-bit binary string the least
significant bit refers to A/D channel#0 (battery level) and the most significant bit refers to
A/D channel#7 (front left light sensor). Please refer to the list below for the sensor
mapping.
A/D Channel 0 (battery level).
A/D Channel 1 (Front Center IR A/D Sensor J14 Pin#1). Purchase Separately
A/D Channel 2 (Front Left IR A/D Sensor J14 Pin#2).
A/D Channel 3 (Front Right IR A/D Sensor J14 Pin#3).
A/D Channel 4 (Rear Left IR A/D Sensor J15 Pin#4). Purchase Separately
A/D Channel 5 (Rear Right IR A/D Sensor J15 Pin#5). Purchase Separately
A/D Channel 6 (Right Front Light Sensor).
A/D Channel 7 (Left Front Light Sensor).
If we want to set Sensor Reflexes for the front left IR and the front right IR, then we
would type in the following 8-bit binary string: 00001100 and then click the Set
Sensor Reflexes button. If you want to find out what the current Light and A/D reflex
values are set to, then use the Get Reflex Level button. Use the Reflex Triggered?
Open-Robot GUI Manual. Abe Howells Robotics.

button to find out when a reflex has been triggered. Once a reflex has been triggered you
will need to use the Reset Reflex button if you want to restore the previously configured
sensor reflexes.

Get Sensor Readings

By default Open-Robot is equipped with (2) Sharp GP2D120 infrared (IR) sensors and
(2) frontward facing light sensors (photo-resistors). You can purchase additional
GP2D120 sensors as Open-Robot will support a maximum of (5) and/or (2) WW-02
Wheel Encoders. You must purchase (2) WW-02 Wheel Encoders if you want to be able
to leverage the Get Encoder Readings button or Get Wheel Velocities button. If your
robot has been properly equipped with WW-02 Encoders, then you can use the Get
Encoder Readings button to find out the current left and right encoder readings. You can
also use the Get Wheel Velocities button to acquire the current wheel velocities. The Get
AD Readings button will return a comma-delimited string that contains all of the A/D
and light sensor readings. Please refer to the list below for an understanding of how to
extract sensor readings.

X0 = Channel 0 (battery level).


X1 = Channel 1 (Front Center IR A/D Sensor J14 Pin#1). Purchase Separately
X2 = Channel 2 (Front Left IR A/D Sensor J14 Pin#2).
X3 = Channel 3 (Front Right IR A/D Sensor J14 Pin#3).
X4 = Channel 4 (Rear Left IR A/D Sensor J15 Pin#4). Purchase Separately
X5 = Channel 5 (Rear Right IR A/D Sensor J15 Pin#5). Purchase Separately
X6 = Channel 6 (Right Front Light Sensor).
X7 = Channel 7 (Left Front Light Sensor).
Example return: a140,120,110,108,0,1,145,151\r

The Wander Mode button will send Open-Robot out wandering with an open loop wheel
velocity of 25 for each wheel. Open-Robot will attempt to avoid sensed obstacles by
using the current value that is stored in the AD Sensor Reflex level. In general, a value of
60 works fairly well for the AD Sensor Reflex level when performing Wander Mode.

Open-Robot GUI Manual. Abe Howells Robotics.

Position and Velocity PID Gain Commands

You can get or set the position and velocity PID gains by using the Get PID Gains or Set
PID Gains buttons. If you set any of these values, then they will be used the next time
you request a closed loop velocity or position control motion. If you want these new
values to persist when you power Open-Robot off, then you must use the Save
EEPROM Data button.
NOTE: It is highly recommended that you leave the default values because they have
been properly tuned to provide optimal performance.
If you accidentally save the wrong parameters you can easily restore the default values
listed below.
Velocity PID Gains -> Kp, Ki, Kd = 1, 2, 1
Position PID Gains -> Kp, Ki, Kd = 2, 1, 1

Digital I/O Commands

There are a total of (8) digital I/O lines on the PIC18F4520 that can be used to control
external devices such as LEDs or read simple sensors such as line following sensors. To
access these you must first select the pin# and then you can either set the pin high/low or
read the pins current state.
Pin#0 -> PIC18F4520 pin RB1
Pin#1 -> PIC18F4520 pin RB2
Pin#2 -> PIC18F4520 pin RB3
Pin#3 -> PIC18F4520 pin RB4
Pin#4 -> PIC18F4520 pin RB5
Pin#5 -> PIC18F4520 pin RB6
Pin#6 -> PIC18F4520 pin RB7
Pin#7 -> PIC18F4520 pin RC5

Open-Robot GUI Manual. Abe Howells Robotics.

Miscellaneous Commands

If you change any of the following parameters: A/D & Light Reflex Level, Position &
Velocity PID Gains, Left & Right PWM Offsets and want the values to persist after a
power cycle, then you must use the Save EEPROM Data button to save them to
EEPROM otherwise they will return to their previous values.
By default you will find that Open-Robots dc gear motors do not rotate at exactly the
same rate even when you set their open loop velocities equal. This is because each motor
has a small manufacturing variation. To accommodate this small variation, we have
added a PWM Offset parameter for both the left and right motors. By default we set both
to a value of 160. However, you may want to fine-tune your robots values so that it
drives straighter when using open loop velocity control. Adjusting the PWM Offsets will
also help the robot to drive straighter during closed loop velocity and position control.
To begin the PWM Offset adjustment process I recommend starting with a PWM Offset
value of 160 for the left and right motor. Next set the left and motor to a value of 1 under
the Motion Control section and also be sure to select Open Loop Velocity as well. Click
on the Send Motion Command button. Check to see if both wheels rotate. Sometimes
you may need to give the robot a small push to break the static friction and get things
rolling. If neither wheel rotates, then increase both PWM Offsets by 1 (enter 161) and
then click the Set Right and Set Left button under the Miscellaneous Commands
section. If just the left motor rotated, then only increase the right motors PWM Offset
and likewise if only the right motor rotated, then increase the left motors PWM Offset.
You may have to continue to increase the PWM Offset on one or both motors to get both
wheels rotating. Now that we have both wheels rotating we want to try and get them to
rotate at the same speed so that Open-Robot drives as straight as possible. I suggest that
you only increase the slower motors PWM Offset until Open-Robot drives relatively
straight. You do not want to increase the PWM Offsets too high otherwise your robot
may have trouble performing closed loop velocity and/or position control. Be sure to use
the Save EEPROM Data button once you have evolved the correct PWM Offsets.

Open-Robot GUI Manual. Abe Howells Robotics.

You might also like