Henrik, the 1st
Computer controlled wheeled mobile robot
- Optimal path searching based on visual input -
Last modified on 7th, June, 1998.
We have developed a six wheeled mobile robot connected to an IBM PC. The rover controllable with high level commands. The system contains a CCD camera hung above the working environment. During the image processing phase status information are determined like robot location and orientation. We also map the accessible and forbidden regions. If the selected target location is available, minimal cost path is sought. The generated control command sequence is converted to stepper driving signals and dispatched to the driver unit placed on the rover. We balance the occurring errors and slips by continuous solving of the current visual input and by dispatching new command sequences.

KEYWORDS: Mobile robot, optimal path searching based on visual input, image processing

Please visit our current development page


If you are interested in learning further details of topics described below please mail us and we will try to answer your questions.
You can send your e-mail to:
            Attila NOVÁK       : anovak@ultra.obuda.kando.hu
            Milán HORVÁTH : mhorvath@ultra.obuda.kando.hu

To build the robot we used parts and materials can be got in commerical. The stability of robot is provided by six wheels, two of them are driven by four phase unipolar steppers. None of them is steered, so the other four wheels slip when the rover turns. You can see the geometry of the robot on figure 1.

The middle wheels connected to the steppers through 1:5 gear. When the motor steps, its axis turns 7.5 degrees, so these are 48-step motors (figure 2.). The number of steps can be doubled by using a special driving (Table 1.). One step means 0.49 millimetre rover moving.The programmable moving unit is 1 mm, so the maximum relative error can be up to 2 percents. The longer the distance have to be passed, the smaller the error occouring. For example to execute a Go 1000 command (1 metre moving) 2041 steps are needed which cause 1.00009 m moving, the error is negligible.
The base unit of rotation is one degree, the real turning is the multiple of the 0.26 degree. This means the worst case turning error is 4 percents supposing that the wheels don't slip.
The motors can be operated by 4.5-6 voltage.The steppers have more connectors than the DC motors.To keep turning this type of motors periodic signals have to be put to the wires. One signal changing causes one step. A general stepper is visible on figure 2. If you want a faster turning, simply you may increase the clock frekvency. Of course you can't reach any speed because the magnetic field is rebuilt after every step (figure 3). Normally one control input is in high at a time but the motor also works if the transition states are used too. This way the motor is in half-step mode and consumes twise the current than in regular use. Every active input requires 750 mA current.
The robot-control information is issued throug the paralel printer port of an IBM PC. The 750 mA is much more than the  maximum load of printer port, so we use an interface (figure 4.) and a high power driver (figure 5.) circuit. The task of interface part is to save pirnter port on failures and to provide enough current to feed the driver circuit. To do this we had to use open collector inverters because of two reasons. First, to open the power transistors about 50 mA base-current is needed, the totem pole output can't supply this. And second, at least 4.5 V voltage is required to close the PNP transistors when the output of inverters are in high. Totem pole outputs don't warrant that. And last, high current transistors switch on or off the stepper inputs on the driver board.

Other hardware elements
All the input information is come from a CCD camera. To convert the analog information to gray-scaled and digitized image we use an AVER 2000 digitizer card. To learn more about the working of the card please click on aver inside.
You also can read about the printer port of PC if you click here.

System description
The softwares based on Windows 95 OS. The following figure shows the logical architecture.

As you can see there are three main part: the robot, the camera and the software. Previously we described the interface between the robot and the software. If you would like to read about the camera-software interface please visit the AVER 2000 inside page. In what follows you can get to know what the software parts do and how the they communicate with each other.

The image processor
This part keeps connection with the AVER 2000 digitizer board. It saves the image passed by the camera. After this we correct the distortion of the picture. The next step is the thresholding method, we convert the 256 gray-scaled image to black abd white. The cause of conversion is that, all the information we are interested in is contained by the black and white image although the amount of data to be processed is less, the algorithms can be faster this way. For thresholding the image is cut to various parts because the illumination can be very different within a big picture. Last some of the parts have to be inverted. The process is visible on the next figure.

 The original, the thresholded and the inverted image

