NASA: 'Extreme programming' controls Mars Lander robot

Engineers send code 170 million miles through space daily in search for life on Mars

Scooping up soil samples and searching for elements that could support life on Mars isn't just an adventure for the Mars Lander and the robotic arm doing the scooping.

It's also an adventure for the approximately 30 engineers and programmers at NASA who are tasked with writing and testing 1,000 to 1,500 lines of software code and then beaming it about 170 million miles away — every day.

Matthew Robinson, the robotic arm flight software engineer at the Jet Propulsion Laboratory, said the team has to write the code sequences to run different parts of the Phoenix spacecraft, including the robotic arm, the cameras and analysis equipment. One mistake and the Lander sits idle for a day, wasting precious time that could be used to discover if the planet can support life.

So far, all the code they've beamed up to Mars in the past week has worked.

"It's a challenge because we have a two- to three-day strategic plan, and then each day that plan is refined," Robinson told Computerworld. "They decide on the final plan that day. You have to build 20 to 30 sequences, and each can have 50 lines of code in it. And they have a lot of interplay between different instruments, so you have to make sure the sequences are not just working, but working together.

"Building the sequences is an extreme programming challenge every single day," he added.

And the developers, who used the C programming language to build their own software for a Linux operating system, are expected to be dealing with that challenge for about three months. The Mars Lander, which is on a one-way trip, is slated to gather and analyze samples throughout the summer months. After that, the planet's temperature will drop well below the current safe range of minus 170 degrees Fahrenheit to 32 degrees Fahrenheit, causing the Lander to freeze up and stop working.

The mission is focused on collecting ice and soil samples that can be analyzed in eight different ovens, four wet chemistry cells and a microscopic imager on the Lander. Robinson explained that they're not looking for life; they're looking for the elements that support life.

The robotic arm, which weighs between 20 and 30 pounds on Earth, is the key to the effort. The arm has a scoop attached at the end that is designed to dig up ice and soil, and then deliver it to the analysis tools. No soil, no analysis.

And keeping that robotic arm, along with other parts of the Lander, running every day is a huge chore.

Robinson said a 3-D digital elevation map was used last Sunday to write code to make the arm reach down and touch the ground. That gave the team an idea of how accurate the maps are, how easily the soil can be scooped up, and how well they can control the arm from so far away. 

"It was really exciting," said Robinson. "It's the first time a scoop has touched Mars since Viking was there in the '70s. And it's also the first time a vehicle has gone to the polar region of Mars. We've actually been able to reach out and touch the Martian North Pole."

Then on Monday, they sent the arm instructions to reach down, scoop up some soil and hold it so onboard cameras could take a picture of it. After that, the arm dumped the soil back on the ground. On Tuesday, they did another practice dig.

Robinson said they practiced the dig because they needed to make sure they were getting the right amount of sample before they had the arm deposit it in one of the ovens. Once in the oven, the sample is heated and the gases that are emitted are captured and analyzed. Once the oven is used, it can't be used again. And with only eight ovens on board, scientists needed to make sure they weren't wasting a burn on a bad sample.

On Wednesday, engineers sent up the code to run an actual analysis, but a satellite orbiting Mars, which transfers the data down to the Lander, was offline. Robinson explained that the satellite had been hit with radiation, knocking it into safe mode. "Space is a harsh environment, and sometimes they just go into safe mode," he noted. "It's a minor problem. [The satellite] aborts whatever it was doing and waits for future commanding."

Engineers successfully resent the code on Thursday. As of late Thursday afternoon, Robinson said they were just waiting for an information feed to come back to Earth, reporting on how the work went for the day.

"In terms of [component] interoperability on a Lander mission, it's one of the most challenging missions we've had with so many instruments working together," he added. "In terms of [human] cooperation, I think of it as being like a stock broker in terms of the tension of having everything lined up to go."

Adding to the tension is the fact that the Martian day is 24.5 hours long. That means that the engineers' workday here on Earth shifts by half an hour each day. One day, for example, they'll start work at 9 p.m. to get the code to the Lander in time. The next day, they'll start at 9:30 p.m.

"It's kind of exhilarating," said Robinson. "We've spent the last five years to get to this point. It's super-exciting to go from testing to practice to doing it for real. I can't stress how exciting it is."

(Editor's note: The current distance between the Earth and Mars is about 170 million miles. This story originally listed a different figure for how far the code is being beamed each day; it was updated at about 11 a.m. EDT on June 6.)

First look: Office 2019’s likeliest new features
  
Shop Tech Products at Amazon