Researchers are developing a system to teach robots how to feel pain.

That might seem counterintuitive, as IEEE Spectrum points out. After all, "One of the most useful things about robots is that they don't feel pain." That means "we have no problem putting them to work in dangerous environments or having them perform tasks that range between slightly unpleasant and definitely fatal to a human."

But the researchers from Leibniz University of Hanover argue that the "artificial robot nervous system" actually makes the robots safer. They say humans working alongside them — using heavy machinery, for example — are also likely to be safer. Here's more from IEEE Spectrum:

"Why is it a good idea for robots to feel pain? The same reason why it's a good idea for humans to feel pain, said Johannes Kuehn, one of the researchers. 'Pain is a system that protects us,' he told us. 'When we evade from the source of pain, it helps us not get hurt.' "

As the journal notes, the phenomenon is clear in individuals with congenital analgesia, the genetic disorder where individuals don't feel pain. This first-person story from the BBC describes just how difficult it is to prevent injuries when you don't know something is hurting you.

Kuehn and his colleague Sami Haddadin presented their research at the IEEE International Conference on Robotics and Automation last week in Stockholm. Here's a video demonstrating their prototype, inspired by human skin, which is equipped to sense both pressure and temperature:

The machine appears to wince and reflexively moves away when hit with light, moderate and severe pain, as well as the heat of a cup of boiling water — all while wearing a jaunty yellow rubber ducky.

As The Washington Post explains, "Depending on the threat, such as a harsh movement or intense heat, the robot is programmed to retract from the danger." It adds: "The more dangerous it registers the threat to be, the faster the robot will retract and the longer it will avoid the hazardous force."

As IEEE Spectrum notes, researchers from Stanford and University of Rome-La Sapienza have already built a bot that avoids collision with humans. But this research inspired by the way humans react to pain goes a step further, as the Post notes:

"[T]o equip these robots with a nervous system forces them to prioritize avoidance of their own pain, thus programming them to avoid destroying themselves as well as avoiding collision with humans, according to [Kuehn]. This will trigger different reactions in the robot than just crash avoidance."Copyright 2016 NPR. To see more, visit http://www.npr.org/.