How do robots control themselves?

They are programmed using a certain software and then the program (aka. the directions) are loaded onto a computer chip (aka. the brain) and that controls the robots movements