It's probably not something you'd say to a person writhing in agony on the floor, but physical pain can have its benefits. It is after all how kids learn to be wary of hot surfaces and carpenters to hit nails on the head. Researchers are now adapting this exercise in self-learning to an artificial nervous system for robots, a tool they believe will better equip these machines to avoid damage and preserve their – and our – well-being.

We send robots into all kinds of situations we wouldn't dare set foot in ourselves. From Fukushima's melted down nuclear plants to landmine-littered conflict zones, their insensitivity to pain and danger is indeed what can make them so useful. Flipping this on its head and making them feel as we do seems counter-productive, but scientists from Leibniz University of Hannover believe it could make robots more durable and safer for us to be around.

Researchers Johannes Kuehn and Professor Sami Haddadin have developed a pain-reflex controller for a BioTac fingertip sensor fitted to a Kuka robotic arm. They built a nervous robot-tissue model that is based on human skin, which helps the system determine how much pain should be felt by the machine in response to differing levels of force.

The pain signals are transmitted as repetitive spikes if enough force is applied, at which point the system sorts the data into either light, moderate or severe pain categories.

In the event of light pain, the robotic arm realizes it is uncomfortable and will slowly retract until the danger is gone. Stronger knocks are placed in the moderate category and cause the robot to cower more quickly and with greater distance, while severe pain forces the robot into passive mode to prevent further damage.

The team also enabled the robotic arm to react to temperature, placing a boiling cup of water on its its fingertip sensor until it couldn't stand the heat.

Robots that respond to tactile sensations are of course nothing new, and it's not the first time scientists have tried to inflict pain on the machines either (check out this robotic dental patient, for example).

But the Hannover researchers hope that this is just the first step toward robots that can experience general pain and be better for it. Some of their previous work in the field involved programming a robot to punch people so they could assess human-robot pain threshold, all with a view to making them safer for us to interact with.

But their latest endeavor is really a form of robot maintenance. With the robotic workforce growing and often operating in the vicinity of humans, damage that goes unnoticed could lead to malfunctioning machines and in turn, accidents that put us in danger. So it's not just the interests of the robots the researchers are looking out for here.

The research was published in IEEE Robotics and Automation, while you can see a demonstration of the system in the video below.