When we think about space exploration, we tend to think of astronauts, rockets or the International Space Station. Maybe we also think about a team of experts sitting in the office of a Chinese or American space agency, breaking out into fits of joy as they successfully land a new rover on Mars.
What we tend to miss is all the people who write the software that keeps the satellites orbiting and the rockets on track. Large numbers of people sift through data from satellite sensors or simulate rocket launches before they take place. They, too, are doing rocket science. But it’s less intuitive to think of them as such.
Many images we see in the media show expert teams congratulating themselves or cool rovers and rockets cruising in outer space. They satisfy our human curiosity and our everlasting thirst for crossing new borders and expanding our horizons. At the same time, these types of stories keep things simple enough. Anyone can appreciate the fact that humanity has landed a few rovers on Mars. On the other hand, it takes a heap of expertise to understand how that rover is built, what goes into steering it, and which technologies make it fit for life on Mars.
Many people want to know about space. They want to know what it looks like and what humanity is doing to explore it. But without detailed knowledge, it’s hard to understand how space technology really works.
That’s where being a software engineer helps. Even if you don’t know too much about physics, or about rocket materials, coders can understand what types of software technologies are used in space and why.
Although NASA makes a lot of its code public, it’s hard to find details on the day-to-day activities of a software engineer for space tech. A few stories are available from Elon Musk’s projects, though. Considering that working at SpaceX or Starlink is many an engineer’s dream, these will be my focus here.
Software Tools for Spacefaring Projects
Starlink, Where Satellites Calculate Their Own Routes
Back in 1945, when science fiction writer Arthur C. Clarke first proposed satellite TV, it sounded like a pipe dream. Even though it took three decades, this technology finally became reality. Nowadays, many people have satellite receivers on their roofs and think nothing of it. Satellites’ major advantage over cable is that they can reach rural areas, which wouldn’t be cost-effective with very long cables.
Similarly, satellite internet still sounds like a pipe dream to many people. But the demand is there: One in four rural Americans thinks that their lack of access to high-speed internet is a major problem. Spotty internet access is also a problem for moving objects like trains, jets and ships. Anyone who has tried to use WiFi while traveling can attest to that.
These problems might get resolved soon, however. Starlink, a spinoff of private-sector rocket pioneer SpaceX, is laying the groundwork for more expansive internet access. First announced in 2015, Starlink internet is already available in many parts of the U.S. today.
To ensure that the internet isn’t too slow, the satellites need to be quite close to Earth. Because of that, they only remain overhead for a few minutes at a time. So, the ground-based antennas that they communicate with need to change which satellite they speak to very often. And the satellite network needs to be dense enough to provide the antennas with a signal at any given moment in time.
The network consists of hundreds of satellites; new ones are constantly being added and old ones replaced. As a result, Starlink software lead Andy Bohn says that the team doesn’t have time to put each satellite into its own designated orbit. Instead, every Starlink satellite navigates itself. To manage the busy traffic conditions, the Earth-side network gives each satellite a place to be, and the satellite steers itself into its spot.
This process requires a huge computational effort. First, the satellites don’t only risk bumping into each other. They can also collide with planes and other satellites in low orbit. Starlink satellites are already involved in half the near-collisions in space, where two objects get closer than one kilometer (0.6 miles) to one another, so this risk is real.
Second, the possibility of interference contributes to the massive computational requirements. When the signals of two satellites overlap, they can distort or even cancel one another. Avoiding interference requires putting the signals into slightly different frequency bands. But this isn’t as easy as it sounds, and a finite number of possible frequency bands. Therefore, two satellites with bands that are too similar can’t get too close to each other. This requirement further complicates the satellites’ navigation.
You might wonder why the satellites’ positions need to be calculated on Earth and not directly onboard the satellites. For one thing, if something goes wrong inside a satellite, it’s much harder to go there and fix it. In addition, things go wrong much more often in outer space than on Earth. Because the sun’s radiation is much stronger outside the Earth’s atmosphere, bits can flip more easily. Bits, the zero-or-one encoding units of all computers, can corrupt entire software programs when they flip their value. To prevent this from messing up a satellite’s trajectory, different machines share software, and a correct copy of it can be reloaded in the event of corruption.
Software at Starlink is written in well-known programming languages. Because of its reliability and capability for bare-metal programming, Starlink uses C++ for most of the code in its satellites. The company also uses Python for some prototyping because it’s generally faster to build in. This mirrors what developers use in autonomous vehicle technology.
Satellite internet is a very ambitious project, and it comes with many difficult challenges. Starlink is undoubtedly the pioneer of this field, but other companies and space agencies are quick to follow. In a decade or two, it might be just as standard as satellite TV is today.
SpaceX, or Trying Not to Fail
Similarly ambitious is SpaceX, of which Starlink is an offshoot. Launching rockets into outer space, docking with the ISS, or aiming for Mars requires near perfection in both hardware and software engineering. Tests can fail, of course. But in the final mission, nothing is allowed to go wrong. And if a part of the rocket system doesn’t work properly, all other parts need to compensate for that failure.
All flight software for SpaceX rockets is built around control cycles. First, all the inputs are read, such as data from sensors or commands from the ground. Then this data gets processed and important things get calculated, such as the position of the rocket or the status of the life support system. Then the program goes to sleep for a fraction of a second, to save compute power, after which the whole cycle starts again.
Different subsystems control different parts of the rocket. In order to prevent big disasters, these need to be isolated from one another. If, for example, something goes wrong in the guidance system that steers the aircraft, the life support system doesn’t need to go haywire as well. If one thing goes wrong, the show must still go on.
This setup differs from how many other tech companies operate. Take Google, for example. They record every failure, select those that seem most important, and try to draw lessons for the future from them. In other words, Google lets failures happen and tries to learn from them afterward.
For Google, this approach works perfectly well. But a search machine (and translator, document editor, cloud service provider and more) operates a little differently from a rocket. If one process in Google fails, maybe a search query will return eerie results. If a manned rocket steers in the wrong direction, though, human lives are in jeopardy.
Because of the high-stakes nature of the problems it tackles, SpaceX tries its best to never fail. Although the company’s engineers do embrace failure for rocket tests, in those cases, they’re almost purposefully allowing the project to fail in order to learn for the future. When the rocket starts for an actual mission, however, everything…
Read More:Software! In! Space!