I've been facing this problem quite frequently when performing installation of probing systems on machines in field. No free M-codes to activate the probe and tool setter. Here is the description:
This document describes method of "generating" M-codes on machine that has no provision of free M-codes to manage probes.
I am using in my projects the APB-12-MRDC Programmable Logic Controller from Array Electronic Co. Ltd. Its programming interface is very friendly, the device is reliable and inexpensive.
If the machine is supplied without free M-codes I am looking for M-code which has no significant role in machine operation during the probing cycle. The most useful and "harmless" is the M-code which commands ON and OFF the operation of chip conveyor
In example given here the M92 turns conveyor on, M91 turns the conveyor off.
The output of the M92 code from the control is connected (parallel to its original connection) to the input I0 of the PLC. In order to prevent turning on of the probe system as the result of random operation of the chip conveyor, the system is coded in following way:
1. If during any period of 3 seconds the input I1 sees 3 leading edges of signal (3 pulses), the output O2 goes high. It stays high until I0 goes once more high. Output O1 stays low.
2. However if during any period of 3 seconds the input I1 sees 2 leading edges (2 pulses) only, the output O1 goes high. . It stays high until input I0 goes once more high. Output O2 stays low.
In order to operate the system I wrote 3 programs:
O9004 (PROBE 1 ON)
M92 (LEADING EDGE NO.1)
G4X.4
M91
G4X.4
M92 (LEADING EDGE NO.2)
G4X.4
M91
M99
O9005 (PROBE 2 ON)
M92 (LEADING EDGE NO.1)
G4X.4
M91
G4X.4
M92 (LEADING EDGE NO.2)
G4X.4
M91
G4X.4
M92 (LEADING EDGE NO.3)
G4X.4
M91
N99
O9006 (ANY PROBE OFF)
M92
G4X.04
M91
M99
I assigned the command M920 to programO9006, M921 to program O9004 and command M922 to program O9005 (Fanuc 0, 16, 18. 21 parameters 6074, 6075 and 6076).
The command M921 turns the probe 1 on, M920 turns it off.
The M922 turns the probe 2 on, M920 turns it off.
This works smoothly and problem free on many installations of the Twin probes. Switching the probes ON causes few "peculiar" movements of the conveyor, but they are harmless. Of course any other M-code of this type can be used.
Unfortunately the logic block diagram of this toy is too heavy to attach it here. If you wish to see it, let me know your mail on PM, and I will be happy to send it to you.
Stefan
Cogito Ergo Sum