Crow by Patrick Wilken

The tale of a family of inertial navigators

Crafted in California by Tim Trueman   (Tue Jul 20 00:00:00 -0700 2010)

"T-minus 31 seconds and we're go for auto-sequence start…"

These words have little meaning to those of us not preoccupied with sending a 2000 ton spacecraft 185 miles up into the expanse of blue that only 49 years ago was science fiction—but for the curious, those words mean everything. With 31 seconds remaining, the seven humans surrender control to the machines. They place their lives into the hands of a family of five computers. The four identical quintuplets and one odd sibling seize control of the critical functions of a spacecraft strapped to millions of pounds of fuel. They choreograph what I would argue is one of the most beautiful concert of coordination; 250 times a second they cast their votes on what actions to take. If one of the machines were to malfunction its watchful siblings would outvote it and continue the mission without hesitation.

Endeavour, rolled onto its back, blasts through the clouds during the launch of STS-130 (shot by Shane Lin)

At T-minus 6.6 seconds the computers throttle up each of the engines one-by-one, 120 milliseconds apart. All five computers nod in agreement when it’s confirmed: engines and systems look good. Moments later launch arms are retracted as the juggernaut accelerates away from the pad.

Upon clearing the tower the computers command a careful, calculated and complex maneuver rotating the vehicle in all three axis: pitch, roll and yaw. It rolls gently onto its back to gracefully and delicately settle into a steady ascent headed downrange. It races towards an orbital path that will cover nearly five miles per second.

Throughout the violent acceleration towards the stars the machines maintain a perfect, constant and anchored orientation like a monk poised in a deep trance. One minute into the flight the vehicle reaches max-Q. It's when the throttle has to be eased back to 65% in order to survive the aerodynamic forces that mercilessly assault the structure protecting the fragile bodies of its passengers. The thunderous, deafening roar of the wind rushes over the aircraft at nearly 1000 MPH. Those computers are what keep the passengers safe as they compute the orientation of the spacecraft and make hundreds of tiny adjustments every second that to the casual observer on the ground over seven miles below them seems rock solid and sure.

Even today this feat is magic to all but a handful. And yet this technology is on the verge of celebrating its 30th birthday. Perhaps the time to pry open the mystery box.

When a human is gripping the joystick of an aircraft with expert hands they are relying on external references to maintain straight and level flight. They gaze to the horizon subconsciously. The AP-101S computers in the Space Shuttle on the other hand know down to a degree of accuracy exactly how the spacecraft is oriented. The magic behind this knowledge is the inertial navigation system.

Inertial navigation is like putting on a blindfold and then navigating simply by feeling which direction you've turn and guessing how far you've walked. Instead of feeling and guessing inertial navigation systems (INS) use a set of sensors: gyros and accelerometers. Gyros sense how fast you're turning in a direction and accelerometers let you feel how fast you're beginning to move forward.

How exactly do gyros sense how fast you're turning? These critical sensors—which sound like something straight out of Tony Stark's lab—are called ring laser gyroscopes. They use the Sagnac effect to detect with incredible accuracy the rate at which the gyroscope is rotating.

OK, so how does the degrees per second at which you're turning help give a computer exactly what angle the vehicle is pointed? A wee bit of calculus, some special software and an exhausted yet excited engineer combine forces to produce the result. What it boils down to is integration. All you have to do is add up the degrees per second. If you were to roll to the right at a constant 15 degrees per second, you would know how many degrees of roll you had accumulated at any given time. At half a second you'd be at +7.5 degrees and at 3 seconds you'd be at +45 degrees. That's essentially what inertial navigation is doing, except much faster: as much as several hundred times every second. Instead of checking every second for the turning rate the sensor is checked hundreds of times per second. The accuracy of the sensor combined with the high update rate allow for a precision that a human could never match.

Of course I'm grossly oversimplifying inertial navigation. There's lots of issues to take into consideration: centripetal force, temperature, even the Coriolis effect. The accelerometers and lots of algorithms to counter-act these issues are critical to inertial navigation.

Inertial navigation is badass, right? Don't you just want to toy around with it yourself? Oh right. Ring laser gyros: the only thing less likely to fall into your hands other than Scarlett Johansson. Fortunately there's a technology rapidly making projects only NASA could take on possible for you and me. It's called MEMS—the much-easier-to-remember-and-pronounce shorthand for microelectromechanical systems. They are tiny. You may never have heard of MEMS but they are everywhere now. Every iPhone uses MEMS sensors and the shiny new iPhone 4 even includes a 3-axis MEMS gyro. It's got enough sensors and processing power to do inertial navigation. Which means…you can afford the gyros and other equipment to build your own INS. Let's do this!

Over many months Ryan Beall (he is the shit) and I worked on a tiny piece of software. It's an open-source (under the MIT license) piece of software written in Python that does inertial navigation based on a BYU paper. I call it Shumai—a reference to a tribe of people who are expert navigators by using their advanced knowledge of the stars in an obscure post-apocalyptic science fiction book series I once read (I'm not nerdy, I'm not nerdy…). Also, even though gyros are cheap, you won't even need them to get started. Shumai works out of the box with the suite of virtual sensors in the flight simulator X-Plane.

Shumai running with X-Plane

At first glance Shumai may seem complicated but its purpose isn't so hard to understand. It collects readings from the gyros, accelerometers, static and differential pressure sensors (altitude and airspeed respectively), GPS and magnetometers (not directly included but emulated by an extra algorithm included in Shumai). After gathering these values it simply produces estimates for pitch, roll, yaw and the position (as well as wind direction and velocity).

To get started all you need to do is head over to Github to get the source code: http://github.com/dronedynamics/shumai. Be sure to follow the step-by-step instructions here: http://dronedynamics.com/shumai/. My ambitions for Shumai is to build the open-source inertial navigation software project that is the most comprehensive and most highly accurate. I would love to help anyone get involved if they'd like to start contributing to the project. Feel free to email if that is the case: tim@dronedynamics.com.

Further reading:

You should follow my inertial navigation and drone related tweets here.

Thanks to George and Asa for reading drafts!

fin

Subscribe Say hi@timtrueman.com