Line follower robot DIY – 2
This is the second part of the “Designing a line follower robot”. See Part 1 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.
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: http://shree-electronics.com/interfacing7segdisp.html (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:
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.
Thank you for vising THE STEM BLOG SA
Click on Subscribe, share (button below the post) or simply look me up on any of these networks: