All current CNC controls have a special program verification display screen page that shows a few upcoming commands in the CNC program, the current absolute position, the distance-to-go and currently instated G and M codes. Many control manufacturers refer to this display screen page as the program check page.
All of these functions are extremely important while you are verifying a CNC program. The program commands make it possible to determine what's going to happen next. The absolute position makes it possible to discern where the cutting tool is positioned, and the distance-to-go helps determine whether the cutting tool will stop before it contacts an obstruction. Currently instated G and M codes make it possible to determine the various modes in which the machine is operating.
The program check page is undoubtedly important to program verification, and there is another time when it can help you as well. If the machine is behaving in an unusual manner, the list of G and M codes that the program check page displays can often indicate what is wrong.
Consider, for example, this turning center scenario. The programmer is using a subprogram to avoid having to repeat commands in the main program. The subprogram is incorrectly called with the commands:
N050 G98 P1000
For this control, an M98 is used to call a subprogram. Therefore, the G98 in the command above should be an M98.
When the control reaches line N050 in the program, it does not call the subprogram. Possibly, an alarm is sounded. The setup person finds the mistake and changes the G98 to M98.
From this point on, the turning center behaves in a strange manner. Whenever a cutting tool is machining the workpiece, it barely crawls. By looking at the absolute position display, the setup person observes that the machine is moving, but the motion rate is not even close to its intended rate.
What's wrong? As you may know, the G98 for most turning centers places the machine in feed per-minute mode. Instead of taking a feed rate word of F0.015 as 0.015 ipr (assuming the inch mode is instated), the machine is moving at 0.015 ipm. This explains why it is just barely crawling along.
If you're actually working on this job, it may not occur to you that the incorrect call to the subprogram has placed the machine in the per minute feed rate mode. The fact that the person running the machine may not even know the function of G98 further complicates things. When the operator calls you to the machine for help, he or she may not even tell you about the G98 being changed to an M98. So all you see is a machine that won't move at the programmed feed rate.
Unaware of what's wrong, you may be tempted to turn off the machine and turn it back on (this tends to be a cure-all for all unusual behavior). When the machine is turned on, G99 is initialized and the problem is solved. But you won't know what caused the problem.
This is also a good example of why you should include a series of safety commands at the beginning of the program to ensure that the machine is still in its initialized states when the program is run. If G99 is included at the beginning of the program in one of the safety commands, the problem will be solved as soon as the program is run again.
Whenever the machine is behaving in an unusual manner, refer to the list of currently instated G and M codes on the program check page. Then determine the function of each currently instated word to ascertain whether it is appropriate. In our example, you will see the G98 in the list and find that the machine is in the incorrect feed rate mode.
Here is another example: After a contour milling operation, a series of holes is center drilled. After center drilling, you check the hole positions; they're all off. Yet, when you look in the program at the listed coordinates for the holes, they are all correct. Now what's wrong?
When you look at the list of G codes on the program check page, you notice a G42. During the contour milling operation, a G42 is used to instate cutter radius compensation. Obviously, you forgot to cancel cutter radius compensation (with G40) after the contour milling operation. All movements made by the center drill are being influenced by the cutter radius compensation offset value.
Again, whenever the machine is behaving in an odd manner, be sure to look at the list of G and M codes on the program check page. Other examples of potential problems that can cause very strange machine behavior include the use of mirror image, XY axis exchange, scaling, inch/metric selection, coordinate rotation and polar coordinates, among many others.