Tuesday, January 24, 2012

MKI: First steps

Yesterday three MKI boards came in the mail and today two motors were driven by one MKI board. I'm very pleased with this controller so far because whenever it doesn't do what I want it to, it turns out it's my fault and not its; which is great! Let me explain...

Top

Bottom

MKI was easy to solder together, despite having no solder mask. The trickiest part was actually preparing XPWMShield. To accommodate a motor controller upstairs, the 5V regulator was just too tall and had to be bent down; which also meant putting the battery input terminal on the bottom. In addition, two of the servo pwm inputs were flipped (to eventually incorporate servos). All power is passed through a temporary splitter that supply the boards individually. When TOBL2 comes together I'll make a nicer connector.

Soldered

Shield mode

Once it was all together I ran into a slight problem with motor A. With no solder mask I shorted a small gap by one of the diodes which meant the motor would run fine and make the L298 burning hot in the other. After a few tests runs - being oblivious to this problem - it still works fine so the stock heat sinking does a great job, which was a concern given there is no space on the board to add heat sinking. Here are the motors running through a quick forward and reverse ramp program:



In getting to this stage I learned some subtleties about the L298. For example, I forgot to mention why the motors took their first steps today and not yesterday. In the datasheet ST says "The sense resistor, not of a wire wound type, must be grounded near the negative pole of Vs that must be near the GND pin of the I.C." Maybe it's just me but this doesn't get across the same message as "The current sense pins must be connected in some way to ground for the motors to work!" -which I found digging though forums. Until I get small enough resistors there is a wire in their place to keep the controller happy.

It's also important to note that for now at least, the regulator I had planned to use is bypassed by a wire, supplying 7.4 uncensored volts. It was hard to find a regulator with a low enough differential between input and output voltages to be efficient. Essentially with the current 2S pack I'd need a 4V regulator to support the voltage overhead and voltage loss during use. This would mean dissipating (read: wasting) a stupid amount of power. Combined and unloaded the motors draw 10mA times 3.4V loses only 34mW. However, during loading and more extreme conditions 2A is feasible which would be a 6.8W loss; which is quite significant! We'll see how it works without a regulator for now...glad I was talked out of it.

Next steps are to test the current sensing and implement my iPhone controller setup. Classes start tomorrow. Boooo.

Friday, January 13, 2012

MKI: Motor Controller

At some ill-defined point in time routing becomes art, I think. I've spent the greater part of the last week transforming that schematic from my last post into the pretty pictures you will see below. It's my first motor controller so I don't want it to suck. Call it MKI if you like (i.e. motor kontroller one or MKI like the VW GTI). The point is I've hung around Shane too long and am beginning the motor controller phase of my life; which is sure to see many iterations.


This first - shield - controller is being produced for TOBL2 and is therefore stupid compact. I know this because routing was a beach. It's contained within a 1.65" x 1.85" form and will plug directly into the headers on XPWMShield I created last year.

MKI has some things that I'm proud of:

There are isolated ground planes on the bottom layer of the board. This technique was suggested by Shane, of course. The logic pins are tied to a ground plane (SGND) which is only connected to the main power ground plane (PGND) by an 0805 resistor. This resistor is sized such that it will explode when too much current is drawn, acting like a fuse to protect the current-sensitive pins on the logic end. In this case running at 6V and fearing 2A gives a 3ohm resistor.

Power ground plane.

Signal ground plane.

Each motor has three diagnostic LEDs. One to indicate forward, one for reverse, and another for over-current. The latter I cannot tout until I write the software for the controller. This LED is not connected to the actually current sensing pin but will use feedback from it to illuminate. More on that once I have a board to test.

It's not visible now but originally several traces wove through the seven-pin header; which the DRC did not like. Moving these traces basically meant ripping up half the wires and starting fresh...#firstworldproblems. (<-- first and last time I will hash tag...yuck...Twitter)

Things I'm not proud of:

Looking at the images above the ground planes are pretty well-contained save for a few wires that need to reach the top header. We'll see if any noise results from this, shouldn't be too bad.

There are 50 f***ing vias. On a via/area basis that isn't bad at 16.4/in^2. However, this board is being ordered 4pcb Bare Bones which allows 35/in^2 maximum, and I'm sure you could pick a given 1" x 1" where that is the case. Hopefully they don't check that so carefully but regardless, that is a shameful quantity of vias.

Switching to the mechanical realm the Robot Marketplace order is in and I suspect so is the McMaster order. In addition I have been working on the frame design. Don't believe me?

Boom.

This wasn't meant to be in the "things I'm not proud of" section but now that I think of it I'm not proud of how little attention the mechanics have received. Maybe I can make it up by over-engineering servo-automated belt-tensioners...

Wednesday, January 4, 2012

Space Invaders and Motor Controllers

The first order of business to address in buildapalooza is TOBL2's motor controller -that way the new chassis can be built while the board and parts are being shipped! This is the first motor controller I've designed and it's based off of the L298 Dual H-Bridge, PowerSO 20 package. Essentially it's an Arduino shield...shield, because it will stack onto XPWMShield. Here's the schematic:


Actually this is the schematic, but it does kinda look like the Space Invaders alien:



It will drive TOBL2's two new FingerTech motors at 6V, which promise not to ask for any more than 2.6A combined if both motors stall. The L298 is rated to handle up to 4A, but to be safe the current sensing pins will be in effect and there will be more status LEDs than one could ever need. Oh, and automated belt tensioning/detensioning....yeah I really don't want any more slipping or breaking (which were all part of TOBL1's charm). More details on the controller once I have a physical controller in my hand to test. Just a little amuse-bouche before the feast of blogposts and building commence.