221 points · by YeGoblynQueenne · 10y ago · 139 comments
The could reproduce the exact same scenario in simulation by replaying the telemetry as inputs to their firmware and see what happened in the software. This is tremendous advantage for debugging, it's like a wireshark replay of network packets for debugging an error in the TCP stack.
This orbiter/descender architecture is really paying off for future missions. If the orbiter hadn't been there, earth wouldn't have received any telemetry at all.. Let's hope that this "real world" telemetry is saved for simulating successive versions of the guidance software of future probes.
If you build it right you also get a replay feature for almost free.
https://github.com/ternaris/marv-robotics https://vimeo.com/187705380
They already have:
> This behaviour has been clearly reproduced in computer simulations of the control system’s response to the erroneous information.
Kind of sad to see that computers nowadays still lack what we call common sense. I mean the machine received negative altimeter data but if it had been able to just look around, it could have seen that this data was erroneous. Hell, considering the descent profile was carefully prepared, the computer should also have noticed that it was way too early to reach the ground and should have concluded that something was wrong with the altitude measure.
So you have a prediction function that takes as input your previous estimated state and some form of "common sense" that's hard-coded or learned and which outputs a prediction of the current state. Then you look at your current measurements and if one of it disagrees to much it gets downweighted or outright discarded. The updated estimate is then computed from the prediction and the current measurements.
Or... run the flight controller through a 'fuzzer' that throws lots of unexpected scenarios at it. To be honest I'm rather disappointed that a project at this level has succumbed to a bug like this. It's a few thousand dollars of additional dev effort versus the whole project failing; classic small certain initial cost versus large possible future cost (see Taleb's Antifragile, systemic failure of financial markets, etc.)
Ho hum.
We in hindsight, now know that a little extra development could have avoided the problem.
The trick is trying to figure out where to spend your limited resources as the project is going.
There are lots of areas that might have caused problems. There may well be other flaws in the system that would also have caused a failure on descent.
In the case of an altimeter it makes sense to be aggressive with the 'common-sense' component to throw out bad data. But with other things like temperature, you wouldn't want to throw out data that could look wrong, but could actually be caused by some unknown phenomenon (like say, superheated gas pockets on mars) as that's exactly the type of weird stuff you'd be interested in.
I guess the problem is distinguishing [data that differs greatly from what was expected] and [data from a sensor malfunctions]
https://en.wikipedia.org/wiki/Sensor_fusion
TIL, thanks.
Well, computer vision is a different issue. Imagine you're a human sealed inside this thing, with no vision from the outside. You reach the point when the parachute's supposed to deploy, you feel something goes wrong - there's a big force, or it's in the wrong direction. Did the parachute rip off? Did it fail? You look at your two altimeters; one says that you're 3.5km up, one says that you're at almost ground level (that it's negative is a red herring I think - the probe knows the readings might be noisy and expects to handle that). What do you do?
It would also require you to anticipate the malfunction in which case you already know that things like that could happen, in which case you'd likely determine how it could happen and how to avoid it and continue having useful data. Sounds to me like a better solution than trying to recover without data.
> This in turn successively triggered a premature release of the parachute and the backshell, a brief firing of the braking thrusters and finally activation of the on-ground systems as if Schiaparelli had already landed.
It would have been better to do nothing, in the hope that the altimeter data will resume to reasonable values, especially since the article mentions that the error is not supposed to last long:
> Its output was generally as predicted except for this event, which persisted for about one second – longer than would be expected.
All inputs and outputs should be run through sanity checks, with a plan for when they go wrong.
Essentially, when you've got a system that can't be fixed, plan for failure of each and every component (in isolation).
They weren't telling that. As far as I understood, the sensors were fully right, the software just hasn't expected the rotation to last "so long" -- the whole second, so it calculated the result wrong ("negative height") by incorrectly processing these multiple (in time) for their model unexpected inputs.
If radar altimeter had never had a lock, either the radar altimeter has faulted in a way you can't detect, or you are above the lock range for your radar altimeter.
If the radar altimeter had locked, you have a very accurate measurement of height above ground.
This is why I'm deeply pessimistic about achieving human level AI any time soon, even within the next 100 years. I'm 50 years old today. AI researchers back when I was born expected to have substantially solved AI as a problem by now, but we're still barely scratching the surface of a very big domain. This accident is a really good demonstration of the limitations of modern computer systems in terms of autonomous independent situational awareness.
>The first thing to do was to try to seal up the hole. This turned out to be impossible, because the ship’s sensors couldn’t see that there was a hole, and the supervisors, which should have said that the sensors weren’t working properly, weren’t working properly and kept saying that the sensors were fine. The ship could only deduce the existence of the hole from the fact that the robots had clearly fallen out of it, taking its spare brain-which would have enabled it to see the hole-with them.
You could stack layer upon layer of fault detecting modules and supervising software and error and redundancy modules, but then you'd probably wind up with something like Dark Star's Bomb 20:
>Unfortunately, Doolittle has mistakenly taught the bomb Cartesian doubt and, as a result, Bomb #20 determines that it can only trust itself and not external input. Convinced that only it exists, and that its sole purpose in life is to explode, Bomb #20 states "Let there be light," and promptly detonates.
Notably, this obviously wasn't a failure case they programmed for. But it does seem a pretty fragile system to throw across the solar system in retrospect.
Not everything is as easy as it seems.
The effect is that the intended landing site is at an altitude of -250m, and the lowest point on Mars is at an altitude of -8200m.
That is, how do you develop fault-tolerant software and at the same time have logic that would reject some sensor readings if they deviate too much from up-to-now readings?
How many readings would you reject in the hope that fresher readings would be better?
I doubt anyone care about my opinion, but since you ask, I do notice that simulation seems to be a big part of their development. So I'm sure there has to be a way to use some kind of an evolutionary algorithm for creating descent procedures.
First, you define a Bayesian model for the system. This includes discrete propositions such as "sensor X is not working" as well as things like a description how the craft's velocity, angular velocity and displacement at t0 can evolve to at t1, expressed as a continuous probability distribution. This takes into account the prior distribution for altitude.
All sensor inputs have distributions -- generally gaussian -- describing what values they could read given the "actual" value they're supposed to be measuring if they're not broken and giving completely erroneous results.
Feeding sensor inputs into this model as they're received to produces a posterior describing the craft's physical state probabilistically. Dimensions which are relevant only insofar as they affect knowledge of the craft's physical state (such as "sensor X is not working") are marginalised out.
Secondly, you define a utility function. This function takes some definite physical state of the craft's and a possible control output, and describes how "good" the outcome of that is. Then you choose the control outputs that maximise the expected utility, integrated over the craft's posterior state distribution.
If sensor X started giving results unlikely under the time evolution model, P(Sensor X is not working|inputs,control signals,prior information) would start to increase very rapidly.
If, somewhow, this probability was only 0.5, but the sensor was showing results that the craft was below the ground, the decision process would "decide" that "if sensor X is telling the truth, firing the landing thrusters will not lead to successful mission completion; if sensor X is lying it is too early to fire the landing thrusters" and not fire the thrusters.
In reality, such a situation is absurd because sensor X showing the craft below the ground would lead to an extremely high probability for "sensor X is not working". However, the point is that even under extremely pathological conditions decision theory will continue to give reasonable results.
One important consequence to note is that the sensor readings and state estimate do not matter in themselves, only as inputs to the decision theory process.
To answer your specific question: if sensor X is determined to be, with high probability, faulty, its inputs aren't "discarded" per se, but will have a very small contribution to the state estimate. If sensor X is only believed to be faulty with moderate probability, both possibilities are considered and the optimal decision will be made given the information available and utility function.
For more information, I recommend reading chapters 13 and 14 of "Probability Theory: The Logic of Science" by E.T. Jaynes [0].
[0]: http://www.med.mcgill.ca/epidemiology/hanley/bios601/Gaussia...
It must be hard for all the people involved in Schiaparelli development.
Sometimes I wonder whether majority of software errors are caused only by multiple layers of people having incorrect / unchallenged / unjustified (and mostly implicit) assumptions about something.
I have been working in safety-related domains, where each failure could involve the death of several hundred people. It wasn't pretty: everything was sub-contracted to death, and there were a minority of people who really knew what they were doing, a majority who was so-so and didn't give a fuck, and still a fair part who was notoriously incompetent. So, the minority of competent and concerned people cannot always make up for the others, and when themselves fail, there is almost no one to make up for them. Oh, and I was working in a company that was supposed to produce better quality than others. And it did :-(
So, for something like ESA where life is not even concerned, I can't imagine it is any better if stuff is outsourced, and since nowadays almost everything everywhere is outsourced, I assume ESA does it too.
> Sometimes I wonder whether majority of software errors are caused only by multiple layers of people having incorrect / unchallenged / unjustified (and mostly implicit) assumptions about something.
Yes and no. This causes a category of mistakes but on the other hand, it prevents another category. When someone knows the full system, he makes a whole lot of assumptions: it doesn't matter if this function cannot handle this or that case because it will never be called this way, it cannot happen, so I won't handle those cases and I won't even check them. And then, later, something changes in an upper function or system, the assumption is not valid any more, and boom.
When you have no idea what the system is, you just stick to the function definition and have it handle all the weird cases. You don't make assumptions. You can still make mistakes, though, some of them caused by the lack of global understanding of the system because the specification writer had those assumptions in mind and did not write them down in the specification of this function because they were obvious to him or they were already written in another part of the specification.
This, alone, deserves an article. It's a fundamental knowledge in any software development made by different teams, or even a discussion about the pros vs cons of having a monolithic team versus distributed teams.
If you expect that small teams, doing parts of a project, take care of all possible interactions of their piece of program with all other components, you'll fail. They just have a subset of the knowledge, and how all those information was passed so that they could act is relevant. And in general nobody writes down every single detail that could make a difference. In those scenarios, analysts who are able to write requisites until the point that some can be considered non-sense or obvious, should be paid in gold.
Yes, everyone can be a super coder on his little bubble and use all the latest techniques to write high quality code, the problems arise when his/her bubble needs to interact with an ocean of unseen bubbles, many of which tainted ones.
That's exactly how Ariane 5 crashed in 1996:
https://en.wikipedia.org/wiki/Cluster_(spacecraft)#Launch_fa...
"Specifically, the Ariane 5's greater horizontal acceleration caused the computers in both the back-up and primary platforms to crash and emit diagnostic data misinterpreted by the autopilot as spurious position and velocity data. Pre-flight tests had never been performed on the inertial platform under simulated Ariane 5 flight conditions so the error was not discovered before launch. During the investigation, a simulated Ariane 5 flight was conducted on another inertial platform. It failed in exactly the same way as the actual flight units."
The software was actually developed correctly, and functioned as intended. At least for it's intended use. Then it was tossed at a new use-case without any accounting for any differences in the new situation.
I had to read that several times, just to make sure it said what I thought it said.
I can't figure out if Terma wrote the landing software, but it seems likely from their press release [1] and they have the relevant specialties.
The software might have been outsourced to another company.
Wouldn't they have a model of expected data and anything that is wildly out be removed? Fall back to an estimation?
This does sound like a rookie mistake, and I'll bet there's a dev somewhere saying "Oh crap" a lot because of it.
It's also a hardware design problem. NASA's human missions have a weight budget that includes multiple redundant systems. I have no idea if this probe had three of everything, but missions that do are more likely to be successful.
More subtly, I'm curious if the sensor failed or maxed out. The kinds of forces that would max out the sensor might also max out the probe. So it's possible it was already doomed after they were encountered.
In a hypothetical scenario, if one of those altitude sensors used barometric pressure, then a piece of grit or ice could have blocked the air intake, allowing the sensor to record a lower pressure than expected. If that grit or ice were suddenly blown away, then the sensor could record an instant change from an incorrect value (3.7km altitude) to a correct value. Even a negative altitude isn't necessarily incorrect, if the "altitude" is based on a mean ground level. For example, the shore of the Dead Sea is at an altitude of -423m [1].
The challenge with designing something like this is to imagine all the possible ways it could fail, all the possible misleading sensors inputs, and an appropriate action for each of them.
[1] https://en.wikipedia.org/wiki/List_of_places_on_land_with_el...
Even a negative altitude isn't necessarily incorrect,
if the "altitude" is based on a mean ground level.
This has been niggling at me, so I had to check :-)As Mars lacks water, the idea of a "zero datum" isn't really meaningful, so an arbitrary point has been used.
Between 1971 and 2001, the "zero elevation" point was an atmospheric pressure of 6.105mb [1] (for comparison, Earth's zero datum is 1013.25mb).
Since 2001, the zero datum definition has been based on the mean radius of the planet (an ellipsoid called the Areoid, similar to Earth's Geoid).
The lowest point on Mars is therefore at an altitude of -8200m (the Hellas impact crater). [2]
(edit) Interestingly, the intended landing site - Meridiani Planum - is "below ground" at an altitude of -250m. [3]
[1] https://en.wikipedia.org/wiki/Geography_of_Mars#Zero_elevati...
[2] http://geology.com/articles/highest-point-on-mars.shtml
[3] http://io9.gizmodo.com/this-elevation-map-of-mars-makes-the-...
On a tangentially related note, do you have any idea what happens to the concept of sea level on earth as the sea level changes?
In every communication and media event they keep putting a positive spin on what now turns out to be in essence a preventable design error...
Also, this was a test flight designed to gather data about the performance of the orbiter/lander platform, so it did perform its mission and according to the collected data, the platform behaves mostly as expected.
I'm also quite confident that even before commencing entry, they had some idea from simulations as to how much the descent should take. Surely there's something wrong f you read negative altitude after just half the time required for landing.
It's also not clear to me that this was an issue of erroneous data. All they said so far was that a rotational sensor maxed out for about a second. I don't think a simple delay-and-retry would have sufficed here. When attempting to land a second seems like a pretty long wait.
In aerospace the phrase IMU typically refers to the combination of accelerometers and gyroscopes.
When merged into the navigation system, the erroneous information generated an estimated altitude that was negative – that is, below ground level.
I wonder if this was a sensor fusion problem or a pedestrian integer overflow.IMU saturation is an expected condition, especially in this type of extreme real-world environment. It's absolutely normal to temporarily saturate IMU sensors on drones during hard landings for example and saturation values are generally clear in the documentation. A large part of the difficulty in position and attitude estimators is in rejecting glitching or erroneous data.
From the description (specifically that the duration of the saturation was an issue), it would sound like the position estimator (most likely a kalman filter) did not reject or distrust saturation values properly and converged on a bad solution. It appears that any strategy in place to (for example) reset the estimator state if it diverged from more reliable sensors (such as the radar altimeter), failed or were not included. It would also appear that the case where the IMU saturated during descent for over 1 second was not properly tested, as they were able to reproduce the issue in simulation.
This must be disappointing for the ESA but at least it was found now 'in beta' rather than in the relatively more important next lander.
An Ariane 5 launch back in 1996 [0] suffered a catstrophic failure after the inertial reference units gave bad data, and the flight control computer accepted it as gospel.
It is sad that they might have lost another platform due to a lack of appropriate range / saturation checking, especially as there was a radar altimeter onboard telling them they weren't underground.
[0] https://en.wikipedia.org/wiki/Cluster_(spacecraft)#Launch_fa...
I hesitate to speculate but the book I read that talked of Kalman filters and two people I know who messed with them said they are opaque and tricky to get right[1]. Hard to understand what the filter constants mean, and buggy software implementations 'sort of work' then break.
[1] Convinced me to use something else.
Most aerospace engineers with a GNC background know a lot about Kalmam filters.
Examples: http://www.techbriefs.com/component/content/article/ntb/webc...
Once the model is so simple, there are many ways to program it wrongly.
To compare, NASA's Mars Climate Orbiter
https://en.wikipedia.org/wiki/Mars_Climate_Orbiter
burned close to Mars in 1998 because the "ground based computer" programmed per contract by Lockheed used lbf·s values instead of agreed N·s values.
https://en.wikipedia.org/wiki/Pound_(force)
The values generated on the ground were 4.45 times bigger.
Space missions are risky.
But it's good that they made such an experiment before sending the whole rover, planned for 2020.
Granted, if it predicts an impossible configuration due to this, perhaps some different action should have been taken, like waiting for higher confidence and a more close-to-expected attitude estimate, but by then perhaps it would be too late. I mean, the thing is falling from the sky.. perhaps the "safe" thing was to deploy anyway. (Even if it didn't work.) I just don't know.
Why? Too much Red tape?
Massive cudo's for being public about the issue. It is not easy to talk about mistakes, especially those that appear to be silly in hindsight.
EDIT Interesting to see that I am getting downvoted multiple times on this. I don't really care about a few downvotes but would be interested to find out why.
And why hasn't anybody asked that question yet? It's the first question I thought to myself.
It's a shame such an expensive piece of equipment and years of work and waiting around were obliterated by a bug that should have been caught.
I expect that a top level system model should reduce the risk of this sort of error.
Of course, it is hard to justify the cost of developing these models without being able to amortize that cost over multiple products / missions, so product line oriented engineering management and strong leadership from the sponsor has a big role to play as well.
Costly mistakes happen when people take unjustified shortcuts. Like not testing Hubble's mirror on the ground, and ending up with a myopic telescope in orbit that then needs another billion dollar mission to correct.