The driver took a little more time. I am using very small DC motors because they are the cheapest game in town in terms of $/torque that you can buy new. (Steppers would be great but I just haven’t found them cheap enough). The plan was to use the half bridge circuit referenced in this post last August. That circuit may still be a good idea, but because I have limited experience with electronics, I decided to buy my way out of potential problems with an off-the-shelf motor driver. The L293D is an H-bridge motor driver built into an integrated circuit, it’s the chip at the top of the breadboard in the pic. It’s widely used with the Arduino so there’s lots of support out there. I used this excellent write up from someone at NYU to help figure out how to wire it and for code examples. I bought the L293D for $2.95 from Jameco, it may be cheaper elsewhere. Also the person who did the NYU write up mentioned an alternate chip, the SN754410, which was $1.95. The L293D apparently has “output clamp diodes for inductive transient suppression” which sound useful, but I don’t know if it’s applicable to this application or not. (Here’s a thread on the topic). But even at $3/stat (each chip controls two motors) it’s in line with my current budget to stay <$100/m2, and could likely be reduced. Efficiency and energy consumption when not in use also needs to be addressed.
What’s taken the most time and isn’t done yet for sure is modifying Gabriel’s code. I think I’m very close – it runs how it should based on the serial port messages it’s sending to the computer but I haven’t connected the ‘stat to it yet. I will post the code over at Gabrial’s forum. Right now it has lots of comments and is very messy. It uses the module he wrote for simple gears, modified a bit due to the different geometry of my ‘stat. Also, I took out the shift register part which is required for multiple stats, the module for multiple targets, and lots of the empty code for running additional ‘stats off the same Arduino. If the code works, my next step will be to add back the shift registers and set something up so it can control at least 4 stats. When it’s cleaner, I’ll post here but if you want it now, it will be on his forum.
So many plans, so little time. But, getting it running off code is an important step. I sure hope I can test the code on the 'stat before leaving for some travel on the 24th.