|
The Derbot design is based around either a PIC
16F873A or an 18F242, 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 & Practice.
|
![]() |
Getting Started
A Derbot build is intended for the confident hobbyist (i.e. someone who has
done some electronic assembly before, and can debug build errors in a circuit),
or for a student who can get support if needed. To succeed with the 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, 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.
Current Circuit Diagram
A couple of small revisions have been made to this since publication of the
book. 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.
|
A simple Derbot with forward-facing ultrasound detector, and piezo sounder. |
|
|
|
Derbot equipped with keypad and lcd human interface, LDR light sensing, simple shaft encoders for odometry, and ultrasonic obstacle detection. |
|
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. |
Class of 2007
Posted here are some of the more original designs of 2006-07.
The pcb in use is Version 4. Thanks to all in the group who have come up with
these very neat designs.
back to top
Derbot Challenge 2008
| This year at Derby University we had 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. |
![]()
|
|
|
|
|
Picture Gallery: Derbot Challenge
2008 |
|
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.
Parts
Parts lists are supplied in the book CD, along with part numbers for UK
suppliers. In the UK:
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 CD. 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.
Construction Details
This section details construction using Version 4 (1.10.06) of the pcb. This
is a slightly smaller pcb than pictured in the 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. |
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. |
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/ |
|
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.
A Word on 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.
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. | |
| 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. This scoop mechanism uses a solenoid (RS Components 250-0653) to operate it. The solenoid needs a 12V surge to cause it to activate, with 6V to hold it once it has pulled in. Circuitry for this can be supplied - contact me. | |
| 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 |
| This Derbot is carrying a Microchip Zigbee node, applying the link for remote control. |
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 |
|
Gregory Dedes with his room-mapping AGV. |
|
|
|
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. |