TrackBot

by Bruce M.

My project was based off of Sergei Bezrukov TrackBot. The purpose of the bot is to not need a remote control. It will be able to run by itself. It detects objects by the sensors that are mounted to the front of the bot. I have included all the information you'll need to get this project done. The source code and the required parts are available on this site as well.

TrackBot Video I Video II
clip
click (DivX, ~5.1Mb)
clip
click (DivX, ~6.5Mb)

Hardware

The hardware for this TrackBot is different then Sergei's TrackBot. I used another CPU family and other parts. For the top level: the main processor is a 20-pin microprocessor chip, MSP430F2101. There are 3 sensors that are infrared LED, SFH4511. These are the infrared that send out a signal in wavelengths. The sensors pick up random wavelengths so part of the code detects that it has to receive at least half of the wavelengths that are sent out. The sensors that receive these wavelengths are IR sensor, TSOP32338. On this board as well are motor controls that are trimmer, 10Kom. There are two of them, one for each motor. This helps to control the motors and get them to match in speed so it doesn't have a slight turn in it. The battery pack and on/off switch sit right behind the control chip.

Sensor board Schematic
clip
click to zoom

On the lower level of the TrackBot the motors sit. We had to use a set up were there are two separate motors. One controlling each track. This would allow for us to change directions of the track. By doing this it allows for a smoother turn. The board that is located on the lower level is where the motors plug in. Each motor has its own connector receptacle on it. The motors have a connector header that plugs into the connector receptacle. Then there is a terminal block, this is where the battery back (on top level) plugs into. This supplies the boards and motors with ample power. The two boards are connected by a 7 prong ribbon cable. This is how the top board communicates with the lower board.

Motor control (top) Motor control (bottom) Control board on vehicle

Movement of the TrackBot

The way that the TrackBot is able to run without a control is by 3 infrared emitters (IE). There are 2 IE that point away from the board at 45° angles and one at the front that points strait down. The ones that point at a 45 degree angle detect objects that are in the way. They are able to do this by sending out radio wavelength pulses. The IE send out 16 pulses that will bounce off an object if there is one in the way. The wavelengths are sent back to the receiver (located right next to the IE). If the receiver receives 8 or more of the pulses that are sent, it realizes there is an object in the way. When it realizes there is an object in the way it will turn the opposite track, causing it to turn. If both IE's receivers sense and object it makes the TrackBot go backwards. Since the motors are not perfectly in sinc, the bot naturally turns a little to the left, this will allow for a slight turn until only one of the receivers detects and object allowing for a quick turn. So the bot should never get stuck.

The middle IE was a little harder to figure out how to make it work. The purpose of it is to notice if there is a drop off or not. We had to program it backwards of the other two IE's. This IE's receiver should always detect an object (the floor). If the IE receiver doesn't detect the floor it stops both engines. The reason for shutting of both engines is so the TrackBot wouldn't turn and have a track fall off the edge while turning. While trying to figure out the middle sensor we had issues with it work on Sergei's shiny desk. But if we put paper down it ran just fine. Well after modify the code several times we thought we had it figure out. But once we brought it to the linoleum flooring it wouldn't move. After standing and staring at it if for a while, we understood that it wasn't reflecting back to the receiver. The surface was too reflective and would bounce at same angle in the opposite direction. Because of this the receiver wasn't detecting a floor. We then bent the IE strait down and the receiver down as well and it detected the floor just perfectly.

Software

Assembly was the language that was decided to be used for the TrackBot. I did not write the code myself, due to the fact that I know very little about assembly and there are sections of the code that had to be processed under 14 msec. Sergei was the one that wrote the code. He sat down with me several times and explained it to me and exactly what was going on. He had already written the code but he had me go through the user guides of the micro controller and write code on how to turn on certain functions from with in.

The checkSensor method was a very complicated method. The checkSensor section of the code is the reason why the robot doesn't run into the walls or off an edge. The code is run by sending out pulses. You have to send 16 pulse out. But the count is done in halfs, so you have to send out 32 instead. After the pulses are sent out you have to be able to have the pulses received counted. Once you have sent all the waves and collected those that were received you need to figure out if half of the waves were received. The reason for comparing with half is because the sensor will pick up outside interference. This could cause the bot to think there is something there that really isn't there. So there is a compare to the number received and the set number, 16 because of half lives. If the number is 16 or exceeds 16 the bot will jump to the part of the code that will turn the right backwards allowing for a turn, at this time the code will re-loop until the number of received waves drops below 16 then will put the right track back to forward. If the number of waves is less then 16 it will proceed to check the right sensor. The right sensor is coded exactly the same way but will turn the left track backwards if object is detected. If no object is detected it will move onto the middle sensor.

The middle sensor is ran a little different. Since this IE detects if the floor is there or not it had to be changed. The logic is very simular to that of the other sensors. But instead of seeing if it receives 16 half waves it detects if it doesn't receive 16 half waves. It has to receive these wavelengths to show that there is still a floor. If the waves are less than that means that there isn't a floor. If the pulse is less then the 16 it will stop both motors instead of just turning one side or the other.

The chkPot1 and chkPot2 are the functions controlling the speed of the motors. They use the theory of PWM. With this theory you are able to control the motor at a more efficient rate. It also controls the humming noise that is heard.

Final words

The whole experience was very knowledgeable. From start to finish it was a constant learning experience. From choosing a project to do, to choosing what parts should be used. Then sitting down and understand the code, changing small parts to work for the hardware that was used. Then for setting the IE set up just right for finding the edge of something or finding an object that is in the way of the bot. Then making sure that the track stayed on the TrackBot it self. Very fun project to do :)

Downloads


Last modified:Mon, Jan 23, 2023.

01739