| OWI ROBOT ARM CONTROL | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The Archive's OWI Robot Arm is a USB-controlled
version, obtained as a kit from Maplin Electronics sometime in 2012.
Requiring simple tools to assemble and using four D-cells, the arm
is designed to work with a range of home computers via a USB-1
connection. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The Archive's fully constructed Arm |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
In order to use the Robot Arm on a BBC micro there needs to be a USB
interface connected. This project uses the USB interface of a
Retroclinic Datacentre. Although, perhaps, primarily designed for
use with USB memory sticks, the Datacentre USB interface can be
programmed to work with a number of other devices, such as a mouse
or a keyboard. The Datacentre documentation included example programs to connect a USB mouse to the BBC micro and comprehensive details about programming the on-board USB controller chip. In addition the Robot Arm documentation included a booklet containing example control programs written in Python 2, Visual Basic and C#. This information was studied and a prototype control program was produced to allow keyboard commands to control the Robot Arm's motors. Following a suggestion at the WROCC Show 2014, this prototype was modified to allow analogue joystick control of the arm. The prototype was constructed in several stages;
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Connecting the Robot Arm The code shown below was developed to connect the arm to the USB port of the Datacentre.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The code works in the following way. USB port 2 is the port used by
the arm. FN_FD on line 140 clears the USB port data buffer and sends
the string "QP2" to the USB port data buffer via PROC_CMD, returning
a value marking the success of the command. If the result is zero,
this indicates no device has been found and an error message is
displayed and the program halts. A non-zero result displays a message that the arm was detected and the program goes on to set the current device on USB port 2 to be device 0, the default device. This is accomplished by lines 190 to 220. The Break key has been programmed to reset the USB connection and
run the program. The Break key would be used if the arm had not been
switched on, for example. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Arm Control Codes To operate the robot arm the string "SSU $4006000100000300" is first sent to the arm USB interface. This string is followed by 3 bytes, which control the action of the arm motors and light. The bytes 0, 0, 0 will stop all activity by the arm.
The global variable
LightOn% is initially set to 0 when the program runs. When the
command to turn the light on is given this variable is set to 1 and
set to 0 when the light is turned off. This global variable allows
the light state to remain as set for all other commands. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Switching the light on and off This was the next step to be completed as it would set/unset the state of the light for all other commands and would produce the necessary functions and procedures needed to add the motor control commands. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Line 100 sets the global variable LightOn% to 0 so that the light
will be off by default. Lines 910 to 940 provide a delay in seconds.
The real parameter T allows fractional seconds to be entered. Lines 990 to 1040 send the appropriate message to control the arm's functions as given in the Arm Control Codes section. Lines 870 to 890 control the operation of the light. Once this
was proven to work the commands for all the other arm functions were
programmed along with a command-driven control program. The full
prototype program is given in the listing below. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Evaluation The OWI Robot Arm is a wonderful toy, especially when used with the joystick option. It is no good for precise work due to the large hysteresis in the gear trains and the lack of precision in the motors. There is also no feedback available so that the control program is unaware of the absolute position of the arm. Nevertheless children (and adults) love it, moving the arm to pick up an item and then moving the arm to drop the item elsewhere. The D-cells last a very long time, so long that is is wise to remove them if the arm is to be stored for a period of time The software works on both BBC model B computers and the BBC Master when equipped with a Datacentre. Internal Datacentres work just as well as external ones. The software is presented 'as is'. It is a work in progress. One addition could be to allow simple control programs to be entered, edited, saved, loaded and run. In this respect the arm could be used as a 3-D version of the program 'Crash' or 'Elephant'. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| © 2018 - 2025 flaxcottage.com | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||