Kartroller 6: The Wrapup

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

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.

Read more “Kartroller 6: The Blitz”