Selasa, 22 Maret 2022
Kamis, 22 Januari 2009
robot room
Sweet! An m&m's Bot That Follows Lines
For the holidays, my local grocery store sold m&m's candy containers in the shape of a racecar. The containers are painted metal (probably steel), with a thin plastic coating on the inside. A dinky package of plain m&m's came inside, not peanut, as the yellow-color driver suggests.
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.
Motors and Wheels:
I had two Buehler gearhead motors (1.61.013.326, All Electronics CAT# DCM-147) lying around after their weight rejected them from inclusion in an early Bugdozer mini-Sumo prototype. They fit nicely and provide enormous torque at low speeds - exactly matching the needs for meticulous floor examination.
A brass tube (with an embedded plastic LEGO bar) couples the D-shape motor shaft to a LEGO wheel. Because the LEGO bar connects with 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.
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. Try it! It makes hole drilling accurate and easy.
Sensor and Circuit Board Holes
The printed circuit boards will be attached to the body with 4-40 size screws. To determine where the boards fit and where the holes should be drilled, I 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.
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-50) 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 10-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.
Don't forget to remove the motors when drilling nearby metal. 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 Beginners.) Also in the above picture, the rear of the opposite motor reveals the off-center shaft.
Short Circuit #1
Remember earlier that the holes drilled in the metal body unfortunately exposed the bare metal? With all the circuit boards installed, the robot refused to operate. A quick voltmeter check revealed the motor power (10 to 18 volts) had mixed with the logic power (5 volts).
But how?
A motor-power through-hole pin on a Molex connector on the power supply circuit board had burrowed through the thin plastic liner and contacted the body. I had even added a transparency sheet between the board and the body, "just in case", and that had been pierced as well. Now, nylon washers add space between the body and the board to correct that situation and provide an air channel for cooling.
But how did the motor power in the frame reach the logic line?
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.
I used a hole 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.
Short Circuit #2 - Microcontroller Death
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. Plug the boards in and *POOF*.
Guess what? Liquid latex is a weak conductor. A splotch on paper and an ohmmeter demonstrates only 150 kilohms of resistance.
The 10-volt (and up) motor power killed all microcontroller pins sinking current. All inputs and +5 V outputs were undamaged. Showing some signs of intelligence, I socket my DIPs. With a quick replacement of the MC68HC908GP32CP microcontroller ($7) and the peeling and removal of all latex masking, Sweet was back in business.
All other chips and components escaped without apparent permanent injury.
Open the Lid
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.
An LCD provides for debugging, but doesn't fit when the racing car cover snaps on. The display screens are nearly identical to Bugdozer's LCD since all the core code for this robot came straight from Bugdozer.
Langganan:
Postingan (Atom)