How the First Helicopter on Mars Uses Off-the-Shelf Hardware and Linux
Nearly 50 spacecraft have been sent to Mars — each one more powerful than the last, Scientific American has reported. It’s been said that it’s the only planet we know of populated entirely by robots.
But this month, as humanity continues its explorations with the landing of the Perseverance rover, open source enthusiasts cheered that Mars was also becoming the second planet where Linux is headed for world domination. The open source operating system is a critical part of a project to deliver what may become the first aircraft ever to fly from the surface of Mars.
And it’s all an inspiring example of a massively complex project that carries with it some of humanity’s best technologies — and also its best hopes.
The Winds of Mars
The mission has already resulted in the first audio recording ever of sounds from Mars. “About 10 seconds into the 60-second recording, a Martian breeze is audible for a few seconds, as are mechanical sounds of the rover operating on the surface,” according to a NASA press release. And Thursday NASA shared live footage from the Perseverance rover’s special mast-mounted, zoom-equipped camera, Mastcam-Z, which can not only generate color pictures but also 3D and stereo images.
But the Perseverance rover also carries a special passenger — a little flying robot that NASA has named Ingenuity. Right now NASA describes it as “attached to the belly” of the Perseverance rover, where it will remain for the next month or two while the rover scouts for a suitable location to drop it off. “Its body is the size of a box of tissues,” explains IEEE Spectrum, weighing just 1.8 kilograms (less than four pounds). And while NASA estimates the cost of the Perseverance mission at $2.4 billion — just $80 million went to the Ingenuity helicopter (with another $5 million for operating it).
But NASA’s Jet Propulsion Laboratory proudly hails it as “the first aircraft humanity has sent to another planet.” And last Saturday the helicopter reported to the Mars orbiter that it had survived the landing and was operating as expected with partially-charged batteries, as was its base station on the Perseverance rover.
Perseverance will eventually become autonomous — sort of. Earth-to-Mars communication can take at least four minutes — or as long as 21 minutes, depending on how far apart the planets are at that particular point in their orbit. So when its big moment comes, Ingenuity will maintain its pre-programmed flight path by analyzing its own images of the terrain below as well as data from its own sensors (like how fast it’s traveling) — without any real-time input from earth. IEEE Spectrum spoke to Tim Canham, who leads the Mars Helicopter Operations team at NASA’s Jet Propulsion Laboratory, who explains that “A few dozen features are compared frame to frame to track relative position to figure out direction and speed, which is how the helicopter navigates.”
Although if a sensor goes bad, “the helicopter really has one response, which is to take the last propagated state and just try to land and then tell us what happened and wait for us to deal with it.”
Though the gravity of Mars is about one-third the gravity on earth, the copter’s designers also had to make adjustments to handle the thin Martian atmosphere — just 1% the density of earth’s. A NASA blog post explains that even though the copter’s stiff blades are a full 4 feet wide (about 1.2 meters), “At 2,800 rotations per minute, it will spin about 10 times faster than an Earth helicopter.” NASA also points out that the helicopter “requires 360 watts of power for each second it hovers in the Martian atmosphere,” (equivalent to the power required by six light bulbs). But most of the energy from the helicopter’s solar array (located over its rotor blades) will be used just to keep it warm.
The NASA website adds that “If Ingenuity survives its first bone-chilling Martian nights — where temperatures dip as low as minus 130 degrees Fahrenheit (minus 90 degrees Celsius) — the team will proceed with the first flight of an aircraft on another world.”
But what may be even more interesting for computer geeks: Perseverance relies on Linux.
“There isn’t a previous use of Linux that I’m aware of, definitely on the previous rovers,” Canham told PC Magazine. Even the Perseverance rover is using Wind River’s proprietary VxWorks operating system, which was also used for some past rovers, the magazine reports — but Canham tells them they’d needed Linux to use with the Snapdragon 801 board. “It’s definitely a win for Linux.”
It’s also using F´ (pronounced “F Prime”), a JPL-produced “component-driven framework that enables rapid development and deployment of spaceflight.” F Prime is available through a GitHub repository listing its components, which include “An architecture that decomposes flight software into discrete components with well-defined interfaces” and “a C++ framework that provides core capabilities such as message queues and threads” (though there’s also several Python dependencies).
Canham tells IEEE Spectrum that “It’s kind of an open-source victory because we’re flying an open-source operating system and an open-source flight software framework — and flying commercial parts that you can buy off the shelf if you wanted to do this yourself someday.”
Need a mid-day pick-me-up?
How about some Mars rover?
Interact with a 3D model of @NASAPersevere created in collaboration with @GoogleArts: https://t.co/nKcl5bEhPD pic.twitter.com/SXZ6I6JeJJ
— NASA (@NASA) February 25, 2021
High Risk, High Reward
NASA considers the mission “a high-risk, high-reward technology demonstration,” according to an impressive animation it created:
Mostly the agency just wants to answer some basic questions: like can it take off in the Martian atmosphere — and can it successfully land. If it remains operable, they’ll try “up to four more flights,” according to NASA — each one flying a little bit further than the last. NASA is estimating flights “up to 90 seconds, to distances of almost 980 feet (300 meters) at a time and about 10 to 15 feet from the ground.”
But the first flights in the 30-day window could be only the beginning, Canham hints to IEEE Spectrum. “Depending on how quickly the first three go, we may have a week or so to try some more exotic things.”
Yet another NASA fact sheet points out it’s also demonstrating the practicality of miniaturized flying technology — shrunken-down onboard computers and electronics that lighten the load. “Since Ingenuity is classified as a technology demo, JPL is willing to accept more risk,” Canham explained to IEEE Spectrum. “So we essentially went out and used a lot of off-the-shelf consumer hardware.” So while the crucial avionics components are radiation-resistant, it’s using an ordinary cellphone-grade inertial measurement unit, and its processor board is just Qualcomm’s cellphone processor Snapdragon 801, Canham added.
“But ironically, because it’s relatively modern technology, it’s vastly more powerful than the processors that are flying on the rover… because we need it, Canham said. “Our guidance loops are running at 500 Hz in order to maintain control in the atmosphere that we’re flying in. And on top of that, we’re capturing images and analyzing features and tracking them from frame to frame at 30 Hz.”
It’s using a laser altimeter they bought online from the open-source hardware site SparkFun Electronics, Canham tells the site. And “The camera is as good as your cell phone camera,” explains one NASA webpage. Equipped with a 13-megapixel camera, “engineers will attempt to take plenty of good pictures.”
NASA points out that Perseverance also carried a special placard with 10,932,295 names, “stenciled by electron beam onto three fingernail-sized silicon chips.”
But maybe the spirit of the mission was best captured by a special message NASA encoded in the colors of the parachute that slowed the landing craft’s descent to the surface of Mars. The orange sections of the parachute represented ones in binary code, while the yellow sections represented zeroes. (So the letter “A” becomes yellow-yellow-yellow-yellow-yellow-yellow-orange.)
What was the message? The colors in the parachute’s outer ring encoded the GPS coordinates for NASA’s Jet Propulsion Lab in Pasadena, California. But the inner ring had encoded a phrase from a Theodore Roosevelt speech in 1889 which has since become the official motto of JPL.
“Dare mighty things.”
- Wall Street tries training robots to understand Reddit.
- As the Python programming language turns 30, version 0.9.1 gets resurrected.
- How a 16-year-old spent the next 16 years building his own massively multiplayer online world game.
- How a bar in Mexico built an “I miss my bar” site recreating the experience — and raising money for bar staff.