A numerical control device which is provided in a machine tool including a plurality of transfer devices which move a transfer object which is a workpiece or a tool for machining the workpiece along a plurality of transfer axes in order to machine the workpiece, the plurality of transfer axes including a first transfer axis and a second transfer axis which respectively include a specific coordinate axis component in a workpiece coordinate system set on the workpiece and which are indeterminate axes whose coordinates are not uniquely determined with respect to a coordinate on the specific coordinate axis, the plurality of transfer devices including a first transfer device which moves the transfer object along the first transfer axis and a second transfer device which moves the transfer object along the second transfer axis, an allowable acceleration of transfer of the transfer object along the second transfer axis by the second transfer device being lower than an allowable acceleration of transfer of the transfer object along the first transfer axis by the first transfer device, and the numerical control device numerically controlling the respective transfer devices by outputting a command pulse per specific period to the respective transfer devices, the numerical control device comprising:
- a storage unit which stores a machining program which instructs machining of the workpiece;
- a path derivation unit which reads the machining program stored in the storage unit, and which obtains a tool path and a second transfer axis path based on the machining program which has been read, the tool path including a function which expresses a movement of the tool during machining of the workpiece by a position coordinate of the tool in the workpiece coordinate system and an intervening variable which is an integrated length of a locus of the movement of the tool, the second transfer axis path expressing a movement of a specific point on the second transfer axis as a function of a position coordinate of the specific point on the second transfer axis and the intervening variable, the specific point being to be used as a reference when the second transfer device moves the transfer object during machining of the workpiece;
- a tool path interpolation unit which interpolates the tool path obtained by the path derivation unit so that a movement of the tool expressed by the tool path becomes smooth;
- a second transfer axis path interpolation unit which performs smooth interpolation and local interpolation, the smooth interpolation being an interpolation in which the second transfer axis path obtained by the path derivation unit is interpolated so that a movement of the specific point on the second transfer axis becomes smooth, the movement of the specific point being expressed by the second transfer axis path, the local interpolation being an interpolation in which the second transfer axis path after the smooth interpolation is interpolated so that a secondary differential value with respect to the intervening variable of the second transfer axis path after smooth interpolation becomes smaller;
- an intervening variable time function derivation unit which obtains an intervening variable time function expressing a variation in the intervening variable with respect to a lapse of a reference time, based on an acceleration/deceleration condition including an allowable acceleration of transfer of the transfer object for each transfer axis when the transfer object is moved along each transfer axis, a post-interpolation tool path which is the tool path after being interpolated by the tool path interpolation unit, and a post-interpolation second transfer axis path which is the second transfer axis path after being locally interpolated by the second transfer axis path interpolation unit;
- a pulse interpolation unit which obtains a position coordinate on each of the transfer axes at each time point at every unit time of the reference time, the position coordinate corresponding to a position coordinate of the post-interpolation tool path in the workpiece coordinate system at each time point, and a transfer amount of the transfer object per unit time for each transfer axis from the obtained position coordinate on each transfer axis at each time point, and which sets the obtained transfer amount per unit time as the command pulse per the specific period;
- and
- a control unit which outputs, to each transfer device, the command pulse for the transfer axis corresponding to that transfer device among the command pulses per the specific period for the respective transfer axes obtained by the pulse interpolation unit, and which causes each transfer device to move the transfer object in accordance with the command pulse outputted to each transfer device, wherein:
- the pulse interpolation unit obtains the intervening variable at each time point at every unit time of the reference time based on the intervening variable time function obtained by the intervening variable time function derivation unit;
- the pulse interpolation unit obtains a position coordinate of the post-interpolation tool path in the workpiece coordinate system and a position coordinate of the post-interpolation second transfer axis path on the second transfer axis, the position coordinate of the post-interpolation tool path corresponding to the obtained intervening variable at each time point, the position coordinate of the post-interpolation second transfer axis path corresponding to the intervening variable at each time point;
- and the pulse interpolation unit obtains a position coordinate on each transfer axis corresponding to the position coordinate of the post-interpolation tool path in the workpiece coordinate system at each time point based on a specific relational expression using the obtained position coordinate on the second transfer axis as a constraint and representing a correlation between a position coordinate of the tool in the workpiece coordinate system and a position coordinate on each transfer axis.