Gate Driving your Way to Victory

As previously illustrated on this site, LOLrioKart’s motor controller is one big lesson in power electronics that I’m learning as I build it (…and blow it up…and rebuild it). While I must admit that it’s frustrating to have a controller that never really works, and which just sits on the metastable edge between functional and explosive, it’s a valuable learning experience to figure out exactly how to steer this edge towards the functional and reliable side.

You know, like finding out that your oscilloscope inputs are grounded so you absolutely shouldn’t probe a floating ground with it because it’ll dead short your power supply through itself and everything else in the path. Many times.

I found out that’s reason #1 why Segfault’s dual custom H-bridges all exploded. Live and learn, I suppose.

Cross-conduction

Another dominant cause of power amplifier failure is shoot-through, or cross conduction. In your average half-bridge circuit, the worst thing that can happen is your top and bottom side switches on the same leg being turned on at once. That usually results in very high pulsed current draw from the power supply, then…

Alright, so it’s not that bad. But shoot-through will generally blow fuses, melt wires, or destroy an output component (in the worst case causing it to fail short) if you‘re not a pussy don’t use fuses like me.  3 phase block commutation generally avoids this shoot-through phenomenon because it ensures the top and bottom sides of one phase are never switched consecutively.

However, DC motor drivers do not have that luxury, because there is essentially only one phase to switch. Therefore, whether in software or through hardware, provisions are generally made for shoot-through protection. It usually takes the form of a section of delay-circuitry, combinatory logic, a delay state in software, or if you’re Shane, driving optocouplers in inverse-parallel because they form a convenient delay circuit already.

During the times I have experimented with full-bridge or half bridge DC motor drivers, I’ve generally used a variant of the delay circuit presented in 6.131, the same one that is documented on Segfault’s progress report post. It takes a while to make, is nonintuitive, and more complex than it needs to be, taking up 5 of 6 inverters in a 7414 hex inverter.

For a little while I’ve been searching for a FET driver chip that has this function built in. After some digging on Digikey and places like FindChips, I found the IR21844.

Like the Ixys IX6R11P7 chips I favor now, it has a standard low side driver and an isolated, bootstrappable high side. The difference between the 2184(4) and the 6R11 is the input. The 6R11 takes two individual inputs, one high and once low. They do not affect eachother, and you could build in a self-destruct mode for your controller if you wanted because it can command both switches to turn on at once.

The IR21844, however, takes a single input and splits it internally into an inverted and noninverted output. So that means if your input is logical low, then the low side is on and high side is off – and vice versa. Not only that, but it also has internal shoot-through protection (IR calls it “deadtime”). Even better is that the 21844 variant allows you to tune the deadtime to the taste of your favorite mutant semiconductors.

It basically tells me that I wasted a year fumbling with this crap when someone already made something I can just buy – like everything else in life. The 21844 comes in 8 and 14 pin DIP through-hole components (+1) as well as SOIC (ewww… but handy if I ever come out of the course VI closet). And so, I gave a few quarters to the Internet semiconductor gumball machine for some units to experiment with.

Here’s the test circuit I rigged together using the schematic found in IR’s datasheet. I’m reading the two outputs using two channels of the MITERscope. The input is a 50% duty cycle square wave, 5Vpp and 10Khz. The single potentiometer is a 100Kohm unit that I’m using for deadtime adjustment.

See? I wasn’t lying. One input to the 21844 is split into two complementary outputs.

This scope screenshot is actually a little deceiving. The vertical scale is 5 volts per division and the zero levels are located on the X axis (channel 1) and 2 major divisions down (channel 2). What looks like the two square waves not meeting in the center is actually them overlapping. I should have used a wider division setting.

What’s really interesting – and what sold me on these – is the built-in deadtime.

Check this zoomed shot of the above square waves. What you see is an approx. 1us delay between when the low side turns off (channel 1 high to low) and the high side turns on (channel 2 low to high).

This is good. This break-before-make behavior ensures that your +V and GND rails never see eachother in the middle.

Even better is the fact that it does the exact opposite thing on the other side. On a low-to-high transition of the output, the high side turns off before the low side turns on again. Again, break before make. This proves that one output isn’t just a time delayed version of the other, it’s legitimately being trimmed to fit neatly into the other.

One implication of this is that the high side will completely shut off at a point before 0% input duty cycle. This seems to be inherent in the nature of delay stages and I conjecture is part of the reason why control deadbands exist. Complementary to this, the low side will completely shut off at a point before 100%, which must be considered if your drive circuitry is bootstrapped on the high side i.e. does not have its own isolated power supply at all times.