As you can see there are more disturbing effects. There are noise pixels in the upper right corner and a bunch of wire connecting to the robot. In many cases the wire cuts the robot into separated parts what can cause problems. The solution is the image preprocessing. To reduce error possibilities we use the composition of more  algorithms. The result is visible below.

Image filtering
After we got a relatively clear image the next step is the mapping of accessible and forbidden areas. All the bigger contiguous black areas are supposed objects and one of them is the robot. To distinguish objects we determine their area and center. In the future further properties will be used.

The path generator
After the objects are found we have to determine which object is the robot. When the program starts  it asks to specify the robot. After that the properties of Henrik are known. The rover has extension so we can't look at to it as a point. The simplest way is the dilating of other objects by the size of the robot. After that the rover is a point. To search optimal path we use a modified wawe-spreader algorithm (Method based on a potential field building. The working environment is looked as a matrix and the matrix elements are the small pieces of working area. Every matrix element is assigned with a kind of cost of getting to the current location. The cost is defined by the distance and the number of turnings). From the actual position a tree is built containing the optimal path to the all available location.

In the last phase a command sequence is geneated. These are high level commands  and passed to the command interpereter modul.

HELP   List of avilable commands
START   Starts the rover using the current settings.
STOP   Stops the robot
FORWARD   Sets the moving direction
BACKWARD   Sets the moving direction
RIGHT   The robot will turning.
LEFT   The robot will turning.
TIMESTEP N Sets the delay between steps. 
GO N Straight moving forward or backward (N is in millimetre and the direction is forward if N>0, backward anyway)
TURN N Turning, N is in degree..
ROUND N M Rounding, N gives the radius, M is the rotation angle.
DELAY Temporarily suspends the executing of comands.
Command interpreter
The third part of software is the command interpreter. It is cabable to convert the above commands to stepper driver signals. Every motor is driven through four data inputs, so the 1 byte is enough to control the two motors. The data structure of the modul is similar to the architecture of robot. A class is implemented to store robot specific, working-state information. It also contains two CStepper classes to realize the functionality of motors. A changable time-base defines the time to pass between two steps. After the specified time has passed, both motor have the chance to step. The state information (set by the script interpreter part described below) enables or disables the motor stepping. When the motors are turning into the same direction with the same speed, the rover goes in a straight line. In the case of different speed, it is rounding. To turn in place, the motors can work in the opposite direction with the same speed.
To realize the command function we implemented a CScript and CAvilCommands class. To create a new command the all to do is creating a function which tells to the script, what to do. After it a command registrating is needed because the interpreter have to be told, there is a executable command. The RegisterCommand() function bindes the command string, the command function and the avilable parameters.
When the script is running, the commands are checked and executed one after the other.
The command functions tells the CRobot object, what to do and how the motors must work to realize the command. The necessary number of steps is calculated and determined which stepper must omit steps, and how many steps have to be missed.

Communication between modules
To get visual information through the AVER 2000 digitizer we use the software library provided by the manufacturer. The problem is that, the library contains only 16 bit DLLs which aren't compatible with 32 bit developer environments. The result is we use 16 bit compiler to the image processing. To utilize the advantages of 32 bit systems we use a 32 environment to implement the command interpreter. 
Conseqently there are two applications must have the capability of working together. The solutation is the DDE communication. When the command generator is ready to give the data to the interpreter, it sends a DDE message as a client. The interpreter executes the commands and sends an acknowledgement to the image processor. After that the next iteration (image evaluation, command generating) can start.

Thanks your visit on our web site.
If you are interested in other projects connecting to the topic of artificial intelligence please visit the following site:
 Main page


Table 1. Stepper control table                                                          Back

Fugure 1. The structure of I. Henrik                                             Back

Figure 2. A general stepper                                                            Back

Figure 3. Stepping period-moment chart                                         Back

Figure 4. The inrerface circuit                                                              Back

Figure 5. The driver circuit                                                                  Back