Friday, 22 February 2013

Desiging a line follower robot - part 2

This is the second part of the "Designing a line follower robot".  To see part 1, click here.

Here I will lay out the first steps in this design:

The weapon of choice for this project will be a PIC18F45K20 which will be the main controller for the robot.  The finished project will have USB to serial communication capabilities for downloading race information and so on.  To program the the PIC I will use PICKit3 and MPLab X IDE from +Microchip Technology Inc.

With any project it is best to break the project down into smaller parts which can be tested and made to work perfectly before moving onto the next stage of the project.  That way you have a better idea of where to start debugging (in terms of programming) or fault finding (in terms of hardware) when something is not working like you expected it to.  Please note that I am by no means a seasoned programmer and that there will be many other ways (probably more efficient ways) to achieve the same results.

So the desired end result will be a robot that will navigate along a random track, which could have gaps in to indicate markers.  We want to be able to communicate with the robot via USB (directly to the PIC and we will also add some external EPROM).  So the three subsystems of this project will be to design, build and program the timer subsystem (part1), the USB bridge and communication (part2) and then lastly the driving and navigation (part3).

The first subsystem which will be developed, is the marker-counter and timer subsystem.

This timer subsystem will have to count the markers (not more that 10x10mm gaps in the dark track/line), time the race and stop the ARV (autonomous robotic vehicle) not more than 100mm after the track stops.

7-segment display

To do this, we will have to design, build and test a system that makes use of an interrupt controlled by a reflective optical sensor (of which there are many different kinds).  The number of markers will be displayed on a seven segment display.  For more information on how to drive and control a seven-segment display, check out this link: (Assembly code included - remember to give credit to the people who's code segments you use)

The seven segment display will display the number zero at system start up and increment with one every time a marker is detected.  At the end of the track the number on the display will flash.

The system can be tested by moving the optical sensor along the track at a distance of 10 - 30 mm above the track over all the markers and proceeding over the end of the track.

Before you jump straight into programming your ARV you need to have an idea of the structure of your program.  So write it in plain English in flow chart form so you can have a clear picture of what the program should do once it is complete.  Here is an example:

line follower program flow diagram

For this project I will be structuring my programming slightly different to this and will share it with you as I progress.  The next post will explain the building and designing of the timer subsystem.  See what you can come up with in the meantime.

Check out the part 3

Tuesday, 19 February 2013

Designing a line follower robot - part 1

I get very excited about tinkering with electronics and things that move, light up, make a noise or generally just respond to my inputs.  A project which I have looking to do for a long time now is to build a robot which will be following a line on a track.

Let me just say this to start off with:  robots are not necessarily very complicated and can be built up from a few simple parts and instructions.  The plan or goal is set out as follows:

Design statement:
To build a autonomous vehicle which will move along by following a track. To keep it simple (since this will be my first REAL autonomous machine that I will build) the track will not cross anywhere, but it will need to perform a few functions during it's navigation around the track.  

So the objective is for the robot to complete a random track (not crossing anywhere) in the fastest possible time.   If there are any gaps (markers of 10mm long gaps in the track) it must be counted  and the number of gaps must be updated and displayed on a seven segment display.

After the track ends, the robot should stop by itself and store the 'lap time' in memory.  The idea is not to use any development kits like +Arduino or +Mindstorms EV3 , so a PIC microcontroller will be used.  In fact any controller can be used.  An +Atmel Microcontroller will also do very nicely.

Some examples of line followers:
Check out this little line follower from ELM:

Miniature line follower robot

From +Letsmakerobots (line follower):

Lets make robots - line follower

So, as you can see, line follower robots can be bigger or smaller depending on the application and design parameters.

Designing from first principles:
This is a concept that posed a hurdle for me when I was a student.  Math papers always say: "prove from first principles that..." followed by some theorem that was thought by some clever guy in the 1800's.  Other times, it is said to design a circuit or something from first principles.  

For maths and physics this means to provide the answer based on some basic laws or rulesFor example to show that power = volts x ampere from ohm's law.  In engineering and design, it simply means to follow logic steps and state what will work and will not work during the design process.  I will try to follow this thought pattern through the design of this simple little robot.

Click here for part 2.

Monday, 11 February 2013

Lets go Robotics Invitation

This Invitation from +I-SET  is extended to all interested parties who are thinking about starting up or getting more involved with learner Robotics groups.

Special mentions: +FIRST Lego League South Africa , +Andre Hoffmann , +House4hack , +Schalk Heunis , +Mike Barker