Programming the

OWI-007

Robot Arm

 

Background:

The Original Parallel Port on the IBM PC has the following PINOUT.

Figure 1[1]

 

The Robot Arm uses pins D0..D7 on the parallel port to turn on and off motors for the robot. The bit pattern required to make each individual move is in Table 1 below.

 

Port Numbers

There are three different addresses commonly used for the parallel port. These are 278h, 378h and 3BCh (h -> hex). You must determine the address used by YOUR COMPUTER. This can be done by looking at the LPT1 settings under the device manager (or on some computers it comes up when the computer is booting). In windows you might see something like this:

 

Figure 2Printer Port Properties

 

The range 0278-27B is the PORT Range, Since the parallel port is actually 3 ports. The first number listed, 278, is the port number of the D0..D7 Pins.

 

Windows and Printer Port Control

Sometimes the Windows Operating system does not like to give up control of the printer port. Since I usually have students program the robot in Assembly Language and run the program on a DOS based machine, this is not a problem for me, but if the arm is not acting as predicted, this MIGHT be the problem so I warn you here.

 

Thinks to keep in mind when programming

  • The robot will only one axis at a time.
  • The robot will only move from the time the data is sent to the port till you send the next value to the port. Most of the time, this means you will need some kind of delay before sending the next value to the port.
  • If you end your program with the arm in motion, the robot will continue to move after the program ends. Always send the stop signal before ending your program
  • When restarting the computer, turn off the robot arm or it will start moving. I put a “PRESS ANY KEY” routine in the program and when I get the message, I turn the robot arm on.

 

Making the Robot Move

To make the robot do each move, you must send the proper number (from Table 1) to the printer port. Most software languages have a command to send a value to a hardware port or address. I have listed some of the languages I am familiar with below along with some tips on the commands to use. 

 

Intel Assembly Language

To write a bit pattern to these pins you have to use the OUT op code. The address for the port MUST be in register DX. The value to write to the port must be in AL. The commands required to write to the port are as follows (assumes port address is 378h):

 

                                    Mov dx,378h

                                    Mov al,value_to_write

                                    Out dx,al

 

So if we want to open the gripper we would have to do the following commands:

 

                                    Mov dx,378h                          ;Write to LPT1

                                    Mov al,0000_1111b                ;the value to open the gripper

                                    Out dx,al        

 

LabVIEW

The robot can be programmed via LabVIEW. See http://zone.ni.com/devzone/conceptd.nsf/webmain/72C6FC6CE4AD4D1386256B1800794596

 

Qbasic

You can program the robot arm in this language as well. The OUT instruction can be used. You will need to convert the HEX value of the port to a DECIMAL number. Refer to your QBASIC Manual for more info on the command.

 

C

I have not programmed the robot arm using C, but it looks like it can be done using the outb() instruction. See http://www.faqs.org/docs/Linux-mini/IO-Port-Programming.html

 

Visual Basic 6.0

To gain direct control of the parallel port in VB 6.0 you need to add a special DLL. I suggest reading: http://www.lvr.com/parport.htm#Programming

 

 

 

Figure 3[2]

Table 1:

Joint

Motion

Binary Output

Gripper

Open

0000_1111b

 

Close

0000_0000b

Wrist

CW

0000_0100b

 

CCW

1000_0111b

Elbow

Up

0001_0111b

 

Down

0000_0001b

Shoulder

Up

0000_0011b

 

Down

0100_0111b

Base

CW

0010_0111b

 

CCW

0000_0010b

STOP

 

0000_0111b

 



[1] http://www.doc.ic.ac.uk/~ih/doc/par/

[2] Picture from OWI-007 Robot Arm Win98 software