A pre-collision control strategy for human-robot interaction based on dissipated energy in potential inelastic impacts