A control device for controlling a reference model servo motor to be used for implementing model following control on the servo motor, the control device comprising: a sliding mode controller configured to implement sliding mode control that determines a torque to be output to the servo motor such that a position deviation indicating a deviation of a position of the servo motor from an externally input position command value and a velocity deviation indicating a deviation of a velocity of the servo motor from an externally input velocity command value converge onto a switching curve determined from a predetermined torque that can be output from the servo motor and a motion characteristic of a load machine to be driven by the servo motor, the sliding mode controller being configured to output a first torque output signal; a proportional-integral-derivative controller (101, 103) configured to implement PID control such that the position and velocity of the servo motor follow the position command value and velocity command value, the PID controller (101, 103) being configured to output a second torque output signal; and a selector configured to select the second torque output signal from the PID controller (101, 103) when the second torque output signal from the PID controller (101, 103) is equal to or less than a maximum torque of the servo motor, and to select the first torque output signal from the sliding mode controller when the second torque output signal from the PID controller (101, 103) is more than the maximum torque, and to output the selected torque output signal as the signal with which to control the reference model servo motor, wherein the sliding mode controller and the PID controller (101, 103) are configured to control the reference model servo motor, the control device further comprising: a feedback controller configured to implement the PID control on the actual position and velocity of the servo motor such that the actual position and velocity of the servo motor follow a position and velocity of the reference model servo motor to be controlled by the sliding mode controller or the PID controller (101, 103) selected by the selector. a sliding mode controller configured to implement sliding mode control that determines a torque to be output to the servo motor such that a position deviation indicating a deviation of a position of the servo motor from an externally input position command value and a velocity deviation indicating a deviation of a velocity of the servo motor from an externally input velocity command value converge onto a switching curve determined from a predetermined torque that can be output from the servo motor and a motion characteristic of a load machine to be driven by the servo motor, the sliding mode controller being configured to output a first torque output signal; a proportional-integral-derivative controller (101, 103) configured to implement PID control such that the position and velocity of the servo motor follow the position command value and velocity command value, the PID controller (101, 103) being configured to output a second torque output signal; and a selector configured to select the second torque output signal from the PID controller (101, 103) when the second torque output signal from the PID controller (101, 103) is equal to or less than a maximum torque of the servo motor, and to select the first torque output signal from the sliding mode controller when the second torque output signal from the PID controller (101, 103) is more than the maximum torque, and to output the selected torque output signal as the signal with which to control the reference model servo motor, wherein the sliding mode controller and the PID controller (101, 103) are configured to control the reference model servo motor, the control device further comprising: a feedback controller configured to implement the PID control on the actual position and velocity of the servo motor such that the actual position and velocity of the servo motor follow a position and velocity of the reference model servo motor to be controlled by the sliding mode controller or the PID controller (101, 103) selected by the selector.