Plasma Touch Off Macro for Ohmic and Floating Head
Posted: Sat Oct 22, 2016 10:53 pm
Plasma Touch Off Macro for Ohmic and Floating Head, using a relay / optoisolator to isolate the ohmic probe input and allow for the use of an Ohmic probe offset AND floating head offset
Requires :
Single Probe Input for both Ohmic Probe, Floating Head and a single output interface with an Isolation Relay / Optoisolator for Ohmic Probe input to test which input is active.
Wire the floating head to the probe input pin. Wire the ohmic probe via a relay or optoisolator and then to the same shared probe input pin.
Mode of Operation:
The macro tests the probe input, if it's active at the start of the probing routine, the machine will stop and put a message in the status box.
If the initial probe input test is not active, the macro will enable the relay, and test the probe input again.
If the probe input is active then the ohmic probe has an issue (dirt / debris in the ohmic cap?), the macro will send a message to the status box, but continue the macro by opening the relay, and carrying on with the standard G31 probing routine, and once the probe input is tripped, it will set the G92 Z offset for the floating head.
If the probe input is inactive, then the probing routine will continue. When the probe input is tripped, the macro will open the relay, and test the probe input.
If the probe input is still active, it will set the G92 Z offset for the floating head, or else it will set the G92 Z offset for the ohmic probe offset.
Tried to upload the macro as a text file M1031.txt, and the the forum reported: "The extension txt is not allowed."
Cut, paste, edit however you see fit, hope you found something useful in it.
Requires :
Single Probe Input for both Ohmic Probe, Floating Head and a single output interface with an Isolation Relay / Optoisolator for Ohmic Probe input to test which input is active.
Wire the floating head to the probe input pin. Wire the ohmic probe via a relay or optoisolator and then to the same shared probe input pin.
Mode of Operation:
The macro tests the probe input, if it's active at the start of the probing routine, the machine will stop and put a message in the status box.
If the initial probe input test is not active, the macro will enable the relay, and test the probe input again.
If the probe input is active then the ohmic probe has an issue (dirt / debris in the ohmic cap?), the macro will send a message to the status box, but continue the macro by opening the relay, and carrying on with the standard G31 probing routine, and once the probe input is tripped, it will set the G92 Z offset for the floating head.
If the probe input is inactive, then the probing routine will continue. When the probe input is tripped, the macro will open the relay, and test the probe input.
If the probe input is still active, it will set the G92 Z offset for the floating head, or else it will set the G92 Z offset for the ohmic probe offset.
Tried to upload the macro as a text file M1031.txt, and the the forum reported: "The extension txt is not allowed."
Cut, paste, edit however you see fit, hope you found something useful in it.
- Code: Select all
// M1031
// Plasma Touch Off Macro for Ohmic and Floating Head, using a relay / optoisolator to isolate the ohmic probe input
// and allow for the use of an Ohmic probe offset AND floating head offset
// Requires Ohmic Probe Input, Floating Head, Isolation Relay for Ohmic Probe to test which input is active.
// Robertspark 22/10/2016
// <><><><><><><> SETUP SECTION
string FloatOffset = "1.4"; // Ohmic offset (in units)
string OhmicOffset = "0.1"; // Ohmic offset (in units)
string Probefeedrate = "240"; // probing feedrate (in units / minute)
string ProbeDist = "100"; // probing travel distance (in units)
int ProbeInputLED = 37; // probe input , could change to port & pin LED ref (check LED number table) , i.e. port2/pin11 = LED #79
int OhmIsoPort = 2; // Ohmic probe Isolation optoisolator / relay output PORT
int OhmIsoPin = 17; // Ohmic probe Isolation optoisolator / relay output PIN
// <><><><><><><><> MACRO SECTION
// INITIAL PROBE INPUT CHECK (IF FAIL, STOP MACHINE, & REPORT ERROR IN STATUS BOX))
if(exec.GetLED(ProbeInputLED) == false)
{
exec.Setoutpin(OhmIsoPort, OhmIsoPin); // enable (ohmic probe input optoisolator / relay input)
exec.Wait(100);
// check probe input , if enabled (ohmic cap fault), disable ohmic optoisolator / relay & run probling routine to set offset to floating head
if(exec.GetLED(ProbeInputLED) == true) // test probe input, if true, ohmic cap fault / ohmic setting error.
{
exec.Clroutpin(OhmIsoPort, OhmIsoPin); // disable ohmic isolator / relay
exec.Wait(100);
exec.AddStatusmessage( "Check Ohmic Probe / Torch" ); // Send Ohmic Probe Error to status messagebox
exec.Code("G31 Z-" + ProbeDist + " F" + Probefeedrate); // run probe routine
while(exec.IsMoving()){}
exec.Code("G92 Z-" + FloatOffset); // allow for floating head offset
return;
}
if(exec.GetLED(ProbeInputLED) == false) // test probe input, if false, all is well.
{
exec.Code("G31 Z-" + ProbeDist + " F" + Probefeedrate); // run probe routine
while(exec.IsMoving()){}
exec.Clroutpin(OhmIsoPort, OhmIsoPin); // disable ohmic isolator / relay
exec.Wait(100);
if(exec.GetLED(ProbeInputLED) == true)
{
exec.Code("G92 Z-" + FloatOffset); // allow for floating head offset
return;
}
if(exec.GetLED(ProbeInputLED) == false)
{
exec.Code("G92 Z-" + OhmicOffset); // allow for ohmic head offset
return;
}
}
}
// INITIAL PROBE INPUT CHECK (IF FAIL, STOP MACHINE, & REPORT ERROR IN STATUS BOX))
if(exec.GetLED(ProbeInputLED) == true)
{
exec.AddStatusmessage( "Touch Off Probe Error, Machine Stop" ); // Send Probe Error to status messagebox
exec.Stop(); // stop / halt machine operation to inspect probe input and restart
return;
}
// End of Macro