Faculty of Engineering and Surveying
University of Southern Queensland

Secondary School Robotics Competition



Guidelines and Rules of Competition.

Background

As technology advances there is an increasing demand for computer literacy amongst young school leavers. It is important that computing skills be encouraged, particularly at a secondary school level, in an environment that maintains interest levels above that of the average classroom setting.



It is with this aim in mind that a handful of Engineers and Technicians at the University of Southern Queensland have devised a robotics based competition - nick named 'Bilby'. This same group of technologists has put together kits of parts to supply participating schools with a standard Bilby. The Bilby Starter Kit provides all of the components required to get a robot moving, including sensors and information as programs and documentation.



The Bilby is a small remote control robot that finds it own way along a path composed of simple wooden squares. The kit robot supplied is made from simple components available in most hardware and electronics stores. This robot is designed in the classic wheel chair configuration, that is - two driving wheels one either side of the chassis. The motors are 12Volt stepper motors identical to those found in 51/4" disk drives taken from old computers. The wheels are from the hardware store, requiring slight modifications for mounting to the motors. The circuit boards use only standard parts for easy replacement and were designed at USQ.

The provision of the Bilby kit is to start the competition off by setting up each school with a robot they can use immediately. As the competition develops teams will create their own improved robots to maintain a competitive edge over other teams.

The objective of the concept is to involve the students in the development of -

The objective of the competition is to race the Bilby's to the end of a path. The Bilby reaching the end of the path in the shortest time is the winner. This year the path will be a simple straight track with a few turns in it, but as the competition matures the paths may become more involved. This provides the competition with sufficient scope for future development to sustain the challenge, and to grow as it fulfils the needs of the participants. It is quite possible that in years to come the Bilby may be solving maze like paths, and bristle with sensors and gadgetry.


Rules of the Competition 10 May 1996

