(CNN) — When the Ingenuity helicopter took off for its latest flight on Mars, things didn’t go quite according to plan.

But the little chopper muscled through its sixth flight on May 22 and survived, despite some unplanned swinging around in the Martian atmosphere.

The unexpected motion was caused by an image-processing issue that disrupted the flight plan. However, Ingenuity was able to get through the final 213 feet (65 meters) of its 705-foot (215-meter) journey and safely land on the Martian surface. And it will live to fly another day.

Here’s what happened.

An ocean of motion

The little 4-pound helicopter that could had already completed all five flights planned for by its team on Earth by the end of April. When Ingenuity showed no signs of slowing down, its creators decided to extend its mission by another month and see what else it could do.

This flight was meant to be an aerial scouting mission, showcasing the chopper’s ability to fly over new territory while moving at 9 miles per hour (4 meters per second) for 140 airborne seconds. It would use its cameras to identify intriguing features on Mars and touch down at a different airfield.

Ingenuity’s sixth flight was scheduled to begin with the copter rising to 33 feet (10 meters) off the ground and flying southwest for 492 feet (150 meters). Once it reached this distance, Ingenuity would capture color images of an area of interest as the chopper flew south for 50 to 66 feet (15 to 20 meters).

Once Ingenuity took these images, it was supposed to fly 164 feet (50 meters) northeast and touch down at a new airfield, called Field C.

Data from the flight shows that the first 492 feet (150 meters) and 54 seconds went smoothly. Then, something went wrong and Ingenuity began to oscillate through the air, adjusting its velocity and tilting back and forth, according to Håvard Grip, Ingenuity’s chief pilot at NASA’s Jet Propulsion Laboratory in Pasadena, California.

This spinning motion afflicted Ingenuity for the rest of its flight. Onboard sensors show that Ingenuity endured pitch and roll motions of more than 20 degrees and spikes in power consumption, Grip wrote in an update.

When the copter is in the air, Ingenuity tracks its own motion using an onboard inertial measurement unit, which measure the rotorcraft’s acceleration and rotation.

Tracking this information over time can be used to estimate the helicopter’s location, how fast it’s moving, and its orientation. The onboard computer can react and adjust quickly based on these motions.

This information is combined with input from Ingenuity’s navigation camera. This downward-facing camera captures 30 pictures a second and sends them to the chopper’s navigation system. Ingenuity is able to recognize time stamps and surface features to determine its actual location and make corrections to orientation, speed or position.

During Ingenuity’s flight, it suffered a glitch while delivering images from the navigation camera. Only one image was lost, but that caused the rest of the images to be marked with incorrect time stamps.

The chopper’s navigation system was operating based on inaccurate data and making adjustments based on those time stamps, causing it to spin.

Safe landing

Ingenuity lived up to its namesake, however, and survived this anomaly. It maintained flight and touched down within 16 feet (5 meters) of its predetermined landing spot.

The helicopter survived this wild ride because it was designed to tolerate errors without devolving into instability. Ingenuity’s team also made the decision to stop relying on navigation camera images during the chopper’s descent when it’s landing. This caused Ingenuity to ignore camera images with incorrect data before landing, allowing it to stop spinning, level off and touch down at the right speed.

“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,” Grip wrote.

“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.”

(Copyright (c) 2024 CNN. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.)

Join our Newsletter for the latest news right to your inbox