SEGFAULT Re/BOOTED Part 1: The Cyclic Tragedy of the SEGFAULT

Pop quiz: When was the last Segfault update?

Answer: It was almost a year ago in January.

As of a few weeks ago, Segfault looked like of like this:

Poor Segfault.

The abridged version of the story is that I stopped reporting on it shortly after the project ran into electrical demons and the gyro-accelerometer filter completely did not function as anticipated. Several more attempts, each getting increasingly desperate, were made during the Spring 2010 term and over the summer. But sadly enough, none were successful in getting it to balance or remain remotely stable, and Segfault has been sitting in a corner at MITERS for the past semester. However, it’s slated to make a comeback…. right freakin’ now…. and hopefully will be somewhat functional this time around.

Let’s start at the beginning.


After putting together the final iteration of the balance controller, I started bench testing the locked-antiphase H-bridge drivers.

Yeah. That worked well. I blew out gate driver chips in rapid succession for seeming no reason at all. The FETs were also changed out a bunch of times as they seemingly latched up and shorted. It wasn’t the deadtime/delay circuit at fault – something else was killing the drivers.

I got so desperate that I began putting the FETs themselves in removable sockets. Damn the current processing ability – I was just going to pop them in and out as they died or became questionable, in the interest of problem solving.

When one power-on seemingly killed the entire dead-time circuit, I gave up for the month of January and finished Cold Arbor for Motorama 2010.

I now know that probing the ungrounded high side drivers with a grounded oscilloscope probe was the most likely cause of the latchup and destruction.


In April, I signed up to exhibit at the HKN Project Expo. Pursuant to this, I decided to Just Rig Something to see if Segfault would remotely function. I yanked the two Dimension 25A controllers from Cold Arbor and set them to run on 0-5v analog input mode, which was compatible with the signal that the original H-bridges wanted. The Dimension boards didn’t allow any more than 24 volts input (originally slated to be 36v), however, so I pitched some NiCd packs that I had just standing around onto the thing.

The verdict? Yeah right.

The response was extremely poor, even with all the gains set to the highest possible. Segfault would start out balanced, but be unable to stay at that position and entered very high amplitude, low-frequency oscillations (effectively driving forward and backward). As I later found out, this isn’t just due to weak motors or weak motor drivers. Regardless, it wasn’t worth demoing…

So I just brought it as a sculpture.


After not looking at Segfault for several more weeks, I decided to take the Victor HV controllers out of Arbor (which by this point was a parts-bot) and try running the whole 36 volts to see if the response would be any stiffer.

Besides switching at only 100 Hz (and making a massive racket using Segfault’s hollow shell as a resonator), the Victors also demanded a digital input signal.

And so I sank yet another level.

Stop judging me.

By this pointed, I just wanted a balancing vehicle, dammit!

This board was thrown together, and some sensor-reading code freelanced, in a few hours.

An IRL screenshot of the Gory Details.  The Arduino read in the user gains and steering pot angle and processed them together with the two sensored readings. A complementary filter (a real one, as I later discovered), i.e. my entire two breadboards full of parts (which really isn’t one), is like one line of code.

It was nearing the end of term, and I wanted to just get this thing out of my sight (and mind) for a while. This version of Segfault was the closest it had ever come to working – I think I managed to stay on it for 2 or 3 whole seconds. But to get there, it must have kicked me in the shins at least 10 times. It was also very angry and would occasionally completely lose all control and accelerate wildly into something, or at least until it just fell over.

The falling over part destroyed the handlebar panel and broke several of the precision pots inside. So that was the end of Segfault for a while. Back into the corner it goes…


On A Midsummer Night’s Eve, when I was waiting on parts for the RazErBlades, I decided to take another crack at the thing. The Arduino controller was horribly hacked together the first time, and didn’t really incorporate the important part of the vehicle – which was the functioning Degrees gauge.

First order of business, however, was to fix the user interface panel. I found some matching 100K 10-turn potentiometers to replace the broken ones. The wiring was made cleaner by the use of a sacrificed VGA cable instead of a billion different twisted pairs.

I rebuilt the Arduino board with some actual forethought this time around so it incorporated all the pins and inputs I needed.

And here it is, the degrees gauge functional for the first time!

Too bad nothing else was. The test video pretty much says it all.