The Robot

  1. The robot may be constructed of any available materials providing it is safe to handle and does not damage or mark the path.
  2. The maximum allowable dimensions of the 'Bilby' are as follows -
    Length ( 25 cm, Width ( 25 cm, Height= no restriction
  3. The robot shall be automatically controlled by a computer through either -
    a cable that carries control information between the robot and the computer, or -
    an on-board computer system.
  4. The robot may be powered from either -
    a single 12 Volt power supply connected to the robot via a pair of wires, or -
    an on-board power supply system

The Path

  1. The path is formed from squares of wood as specified below. Note a suitable source for this material is 180mm wide, white shelving. White paper lying on black surface will also work.
  2. Each square is to be cut to the following dimensions -
    Side Length 180mm, Thickness 12 - 18 mm
  3. Hold squares together by tape on the under side, or joining by a dowelling pin in the centre of adjacent edges. The dowels should fit snugly so as to hold the squares together when lain out on a flat surface.
  4. The squares are to be finished on the upper square surface with a white finish.
  5. The path is laid out - white side up - on a flat, horizontal surface with a black non-reflective finish. This will ensure a good contrast between the path and its surrounds.
  6. The path configuration is flexible but will take the form of a single string of squares with only right angle turns.

Robot Control

  1. The control of the robot shall be entirely pre-programmed into the computer, that is - no human control is allowed during the race except to start, restart and stop the robot.
  2. The configuration of the path is to be unknown to the controlling program, that is - the path configuration shall not be pre-programmed into the computer to aid in the solution. The program may however record the path configuration during each heat or final period.

Competition Format

  1. A practice session will be held before the competition to test and adjust sensors, and allow teams to make final program changes etc. A typical path will be laid out for practice.
  2. Teams may be placed into age divisions depending on the number of teams entered.
  3. The competition will be composed a series of timed 'runs' in heats and the final.
  4. The 'run time' is measured from the instant the Bilby crosses the join between the first and second squares, to the instant it crosses the join between the 2nd last and last squares.
  5. In the heats each team is required to post a run time for their 'Bilby' to complete the path. The fastest run time for each team will be recorded. The period allocated for each heat is set according to number of participants, but would be typically 2 or 3 minutes.
  6. During the heats teams may adjust sensors and modify programs if so desired.
  7. The 3 teams recording the fastest run times will be selected to participate in the final. Once these teams are selected their Bilby's will be 'caged' ready for competition, and no further modifications will be allowed to either the robot or the control software.
  8. The path configuration will then be changed for the final to ensure fairness.
  9. In the final each team is required to post a run time for their 'Bilby' to complete the path. Each team will be allocated 3 minutes in which to post their fastest run time.
  10. The robot to reach the end of the path in the shortest time is the winner. If no robot completes the path then the one that moves furthest along the path within the time limit is the winner.

Robot Handling

  1. Each team is expected to mind and operate their Bilby during the competition.
  2. All teams shall use the 12 volt power supplies provided by the USQ.
  3. Each team may provide their own personal computer to operate their Bilby, or may choose to use an IBM compatible PC supplied by the USQ. ( 486 DX 33) A word of warning -
  4. Different PCs can run at different speeds. Using another computer will effect the speed of your robot and can significantly effect the reliability of your program. If you choose to use another PC allow for a simple global timing adjustment in your program.
  5. Within the time limit of each heat or the final a Bilby handler may start, stop or restart their Bilby at any time. This must be done via single key strokes to the control program.

Control cables to the Bilby must be supported by the handlers in such a manner that they neither impede nor aid the operation of the robot.


The 'Bilby' Starter Kit

Contents

Constructing your 'Bilby'

The following list of instructions is a guideline only.

  1. The stepper motors should already be bolted to the chassis with the 8 bolts provided.
  2. The wheels should already be press fit onto each motor, do not remove them.
  3. Bolt the 2 x 5 mm bolts into the 5 mm holes front and rear in the chassis, such that the head of the bolt protrudes outside the chassis and the length is adjustable, forming balance skids.
  4. Mount the driver PCB to the chassis using the 3mm bolts, ensuring the spacer is between the chassis and the bottom of the PCB.
  5. Connect the motor cables to the connectors on the driver board, making sure the tags on the white connectors match the connections shown in Figure 1. (If you put the connector on the wrong way the motor will just not run)
  6. Plug the sensor PCB onto the driver PCB, ensuring the connectors mate as in Figure 2.
  7. Cut 2 lengths of plastic support rod to a suitable size and lie them along the inside bottom corners of the chassis and strap them into place with the cable ties as in Figure 3.
  8. Cut lengths of threaded rod to suitable sizes and mount them to support the sensors as you desire. Use 3 mm nuts and washers to fix the sensors in place. You could use 3mm bolts instead of the rod if you like.
  9. Connect the sensor cables to the connectors on the sensor board, making sure the tags on the white connectors match the connections shown in Figure 2. (If you put the connector on the wrong way the sensors will always read ON) You may install up to 4 sensors.
  10. Connect the ribbon cable to the D shaped connector on the PCB, and connect the other end to the parallel printer port an the IBM compatible computer.
  11. Connect the power wires to the screw terminals -

Figure 1. Stepper Motor Driver Circuit Board


Figure 2. Infra Red Sensor Circuit Board


Figure 3. Suggested Infra Red Mounting Arrangement


How this Robot works

The Motor and Drive Circuit

This robot is driven by two stepper motors similar to those found in old floppy disk drives. These motors work on the principle of aligning the rotor of the motor and with electromagnets (poles) in the outside of the motor. By having many poles (or Phases) in the motor the rotor can be made to align to any one of the poles by energising the corresponding coil.

There are actually many of these poles (200 in this motor) around the outside of the motor, with every forth pole being energised by the same coil. The result is a motor with 200 steps per revolution which can be held stopped at any position. To make the motor turn - move from one step to the next -the 4 coils (phases) are energised in a sequence that attracts the rotor of the motor away from the last pole and onto the next. This is achieved by switching coils on in certain patterns which look just like a series of numbers to us. To reverse the direction of the motor we simply reverse the sequence.

The stepper motors provided in the Bilby Kit are controlled through the 8 data lines of the IBM PC's parallel printer port, which are normally used to send characters to the printer. As each motor has 4 coils to drive, each half (4 bits) of the port is used to drive one stepper motor. As the coils require 12 Volts to drive them each bit is used to switch on a transistor which switches on the coil. The integrated circuit (IC) on the circuit board has 8 of these transistors in it. The coils in the motor are connected to the transistors via the wires.

The best thing about using stepper motors is that once the sequence of bit patterns (numbers) is defined, the only thing the operator or programmer needs to know is how to step the motors forward or backward. In the robot Bilby Kit the software supplied in the documentation has the sequence of phases defined. (See the arrays left1() and right1() in the listing)

A sample program BILBY.BAS is provided including a subroutine that sends the appropriate patterns to the motors via the parallel printer port. You are encouraged to look into the subroutine to see how it works.

Subroutine Stepper(right, left, size)

The Stepper subroutine should be called from your Bilby control program once per step required. The parameters passed to the subroutine identify the right step, left step and step size -

right = 1 to step forward, 0 for no step or -1 to step backward on the right wheel

left = 1 to step forward, 0 for no step or -1 to step backward on the left wheel

size = the size of the step to be taken, 1 for a small (half) step, 2 for a large (full) step

Combinations of steps forward or backward on both wheels at the same time can be used to turn the Bilby around its centre point, or just to give it a nudge to the left or right to keep it going straight.

For examples on how to use the Stepper subroutine see the BILBY program provided.


The Sensor Interface

The ability for the Bilby to 'see' is provided in the form of up to 4 Infra Red sensors. These sensors are composed of an Infra Red LED (light emmiting diode) and an Infra Red Sensitive Transistor. These are arranged at an angle to reflect IR light off a surface about 5mm away from the sensor. Each of the sensors connects back into the computer through spare inputs on the parallel printer port. From your program the activation of the sensor is detected by reading the printer port input bits.

To add a sensor to the robot -

choose a sensor provided and position it where you wish to sense the path

plug the sensor into the connector on the sensor circuit board as shown in Figure 2.

locate the Sensor Adjustment Card attached to this documentation

adjust the sensor sensitivity by following the procedure on the adjustment card

incorporate the sensor function into your program

The Sensor function is provided that reads the parallel printer port to determine the state of the sensors and returns a number. You are encouraged to look into the function to see how it works.

Function Sensor(number)

The Sensor function should be called from your Bilby control program each time you wish to read the individual sensor states. The parameter passed to the function identifies the sensor number -

number = 1 for sensor1, 2 for sensor2, 3 for sensor3, or 4 for sensor4.

The value returned from this function is a 0 for the sensor OFF (no path), or a 1 for the sensor ON.

For an example of how to use the Sensor function see the BILBY program provided.

Function Bank

You may find the Bank function useful. This function is designed to read all sensors at once and return a suitable number. When you use the program line x = bank the bank routine will return a number between 0 and 15 inclusive which is a combination of all four inputs as follows.

x = sensor4 x 8 + sensor3 x 4 + sensor2 x 2 + sensor1 x 1 where each sensor value is 0 or 1

This may look familiar to you, as it is based on the binary number system.

For an example of how to use the Bank function see the BILBY program provided.


The BILBY sample program

To show you how easy it is to get the Bilby mobile we have provided a simple keyboard control program to use the Stepper subroutine and the Sensor Function to test the Bilby using -

f or F - for forward b or B - for backward

r or R - for right l or L - for left q or Q - to quit

The sensor states are displayed after each command. Lowercase letters cause steps of 1, and uppercase letters cause steps of 2. You are encouraged to start with this simple program to get going on the competition. Why not try a loop from 1 to 10 to step the Bilby 10 steps at a time.

Important Note :

Be aware that the stepper motors will step at a maximum rate of about 200 steps per second. You may need to include a delay loop inside your stepping loop just to slow down the rate at which you step the motors. You will be able to see when you are trying to step too quickly as the Bilby will probably just sit still and shake.

The Sensor Adjust Program

To simplify the Sensor adjustment procedure we have provided a simple program to read and display the sensor states continuously, which is used in conjunction with the Sensor Adjustment Card.

q or Q - to quit


Software Listings (files provided on disk)

Bilby Sample Program

DECLARE FUNCTION bank% ()

DECLARE FUNCTION sensor% (n%)

DECLARE SUB stepper (r%, l%, s%)

DECLARE SUB delay ()

CONST steptime = 500

CONST pdata = &H378

CONST pinp = &H379

CONST pout = &H37A

CONST pin13 = &H10

CONST pin12 = &H20

CONST pin10 = &H40

CONST pin11 = &H80

CONST pin1 = 1

CONST pin14 = 2

CONST pin16 = 4

CONST pin17 = 8

DIM SHARED lstep, rstep, olds AS INTEGER

lstep = 0

rstep = 0

olds = 1

DIM SHARED Mask(3) AS INTEGER

FOR i = 0 TO 3

READ Mask(i)

NEXT i

DATA &H80, &H40, &H20, &H10

DIM SHARED left1(7) AS INTEGER

FOR i = 0 TO 7

READ left1(i)

NEXT

DATA &H01, &H03, &H02, &H06, &H04, &H0C, &H08, &H09

DIM SHARED right1(7) AS INTEGER

FOR i = 0 TO 7

READ right1(i)

NEXT

DATA &H10, &H30, &H20, &H60, &H40, &HC0, &H80, &H90

SCREEN 9

CLS

LOCATE 2, 1

PRINT "Bibly Sample Program."

LOCATE 5, 1

PRINT "Move Forward Backward Right Left"

LOCATE 8, 1

PRINT "Full step F B R L"

LOCATE 11, 1

PRINT "Half step f b r l"

LOCATE 15, 1

PRINT "Sensor Number 4 3 2 1 Sensor Bank"

LOCATE 22, 1

PRINT "Q to quit"

DO

a$ = INKEY$

IF a$ = "f" THEN CALL stepper(1, 1, 1)

IF a$ = "b" THEN CALL stepper(-1, -1, 1)

IF a$ = "r" THEN CALL stepper(-1, 1, 1)

IF a$ = "l" THEN CALL stepper(1, -1, 1)

IF a$ = "F" THEN CALL stepper(1, 1, 2)

IF a$ = "B" THEN CALL stepper(-1, -1, 2)

IF a$ = "R" THEN CALL stepper(-1, 1, 2)

IF a$ = "L" THEN CALL stepper(1, -1, 2)

LOCATE 18, 1

PRINT "Sensor State "; sensor(4); " "; sensor(3); " "; sensor(2); " "; sensor(1); " "; bank;

LOOP UNTIL a$ = "q" OR a$ = "Q"


Sensor Function

FUNCTION sensor% (n%)

REM This version is for the new sensors and circuitry

IF n% >= 1 AND n% <= 5 THEN

IF (Mask(n% - 1) AND INP(pinp)) = 0 THEN

s% = 0

ELSE

s% = 1

END IF

IF n% = 1 THEN

sensor% = 1 - s%

ELSE

sensor% = s%

END IF

ELSE

PRINT "Use sensor numbers between 1 and 4"

END IF

END FUNCTION

Stepper Subroutine

SUB stepper (r%, l%, s%)

rs% = SGN(r%)

ls% = SGN(l%)

IF s% < 1 THEN

s% = 1

ELSE

IF s% > 2 THEN s% = 2

END IF

IF (s% - olds) = 1 THEN

IF (rstep MOD 2) = 0 THEN rstep = rstep + rs%

IF (lstep MOD 2) = 0 THEN lstep = lstep + ls%

END IF

olds = s%

rstep = (rstep + rs% * s%) MOD 8

IF rstep < 0 THEN rstep = rstep + 8

lstep = (lstep + ls% * s%) MOD 8

IF lstep < 0 THEN lstep = lstep + 8

stepdata% = left1(lstep) + right1(rstep)

OUT pdata, stepdata%

END SUB

Delay Subroutine

SUB delay

FOR i = 0 TO steptime

NEXT i

END SUB

Bank Function

FUNCTION bank%

b% = 0

FOR i% = 1 TO 4

b% = b% + sensor(i%) * (2 ^ (i% - 1))

NEXT i%

bank = b%

END FUNCTION