Archive for May, 2010


Coming Out of the [Course 6] Closet

May 29, 2010 in Project Build Reports, Stuff

If I could say that MIT has made anything very painfully obvious to me, it’s that all mechanical engineering projects are spoiled by their electronics components. We can observe the phenomenon in any Course II class which focuses on producing some integrated electomechanical contraption. Invariably, the project is delayed or left unfinished because the electronics or software did not cooperate or had to be rebuilt… over and over and over and over.

This has been the story of many people in 2.007, 2.009, 2.12, just about everything I build, and my entire adventurous spree at the Media Lab.

Now, I still think software sucks (and Arduinos are therefore the best thing to ever happen), but one of the things that I’ve been “meaning” to do for a long time is printed circuit board design. I’ve had a propensity for electronics design for a while, as illustrated by the many Kartrollers, Segfault’s controller, and the disproportional amount of Course VI classes I’ve taken, but the vast majority of my work has been on breadboards, wired point-to-point, or using protoboard. It would be great if I could whip up an idea and have it housed on its own specially-designed PCB, which would have been layout-validated and checked on the computer so I *know* I didn’t put everything in backwards. But the protoboards and breadboards have always been there, and everything I make is a one-off anyway, and PCBs take a long time to make and are expensive if hired out… so it’s been fine.

But I thought that PCB design was the last hurdle to overcome before I’m actually able to take one of said electromechanical integrations and develop it from start to finish. No more being impeded by the other half, especially because now I at least know my way around electronics design and execution, even if I still plug things in backwards and short things with oscilloscope probes. Like countersunk cap screws and chamfered edges, a customized PCB just makes a project that much more professional-looking… and functioning, since there are less of a chance of making airFETs.

I’ve been playing with Eagle for a while, and have even made some halfway decent schematics with it. But what I haven’t done is actually go from schematic to board. I didn’t pay attention to packages, board footprints, or any of that.

So, in a Mountain Dew-fueled rage (Dew-colic)  a few nights ago, I finally sat down and explored the things which make Eagle physically relevant.

it has the worst user interface ever.

But once I got over the fact that essentially no commonly used keyboard shortcuts or mouse motions did what I thought they do, and found where parameters could be changed or adjusted after looking in the most cryptic of places and clicking on the many nondescript and  untagged buttons, it was pretty straightforward.

can i have a copy-paste function that doesn’t take 5 feet of cursor motion and 8 buttons to do?

Also, mouseclicks associate with commands and you have to select another command before it does anything else. So no, clicking furiously at a component because you want to move it but it wants to change the orientation gets nothing done.

Without further ado, I now present the Small Cute Half Bridge.

Shown in roughly 3:1 scale

While I figured a good test would be just jumbling every which component together onto a board, making something I could actually use is better. The SCHB uses the IR21844 (previously explored on this site) and drives a MOSFET half-bridge. Half-bridge units like this form the basis of many switching power supplies and motor controllers.

The actual schematic of the SCHB is the jumbled mess:

Making the SCHB was an exercise in device creation. I had to define a footprint, a schematic symbol, then associate the two together into one device. It’s a clunky system that I think could be streamlined, but the clunkiness probably carries over from industrial engineering rigor. I made a 14-DIP and SOIC-14 version of the IR21844 to cover all my bases. I also made the IRFB3077 FETs. Fortunately, knocking the board footprints from existing libraries meant that I didn’t actually have to draw them.

What’s next? Get the board made!

Many PCB companies have online services where they can make you boards from a design. One example is Advanced Circuits, which seems to be a favorite of MIT students. This is where I think the mechanical engineers and manufacturig industry can step it up – where are the online services for fabrication and machining?

Granted that making 3D parts in metal is much more resource and equipment intensive than PCBs or 2-dimensional machining like waterjetting and LASER cutting, but I contend that it’s worthwhile to look into as an additional market for shops, especially as the DIY trade is growing.

Hopefully, within the next two weeks, there will be SCHBs on my desk and ready to plug in backwards test. It’s incredibly small (1.5 x 1.6″), all through-hole, and the FETs can probably handle 25 to 30 amps with no heatsinking.

Kartroller 6: The video

May 27, 2010 in LOLrio Kart, Project Build Reports

As promised, here’s a short highlights clip of the Kartroller 6.

…so it’s actually just a very small cross section of all the testing that’s been going on. I’ve been thrashing the new controller mercilessly. Never before could I throw the kart around like that without the risk of something setting on fire – but it’s been bulletproof.

That J-turn took about 15 tries to get right, by the way, and it still isn’t quite up to spec. I’d need much more space to do it correctly…

I am satisfied. Next: 6 quadrants.

Random site updates!

May 25, 2010 in MIT, Bostoncaster, Cambridgeshire, Stuff

It’s not often that I actually update the site in a way that’s not a build report. It does happen occasionally, and in small increments. I’m trying to clean up and update the dark, neglected corners of the site.

Reference Section

I’ve made a page specifically for links and posts  that contain technical info or methods of execution – “Useful Stuff“. For instance, my exploration of the IR21844 would be such a post. Since I’ve found that it’s a pain digging through my own build reports to find the small amount of “oh, so that‘s how I did it” within, I figure others would have even more trouble. The topics are also things which I’ve been asked about frequently – then had to go mine out of the archival depths.

Donations Box


I’ve sold out.

Or not – but I have decided that it wouldn’t really hurt to keep open the option of accepting pittances. You may find the Paypal link on the Tips Jar page.

Nobody is morally obligated to donate. But keep it in mind if you find the site enjoyable or useful! You’re not paying for my living expenses, MIT, bar crawls, drug habit, services of ill repute, or things of that nature – it’s for showing your support of a little Turbo button on the next epic build project because you want to see it happen.

Kartroller 6: The Wrapup

May 21, 2010 in LOLrio Kart, Project Build Reports

Unhappy aluminum spacer is unhappy.

As of about right now, LOLrioKart features a full bidirectional and regenerative motor controller. This might not be true soon since I still have to perform stress tests, but nobody can point at me and say PICS OR IT DIDN’T HAPPEN either because there are pics and it did happen!

Continuing from Day 1, here’s most of the high current bus wiring. I was able to salvage much of the weird grounding strap/braid from the previous controller to use on this one, since it had much shorter wiring spans. The braid is much more flexible than the equivalent amount of ~6 gauge wire, and passes right through the copper screw lugs.

Also in the picture is the large 10 ohm power resistor that shunts the contactor. It’s the precharge resistor for the bus capacitors. I included a check in this iteration of the software to prevent the motor driver from outputting any power if the contactor itself is not latched. When not latched, the logic can still draw power through the resistor.

Check out the double bus capacitors. Some 8 gauge noodle wire links the caps in parallel and also to the  gigaFETs next to them.

It turns out that 3900uF of bus capacitance isn’t really enough, so I might have to double-deck the caps later on.

Now comes the enormous 375A Anderson powerpole. Since the whole controller is upside-down this time, I decided to put the Etek on connectors. I received a set of these for my birthday as a gag gift (they were spraypainted red and black to prevent me from plugging them in backwards!).

The pigtails are 2 gauge welding cables. The kart seems to feature  a very diverse conductor menagerie, ranging from 10 to 2 gauge. Overall, the longest runs get the biggest gauge, so I think it all balances out.

It’s time for mounting! I found some abnormally long wood screws, so just decided to use them to mount the controller instead of trying to use machine screws and tapping plywood like last time.

I was too lazy to actually draw out the mounting hole pattern on the wood first, so I just set the controller up on the machined standoffs and dimpled the wood in the center of each hole with a punch. Then the wood screws were too large to thread themselves into the wood without splitting, so I pilot drilled the dimples. All the precarious controller balancing and punching probably came out to more effort than just drawing the mounting pattern, but hey…

The main battery connector and power switch are located across from eachother, joined with the shortest possible wiring runs. Overall, I cut a few inches out of the amount of wire needed to link all the parts together.

Here’s a look under the upside-down controller. I probably could have dropped the standoff height another half inch so the wires keep themselves in place.

Alright, now we get to my favorite part of this controller design – the entire reason why I chose the Epic Heatsink of Epicness and the upside down design: the case mod.

Two 120mm LED fans park right on top of the Epic Heatsink and tap off the 12 volt line. They are probably the worst possible choice for real controller fans, since they flow as much air as I do by sleeping, but look at how awesome they are.

I dropped the assembly in for a quick test spin of the drivetrain. To my utter surprise, nothing exploded on application of battery power. This is a new development in the line of Kartrollers – generally I have to rebuild it every time I plug it in. The precharge circuit works much faster than the old one now, and without danger of being set on fire by the motor trying to pull current through the bypass resistor.

Downside: That’s probably the most awkward possible place for the battery switch.

Well that didn’t last long. The first wheels-up test resulted in a sudden and mysterious total system shutdown after entering a particularly stiff period of motor braking. No fire, just a sudden crowbar-like effect. After half an hour of diagnostics (the gate driver chips were both toasted and replaced), the controller worked again… barely.  It managed to spin a small test motor at about…. 10 RPM or so.

The above high-side scope trace led me to discover that, horrifyingly enough, I was using bootstrap diodes at almost twice their rated blocking voltage.

The bootstrap diodes are pointing towards the brown capacitors in the picture.

I randomly picked some diodes out of our “power diode” bin which turned out to be 1n5819s on closer inspection – rated to 40 volts absolute maximum. First off, the kart battery was 60+ volts charged, and on regenerative braking, the voltage spiked beyond that. Hitting the brake hard most likely resulted in a mortal blow for both diodes, momentarily firing( x >> 12.0) volts into the 12v auxiliary bus.. This caused the DC/DC converter to freak out and shut down, powering everything off.

Better than setting everything on fire.

The diode carcasses still conducted a little, just barely enough to make the high side FETs also  conduct just a little to run the test motor.

The solution was to replace them with some more random diodes from the bin. This time, they were 1n4007s, good to $MORE_VOLTAGE_THAN_THE_KART_SHOULD_EVER_SEE (namely, 1000 volts).  The test motor almost flew off the table, a good sign.

The negative current is a sign of the regen brake working! Negative current in this case means it’s going back into the battery bank.  This was captured by revving the kart drivetrain up to full speed (a scary ordeal with it balancing delicately on an automotive jack, by the way… if it fell off, it would probably have broke into TMRC) and then letting off the throttle. The synchronous H-bridge took care of the power conversion.

So what always happens after I quickly check that the vehicle works in midair?

Yup. With the reverse switch and brake pot still dangling precariously off the terminal strip, I hurriedly threw the throttle back on and took the kart out for a hallway joyride.

…but not before rigging myself an easily accessible emergency stop. The little chunk of wire is normally wedged into the contactor switch terminals, turning it on. Making sure I was tied to it at all times meant that I could quickly disengage the contactor if… stuff happened.

Fortunately, it wasn’t necessary. There’s not any test video since I decided to save face in case the whole thing detonated in the middle of the hallway, but rest assured video is forthcoming. After doing the drooping-wire test run, I decided to clean everything up and actually consolidate the controls into one easily-accessible location.

…yeah, um, so my user interface design skills need some work.

But the whole thing is conveniently located and fulfills its requirements. The Big Red Switch is a legitimate emergency stop button now! It opens up a normally closed circuit when I pound on it, turning off the contactor. As some people may remember, the previous kartswitch was actually a normally open button, so you had to push to engage and pull to disengage.

The direction selector is located next to the Big Red Switch , and above it is a potentiometer to adjust the drag braking force. This pot should really be a logarithmic pot, since the filter time constant calculation behaves exponentially near zero – very fine adjustment of the pot yields very large coast/brake differences at the “coast” end of travel.

The current-voltage-micrometer makes a return.

And here’s the whole nest from the other side.  I was lucky to find an “INCREASE OUTPUT” knob, which really should have been reserved for cruise control.

The nest enters into the terminal block in a neat and orderly fashion.

A new day and an overnight trickle charge on the batteries means plenty of testing and fire to come! Stay tuned for more pics and video of Syncrec LOLrioKart!

Kartroller 6: The Blitz

May 18, 2010 in LOLrio Kart, Project Build Reports

Poor LOLrioKart.

LOLrioKart in a forest of scooter handlebars

After being totally whored out for CPW by giving rides to prefrosh and generally being hooned around campus, I remounted the kart sound system to use as a portable music device and all-around pimpmobile for Mini-Maker Faire the weekend after. But thirty minutes before departing for the Faire, I powered the kart on.

Nothing happened.

It wasn’t a spectacular explosion. It wasn’t even a smoke column or a quiet sizzling sound. Through a half hour of diagnostics, I only managed to deduce that the gate driver stopped driving the gate. The power FETs appeared to be fine. Whatever – we were late already, so I just pushed the kart a mile or so to the Cambridge Public Library where the event was being held, blasting bad eurodance and girl pop along the way.

Afterwards, I decided to just remake the controller, yet again. The latest iteration, version 5, did work, but was haphazardly put together (i.e. pretty par for the course). I wanted something that had more structure than a bundle of wires. I also wanted to keep advancing on the number of features and simplifying the schematic. This resulted in the great gate driver hunt of 2010, out of which the IR2184s came.

As described, the existing controller core is kind of a kludge. It was just an Arduino with a protoboard shoved onto it which had the gate drive componentry. Alongside was a 12v DC/DC converter. Everything was just packed inside a little box with foam bits, and not otherwise secured.

Running the controls in open air for half an hour to diagnose the latest failure resulted in me discovering that the DC/DC converter got hot. Way hot – hot enough for it to shut itself off, which explained alot of kart flakiness.

So I did what any shady college engineer would do given a totally rigged and quasi-functioning project – rip everything the hell apart.

I dismounted everything and took the mounting board out of the kart.

The big black slick in the righthand corner is from grease and oil being thrown upon it by the drive chain.

Let’s begin again. We start with an epic heatsink:

I found this in the materials cave at MITERS. There are a few reasons why I wanted an Epic Heatsink, the foremost of which is epicness.

The other reason is modularity. At 300 x 200mm, this heat sink had enough area on its back to mount practically all the core componentry. I wanted to move away from point-to-point hardwiring onto something a little more modular, like a commercial controller.

Mechanical issue: Only one side of the heatsink had space for mounting holes or other provisions. The other seems to have been trimmed off by someone else.

It just so happened that removing the bent fin would open up a width on that side of the heat sink equal to the width of the flange on the other.

…so that’s what I did. Remembering a trick someone showed me a while ago, I slammed the heatsink on the mill and cut down the bent fin.

The 3/4″ rod fits into the 5/8″ T-slot on a Bridgeport mill table and provides a straight edge to bump a long part against, for axial trueness without resorting to hammer bashing and a dial indicator. Normally the rod should be precisoin ground or otherwise some length standard, but in this case, “precision” meant “closest one to me that qualified for diameter”.

With the edge cut down but no holes drilled yet, I started laying out the components. There were a few iterations – this is the first. The FETs would be centrally located so one fan can blow on the back of the heatsink to cool them. The Arduino would sit right next to the gate pins.

But that was before I found these cool double capacitor holders, which allowed me to pack on more bus capacitance than the kart currently had (2400uF to 3900uF) and keep it on the heatsink mount. Of course, caps like this don’t need heatsinking themselves, but the mounting surface was there.

Through more cramming, I decided to also move the contactor onboard, such that the unit was essentially self-contained. Other parts of the power system, like the battery cutoff switch, terminal blocks, and power connector, would remain offboard.

I took a quick break and laid out the parts. The heatsink itself already had quite a few holes drilled in it from its previous, more legitimate application, but sadly none of them lined up. Thus, it was back to the mill to drill the mounting holes, which was a rather boring half hour of trying to match a digital readout with a hole chart.

Some screws and washers later, and the pieces are mounted. The contactor is case-grounded, and my intention was to keep the heatsink itself isolated. So, it’s secured by large nylon screws and insulative washers.  The Arduino and capacitor block are mounted with nylon standoffs.

The DC/DC converter has an isolated case, so it was bolted straight to the heatsink. It will probably be alot happier this way. It, and the two Ixys gigaFETs, got a liberal coating of Arctic Silver thermal compound on the bottom.

Here’s the new driver board. It’s another Arduino-perfboard assembly that houses two IR21844 dual gate drivers. Unlike Kartroller 5, the high sides are bootstrapped, not supplied via isolated regulator. I decided this was a good simplicity tradeoff.  Additionally, it’s much more failsafe – the boostrapped high side can’t maintain 100% duty cycle, so it can never get stuck on like the low side drive can.

The wiring nest on the underside, in typical me-fashion. I’m using some cool 30 gauge solid tinned wire that has very unique insulation properties. It doesn’t smoke or burn when it contacts a soldering tip, but rather just melts out of the way. It’s very thin and easily damaged.

But those same properties let me just mash the wire into the solder joint with the tip and it will automagically fuse with the solder ball that’s already present. This has enabled me to just go pin-to-pin and link up an entire net very quickly.

I think it’s wire-wrapping wire, but I’m not sure. What is it and where can I  get more?! MITERS is almost out!

Check out the integrated signal terminal block. I even labeled it so I don’t forget which wire goes where!

Most low power wiring joined. Notice the small 5mm power plug coming out of the DC/DC converter and into the Arduino. I figured it was better than soldering directly to the input pins…

Here’s the gate wiring from the Arduino shield to the FETs. Gate resistors are integrated into the heatshrunk portion of each cable end. I really should have local pulldown resistors too, but elected to keep those on the shield.

The rightmost gate wire got red shrink because I ran out of black.

I began to add other signal interfacing hardware to the shield at this point. First to be completed is the contactor detector. It’s a wire (the red one) connected to the contactor (through a resistor divider) which enables the software to see whether or not the contactor is latched. One of the problems with Kartroller 5 is that it just let me (or someone) gun the throttle even with the contactor was in the precharge state.

This just caused the controller side voltage to fall under 36 volts, resetting the DC/DC converter, thus shutting the logic off. In turn, the FETs turned off, causing the voltage to rise again, which… well, it led to an unhappy cycle of kart-twitching until I reached for the battery switch.

The next few lengths of wire connect the Arduino to the important I/O – throttle, brake, and reverse.

With all the signal side wiring done, I could start on the software. Here’s a makeshift user interface with a throttle pot, a brake pot, and a reverse switch.