Ingenuity’s sixth flight on Mars took place this week, and we’ve just heard details from JPL on an “in-flight anomaly.” The little robotic helicopter did manage to land safely, more or less where it was aiming for, but the software glitch that it encountered sounds terrifying, with “roll and pitch excursions of more than 20 degrees, large control inputs, and spikes in power consumption.” Fortunately, JPL knows exactly what went wrong.
Flight six was an ambitious flight for Ingenuity. After ascending to 10 meters, the plan was for the helicopter to fly 150m to the southwest, translate 20m south while taking some color pictures, and then finish up by flying 50m northeast to land at a new airfield that it had never seen before. Total time in the air was expected to be 140 seconds, with a top speed of four meters per second. This flight was to be both a significant expansion of Ingenuity’s flight envelope, as well as a test of whether its color camera could be used to take aerial stereo images to generate three dimensional maps of the Martian surface.
But right at the end of that first 150m leg of the flight (about 54 seconds after takeoff), something went wrong, causing Ingenuity to begin “adjusting its velocity and tilting back and forth in an oscillating pattern” with “roll and pitch excursions of more than 20 degrees, large control inputs, and spikes in power consumption,” according to Ingenuity Chief Pilot Håvard Grip. Ingenuity’s behavior was erratic for the remainder of the flight, but remarkably, it landed safely within just five meters of its target.
This sequence of images taken by Ingenuity’s navigation camera shows the final 29 seconds of flight six. Images: NASA/JPL-Caltech
JPL traced the cause of this glitch to the loss of a single image in the pipeline that Ingenuity uses to estimate its speed and position. The robot relies on a downward-pointing VGA camera for monocular feature tracking: the camera captures frames at 30hz, finds distinctive features in those frames, and then compares each frame with the frame taken immediately before to see how much those features have moved and in which way. This allows Ingenuity’s navigation algorithm to figure out what direction it’s heading in and how fast it’s going.
This is a very well established technique that works great, as long as you know exactly what the time difference between the two frames that you’re comparing is, and this is where Ingenuity got into trouble. When that one image was lost, it screwed up the timestamps of every subsequent image without the navigation algorithm realizing it, Grip says. “From this point on, each time the navigation algorithm performed a correction based on a navigation image, it was operating on the basis of incorrect information about when the image was taken. The resulting inconsistencies significantly degraded the information used to fly the helicopter, leading to estimates being constantly ‘corrected’ to account for phantom errors.”
It would not have been at all surprising if this had been the end for Ingenuity, but the helicopter managed to keep flying along its pre-planned route. It was able to land safely because it’s programmed to stop using its visual navigation system just before landing, a decision that JPL originally made because of concerns about dust kicked up by the rotors obscuring the images.
Remember that Ingenuity has already done everything that it was designed to do, and that technically, its mission was a success after the very first flight. Everything that’s happening now is just gravy. And the good news about this particular anomaly is not just that everything ended safely, but that it put the Mars helicopter through the kind of test that JPL would never have dared to do deliberately, which hopefully will help the next Mars helicopter be even more resilient, as Grip explains:
Looking at the bigger picture, Flight Six ended with Ingenuity safely on the ground because a number of subsystems – the rotor system, the actuators, and the power system – responded to increased demands to keep the helicopter flying. In a very real sense, Ingenuity muscled through the situation, and while the flight uncovered a timing vulnerability that will now have to be addressed, it also confirmed the robustness of the system in multiple ways.
While we did not intentionally plan such a stressful flight, NASA now has flight data probing the outer reaches of the helicopter’s performance envelope. That data will be carefully analyzed in the time ahead, expanding our reservoir of knowledge about flying helicopters on Mars.