Approaches For Low-Cost Robotic Prototypes: Figure 1 - The Dalton Robot
Approaches For Low-Cost Robotic Prototypes: Figure 1 - The Dalton Robot
Approaches For Low-Cost Robotic Prototypes: Figure 1 - The Dalton Robot
1. INTRODUCTION
Brain-machine interfaces and biological robots may be considered trends to current research on robotics, which
funds the implementation of new therapeutical procedures for several frontier problems in the medical sciences,
particularly rehabilitation and prostheses. However, the development of such complex strategies require a joint
multidisciplinary work involving scientists of different backgrounds, but especially a well-established infra-
structure on robotics. In this paper we report our first results to set up such infra-structure based on simple,
costless and flexible robots, so that to face budget limitations and to propose pedagogical strategies to be used in
undergraduate courses on robotics.
1
Figure 4 – Circuitry of
the robot
The building of the arm was accomplished using Hitec RS-422 servomotors and aluminum links from Robix
didactic kits. Some adaptations were required to elongate the first link of the arm, in order for the two links (one
real link and a virtual one, as it will be seen ahead) to be the same size.
The platform was built using wood, including the support for the video camera, which later proved to be a bad
choice, since the support would bend, misplacing the camera’s positioning.
The circuitry included a level translator for adapting tension levels between the microcontroller and the
computer, and the peripherals required for the microcontroller itself. For the level translator, regular bc-337
transistors were used. A 7-segment display was also included for debugging purposes.
2.2. SOFTWARE
2.2.1. Acquisition
The recognition system is composed of a color video camera and a video capture card (BT878 chipset).
To establish the communication with the video capture card and to acquire the image, DirectX 9 (SDK) libraries
were used, specifically the DirectShow libraries. The entire project was developed using Microsoft’s Visual C++
IDE. The image is obtained continuously by the software, and a static capture is taken when the robot’s arm is
not interfering in the image.
2.2.2. Pre-processing
Each static image taken during the acquisition has its internal representation as a bitmap.
The search for the balls in the image is based in color match. To improve the recognition efficiency, we perform
a search in a sub-sample of the image, accordingly to the Nyquist-Shannon theorem. This theorem states that, for
a reasonable sampling of a signal, one should use the double of the maximum frequency found in that signal. For
example, if the highest frequency of a signal is 1kHz, then this signal must be sampled at 2kHz minimum.
Using this idea, and calling D the average diameter of the balls, just one pixel at each D/2 pixels were analyzed.
If this pixel is of one of the colors in the project, then the Sobel algorithm was used. This assures that every ball
within the average diameter considered will be found, and reduce the number of analyzed pixels. This sub-
sample is obtained “on-the-fly”.
After finding one pixel of a ball, the borders of this balls are detected by the Sobel edge-detection indicators, also
calculated “on-the-fly”. The Sobel Edge Detector uses a simple convolution kernel to create a series of gradient
magnitudes. Applying convolution K to pixel group p can be represented as:
1 1
N ( x, y ) = ∑ ∑ K ( j, k ) p( x − j, y − k )
k = −1 j = −1
(1)
So the Sobel Edge Detector uses two convolution kernels, one to detect changes in vertical contrast (hx) and
another to detect horizontal contrast (hy).
− 1 0 1 − 1 − 2 − 1
− 2 0 2 , 0
hx
= hy 0
= 0
− 1 0 1 1 2 1
2
Figure 5 – Sobel Edge Detection algorithm example: the original
image, the horizontal detection and the vertical detection
2.2.3. Recognition
After image acquisition in the pre-processing, to every presumed ball we have a group of points in its borders in
diametrically opposed pairs. The center of the ball is easily found with a 1 pixel approximate error.
Each ball will go through a new color match step, were just the system cataloged colors will be actually
recognized (and every other color will be ignored).
2.2.5. Control
The angles that should be performed by the arm were calculated through trigonometrical equations of inverse
kinematics, from the real positions of the center of the balls. As the arm has three possible movements (shoulder,
elbow and wrist, in Figure 7a), the most immediate representation would be a three degrees of liberty robot, as
shown in Figure 7b, but considering the last link of the arm as a fixed joint, that should be positioned parallel to
the platform in order for the robot to capture a ball, we can simplify the scheme to a two degrees of liberty robot,
as shown in Figure 7c. Using this simplification and observing that the two links of the robot (one “real” link,
between the shoulder and the elbow, and another “virtual one between the elbow and the claw) are of the same
size, we have an isosceles triangle, whose base is variable but is known (the distance of the origin of the arm and
the ball), and two fixed equal sides (the links). Now it’s easy, using trigonometrical equations, to determine the
two angles that should be performed by the arm.
3
Figure 7a - Top view of the arm Figure 7b – Representation of the arm Figure 7c – Simplification of the arm as
as a 3DL robot a 2DL robot
There’s also a definite order to catch the balls, giving the Dalton robot a deterministic and predictable behavior,
which helped during the development in the error detection and correction steps.
2.3. HARDWARE
The communication between the robot and the host PC was established using the serial port of the computer. A
communication protocol was defined, including error detection parameters. Just two bytes (at best) are needed to
determine the movement of each of the robot’s joint.
As four simultaneous pulses are needed, with frequencies of 50Hz, to maintain the position of the
servomechanisms utilized in the arm, we’ve decided to use a PIC microcontroller. The utilization of the
servomechanisms, which gives a better movement precision and easier control when the end point is known,
requires the generation of a 50Hz pulse for each motor, whereas an update of the motor position is needed or not.
In the absence of pulses for a long period of time (bigger than some 50Hz cycles) can cause the loose of
tightness of the joint or even cause unexpected movements. The generation of the pulses directly in the host
computer would bring up problems, considering the real-time requirements of the system. Thought, we’ve
decided to use a microcontroller to generate the pulses, while the computer would be responsible to update the
positions as necessary.
Figure 8 – Pulses generated by the microcontroller. The minimum pulse width of 0.9ms moves the
servomechanism to its minimum counter-clockwise position, while the maximum 2.1ms pulse moves it
to the maximum clockwise position. After generating the fourth pulse, the microcontroller checks for
serial data available and makes any changes needed for the next pulse cycle.
In order to generate the four pulses in continuous mode, the microcontroller would receive data from the
computer, using the established serial protocol. This one supposes the first byte indicates what would be the next
motor to have its position changed. After that, a second byte, indicating the absolute position to where that
previous defined motor would move. The microcontroller echoed every received byte, avoiding communication
errors.
For the microcontroller being able to receive the data coming from the computer through the serial port, an
amplitude conversion should be performed, as the RS-232 protocol, used by the computer, works in the -12/12V
band, and the TTL protocol, used by the microcontroller, works in the 0/5V band. Many integrated circuits could
perform this operation; however, an analog circuit was built, since it’s easy to assemble.
4
3. A LOW-COST PROTOTYPE FOR ROBOTIC SOCCER
This circuit (Figure 11) is composed of the RF transmitting module, a rectifying diode in order to process the
signal incoming from the serial port of the computer and an antenna.
5
The size of the receiver (Figure 12) was greatly reduced by the module. In the following, data are processed by a
PIC16F84A-10 (Microchip Inc.) circuit, which is programmed by means of C language, in order to activate
motors.
3.2. PROTOTYPE
The prototype robot was developed to the first tests of the robot’s behavior and movements. Although it has not
been tested with the team control software, its behavior is reasonable with manual control software, attesting that
such approach enables the development of the other robot-players.
The prototype presents two independent DC motors: Consequently, it can moves easily and it is able to turn on
its own center, for example, when the motors are told to run in opposite directions.
3.2.1. Motors
In order to build the prototype, we made use of DC motors from old CD-ROM drivers, operating with 6Vdc,
mechanical reductions to slow down final speed and increase torque. Despite of the reduced size of the motors,
they provide a reasonable torque. Notice that other motors were tested and evaluated, however they did not
perform well in terms of size, torque or electrical tension requeriments.
Five 1.2V Panasonic rechargeable batteries, with 1.2Ah charge, were used. The project allows batteries changes
without any additional change to be made, as long as the size of the batteries remain the same.
3.2.3. Chassis
The chassis were built using fiberglass, which offers a good resistence to impact and little aditional weight to the
prototype. Any adittional weight would reduce the prototype speed and increase power consumption. The motors
are attached to the base of the chassis, the batteries are in a second plane, and the eletronic circuitry in a third
one.
To drive the motors, a Texas Instruments quad half H-bridge chip, SN754410NE, was used. This chip can
operate with 4.5V to 68Vdc supply voltage to the motors, at one Ampere of current source, and a separate logic
voltage supply. As we need a full H-bridge per motor, the two motors used for the prototype can be driven using
only one chip. A onboard heat dissipation layout had to be used, since operating power dissipation can lead to
high temperatures.
3.2.5. Control
The control of the transmitted signals and the speed of the motors is made with a Microchip PIC16F84A
microcontroller. A system using Microchip PIC12F675 is being developed, to take advantage of its small size
and reduced price.
3.3. SOFTWARE
6
• The next three bits indicate the driving of the first motor. The first bit indicates de direction that the
motor should move, and the other two indicate the speed of the motor;
• The last three bits follow the same rules to indicate direction and speed for the second motor.
With this protocol, four robots and eight speed levels (including a “stop” level) for each motor can be controlled.
5. ACKNOWLEDGMENTS
The development of the systems – the Dalton Robot and the prototype of the robot-soccer player – would not be
possible without the support from the Department of Biomedical and Automatic Control Engineering; as well as
the Research Funding Agency of Uberlandia (FAU), which provided the budget for all material required for this
project. We also acknowledge companies as Texas Instruments, who provided us with free samples of electronic
components; and Panasonic, who gently supplied us with the battery packs.
6. REFERENCES
• “THE SOBEL EDGE DETECTION ALGORITHM”, http://www.generation5.org/content/2002/im01.asp,
on September 9, 2004;
• “NYQUIST-SHANNON SAMPLING THEOREM”, http://en.wikipedia.org/wiki/Nyquist-
Shannon_sampling_theorem, on September 9, 2004.