主权项 |
1. A motor control apparatus comprising:
a motor control unit configured to control a motor; and a signal output unit configured to output a signal corresponding to rotation of the motor, wherein the motor control apparatus is configured to displace an object to be driven to a target stop position by controlling the motor based on the output signal of the signal output unit, wherein the motor control unit is configured to execute:
a first control process that determines a first control input corresponding to an estimated current upper limit which is an upper limit of a current that is able to be input to the motor;a second control process that determines a second control input, based on a difference between a detected value specified from the output signal of the signal output unit and a target value of a target trajectory that has a constant speed section, in which the object is driven at constant speed where an initial speed corresponds to a speed at an end of the motor control by the first control process, and a deceleration section, which is a section for deceleration after the constant speed section, wherein the second control input is applied to the motor after the first control process and the second control process controls the motor to stop the object to be driven at the target stop position;a first calculation process that calculates a necessary amount to stop, which is a displacement amount of the object to be driven from a start time of the motor control by the second control process to a stop time of the object to be driven, in a case that the motor is controlled according to the target trajectory of the second control process, based on the speed specified by the output signal of the signal output unit;a second calculation process that calculates a remaining displacement amount of the object to be driven from that time to a time, at which the object to be driven reaches the target stop position, based on the displacement amount specified from the output signal of the signal output unit; anda switching process that determines whether a starting condition of the motor control by the second control process is satisfied, based on the necessary amount to stop calculated by the first calculation process and the remaining displacement amount calculated by the second calculation process, wherein the switching process enables the first control process to control the motor when determining that the starting condition of the motor control by the second control process is not satisfied, and enables the second control process to control the motor, instead of the first control process, when determining that the starting condition of the motor control by the second control process is satisfied. |