Learning to Fly (with Ingenuity)
Image: Caltech/NASA-JPL
by Sabrina Pirzada
When the Ingenuity helicopter lifted off the dusty surface of Mars on April 19, 2021, it marked an extraordinary accomplishment: the first powered flight on another planet.
Here on Earth, Alejandro Stefan-Zavala, a graduate student in Caltech’s Center for Autonomous Systems and Technologies (CAST), watched in amazement as history was being made on Mars, knowing he had helped give Ingenuity its first breath of wind. Years earlier, as a Caltech Summer Undergraduate Research Fellow (SURF), he had helped design, develop, and maintain the software that controlled the wall of fans used to simulate Martian winds inside the Space Simulator at NASA-JPL, which prepared Ingenuity for its historic takeoff.
Today, Stefan-Zavala channels what he learned from Ingenuity closer to home, engineering drones that can survive the unruly winds of Earth, especially those in cities. To do that, he develops models that predict how wind flows around buildings and uses those predictions to help drones plan safer flight paths through urban environments — an advance that could improve the safety of delivery drones, infrastructure inspections, and future air taxis.
At Caltech’s Center for Autonomous Systems and Technologies (CAST), graduate student Alejandro Stefan-Zavala runs experiments to understand autonomous drone flight. Credit: Lance Hayashida for Caltech.
Stefan-Zavala shared his journey at Caltech's Science Journeys lecture series, tracing the unlikely path from a childhood in Venezuela to the cutting edge of autonomous flight. He grew up in Maracaibo, where his childhood hobbies included climbing things he was told not to climb and building contraptions from motors and batteries. He spent hours carefully drawing arrow-filled circuit diagrams and blueprints that didn’t quite correspond to what might produce actual working machines but nonetheless fueled a fascination with flight that has grown into a complex pursuit to design smarter flight paths and predict the conditions that make flight possible.
Understanding the Environment
In photographs, the Martian environment appears serene, with wide, red plains under a muted sky. The seeming tranquility belies conditions that are profoundly hostile to powered flight. Mars has far less gravity than we do on Earth which sounds helpful for any vehicle trying to become airborne, but there is a catch: the weaker gravity that makes liftoff easier has also left Mars with almost no atmosphere. That’s a problem, because everything that flies in Earth’s skies (birds, planes, drones) generates lift by pushing against molecules in the atmosphere. In an atmosphere like that of Mars, which comparatively is almost empty (only 1% as dense as Earth’s) there’s nothing to push against.
There are two additional challenges: Mars’ unpredictable winds and the communication delay of 7 to 20 minutes each way when the planet’s robotic explorers are talking to Earth. When it came to designing Ingenuity, these factors meant the helicopter would have to be self-sufficient and autonomous. To understand how to make Ingenuity fly on Mars, engineers had to simulate Mars here on Earth—not only its air, but its winds, its turbulence, its gravity, and its temperament.
NASA’s Ingenuity Mars Helicopter flies above the Martian surface—the first powered flight on another planet. Credit: Caltech/NASA-JPL
Building the Sky
Stefan-Zavala and his colleagues set out to build the Martian sky inside a giant stainless-steel dome, the 25-foot Space Simulator, located at the the Jet Propulsion Laboratory (JPL), which Caltech manages for NASA. There, engineers replicated deep space conditions by removing almost all the air inside the chamber. Once it was nearly empty, they added back in only those chemical elements that make up the air on Mars, which is mostly carbon dioxide.
Replicating Mars’s remarkably thin atmosphere was only the beginning, however. To teach Ingenuity to fly in that atmosphere, engineers also had to recreate the planet’s wind. To do this, the team at JPL built a wind tunnel made of 441 individually controllable high-powered fans. By adjusting the speed of each fan, researchers could generate an array of precise wind fields. The concept worked: With enough fans and enough control, the team could effectively “paint” the wind, as Stefan-Zavala describes it, recreating Martian winds on Earth with fidelity.
Crash. Fail. Repeat.
Early prototypes of flying robots, it turns out, do not glide elegantly on their first takeoffs. They wobble, jitter, and crash. Inside the Mars simulation chamber, the Ingenuity helicopter behaved much as humans do when we take our first steps: falling, getting back up, and trying again.
An early prototype of NASA’s Ingenuity Mars Helicopter during flight testing on Earth. Credit: Caltech/NASA-JPL
But such crashes are not setbacks, Stefan-Zavala explains. They are the entire point. Every crash generated data the engineers needed: vibration signatures, instability patterns, and aerodynamic limits. Each failure showed them how to reshape the helicopter blades, adjust the controls, and strengthen the design. Prototyping meant building a machine that could survive on a planet where flight shouldn’t be possible, and the only way to get there was through a long sequence of imperfect, instructive failures. As Stefan-Zavala notes, “You’re supposed to fail in the beginning.”
Mapping the Invisible
On Earth, where winds are denser, more chaotic, and shaped by terrain and structures, the drones Stefan-Zavala now works with have yet another exacting requirement for safe flight: a map of the invisible wind. Before a drone can safely navigate a city block, someone has to map the wind it will encounter there. This includes both direction and speed, as well as the swirling patterns, vortices, wakes, pockets, and recirculation zones that shape how those winds behave. Researchers use a technique called computational fluid dynamics (CFD) to simulate these complex airflows using the laws of physics. They then train machine learning (ML) models on the results of those simulations, allowing computers to approximate the same flow patterns much more quickly.
A machine learning model is a computer-generated simplification of something that exists in the physical world. The model “learns” from massive amounts of data by refining itself until it behaves like a mirror image of the patterns within that data. If you show an ML enough examples of how wind behaves when it runs into different building arrangements, it becomes able to infer (or “predict”) how wind will behave against new building arrangements—ones that were not among its training examples. A model will never be a perfect replacement for the real-world process that created its training data, but that’s not the point. The point of a model is to be simpler, cheaper, or otherwise more usable than the original process. In this case, Stefan-Zavala's model gives, in a fraction of a second, coarse estimates for city winds that would take hours to produce using computational fluid dynamics. The model’s wind predictions are not as accurate as those from CFD simulations, but (given enough training examples) they eventually become accurate enough to reliably guide real-world flight as well as the expensive CFD predictions would—and, by being so much cheaper, they can be either run on smaller hardware (even on-board a drone) or on much larger inputs than one could afford with simulations.
Alejandro Stefan-Zavala works with the programmable fan array at Caltech’s Center for Autonomous Systems and Technologies (CAST). Systems like this allow researchers to generate precisely controlled wind fields. Credit: Lance Hayashida for Caltech.
Learning to Fly
Ingenuity’s success opened the door to a new era of exploration. Future Mars helicopters will be larger, more capable, and more autonomous. They will be able to scout landing sites for human missions, retrieve samples, or zip into canyons that rovers cannot reach.
As JPL continues to expand the boundaries of what is possible in space, the work led by Stefan-Zavala and his colleagues will also shape the skies here on Earth, where wind is denser, less predictable, and shaped by buildings and terrain. This is where the challenge of flight becomes even more complex and wind-aware navigation is needed to make delivery drones safer, improve disaster response aircrafts, and enable structural inspections in dangerous conditions.
As with the work he pursues, Stefan-Zavala’s path into aerospace engineering was non-linear and not only tolerated failure but thrived because of it. He began at Santa Monica College on a student visa, then applied to Caltech as an undergraduate but was not admitted. Stefan-Zavala was undeterred and rejection rerouted rather than ended the journey. The curiosity that had once led him to sketch imaginary machines and tinker with motors and batteries long before he understood how they worked would take him to Caltech, first as a SURF fellow, then as a graduate researcher in CAST, became the foundation for real-world engineering that would touch the first powered flight on Mars.
As a graduate researcher at Caltech, Stefan-Zavala applies that same sense of curiosity and perseverance to his ongoing work on autonomous flight, following the steps that have taken him this far: predict, test, adjust, repeat. It turns out, teaching a robot to fly is not only about understanding Mars, it’s about learning how to move forward through turbulence, and engineer within ourselves the ability to take flight.
This article is adapted from Alejandro Stefan-Zavala’s Science Journeys presentation, “Flight School for Robots.” Watch the full presentation here.