A controller that determines a rotational speed of a tool and a feeding amount per unit cycle of a tool when a cutting part of the tool passes through and exits a workpiece in crosscut grooving, the controller comprising:
- a processor for controlling the tool and performing a machine learning algorithm including:
- controlling, by the processor, a first motor to rotate the tool at the rotational speed, and a second motor to move the cutting part of the tool along an axis to pass through and exit the workpiece at the feeding amount per unit cycle;
- observing, by the processor, state variables that express a current operational state of an environment in which a learning target exists, the state variables including a feeding amount data indicating the feeding amount per unit cycle of the tool when the cutting part of the tool is controlled by the processor to exit the workpiece, and a rotational speed amount data indicating the rotational speed of the tool when the cutting part of the tool is controlled by the processor to exit the workpiece, a tool data indicating information on the tool, machining shape data indicating information on a machining shape, and a vibration amount data indicating a vibration amount of the cutting part of the tool when the cutting part of the tool is controlled by the processor to exit the workpiece;
- acquiring, by the processor, determination data indicating a comparison between:
- i) the vibration amount of the cutting part of the tool due to a current rapid change in the deflection of the tool when the processor controls the first motor and the second motor to rotate and move the cutting part of the tool to exit the workpiece, and
- ii) a previous vibration amount of the cutting part of the tool due to a previous rapid change in the deflection of the tool when the processor previously controlled the first motor and the second motor to rotate and move the cutting part of the tool to make a previous exit from the workpiece;
- computing, by the processor, a reward based on the comparison, the reward being positive when the comparison indicates that the vibration amount decreased as compared to the previous vibration amount, and the reward being negative when the comparison indicates that the vibration amount increased as compared to the previous vibration amount;
- learning, by the processor, based on the state variables, the determination data and the reward, an adjusted rotational speed of the tool and an adjusted feeding amount per unit cycle of the tool which maintains a subsequent vibration due to a subsequent rapid change in the deflection of the tool when the cutting part of the tool exits the workpiece to within an allowable range in association with the tool data, the machining shape data, and the vibration amount data, using the state variables and the determination data;
- controlling, by the processor, the first motor to rotate the tool at the adjusted rotational speed, and the second motor to move the cutting part of the tool along the axis to make a subsequent exit from the workpiece at the adjusted feeding amount per unit cycle;
- and
- repeating, by the processor, the machine learning algorithm to maximize a total of the rewards to optimize the adjusted rotational speed and the adjusted feeding amount per unit cycle.