A numerical controller configured to use table format data for specifying a position of each controlled axis with respect to a reference value based on time, an axis position, or a spindle position to control the position of the controlled axis in synchronization with the reference value, the numerical controller comprising:
- a reading unit configured to read command blocks from the table format data, analyze the command blocks to acquire a reference value and a coordinate value of a control point, and output the reference value and the coordinate value;
- a segment distinction unit configured to divide a movement path of the controlled axis from a current point to the control point into
- (1) an acceleration segment at a start of the movement path,
- (2) a constant speed segment subsequent to the acceleration segment, and
- (3) a deceleration segment subsequent to the constant speed segment at an end of the movement path, based on
- (a) the reference value and the coordinate value of the control point acquired from the reading unit, and
- (b) an acceleration time constant set in advance for the acceleration segment and a deceleration time constant set in advance for the deceleration segment;
- a feed speed calculation unit configured to calculate a feed speed in the constant speed segment, which occurs between the acceleration segment and the deceleration segment, based on the reference value of the control point acquired from the reading unit and the acceleration time constant and the deceleration time constant;
- and
- a distribution process unit configured to calculate a travel of an axis controlled by the table format data for each control cycle based on the reference value and the coordinate value of the control point acquired from the reading unit,
- wherein
- the feed speed calculated by the feed speed calculation unit is a feed speed for correcting, within the constant speed segment, a delay in the coordinate value with respect to the reference value, wherein
- the delay is a sum of a first delay produced as a result of acceleration control in (1) the acceleration segment and a second delay produced as a result of deceleration control in (3) the deceleration segment, and
- the feed speed is determined such that a first travel between command blocks in the table format data in a first case where no acceleration control and no deceleration control are performed is equal to a second travel between the command blocks in the table format data in a second case where at least one of the acceleration control or the deceleration control is performed,
- the segment distinction unit is configured to determine whether a segment currently under control is the acceleration segment, the constant speed segment, or the deceleration segment based on a current value of the reference value acquired for each control cycle, and
- the distribution process unit is configured to calculate the travel for each control cycle based on a result of the determination made by the segment distinction unit by
- using acceleration based on the acceleration time constant in the acceleration segment,
- using the feed speed calculated by the feed speed calculation unit in the constant speed segment, and
- using deceleration based on the deceleration time constant in the deceleration segment, and
- the numerical controller is configured to control the position of the controlled axis based on the travel calculated by the distribution process unit.