the Derbot Project


Home
 

The Delight of the Derbot

Getting Started

What's New?

Current Circuit Diagram

Example Builds

Derbot Challenge

Parts and Kits

Design Options

Construction Details

Some Practical Issues

The Hand Controller

Using Derbot as a General-Purpose Development Board

Taking Things Further

Some History


The Derbot is a small and low cost AGV (Autonomous Guided Vehicle, designed for educational and experimental purposes. It is easy to adapt the core design to many versions, and new versions and variants are being created all the time. It can be used from an introductory level, right up to sophisticated multi-tasking applications applying a Real Time Operating System (RTOS). 
 

The Derbot design is based around either a PIC 16F873A, 18F242 or 18F2420, with DC motors driven by PWM, and  I2C bus for expansion.
 

The Derbot is a design example in the book Designing Embedded Systems with PIC Microcontrollers - Principles & Applications.

 


Getting Started
A Derbot build is intended for a student working on a university or college course, or for the confident hobbyist (i.e. someone who has done some electronic assembly before, and can debug build errors in a circuit). To succeed with building a Derbot, you need basic hand tools for electronic assembly, including a soldering iron. To start programming, you will need a PC, along with a Microchip PicStart or ICD2, either from Microchip themselves, or your preferred supplier.*

All parts are readily available. To start you need the main printed circuit board, which forms the chassis. For a supplier of the pcb or a kit, see under Parts. You can then build up and customise at your own pace.

*Note: there are alternative programmers at lower price, e.g. the Velleman PIC Micocontroller Programmer Kit from Rapid Electronics. This does not however program 18 Series PIC microcontrollers. I do not endorse these alternatives, but am aware that others use them successfully.


What's New?

A Summer (2011) project on cooperative robots

 

    click on image for full view

Alexis Cogrel and Bhekimpilo Nyathi, originally with Adam Louca, worked on this summer project.
 

A low-cost development equipped the Derbot with ultrasound obstacle sensors, electronic compass for direction sensing, light sensing, and a simple "kicking" actuator.

 

  

 click on image for full view

 

  click on image for full view

Derbots were programmed with the aim of taking part in a game something like football!
The "ball" was illuminated, and sensed by light seeking.

 

 

  click on image for full view

 

Applying the ARM mbed on the Derbot


  click on image for full view

In a final year project (2010-2011), Neil Race applied the ARM mbed to a Derbot.
The Derbot carried a protyping board which itself held the mbed. Wires were linked back to the PIC socket. It proved comparatively easy to replicate all the main Derbot functions with the mbed hardware, and development environment.

  click on image for full view

back to top
 


Current Circuit Diagram
A couple of small revisions have been made to this since publication of the book first edition. This is only of any significance if you are building a Derbot using Version 5 of the pcb. The current circuit diagram version is available here.

back to top


Example Builds
 

An early Derbot, equipped with keypad and lcd human interface, LDR light sensing, simple shaft encoders for odometry, and ultrasonic obstacle detection. This is the one that made it onto the book cover, in both editions!

A simple Derbot with forward-facing ultrasound detector and piezo sounder, which somehow got into my back garden!


          click on image for full view

     click on image for full view

John Toplis with his "Dogbot" burglar alarm Derbot. When it hears a sound, it runs around in circles, barking madly!

An interesting build by Don Brewster of  Texas, USA. The hand controller has been built very tidily using prototyping board.

            

        click on image for full view

       

 

         click on image for full view

This fascinating Derbot senses sound with three microphone capsules, mounted in triangular formation. A simple signal-conditioning circuit board is mounted above the battery pack. It uses the 16F873A Analog to Digital Converter to sense the sound from each microphone. When a wavefront is detected, it determines which direction it is coming from by comparing timing information from each channel. It then turns and runs in that direction.

This machine carries a marker pen, and is programmed with a neat teaching routine - teach it to draw a shape, and it then replicates that. It's meant to run on a whiteboard laid on the floor. By the time this picture was taken the whiteboard was put away. So it's running on just one sheet of paper...



       click on image for full view

 

         click on image for full view

This Derbot is similar to the one on the book front cover. It has an ultrasonic sensor mounted on the servo, and runs towards any movement it senses.

back to top

 


Derbot Challenge is an annual event, taking place at the University of Derby every year. Student teams, usually three-person, are set up and given the Task Statement, against which they have to develop their competition Derbot. Teams are chosen to be international, and combine students from different courses. View the machines and the action from each year below.
 

A Note to Prospective Employers: Students who have been part of the Derbot Challenge have completed a gruelling but rewarding design, build and commission experience. They have worked with embedded, electronic and software systems in international teams; they have indulged in innovative design, grappled with sensors and actuators, tasted the reality of reliability and EMC issues, and delivered to an unbending deadline. A good number have already gone on to rewarding careers in electronic, embedded or software design. Email me if you are recruiting graduates this year (especially in the April to July window), and want some recommendations.
 


Derbot Challenge, December 2011

This event took place on December 6th, with this task statement, and 12 teams competing. The members of the winning team were from UK, Poland, and Libya.

        


Derbot Challenge, March 2011

This event took place on Tuesday March 15th, with this task statement, and this poster. Nine teams took part. Local media were there, with this report by the BBC as a nice example.

Picture Gallery
Thanks to Richard Richards, Derby University photographer, who took all photos in this gallery.

.

 



Derbot Challenge 2010
This event took place on Tuesday March 16th, with this task statement, and prizes donated by Phaedrus Systems. Eight teams took part, each one producing an innovative Derbot machine; all performed creditably on the occasion. The requirement to clear obstacles from the path was met in broadly three ways: by a snow plough approach, by hitting, or by a grabber or fork mechanism with obstacle taken and dumped over the edge.
 

Picture Gallery
Thanks to Sally Edwards, Derby University photographer, who took all photos in this gallery.

.

A Derbot is checked for correct starting position, and whether the batteries are rechargeable.

back to top


Derbot Challenge 2009
Click here for task statement, and here to see the video.
 

back to top



Derbot Challenge 2008

In 2008 there were 12 teams of three students, each developing a Derbot machine. The aim of each team was to meet the requirements of a task statement issued in December. Teams displayed the performance of their machines in a competitive event on March 12th, 2008.

 


 Click on image
for  full view of poster.


Click to view video of Derbot Challenge event.
 

Picture Gallery
Thanks to Richard Richards, Derby University photographer, who took all photos in this gallery.

.


back to top


Parts and Kits

Printed Circuit Boards
The printed circuit board forms the chassis of the Derbot, and is the starting point for building the AGV. Version 2 of the pcb is used in the book, and published on the book CD. It is reproduced as a jpeg image, which is not the easiest thing to transfer to the pcb material.

Version 5 (15.6.07) of the pcb layout is the current version. As with previous versions, it is designed using EasyPC. It follows the same circuit design used in the book, but is smaller (and hence cheaper) than Version 2. The one circuit difference is that an extra decoupling capacitor, C10, has been added, at the 5V supply to the L293. A suitable value is 100n ceramic. Importantly, this board is designed for plated through hole manufacture, whereas Version 2 was not. This makes the board a little more costly again, but quicker to assemble, and much more reliable. Version 5 is almost identical to Version 4, pictured in all illustrations below, but corrects the known issues listed. The power inlet connector is also shifted slightly. Only known issue with this version is that the inner two nuts or bolt heads securing the right motor can short circuit the neighbouring track to ground. Solution is to insert insulating washers.

The Derbot main pcb, Version 4 (1.10.06). This pcb acts as the chassis for the Derbot AGV. 

 

While there is a UK supplier of this board I will be happy to supply Gerber files of this layout to institutions recommending the book, or to non-UK manufacturers. 

Getting Parts
Parts lists are supplied in the (first edition) book CD, along with part numbers for UK suppliers. Here is the current parts list, up to "Build Stage 2".

  •  Derbot kits, with and without hand controller, are currently available; email me for details. This works out rather cheaper than buying a set of parts.
  • The Derbot pcbs (main pcb, hand controller and battery pack) can be supplied directly by P & M Services Ltd  (phone: 01706 815212).
  • Motors are available from MFA/Como Drills .
  • All electronic components and other hardware bits and pieces in the core build are available from Rapid Electronics .

back to top

 


Design Options
The Derbot pcb is designed to be highly versatile. There are a number of standard options which are designed in to the circuit and pcb. For some of these there are fully developed demonstration programs on the book support page. The fun comes when you develop and customise these for your own applications. There are unlimited options if extra components or sub-systems are added, either on the prototyping area, or as extra boards mounted above the battery pack. In this case connect to the new board via the "bus" connector. 

Options for consideration include:

Non-AGV (standard options)
Simple led control from microswitches (Build Stage 1)
Signal generator, using the PWM output of  TP1 and TP2. 

  With "Hand Controller"
  Light Meter,  Voltmeter,  Electronic Tape Measure

AGV (standard options)
Basic AGV
(Build Stage 2)
Addition of light dependent resistors for light-seeking/light averse characteristic
Use of reflective opto-sensors for odometry
Use of ultrasound sensor for obstacle avoidance/wall following
Use of servo with ultrasound sensor for more sophisticated obstacle avoidance/wall following
Use of Hand Controller for user control

Further (non-standard) Suggestions
Line following, with downward-facing leds mounted on prototyping area
Electronic compass, linked through I2C bus (see the strangest looking Derbot ever)
Inter-AGV communication, or AGV to base station, with Zigbee, infrared, or radio frequency
Control using a standard model aircraft radio control unit.

back to top

 


Construction Details (standard version)
This section details construction using Version 4 (1.10.06) of the pcb. This is a slightly smaller pcb than pictured in the  (first edition) book, but is very similar, and uses the same circuit diagram. All images which follow apply also to Version 5, which is the current pcb version. 

Note that it is not easy to rework plated-through-holes boards. Therefore be sure you know what you are doing before starting to solder.

Known issues with  Version 4 pcb (note: these are all minor, and easy to correct): 
* Holes for the power input connector are too small for the part specified in the parts list. These should be enlarged by drilling to 3mm for the end connector, and 2.5mm for the other two. Alternatively, the connector tabs can be cautiously filed down.
* Holes for the plastic mounting lugs of the ICD connector do not match the lugs on the part specified. Holes for electrical connections are however correct. It is simplest to clip off  the mounting lugs, and solder in place. The mechanical strength of the six soldered connections will be adequate for all normal applications.
* The front microswitches should be mounted on 1mm pcb pins. The 3 holes per switch for these are slightly undersize for 1mm pins. They can be opened up to 1mm by drilling. Connections are only made to the underside of the board, so the loss of the hole plating will not matter. The same comment applies to the four motor connection terminals.
*There are two R10 resistors shown, as also noted in the Errata section of the Book Support Site. 

Build Stage 1
This completes the build to that shown in Fig. 7.22 of the book. Points to watch:
* Mount the body of the crystal oscillator slightly above the pcb. Otherwise the metallic can may cause a short circuit between the two terminals.
* Ensure that the polarised capacitors (C1 and C2) are connected the right way round. Each will be marked with a tiny "+" or "-" sign to guide you. In each case the negative side should be connected to the 0V pcb track, which is the widest at the point of connection. Reverse connected polarised capacitors are likely to burn out.
* Ensure that leds are connected the right way round.  

Derbot assembled to Build Stage 1, (Fig. 7.22 of book), except for piezoelectric sounder and drive transistor.

Microswitch mounting detail. Three 1mm terminal pins are soldered into the board, and the microswitch soldered to these.

Test this version of the Derbot by downloading Program Example 7.1. On power-up both leds should flash, and then remain on. Pressing the left/right microswitch after this will cause the left/right led to go off. 

If this does not work, check that:
* power is reaching the microcontroller;
* the crystal is oscillating;
* the |MCLR input is at logic 1;
* the logic levels from microswitches are reaching the port input pins on the microcontroller.

Build Stage 2
This completes the build to that shown in Fig. 8.29 of the book. It is a comparatively easy stage, adding two resistors, two ics, two motors, and finally two wheels! As this is the stage at which the Derbot can start to run around, it is generally the right moment to build and mount a battery pack as well. 

Add the two new ic holders, and the two pull-down resistors on the control lines to the L293 motor driver chip. Mount the motors using 3mm round-head screws and nuts, with the screws pointing upwards. 

Use terminal pins on the drive connections to the motors, wiring directly up between motor terminals and pcb terminals.
If you're adding a battery pack, then mount the pillars at this time, again with screw threads pointing upwards. There are three positions that the battery pack can take. The normal requirement is to place the centre of mass just behind the axle line, so that the Derbot tilts backwards. At this build stage the central position is fine. You can adjust position if you add to the payload of the AGV.

The battery pack then mounts on the pillars, and can be screwed down. Finally mount the wheels on the motor axles. If you are using the ones specified on the parts list, they have 2mm holes, which must be drilled out to the 3mm of the specified motor, or just under. Do this carefully, to avoid wheel wobble. The holes should be such that there is a firm sliding fit between axle and wheel.

NOTE: Although there is a standard pcb available for the battery pack, the simplest and cheapest solution is to make one out of strip board. See below.

You will need a third point of contact between AGV and the floor.  The simplest way to do this is a slider at the position marked "Tail Slide". Furniture and DIY shops offer little stick-on feet, e.g. for chair legs, which can be adapted. There are also a range of sticky feet for instrument cases, which may be useful. Many of these are meant to be non-slip, whereas we want something that does slip - so take care!

More up-market are the various roller-ball mechanisms available from hobby and robotic sites. Only small ones will Fit Version 4 of the pcb. 

As the Derbot is likely to tilt forward at some times in motion, it helps to fit a second slide to the front as well, say beneath the servo site.

 

    click on image for full view

While there is a layout for the battery pack pcb, it is just as easy to do without. Prototyping board (also called "vero board" or "stripboard") is available which has exactly the same width as the Derbot pcb, Rapid Electronics sell a sheet of stripboard with dimensions 119x455mm (part number 34-0540). This is exactly the same width as the Derbot pcb. To make a battery pack, cut an 82mm (3.2") length of this. Transfer mounting hole positions to this from the main Derbot pcb (4.3" side to side, 2.7" front to back). Drill these holes to 3mm. Mount the battery packs, and insert wire links to put the two packs in series.
There are alternative wheels which can used. This picture shows aeromodellers wheels in use, with aluminium hubs. Such wheels can offer improved rigidity, an asset if you're using the reflective opto sensors. These ones needed to have the hole drilled out to fit the motor shaft.

click on image for full view  

Test this version of the Derbot by downloading Program Example 8.4 (see book site for small bug in this program, and its fix). The leds should flash when power is switched on. The Derbot should then run forward. When it hits an obstacle, as detected by a microswitch being depressed, it should reverse and turn, the turning direction depending on which switch was activated. The Derbot will then return to its forward motion, until such time as it hits something again.

A Word on Batteries
The motors can take significant current, particularly when starting from rest. For this reason it is best to use alkaline batteries for this project. Certain other battery technologies have internal resistance to a level which will cause the system to "brown out" on a current surge.

Bumpers and Whiskers
Once your Derbot starts running around, you'll realise that the microswitches won't detect every obstacle it's going to hit. Therefore you need to apply your ingenuity to design bumpers, whiskers, or whatever extension you think your microswitches need. There are 12 holes distributed around the front of the pcb which have no electrical connection. They can be used to anchor the ends of whiskers, or other outriders.



This picture shows a Derbot with a simple plastic bumper. The microswitch blades are curved, and the bumper is loosely wired onto them, giving a sliding fit. 

This picture shows a simple whisker arrangement on a Derbot Ver. 2 pcb (as seen in the book). Whiskers are made out of lightweight piano wire, with a sliding fit on the microswitch blades, and the other end clipped into holes placed there for the purpose.

This build by Jim Wicks uses the edge of a margarine or ice-cream tub to form the bumper. Just the right size and curvature!


Fitting the Light Dependent Resistors (LDRs)
It is simple to fit these. The sensors themselves should sit around 2cm above the level of the pcb. Each one should have its associated 10k resistor fitted.

The rear LDR looks out over the 74HC14 chip. 

 

Fitting the Reflective Optosensors
These are the most awkward of the standard Derbot options to fit. The sensors themselves are small and delicate, and can need careful positional and electrical adjustment. 

Mounting on a section of right angle header plug is recommended. This creates a 4-pin right angle plug, as shown, which can be mounted in two different ways, offering two different physical positions for the sensors.  The sensor can be mounted before the plug is soldered in place, checking very carefully that the connections are correct.

The optosensor in place, with black/white pattern (from book CD) fitted in place. The sensor face must be the correct distance from the pattern surface (generally 2-3mm). 
If you don't want to use the encoder patterns given on the book CD, consider buying wheel encoders, such as these supplied by  http://www.active-robots.com/

Wheel Encoders

As the leds of both sensors are in series, both must be correctly fitted for either to work. Transistor TR2 must also be fitted (and switched on by the microcontroller), or alternatively a connection wired between drain and source (for optosensors to be permanently enabled).

Different sensors have been tried with success. However they have different sensitivities, and may require adjustment of resistor values.


Some Practical Issues

If you work with the Derbot or similar machine, then you are at the interface of software systems, electronic systems, and electrical systems. You need some understanding of all in order to be successful. This section highlights some areas which give challenge, and where solutions to a problem can be software, hardware, or a mix of both.


Motor Interference
Like all brushed DC motors, the motors recommended for this project produce radiated interference. First order filters are designed in to minimise the impact of this on the reflective opto-sensors. In most other cases where it is a potential problem, it should be possible to eliminate by software methods, as described for example on pages 209-213 of "Designing Embedded Systems with PIC Microcontrollers". 

The manufacturer's recommendations for interference reduction, which I have never felt the need to implement, are as follows: 
* connect 0.1uF capacitor from each terminal to the motor case, ensuring that non-conductive coating of case is rubbed off where connection is made;
* increase the suppression capacitor already fitted to 0.22uF;
* place ferrite beads on motor leads close to the motor body.


Using the Futaba S3003 Servo

This servo is power hungry, as mentioned in the first paragraph of 9.6.1. That's why in Program Example 9.3 (either edition) we ramp it to move. However experience with a number of builds has shown that the values used still leave the performance "on edge". If battery voltage is on the low side, and/or alkaline batteries are not in use, and/or the voltage regulator goes into over-current shut-down too enthusiastically, then there is a dip in the 5V line, and Brown-out reset is invoked (this is left enabled in this Program in the version on the book CD, 1st edition).

 
To correct try one or more of the following:
* ensure battery voltages are adequate, and alkaline are used;
* introduce a voltage regulator just for the servo, drawing its input direct from the 9V line;
* slowing the ramp down in software - this will take a bit of thought, as at present it increments/decrements by one every time the PWM pulse is output, but it shouldn't be too difficult to halve it;
* introducing a larger value electrolytic capacitor between 5V and ground;
* switching off brown-out reset; as there are clear symptoms that the supply line is dipping this is of course not too clever, except as something to experiment with.
 
This is an interesting moment to apply a digital storage 'scope, if you have one, to observe the suspected voltage dip, either at battery terminals, and/or voltage regulator output.


back to top



The Hand Controller
The "Hand Controller" provides human interface to the Derbot, whether it is then used as an AGV, or as a development system, for example to create the light meter, voltmeter, or ultrasound tape measure. The latest pcb is dated 9.1.09 (Jan. 9th, 2009), and is the one pictured below. It is lcd only, and adds a general-purpose led to Port B0, which had been used by the 7-segment display. When loaded with Program Example 10.3 the hand controller becomes a general-purpose keypad/display terminal.

Some Notes on Construction

Use tinned copper wire, or cut-off leads from resistors or other components, to connect the lcd and keypad to the pcb. Secure the lcd to the pcb by also soldering  two wires at the right hand end of the display, even though they make no electrical connection.

There aren't then so many other components. Ensure correct insertion of led (positive, longer, terminal to right in picture) and resistor array (common terminal, with dot, at lower side of picture). Ensure also correct interconnection of the five wires, they match the connector on the Derbot directly. Crimp or solder the little connector terminals to each wire, and slide them into the connector housing. Each terminal has a tiny leaf spring, which should click into the corresponding slot in the housing (clever eh!?). If you have soldered, then you will probably still need to fold in the little crimp wings on the terminals a bit, or they may not slide into the housing.

One way of testing your newly-assembled hand controller is by loading Program Example 10.2 into the Derbot microcontroller, and Program Example 10.3 into the hand controller microcontroller. A welcome message should appear on the lcd, and any keypad press is sent to the Derbot, and echoed back. This can then become the skeleton for you to develop your own programs using the interface. The light meter program is another good one to try (but remember to fit LDRs and associated resistors).  If you get nothing on the display, or very dark lettering, try adjusting to contrast potentiometer.

The current hand controller board does not have a connector for ICD2 or PICkit 2. To program you will need to transfer the PIC to your Derbot, or some other programming device.

 

click on image for full view

back to top
 



Using the Derbot as a General-Purpose Development Board

The Derbot pcb can be used as a general -purpose development board, for example when working on the light meter, voltmeter or ultrasound tape measure, as described at the end of Chapter 11. The board can then be powered from a 9V battery, as shown.

 

click on image for full view

 

 

click on image for full view

The Hand Controller can be mounted above the Derbot pcb, as usual.

back to top
 


Taking Things Further

There is plenty of scope in the Derbot design to customise it extensively. On the main pcb itself there is a prototyping area, and further boards can be added above the battery pack (including of course the Hand Controller.

One way of adding prototyping space is by making a battery pack using stripboard, but extending it to include some prototyping space. The picture shows a partially complete board, made in this way. Note that signals can be brought up from the I2C bus connector at the rear of the main pcb, or from the many signals that appear at the front of the pcb, including those meant for the servo and ultrasonic detector.

click on image for full view

click on image for full view  

There is not much in the book about adding actuators to the Derbot, e.g. for picking up, carrying or putting down objects, or clearing obstacles. However it is perfectly possible to devise a range of simple actuators, and this has been done numerous times in the Derbot Challenge events. The scoop mechanism shown uses a solenoid (RS Components 250-0653) to operate it. See below for more on solenoids.
An interesting challenge is to equip the Derbot with solar energy. Ideally this requires an energy management program to be written, with an ADC input being used to monitor solar array voltage. Solar energy is after all a fickle thing (at least in the UK it can be!). Secondary energy stores, e.g. large capacitor or rechargeable battery, can also be used. Solar cells used here are 0.45V, 200mA, order code 37-0432  from Rapid. click on image for full view

click on image for full view

This Derbot is carrying a Microchip Zigbee node, applying the link for remote control.

Read this for more information on working with solenoids.

Push action mini solenoid,1.2W 6Vdc

back to top
 


Some History
At Derby University students studying embedded systems have designed and built over the years a range of microcontroller-driven devices - games, toys, metronomes, industrial controllers, and various types of autonomous guided vehicle (AGV). A core AGV design was developed, which came to be called the Derbot.

Kelvin Brammer testing an early line-following Derbot on a special test table.

   

David Cotterill-Drew with his Metal-Detecting AGV
This machine senses and avoids obstacles by means of the two front-mounted ultrasound sensors, and detects and signals any metal it passes over.

 

Gregory Dedes with his room-mapping AGV.
This is a 68HC12-based machine, with rotating ultrasound obstacle or wall sensor, and electronic compass. It uses shaft encoders on its wheels for odometry. It was built as part of an MSc dissertation, with the aim of implementing a room mapping algorithm.

 

The strangest-looking Derbot ever? An electronic compass is placed at the top of the pole - high enough to be absolutely clear of the magnetic field of the motors. This however is overkill. Around 20-30cm is adequate. The compass communicates with the microcontroller via the I2C link.

back to top