In one embodiment, a surgical robotic system includes a main controller and a motor unit assembly that is associated with a robot and is in communication with the main controller. The motor unit assembly has a non-sterile motor unit and a sterile enclosure that surrounds and contains the motor unit. The motor unit includes at least one motor and a motor controller that is operatively connected to the motor unit, wherein the motor unit and the enclosure are configured to permit attachment between the motor unit and the controller.