Adding Electronic Control to the RBB-Bot
Mounting the L298 Module Board
The first order of business is to remove the switch panel and wiring from the Phase 1. These components won't be used this time around, but don't discard or recycle them just yet! You'll have the option to reuse these components in later installments of this series.
Note: Rather than unsoldering the wires to the motors, completely remove the motors from their gearbox housing. Merely pull back on the retainer clip on the side of the gearbox, and lift out the motor. Set the motor/switch assembly aside for the moment.
Drill four holes into the RBB-Bot base for mounting the L298 module board. Be sure to position the board on the end opposite the skid. The reason: you want the heaviest components over the skid, to keep the robot from tipping the other way. You'll be placing the batteries, which weigh more, on the skid end.
Orient the L298 module so that the black metal heat sink faces toward the far end of the robot. We'll call this the "front" of the RBB-Bot.
Use 4-40 x 3/4" machine screws, spacers, and threaded standoffs to mount the board as shown. The Seeed Studio L298 module leaves plenty of room for mounting the board, but not all H-bridge boards are so cooperative. If mounting space is tight you may need to use smaller 2-56 size hardware, which is harder to find.
Also shown in the illustration is how to mount a separate small deck for a mini breadboard. See Figure 5 for a cutting and drilling template for this deck. Use 1/4" plywood or expanded PVC plastic. Don't attach this deck quite yet, because you need to first wire up the L298 module.
Replacing the Tamiya Gearbox Motors
The RBB-Bot uses a pair of low-cost gearbox motor kits from Tamiya. The small DC motor that's included in the kit is rated for operation at just 3 volts. And as motors go, it's not terribly efficient. As a result, these motors consume a lot of current, especially if they get bogged down under lots of weight or strain.
All H-bridge circuits are rated to handle a certain amount of current before they overheat -- and either shut off, fail, or become damaged. The L298 module can handle up to 2 amps per motor. Yet the Tamiya motors can consume in excess of 3 or 4 amps when powered at just 4 to 6 volts.
Fortunately, you can get low-cost drop-in replacements for the stock motors provided in the Tamiya gearbox kits. For example, the Pololu #1117 replacement motor is rated for operation at 6 volts (can be operated at up to 12 volts), and at that voltage consumes a maximum of only 800 mA (0.8 amps) when stalled -- the motor is still powered but cannot move.
When replacing the motor you'll need to pull off the small spur gear off the old motor, and mount it onto the replacement. The fit is tight; avoid grabbing the teeth of the gear with a tool to remove it. Instead place the jaws of a pair of small needle nose pliers behind the gear, and gently work the gear off. Be careful that the gear doesn't come flying off the motor shaft, or you may never find it!
Solder 7" to 8" leads (use 18 to 20 AWG stranded wire) to the motor for connecting it to the L298 module. Here's a tip: It's often a good idea to add a small 0.1 μF ceramic disc capacitor directly between the terminals of the motor, along with the connecting wires. The capacitor helps to reduce any negative effects of electrical noise induced by the motor. Be sure the capacitor is rated at 25 volts or higher.
Connecting the Motors to the L298 Board
Locate the two-terminal motor terminal blocks on either side of the L298 board (see the figure below for the main points on the Seeed Studio L298 module). On each block the terminals are labeled VCC and Gnd. Orient the robot so that the heat sink on the L298 board faces away from you. Then:
- Attach the wires from the left motor to the motor terminals on the left (shown as green in the illustrations).
- Attach the wires from the right motor to the motor terminals on the right (shown as red in the illustrations).
Use a small flat-bladed screw driver to tighten the terminals so the wires remain snug.