Posts

Not Dead Yet

I've been working on this project and wished to post an update. I don't imagine this blog has a ton of readers but I was looking over old posts and reminiscing and thought maybe it was useful to keep track of progress, for myself if for nobody else. I wanted to include some photographs and screenshots but that will have to wait for another post. Or maybe I'll come back and update this one. I started blogging about this project in the Fall of 2017. I worked on it most of that Winter and into the Spring and then other things took hold. I bounced between Portland and Arizona and most of my stuff was in storage during that time. In 2019 I returned to Portland and I finally ended up living at a place with the space for projects. Up to that point, I had been purchasing remote-controlled tanks off the shelf and modifying them to be autonomous. I had a couple of parts custom-printed from Shapeways. There were several disadvantages to this approach but it was always going to be cost...

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 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 in ...

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...