The International Space Station is a science facility, so it's no surprise that experiments occasionally fail.

Most of the time, however, they don't involve weird robots - like Robonaut, the robotic astronaut NASA sent up with the STS-133 mission in 2011.

The golden-helmeted figure has been out of action since 2015 after its hardware went awry. And now, finally, it's being sent back to Earth for repairs.

A project NASA has worked on since 1996, Robonaut - developed with General Motors - is quite a marvel.

Originally, it consisted of a humanoid torso (and wears an astronaut-style helmet, neatly eliminating the uncanny valley), with five jointed fingers on each hand so that it can complete tasks like humans do.

robonaut aboard the iss 2(NASA)

Initially the torso was doing stationary work in the Destiny laboratory, performing simple tasks such as taking air flow readings and cleaning hand rails.

But NASA never planned that Robonaut would remain still, and in 2014 the robot was fitted with a pair of new, wiggly climbing legs designed to let it move around the space station - which somehow made it look very disconcerting.

The problems started because Robonaut wasn't designed for easy modularity; putting the legs on required significant core hardware upgrades and a new wiring interface - work the astronauts weren't trained to do.

It was expect that the operation would take them 20 hours, all up. It ended up taking them 40, and almost immediately things started going wrong.

First, when Robonaut was rebooted, Johnson Space Center couldn't see its live feed.

A loose wire was fixed and everything seemed OK, but then the legs stopped working.

Then, the robot's sensors started failing, or its communications systems, or its processors. In a fictional scenario, this would be the point at which you're screaming at the crew to jettison the failing creation to prevent a horrific mass space robomurder.

robonaut mobility upgrdeRobonaut 2 being upgraded. (NASA)

"We would start losing power to our computers within our operational window, and it got more and more severe as time went on," Robonaut project manager Julia Badger told IEEE Spectrum.

"A power cycle would in general bring it back, just for a little while. The problem was that since it was intermittent, sometimes we'd be able to turn it on and sometimes it would just fail right away as it degraded, we weren't necessarily able to trust the data - it was very confusing."

To further complicate matters, the five robonaut copies kept on Earth are a slightly different model, which made coordinating troubleshooting tricky.

Eventually the team figured out that Robonaut was missing a ground cable, which meant electrical currents were finding other routes through its body - providing too much power to some parts and not enough to others. This was slowly degrading the machine.

Although the robot has been booted up a few times since it went down in 2015, it's become clear that the problem will not be fixed in space.

NASA astronauts Joseph Acaba and Mark Vande Hei have now packaged the robot up in anticipation of its return to Earth. It will be sent back in the space freed up after an upcoming resupply mission.

Once it gets back to Earth, NASA roboticists will have to figure out whether Robonaut can be repaired, or whether it will need to be replaced by one of the newer models currently here on Earth.