No matter how the gains were tuned, Segfault was prone to high frequency oscillations this time. It was too twitchy, or perhaps the sensors coupled too much of the motion back into the control loop.

The spark seen in the video was a portion of the battery pack heatshrink wearing through because of the vibrations, briefly contacting the metal frame at two different potentials. It was inconsequential. Unfortunately, the rapid forward-and-reverse gunning of the motors stripped out both of the precision spur gearboxes.

With the forced termination of that test, I decided to just write off Segfault and revisit it yet another day.



The synergistic combination of Mechanical engineering, Electronic engineering, Computer engineering, Control engineering, and Systems Design engineering[1], and also a really cool class here at MIT, designation 2.737. You should take it if you get the chance.

Basically, my assessment is that it’s everything I should have learned in my undegraduate controls courses (It’s actually a grad-level class, since MIT enjoys watching undegraduates torture themselves by taking G-level classes).

As such, I now know what a real analog complementary filter is. Referencing this paper by K. Byl (nee Lilienkamp), I’ve designed a new balance filter for Segfault, the Adaptive Face-Forward Compensator. I’ve also summoned the 21844 gate drivers and my now full-blown addiction to PCB design to create a new locked-antiphase Segtroller.

The major difference this time? I’m actually finishing SEGFAULT as a part of the grade for this class. This shit just got real™.

Here’s the sneak-peek.

The complementary filter and analog signal processing backend

The locked-antiphase H-bridge, each driving a single side

So when’s this due? Wednesday.

By that I mean a few days from now, and between now and then I also have to make sure that 2.009 doesn’t end in utter disaster.

Onwards Adaptive Face-Forward Compensator!

6 thoughts on “SEGFAULT Re/BOOTED Part 1: The Cyclic Tragedy of the SEGFAULT”

  1. Protip: Don’t ever use net labels. Like, EVER.

    While they make schematic drawing easier, if you put the project down for a week, and come back to it, you will be completely confused. It’s even worse if someone else is trying to understand your project.

    Also, you know you need bypass caps for *every* op-amp? Assuming you’re going SMT, there should be a cap between V+ and Gnd, and between Gnd and V- *directly* underneath EVERY op-amp. You want the trace length between the caps and op-amp pins to be as short as possible, try to keep it below 0.3″ in.

    Generally for non-high-performace analog, two 0.1uF ceramic caps are enough (make sure you get a good dielectric, like X7R). If you really feel like overkill, two few uF tants and 0.01uF ceramics is better (lower value ceramic caps have lower ESR).

    Also, is the bypass on the gate drivers ceramic or electrolytic? If it’s electolytic, the ESR is probably killing you. You’ll get short-period high-current transient spikes on the power rails which will overvoltage the part.
    Again, here trace length is *very* important. Place the cap as close as physically possible to the power pins, and keep all the power traces as wide as possible.

  2. Yeah, I’m a sloppy PCB artist. Alot of things aren’t indicated in the schematics, and I also just copied and pasted a single capacitor symbol around half the time. Worry not, gate drive bypass is all ceramic.

    I strongly prefer the net label/name method, however. I hate looking at schematics which have Little Green Wires going every which way, especially when you’re not sure they’re supposed to intersect. Pretty much all of my PCB work so far has been using net labels. I had the privilege of working closely with both schools of thought before I jumped into it myself.

    The filter is all breadboarded, so bypass caps are kind of implicit. The power stage, however, has been hired out to AC.

  3. (You probably do not want to see my technical drawings for machined part fabrication…)

  4. It’s completely possible to not use net labels at all, and still have a very organized schematic.

    Not that I’m referring to net labels, not power connections.

    Everything on your schematics basically have an input and an output. I don’t see why you can’t simply link them together.

    When you have a schematic where the control-flow is very immediately apparent, it is much easier to visualize the circuit’s behavior.

    Net labels are like GOTO statements in programming. They’re very powerful, but if you don’t have an thorough and explicit reason for using one, you shouldn’t be.

  5. I’m sure it’s completely possible, but at the moment, I find net labeling more clear and readable.

    Conversely, I consider grouping functional blocks of circuits together to be more akin to object-orientation, at least as it makes sense to me.

  6. In this world of so much chaos, I find clean schematics with as few overlapping wires as possible and well-chosen net names rather soothing…

    And there’s always “Show: PWM” to help me find the other half of my net that I forgot since the last time I looked at the circuit.

Comments are closed.