Programming a Line Follower Robot
5 stars based on
The containers are painted metal probably steelwith a thin plastic coating on the inside. About this same time, the ChiBots robot club began discussing holding a robot line-following contest. Naturally, the colorful candy tin seemed like a perfect body to motorize and drive around the course.
I had two Buehler gearhead motors 1. They fit nicely and provide enormous torque at low speeds - exactly matching the needs for meticulous floor examination. Because the LEGO bar connects line following program for nxt robot using pic microcontroller friction to all standard compatible LEGO wheels, a wide selection of high-quality, inexpensive, production-precision tires are available and quickly interchangeable.
A screw hole is drilled and tapped threaded to lock the brass to the gearhead shaft. Since the shaft is off-center on the motor, the motor bodies are purposely misaligned with each other, so that the wheels actually line up.
Clamping wood to the metal frame. Drilling holes with tape protection. Masking tape blue protects the paint at the drill sites. Clamp a piece of scrap wood against the thin metal body to prevent vibration and tearing during drilling. Be sure to center punch holes before drilling!
A center punch looks like a solid metal pencil with a hardened pointy tip. Aim the tip against the location for the hole and then lightly strike the punch with a hammer.
The indentation created prevents the drill bit from walking away from the desired hole location. Print outs of circuits taped in place to guide center punching.
Wood to level the underside during LED and sensor hole drilling. The printed circuit boards will be attached to the body with size screws. To determine where the boards fit and where the holes should be drilled, Line following program for nxt robot using pic microcontroller printed the CAD circuit drawings and taped them to the body. The paper would shift and tear-up during drilling, so I just used it to center punch each of the holes and to determine drill bit sizes. The car body has wheel axles formed into the base.
A piece of scrap wood is taped in place to keep the candy container flat during drilling. Bare metal exposed with protruding burrs. LED and sensor holes. Most of the holes drilled cleanly, although many have burrs and rough protrusions. An unfortunate consequence of the drilling is the exposure of the raw metal of the body. Beneath the front of the robot, two rows of eight holes each are for phototransistors and one middle row of seven holes are for the ultra-bright, high-efficiency, low-current, red LEDs All Electronics CAT LED The LEDs provide a consistent and controllable source of light, to which the phototransistors sense the light reflecting off of the floor surface below.
To save money and to avoid multiplexing inputs, only six phototransistors are currently installed. A segment LED bar-graph fits into the front grill. Wax paper is taped against the front to prevent hot glue from spilling through the cracks during bar-graph mounting. Yellow color hot glue was used to fill the cracks, although clear or black would have been fine. The shards and scrap collect on the motors due to magnetic attraction. The above picture contains a more detailed shot of the brass coupler.
Complete instructions on making a motor shaft to LEGO wheel coupler are detailed in the book Robot Building for Beginnersor make couplers on a lathe. Also in the above picture, the rear of the opposite motor reveals the off-center shaft. Black paint to insulate phototransistors. Reddish-pink latex mask peeled off after painting. Remember earlier that the holes drilled in the metal body unfortunately exposed the bare metal?
With all the circuit boards installed, the robot refused line following program for nxt robot using pic microcontroller operate.
A quick voltmeter check revealed the motor power 10 to 18 volts had mixed with the logic power 5 volts. A motor power pin on a Molex connector on the power supply circuit board had burrowed through the thin plastic liner and contacted the body. Now, nylon washers add space between the body and the board to correct that line following program for nxt robot using pic microcontroller and provide an air channel for cooling.
The phototransistors at the front of the robot have metal cases. The metal cases touched the exposed metal in the burred holes. The metal cases also happen to connect to the logic power. Line following program for nxt robot using pic microcontroller used a line following program for nxt robot using pic microcontroller reamer to somewhat deburr and slightly enlarge the holes.
Then I painted the exposed metal on both the holes and the sensors. Not only does the paint protect the exposed metal from corrosion, but should provide enough electrical insulation in case the phototransistors accidentally touch the sides of the holes again.
The metal body proved to be a liability. Plastic frames are lighter, easier to work with, and self-insulate. On the other hand, steel is durable, strong, and feels less cheap. Before painting the sensors, I dabbed their lenses with reddish-pink latex mask.
After the paint dried, the masks were just peeled off. This latex mask is great stuff! I poured it over all the backs of the printed circuit boards as further electrical insulation.
No need to dry beyond tacky. Liquid latex is a weak conductor. A splotch on paper and an ohmmeter demonstrates kilohms of resistance, rather than multiple megohms. The volt and up motor power killed all microcontroller pins sinking current. Showing some signs line following program for nxt robot using pic microcontroller intelligence, I socket my DIPs.
The container has plenty of room for motors, batteries, and three homemade printed-circuit boards. With the exception of two pieces glued to the frame, everything disconnects either through screws or Molex connectors.
Either a pair of 9-V batteries or a pair of four AA cells supply power. In either case, the batteries are center tapped to provide line following program for nxt robot using pic microcontroller power to the Maxim voltage regulator for the logic circuits.
This saves on voltage drop, while still providing a full kick to the motors. An idea about using metal structural parts: Attach one lead to the body, and then manually probe each metal part on the PCBs once. I have a question about your method of center-tapping the power supply for the electronics. So theoretically even if both motors operate for the same amount of time, one battery will give out before the other? A simple ohmmeter check would have revealed the short before applying power.
In center-tapping, one battery does indeed drain faster than the other. Both batteries supply full power to the motors, but one takes on the additional load of the logic chips and LEDs. In essence, three fresh batteries can perform the work that would otherwise require four. The actual ratio depends on how much idle logic time vs. Regardless, you make an important point.
This particular center-tapping arrangement only provides power savings, not current savings and therefore not extended running time.
By the way, inductor and capacitor-based switching regulators are much more efficient for most applications. This allows for rapid replenishment or a change in weight 9 V batteries are obviously lighter.
Using two alkaline 9-volts tops the motor supply at 18 volts. These are a good choice only for competition runs. At the low end of the scale, using eight 1. Although in practice they seem to be capable of a little more than 10 volts. Tapping that provides half the rated value, 4. But since the chips are all high-speed CMOS or better, they operate just fine down to 3. The AA packs last a lot longer than 9-volt batteries. They are also capable of delivering more peak current. To counteract the added line following program for nxt robot using pic microcontroller, the packs are balanced in front of and behind the wheel shafts.
The tailpipe is actually a switch. By having a covert switch, no electronics mess with the racing car decorum when the lid is on. Years later, the tailpipe switch needed repairs. Click to see a movie of a strip of paper being moved underneath the sensors and the bar-graph LED displaying the robots sense of following. A Maxim MAX regulates logic voltage.
Notice the liberal use of capacitors on both the regulated and unregulated paths to make it through current surges without glitches. A green LED connects to the microcontroller board hinged above the power board.
The green LED blinks every second under microcontroller control. Also, the power switch is too difficult to reach. The 68HC08 microcontroller provides plenty of horsepower at 8 MHz.