The deadtime adjustment is internally grounded on the 2184 but brought out to a pin on the 21844 variant. You connect it to ground through a variable resistance of your choice – datasheet page 10 gives a rundown on deadtime vs. resistance.

As advertised, the deadtime is adjustable from about 400ns (0 ohms)…

…To roughly 2.5us when my 100Kohm pot was pegged. The 21844 appears to support deadtimes of up to 5 microseconds.

Indeed, when I just straight yanked the pot out of the circuit, all the output shut off. I suppose an infinite deadtime is just like being permanently off.

With this in mind, I went ahead and made a little buck converter just like I did in 6.131. I used two IRF2807 FETs that I had leftover, running in bootstrapped high side mode. It was still running on the 50/50 square wave input. Will it work? Will everything explode?!

Well, what happened first was that I shorted the high side through the scope probe, killing half of the 21844.

Sad.

That’s why I bought a rail of 30.

But then it worked! On the (real) first try, even! That is, well enough to totally smoke a power resistor of too small value while I wasn’t watching.

hey guys i made a power electronic widget that worked on the first try do i win a prize do i do i do i

The next stage was to replace the resistor with something more meaningful. Something that actually does some useful work besides making a small smoke column… I mean, it can do that too, but it should be designed to do otherwise.

I have an idea – let’s try a DC motor!

HO REGEN BRAKING YAY

I probably played with this thing for half an hour – just gunning the motor, then quickly dropping the duty cycle and watching the power supply’s voltage spike up. This half bridge circuit brings me one step closer to a 4 quadrant synchronous regenerative drive for LOLrioKart, and who knows what else. To add the other two quadrants, I just need to make another half-bridge and connect the motor up between them.

Speaking of LOLrioKart, can these little driver chips actually handle semiconductors the size of those I have an excessive amount of? One way to find out is to try driving the gate. This is an IXYS VMM65001F, good to 100 volts (same as a Swapfet) and 680 amps, which is at least three Swapfets. This is a bigger transistor than LOLrioKart can ever hope to push. Just because of that, it’s a good example to test the 2184s on.

Also because it is a convenient half-bridge module, and two of them will easily make an oversized H-bridge for said LOLrioKart.

I drove the gigaFET using the bootstrapped high side.

It took a full 1.7us to turn on, where I defined turn-on as the gate voltage reaching approx. 67% of the drive voltage. There are many ways of defining “turn-on”, this is just one of them.You can even see a little bit of the “Miller Plateau“.

This is not bad given that the on period is very long compared to the switching period. During this switch is when the FET acts like a resistor, dissipating power. LOLrioKart’s PWM runs at 4Khz, which is a half-period of .125 milliseconds, still about 70 times longer than a switching cycle. Not the best, but most likely better than anything else I have on the kart at this moment.

And the turnoff occurs a little faster, since the gate voltage only has to reach 4 volts before it falls under the threshold voltage. The turnoff itself is mostly clean.

So where does that leave me? I now have a method of switching a half-bridge in an orderly manner, without external glue circuitry. I also happen to have enough large semiconductors to make a 600 amp peak capacity H-bridge. I have this dumb shopping cart with a motor on it.

Will there be a kartroller version 6?!

The Fall 2009 Roundup: Überclocker Updates, RazEr Redux, Analog Antics, and the End of the Tragedy of the LOLrioKart

…wins for the longest post title EVER on this site. That’s because it addresses quite a few topics. I can finally characterize the academic term so far as having entered a steady state, which just means I know which nights I can bumble away safely, so it’s time to step up work on the projects. I’ve devised a list of theoretically attainable goals for the next few months, stretching into the coming winter months.

Überclocker Remix

Let’s start with some pictures of epic motor ownage. I cracked open the toasted HTI gumball machine motors out of curiosity after removing them from the bot. What awaited me inside was a scene of utter devastation.

That doesn’t look very healthy. It appears the commutator decided to just melt off the backing material. This motor actually still ran, just throwing blazing white sparks everywhere. The discoloration of the copper next to the crater attests to the extreme heating that occured.

The brush cap from the left side, which simply failed open circuit at the event. Well, now the reason is clear why it failed open. Half of the brush conductor spring just sort of flew off and melted itself into the other side of the plastic brush holder.

The carbon brush itself was bouncing around inside the motor.

