A robot controller for avoiding an emergency stop of a robot due to
shortage of the amount of charge of a secondary battery of a portable
operating part during automatic operation of the robot. The robot
controller includes a portable operating part having a secondary battery,
a robot control part capable of communicating with the portable operating
part and having a means for bringing the robot to an emergency stop when
communication between the robot control part and the portable operating
part is interrupted, a charging circuit for charging the secondary
battery, and a cable for electrically connecting the charging circuit to
the control part during automatic operation of the robot.