Previously, we saw how large 10 mm LEDs provide headlights and taillights for the robot. Here is the printed circuit board that contains the brains and motor drivers.
Yummy PCB
I tried to cram too much functionality into the PCB, but still fit it into the maximum dimensions allowed by the PCB manufacturer for a prototype special deal. As a consequence, the eight wires connecting each MOSFET transistor to the microcontroller need to be wired by hand. What a pain.
Supplimental wiring and capacitor on bottom of PCB
Also noteworthy, soldered underneath the board are pull-down resistors and surface-mount bulk capacitors that supply the battery voltage to the motor driver. Having components on both sides of a board is easy when you’re soldering a board by hand, but is generally frowned upon when having boards manufactured and populated mechanically. The issue is that the bottom parts will fall off when bulk soldering parts to the other side of the board.
Speaking of soldering, I spent hours and hours debugging a serious fault that turned out to be bad soldering. The board would randomly short circuit at startup, and consistently short circuit when trying to drive the motors in certain directions. Thankfully, the board was attached to a power supply that automatically limits current to prevent damage.
Lousy soldering job cost hours of debugging
The root cause was a failure to completely solder the output of a MOSFET driver pin. As such, the MOSEFT was not receiving a clear signal to either shut off or turn on. Sometimes the MOSFET would take the value of a nearby pin; sometimes the value would be random. Thus, sometimes both the high and low MOSFETs would be enabled on the same side of the motor driver, resulting in a short circuit across the battery.
Originally, the main board was going to sit directly against the motor mounting block. Unfortunately, the soldered leads of the pushbutton prevented the board from sitting flat. So, after soldering, I milled the leads flush (see yellow arrow).
Milling soldered leads flat
You need to be very careful if you’re going to do this. The leads need to be well-soldered in the holes themselves, not just on the surface. Also, if you mill too deeply, you’ll disconnect the traces on the surface of the board (most of the pad above the yellow arrow has been accidently cut off). Be cautious with this approach.
It turned out that the robot needed additional room for the battery at the bottom of the candy tin. Nylon standoffs raise the board off of the motor mounting block, negating the need for flush component leads.
I mentioned earlier that the size of the board was dictated by the dimensions of the PCB manufacturer's prototype special pricing. To reduce the order cost, the line-following board was built into the main board -- a technique called panelizing. Upon receiving the finished PCBs, I needed to cut out the smaller board. Thus, a special fixture needed to be created to hold the PCB during depanelization.
I began with a nice flat scrap piece of PVC. I drilled screw holes at the same locations as the screw holes in the PCB. I also milled out wider diameters so that the PVC could sit on top of parallel block in the vise. (It wasn’t necessary for this particular exercise, but the PCB is being reused in other projects where this mounting plate may need to sit on parallel blocks during machining.)
Milling depth in number 42 hole so 2-56 screw head sits flush
The PCB is then screwed onto the PVC, with plastic standoffs in between to provide room for the tip of the cutting tool. Using a tiny 1 mm end mill, the smaller board is separated from the larger board.
Tiny 1 millimeter end mill separating inner PCB
Here’s what it looks like after vacuuming the nasty PCB dust.
Small PCB depanelized
In this particular case, nuts were not necessary on the top of the board to hold it securely, because the board itself had been tapped with thread holes. Let’s take a closer look at the line-following board.