Another view. That bit of spring must have been pretty hot to instantly melt itself into the plastic.

And another view of the copper droplet that is the commutator. Oddly enough, the windings themselves seemed for the most part to be just fine.

Here’s Überclocker looking decrepit on a table. Since a robot with no motors is akin to a dog with no legs, or a fish with no fins, I began the quest to search for a… well, more legitimate motor. That’s when I remember that I found these, from Way Back.

DeWalt drills are classic musclebot motors. Sadly enough, these were of different voltages (!?), which not only surprised me as to how on earth their previous user expected their creation to move in a straight line, but saddened me because I… well, want mine to.

It was enough to perform a fit test and draw up plans to modify the gearbox to accept these motors while UPS channels their Brownian Motion to get a matched set of motors to me. They are the “new” DeWalt motors, where “new” is relative to 2003 or so. These drills have 3 speeds and are infinitely more of a bitch to mount. So I will only be using the motors in my custom frakenb0xen.

Fit test. The good news is that these motors are roughly the same length as the 700-size HTI motors, but a little fatter. No issue, considering the gearboxes have plenty of wiggle room.

The gearbox modified to accept a DeWalt motor, with its Alien Technology Motor Pinion of neither metric nor Imperial tooth pitch. Needless to say, this will be removed and the HF motor pinion crammed on in place.

So am I over-motoring the HF drill gearbox parts by putting a real motor on them? Perhaps. However, I think it’s a legitimate move in a 30 pound robot, because the laws of physics dictate that I can only put so much power to the ground. I’m mostly after the “real motor” bit, not so much increased drivetrain power, because the robot doesn’t have the traction to use it.

With motors now on the way, this conversion ought to go quickly since I’ve already drilled the new mounting holes to accommodate them. Überclocker should then be able to attend more events.

The (Possibly?) Final Chapter in the Tragedy of the LOLrioKart

So by now all ya’ll have probably heard of this.

While the details surrounding the citation were totally illegitimate and imply a degree of recklessness that was not present at all, the bottom line is that the kart is not going on any more open road adventures until it’s legit. And by legit, I mean registered and insured and fully street legal.

Whatever measure this takes, it will happen. It will simultaneously the most confusing and most glorious thing on the planet.

But the good news is that through two weeks of intense demos and driving during Orientation, the kart didn’t explode. The motor controller, version 6, is more or less stable. That’s huge. That’s like, me doing something right in electronics for once.

Of course, if I actually run the numbers on the electrical characteristics of the power converter, it would probably make real EEs run away to vomit. But the kart has survived more than twenty power cycles without misbehaving, save for the flakey DC-DC converter that caused the initial failure of version 6. A replacement module with better-designed (read: existent) filtering solved the problem.

So I’m satisfied. There will be little active work on LOLrioKart this term, with most of the fleeting effort concentrating on the battery system. After said weeks of operation, two cells in the battery pack are now just resistors. I regularly saw the voltage dipping under 45 volts on acceleration, which is concerning to say the least. Battery management solutions are condensing around me, so I may make the jump to lithium iron phosphate cells.

Now let’s move onto the new shiat.

This is a Xootr Street push scooter.

Gee, that looks kind of like every other push scooter on the planet. You know, like a Razor scooter. I thought you already had one of those? With like… a motor on it, right? That you built? I heard you built a motor. Can you show me how that works? Can you build me one?

… </average_miters_visitor>

Oh, that’s the difference.

As much as I love RazEr when it works, it’s time for me to realize that it’s too freakin’ small. I’ve managed to hit the tiny-but-functional goal, and at the same time the maximum recommended rider weight a few times. With some more scrupulous design, I could probably fit more batteries in there, but otherwise all the useful space is essentially occupied. And while 5 inch wheels are great for shoving your average copier motor core into, they are not great for shoving into your average pothole.

I need something bigger. More legit™. So thanks to MITERS for coming up with an engineering sample of the Xootr Street. I won’t actually be making any mods to this one, since it’s … not mine, and stuff.

This thing measures a bit over 3 feet long when fully deployed. The wheels are 7 inches in diameter and cast aluminum. It’s the smoothest thing ever on the ground because of the large wheel-to-bearing diameter, which minimized rolling friction. And the deck is absolutely enormous….

… and HOLY MAGNESIUM JESUS ON A STICK. It is in fact CNC machined from billet aluminum. These guys are just like me, except with infinitely more style. A scooter? Made from real metal?

