The invention involves a system and method for controlling the movements of a multi-axis robot to perform a surgery at least on the spinal area of a human in vivo. The system includes controls and software coding to cause the robot to move in desired patterns to complete the surgery, which may include bone, disc and tissue removal, and may also include insertion of hardware for fusing adjacent bony structures.