Posts

More about Motors

Image
I received Revision 4 of the main boards last weekend. The part I was most nervous about was the motor IC footprints and soldering the tiny surface-mount pins. But that actually went pretty well, even though I forgot to use flux on the first attempt. I did make one major mistake on the board, wherein the controlled-voltage line to the micro-controller is missing. It's something that I had noticed and thought that I fixed, but somehow didn't actually fix. The good news is that it's really easy to jumper that connection. So pretty soon, I had enough components soldered onto the board to test the motors. The result from that was fairly disappointing: the controller would reset immediately when the motors were turned on. But it didn't ALWAYS reset and, when it actually continued working, the motors were turning strongly and motor IC was not getting warm. So, that was the silver lining, I guess. I tried bodging in various capacitors but, still the result was nearly alw...

Main Board v0.4

Image
I received Main Board v0.3 back from OSHPark and the TB6612FNG IC did not seem to line-up with the contacts on the board. It was, in fact, about a millimeter too wide. I had anticipated a challenge, as this was to be my first attempt at soldering surface-mount. But this footprint problem was not an issue that I had not expected to encounter. I had taken a SSOP-24 footprint from KiCad's library and modified it only in that I joined adjacent pads for the motor connections. Looking at the TB6612FNG datasheet, I confirmed from the drawings that the footprint I used was not wide enough. Yet another reminder to check and double-check datasheets. So I did attempt to bend the IC pins to see if I couldn't work the chip on somehow, so that I could test the board functionality. But, with the pins bent back, even a bit, they became impossible to solder. I did briefly consider attempting to bodge wires onto the chip and in that way connect it to the board. But it looked like an exercise...

Infrared reception

Image
So, while waiting on a new main board, I decided to work on the software a bit. I wanted to get IR reception/transmission working reliably and also modify the code to support the new motor controllers (PWM on all motors + control signals supported with a shift register). I began with the IR reception. Most importantly, this will record the hit from the other tank's shot. Secondarily, it will be used to receive commands from an IR remote. I sourced some  cheap IR remotes  from Sparkfun. I think that these will be useful for debugging (in debug mode, you will be able to control basic tank functions with the remote). Also, they can be used to give a start signal for the tanks to begin fighting. I had messed with the IR stuff a little, before, using the  IRemote library . The library makes it stupid-simple but when I tried using it with the rest of my tank code, I began having problems. The main issue seemed to be that, even though I had my IR receiver diode on a har...

IR Distance Test

Image
A month ago, I had the rather belated realization that merely sticking a bog-standard infrared LED on a short mast on top of my tank was not going to work very well. Most LEDs are intended to be directional. I needed an LED that would point not up but in 360 degrees, so that the opposing tank could detect it, no matter where the tanks were in relation to each other. So I ordered a few different lenses and infrared LEDs from Digikey. Though the number of choices on that site seem overwhelming at first, once I narrowed-down the options based upon my needs, there were only a few options left for each. Also, since I finally had a working camera PCB, I used one of the boards plus an OLED display to build a "detector box", a gadget that displays detected IR blobs on the screen. This made testing much easier, since I didn't have to sit next to a computer reading serial debugging information. [Before I even received the LEDs in the mail I experimented with using sandpaper t...

More About Motor Controllers

Image
In my last post , I talked about my problems with motor controllers not delivering enough current to the tank motors. After some more experimentation, I decided to abandon the L293X h-bridges and similar. Versions that supported more current featured bigger heatsinks: they all have some significant amount of voltage drop (Somewhere around 1 - 2 volts. Maybe not a big deal when you are north of 10 volts, but if your starting voltage is 5.5 then it matters a lot.) There was a break in tank work, as the holidays took over and I spent what spare time I did have building a Nixie-tube clock from a kit. I found a  Pololu Qik motor driver that I had nearly forgotten about, sitting in a drawer. I installed that on my tank and, what do you know, the driver worked pretty well. This particular controller features a serial communication chip and translates that to signals that the actual motor controlller, a  TB6612FNG , understands. This driver costs $25 from Pololu and, since I need...

Drive Problems

Image
So I got the second version of my main board, the one with the increased motor traces, back last week sometime. I finally did solder most of it up and, initially, found only a couple of minor issues. One was that my screw terminals for my motor wires did not fit. Which is frustrating since that footprint was also wrong in my initial version. Now instead of two close together the pin holes are too far apart. Anyway, not a big deal as I can just solder the wires onto the board directly. The sonar module in the front of the tank (right side of the above image) was just hot-glued into some crude cut-outs and ended up pointing slightly downward such that it was reflecting against the ground. The led strip is just thrown into the tank (This strip comes with the tank and has a mounting position on the top chassis. I wanted it in my tank for debugging purposes: I am able to light two of the LEDs and give some visual feedback as to what is going on with the microcontroller...

Turret Board Revision 4

Image
Over the weekend, I updated the turret-board design and put in a new order to OSHPark. There was a lot of trial-and-error and aggravation, trying to figure out why my bread-board version of the Pixart camera was working, while my revision 3, with bodge wires added, still did NOT work. Turns out that I needed my oscillator to share a ground with the Arduino. This is still a weird kind of mystery to me and another one of those times when I wish I had a firmer grasp of the underlying theory. [Edit: Circuits need a common ground! This Stack Exchange explains it okay.] After I figured out the oscillator situation, the camera seemed to work fine. It would occasionally stop working but I think that this was just due to bad connections. It would be nice to have a reset capability. Just having the ability for the microcontroller to shut on and off the power to the turret would be sufficient. This would only require the addition of a transistor to the main board. But it would require one mor...