And the 10 center-side pockets are just big enough to comfortable seat two A123 26650 cells apiece! How about that. 20 cells yields almost 150 watthours of battery pack energy.

Ground clearance check. The deck height, oddly enough, is almost the same height of the Razor A3 frame. The wheel line is just an inch and a half or so higher to fit the 7″ wheels. Overall, as can be seen, there is about 1.25″ of “fiddle space” from the bottom of the deck (not including the pockets) to the top of the 1.5″ parallel.

This is good, because hiding all the goodies under the vehicle frame contributes to vehicle aesthetics and the illusion that something which is not supposed to be motorized is moving under the directive of an unknown force.

There are no motor drawings or plans for this yet, but the profile of the wheels and their spacious internal diameter make them amenable to stuffing axial flux coreless motors inside, maybe even one per wheel. I’ve been itching to build a real surface-wound (no iron core) pancake motor for a while, but have been put off by their complexity in manufacturing.

As more details condense from the bot-aether, I’ll give this project its own page, category, and possibly a snappy and witty name. This is not a high priority project, as I don’t even have the vehicle yet, and it might spill over into Spring term.

Spring is a better time to blaze around anyway.

Now Announcing Project SEGFAULT

Segways.

A bad pun on the word segue. A fundamentally unstable faceplant-waiting-to-happen of an inverted pendulum. A cool exercise and great demonstration of basic control theory.

DIY balancing personal transporters have been attempted and perfected many times before. It’s almost passè. There’s even instructions on how to do it and code for your choice of microprocessor. All you need is two fat motors, a rate gyroscope, an accelerometer, and determination.

The whole thing about “microprocessors” is what has been putting me off. I like to think I’m familiar with mechanical engineering principles. I’m shake on electronics and EE. But I’m the last person you want to ask about anything software related. I hate software. With a passion. Even though I use it ALL day, I shudder to see what goes on under the glitzy Web 2.0 interface, or under the ultrasonically-welded sealed cap of an Atmel chip.

…so that’s why I want to do it all in ANALOG ELECTRONICS.

That’s correct. Op amps, comparators, linear components, passives… it’s a 6.002 (or 6.101) paradise. I stochastically arrived upon this idea near the beginning of the term, but it took a few weeks before I took it upon myself to do some research on gyros and accelerometers, and sketch out a rudimentary control network composed primarily of rail-to-rail op amps.

Then I remembered that Dale had built an analog balancing robot, so naturally I read the site and discovered I was doing it totally wrong.

I have a sneaking suspicion that a relatively non-chaotic differential equation like the one that governs inverted pendulums can be pretty easily translated to a continuous time control system (analog, as opposed to a discrete time digital control system). The idea as a whole is to have a purely analog, continuous-time front end controlling a Class D amplifier, also known as a switching amplifier or if the output is bidirectional a locked antiphase amplifier. Basically this just means your transducer wiggles back and forth really quickly… but some times more in one direction than another, so the summation of the movements is a velocity.

But Charles, isn’t a switching amplifier a digital thing?!

Yeah, if I implemented a real linear motor driver, I would have a battery life of 30 seconds and require heat sinks the size of Hannah Montana. Sssshh…. don’t tell anybody.

With the plan now more grounded (HURRRRRRRRRR PUN) than before, I’m moving forward with the mechanical details, as I always tend to do first. Once I have a rolling frame, I could conceivably roll analog or digital, or mixed-signal. As always, this entails a trip to MITERS and a few hours of mining for parts.

Yeah, so it’s nothing much yet. I grunged these 9″ pneumatic tires for the project as they were the only two matching wheels in MITERS that weren’t already on something.

9 inches? Isn’t that a bit small (&thats_what_she_said;) ? It is, but there’s nothing fundamentally wrong with having smaller wheels on such a machine. It just makes obstacle negoatiation tougher. If anything, I can get away with having less torquey motors because of the increased mechanical advantage.

The design work continues! After I get my control theory a bit more in line, I’ll sketch up a schematic of what I think should work. There are endless supplies of linear circuit components at MITERS and kicking around the EE labs for experimentation. I have accelerometers and gyros on the way from Sparkfun for experimentation.

…Oh, that’s the other cheat here. Real, modern MEMS sensors. I’m going for the analogginess here, not period-realism.

SEGFAULT will get its own page and category as it develops. This is my number one goal for the end of the term, and I’m actually going to try to get the controller graded. Here goes… something!