CNC Head Travel Logic

As discussed in the Common Software-Only Method section, total distance traveled can be determined using Equation 3-1. Therefore, to ensure the distance traveled in each axis is correct, it is not necessary to measure the distance traveled in either axis. Instead, once the number of output ticks from the master NCO is equal to the total distance to travel, both axes will have traveled the correct distance. The number of output ticks is measured by connecting a Signal Measurement Timer (SMT) to the output of the master NCO.

For travel with acceleration, there are two possibilities:
  1. 1.The travel distance is sufficiently long enough for the machine to ramp up to full speed, travel for a period of time and then slow back down to a speed slow enough to stop.
  2. 2.There is insufficient distance to accelerate, therefore it will need to begin slowing down before it has reached full speed.

To determine which is the case, the SMT is configured to generate an interrupt once the SMT reaches half the total travel distance. At the same time, the acceleration DMA is configured to generate an interrupt once it has finished transferring data (i.e., acceleration is complete).

In the case where the DMA interrupt fires first, this indicates that there was enough time for full acceleration. In this case, the current value of the SMT is read and this value is the distance it takes for acceleration. Therefore, it also the amount of distance it will take for the machine to slow down.
Figure 1. Acceleration Timing

The SMT is reconfigured to generate an interrupt when it reaches a value of the total travel distance less the acceleration distance (i.e., the interrupt will fire to start the slow down process when there is enough room left in the travel for the machine to slow to a stop), as shown in Figure 3-3. Once this interrupt is fired, the DMA is reconfigured to ramp the speed down, as described in CNC Acceleration Operation. The SMT is also reconfigured to generate an interrupt once it reaches the value of the total travel distance. When this interrupt fires, travel is complete and the master NCO is disabled.

Where the SMT interrupt set for the halfway point fires before acceleration is complete, this indicates that there was not enough time for full acceleration. In this case, the machine will need to begin to slow down immediately. The DMA is configured to begin to slow down from whatever point in the LUT it managed to reach and the SMT is reconfigured to generate an interrupt once it reaches the value of the total travel distance. When this SMT interrupt fires, travel is complete and the master NCO is disabled.