User Tools

Site Tools


plc:plc_gas_cutting_implementation

Gas (Oxy Fuel) Cutting Control implementation.

Gas cutting control can be easily implemented on myCNC controllers through Hardware PLC.

Simple Gas Cutting Control.

  • I - relay for ignition unit
  • F - Fuel valve
  • OH - Preheat Oxygen valve
  • OC - Cutting Oxygen valve
M71.plc
#include pins.h
#include vars.h
 
main()
{
  portset(OUTPUT_FUEL);         //turn ON fuel valve
  portset(OUTPUT_IGNITION);     //turn ON sparkle relay
  timer=timeout_ignition; 
  do{ timer--; }while(timer>0); //delay for ignition
 
  portclr(OUTPUT_IGNITION);     //turn OFF sparkle relay
  portset(OUTPUT_OXY_HEAT);     //turn ON Preheat Oxygen valve
  timer=timeout_heating;
  do{ timer--; }while(timer>0); //pre-heating loop
 
  portset(OUTPUT_OXY_CUT);      //turn ON Cutting Oxygen valve
 
  exit(99);
};

myCNC software HMI has access to PLC variable proc and able to display its value on main screen. If update proc value with current status (Ignition/Preheat/Cutting/Purge) inside PLC procedure, then this status can be displayed on myCNC main screen

M71.plc
#include pins.h
#include vars.h
 
main()
{
  portset(OUTPUT_FUEL);         //turn ON fuel valve
  portset(OUTPUT_IGNITION);     //turn ON sparkle relay
 
  proc=plc_proc_ignition;
 
  timer=timeout_ignition; do{ timer--; }while(timer>0); //delay for ignition
 
  portclr(OUTPUT_IGNITION);     //turn OFF sparkle relay
  portset(OUTPUT_OXY_HEAT);     //turn ON Preheat Oxygen valve
 
  proc=plc_proc_preheat;
 
  timer=timeout_heating;
  do{ timer--; }while(timer>0); //pre-heating loop
 
  portset(OUTPUT_OXY_CUT);      //turn ON Cutting Oxygen valve
 
  proc=plc_proc_cutting;
  exit(99);
};

How to add PLC process display to myCNC main screen described here

Relay numbers are defined in pins.h

pins.h
#define OUTPUT_FUEL	6
#define OUTPUT_OXY_HEAT	7
#define OUTPUT_OXY_CUT	8
#define OUTPUT_IGNITION	5

Variable names are in vars.h

vars.h
#define variable                var00
#define command                 var00
#define parameter               var01
 
#define thc_enabled             var04
#define timeout_ignition        var05
#define timeout_heating         var06
#define ihc_pierce_time         var09
#define timeout_purge           var07
#define break_heating           var15

Time values for Ignition and heating are initializad in plc-variables.xml

plc-variables.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE CNC>
<plc-configuration version="1.0">
  <plc-function name="C07" alias="M71;M07;M03;AIR;M401;M710;M151;C08;M74;M05;M02;OFF">
    <message>Oxy Fuel Cutting</message>
    <message_ru>Газовая резка</message_ru>
    <item>
      <value number="4" pname="plc-var-thc-enabled" type="radiobutton" min="0" step="1" 
      max="1" text=";Off;On">1</value>
        <message>THC Enabled</message>
        <message_ru>Система слежения</message_ru>
        <message_kr>THC Enabled</message_kr>
      </item>
      <item>
        <value number="5" pname="plc-var-timeout-ignition" type="numpad" min="0" step="5000" 
        max="10000">660</value>
        <message>Ignition time (Sparkle), ms</message>
        <message_ru>Время искры, ms</message_ru>
      </item>
      <item>
        <value number="6" pname="plc-var-timeout-preheat" type="numpad" min="0" step="1000" 
        max="200000">5750</value>
        <message>Preheat time (Sparkle), ms</message>
        <message_ru>Время подогрева, ms</message_ru>
      </item>
      <item>
        <value number="7" pname="plc-var-timeout-purge" type="numpad" min="0" step="100" 
        max="3000">1220</value>
        <message>Purge Time, ms</message>
        <message_ru>Время продувки, ms</message_ru>
      </item>
      <item>
        <value number="9" pname="plc-var-ihc-pierce-time" type="numpad" min="0" step="100" 
        max="10000">220</value>
        <message>Pierce Time,ms</message>
        <message_ru>Время пробивки,мс</message_ru>
      </item>
  </plc-function>
</plc-configuration>

Cancel Pre-heat

Preheat procedure can take a long time (we often set 120 seconds for preheat). However if operator see metal sheet is warm enough to start cutting, he has an option to cancel preheat process immediately and start cutting by pressing a button.

Easy way - to press on-screen “Start” button. If myCNC software interface is configured for Gas cutting, myCNC software will reset PLC variable, defines in “Gas Cutting” configuration dialog as “break heating” variable.

in Start Cutting PLC procedure should be handler to monitor “break heating” variable and cancel Pre Heating if variable value is “0” -

M71.plc
#include pins.h
#include vars.h
 
  portset(OUTPUT_FUEL);         //turn ON fuel valve
  portset(OUTPUT_IGNITION);     //turn ON sparkle relay
 
  proc=plc_proc_ignition;
 
  timer=timeout_ignition; do{ timer--; }while(timer>0); //delay for ignition
 
  portclr(OUTPUT_IGNITION);     //turn OFF sparkle relay
  portset(OUTPUT_OXY_HEAT);     //turn ON Preheat Oxygen valve
 
  proc=plc_proc_preheat;
 
  break_heating=1;              //set break_heating variable
  timer=timeout_heating;
  do{ timer--; 
  if (break_heating==0) 
  { timer=0; };     //If break_heating was cleared outside of PLC, clear timer to exit from the loop
  }while(timer>0);              //pre-heating loop
 
  portset(OUTPUT_OXY_CUT);      //turn ON Cutting Oxygen valve
 
  proc=plc_proc_cutting;
  exit(99);
};

6 valves Gas Cutting Control

More complicated Gas Cutting control contains 6 valves

  • I - Ignition
  • F - Fuel
  • OH Low - Preheat Oxygen Low Pressure
  • OH High - Preheat Oxygen High Pressure
  • OC Low - Cutting Oxygen Low Pressure
  • OC High - Cutting Oxygen High Pressure

Start Gas Cutting procedure is simple sequence of following steps -

  • Ignition (turn on valves for ignition), wait ignition time;
  • Preheat (turn on valves for preheat), wait preheat time, cancel preheat if “break_heating” variable was reset;
  • Cutting Oxygen soft start (turn on Cutting Oxygen Low pressure valve), wait soft start time;
  • Pierce start (turn on Cutting Oxygen High pressure valve), wait pierce time;
  • Turn off Oxygen Heat Hi pressure to come to soft cutting mode.

Source code is -

M03.plc
#include pins.h
#include vars.h
 
main()
{
  portset(OUTPUT_FUEL);         //On Valves for ignition
  portset(OUTPUT_IGNITION);
  portset(OUTPUT_OXY_HEAT_LO);
  proc=plc_proc_ignition;
 
  timer=timeout_ignition;       //Set Ignition process
  do{ timer--; }while(timer>0); //wait ignition
 
  portclr(OUTPUT_IGNITION);
  portset(OUTPUT_OXY_HEAT_HI);
  proc=plc_proc_preheat;
 
  break_heating=1;
  timer=timeout_preheat;
 
  do{ 
  timer--; 
  if (break_heating==0) { timer=0; };
  } while(timer>0);             //heating loop
 
  portset(OUTPUT_OXY_CUT_LO);   //add Oxy Cutting Lo pressure
  timer=timeout_soft_start; 
  do{ timer--; }while(timer>0); //wait for Soft Oxy start
 
  portset(OUTPUT_OXY_CUT_HI);   //add Oxy Cutting Hi pressure
 
  timer=ihc_pierce_time; 
  do{ timer--; }while(timer>0); //wait for Pierce
 
  portclr(OUTPUT_OXY_HEAT_HI);   //add Oxy Cutting Hi pressure
 
  if (thc_enabled!=0)
  {
    command=0xa4;//Start Height sensing
    parameter=1;
    message=PLCCMD_SET_CNC_VAR;
    texit=timer+3;do{timer++;}while(timer<texit);
  };
 
  proc=plc_proc_cutting;
 
  exit(99);
};

In “Stop Cutting” procedure all the valves should be turned OFF. However due to slow flow speed of fuel gas a loud swat is possible while valves closed. It's useful to purge the gun with Oxygen for about 1-2 secs.

Stop Cutting PLC procedure with purge is shown below -

M05.plc
#include pins.h
#include vars.h
 
main()
{
  portclr(OUTPUT_FUEL);         //Off Valves
  portclr(OUTPUT_IGNITION);
  portclr(OUTPUT_OXY_HEAT_HI);
  portclr(OUTPUT_OXY_CUT_LO);
  portclr(OUTPUT_OXY_CUT_HI);
 
  if (proc==plc_proc_cutting)
  {
    portset(OUTPUT_OXY_HEAT_LO);
    timer=timeout_purge;       //Set Ignition process
    do{ timer--; }while(timer>0); //wait ignition
  };
 
  portclr(OUTPUT_OXY_HEAT_LO);   //
  command=0xa4;//Stop Height sensing
  parameter=0;
  message=PLCCMD_SET_CNC_VAR;
  timer=2;do{timer--;}while(timer>0);
 
  proc=plc_proc_idle;
  exit(99);
};

Gas Cutting Control with Initial Height positioning

  • H1 - Safe Height, defined as distance from cutting height at the end of previous cut. Ignition process started on Safe Height. A system waits 1-2 seconds for stable flame process, then switch to Preheat Process and moves torch down to -
  • H2 - Preheat Height - defined by Capacitory Height Sensor value. After Preheat process finished, valves switched to “Start Pierce” and torch moved to
  • H3 - Pierce Height defined as distance from preheat height. After Pierce is finished, Cutting and toolpath motion started, THC is activated and toch moved down by Torch Height Control to
  • H4 - Cutting Height, defined as Torch Height Control Reference value.
M03.plc
#include pins.h
#include vars.h
 
main()
{
 portset(OUTPUT_FUEL);         //On Valves for ignition
 portset(OUTPUT_IGNITION);
 portset(OUTPUT_OXY_HEAT_LO);
 proc=plc_proc_ignition;
 
 timer=timeout_ignition;       //Set Ignition process
 do{ timer--; }while(timer>0); //wait ignition
 
 portclr(OUTPUT_IGNITION);
 portset(OUTPUT_OXY_HEAT_HI);
 proc=plc_proc_preheat;
 
 break_heating=1;
 timer=timeout_preheat;
 
 gvarset(7080,2000);           //setup Z axis Speed
 h=0-30000;
 g0moveA(0x0,0x4,h);           //Z axis, move down
 do{ timer++; }while (adc01<ihc_preheat_height); 
 //wait in the loop till Current Height from Height Sensor (adc01)
 //less than given value of ihc_preheat_height;
 //then stop motion and continue preheat process
 
 message=PLCCMD_LINE_STOP;//stop motion
 do { code=gvarget(6060); } while(code!=0x4d); 
 //wait till motion finished
 
 do{ timer--; 
 if (break_heating==0) { timer=0; };
 } while(timer>0);             //heating loop
 
 portset(OUTPUT_OXY_CUT_LO);   //add Oxygen Cutting Lo pressure
 
 gvarset(7080,2000);
 g0moveA(0x0,0x4,ihc_pierce_height);  //Z axis, move up
 timer=200; do{ timer--; }while (timer>0); 
 //after 0.2sec delay motion is definetely started
 do { timer++;code=gvarget(6060); }while(code!=0x4d);
 //then ait till motion finished
 
 timer=timeout_soft_start; 
 do{ timer--; }while(timer>0); //wait for Soft Oxygen start
 
 portset(OUTPUT_OXY_CUT_HI);   //add Oxygen Cutting Hi pressure
 
 timer=ihc_pierce_time; 
 do{ timer--; }while(timer>0); //wait for Pierce
 
 portclr(OUTPUT_OXY_HEAT_HI);   //add Oxy Cutting Hi pressure
 
 if (thc_enabled!=0)
 {
    command=0xa4;//Start Height sensing
    parameter=1;
    message=PLCCMD_SET_CNC_VAR;
    texit=timer+3;do{timer++;}while(timer<texit);
 };
 
 proc=plc_proc_cutting;
 
 exit(99);
};
M05.plc
#include pins.h
#include vars.h
 
 
main()
{
 
  portclr(OUTPUT_FUEL);           //Off Valves
  portclr(OUTPUT_IGNITION);
  portclr(OUTPUT_OXY_HEAT_HI);
  portclr(OUTPUT_OXY_CUT_LO);
  portclr(OUTPUT_OXY_CUT_HI);
 
  if (proc==plc_proc_cutting)
  {
    portset(OUTPUT_OXY_HEAT_LO);
    timer=timeout_purge;          //Set Ignition process
    do{ timer--; }while(timer>0); //wait ignition
    portclr(OUTPUT_OXY_HEAT_LO);  //
 
    if (ihc_lift_height>0)
    {
      proc=plc_proc_moveup;
      gvarset(7080,2000);
      g0moveA(0x0,0x4,ihc_lift_height);      //Z axis
      timer=300;do{timer--;}while(timer>0);
      do { timer++;code=gvarget(6060); }while(code!=0x4d);
      //wait till motion finished(7140 for Multidev)
    };
  };
 
  portclr(OUTPUT_OXY_HEAT_LO);   //
 
  command=0xa4;//Stop Height sensing
  parameter=0;
  message=PLCCMD_SET_CNC_VAR;
  timer=2;do{timer--;}while(timer>0);
 
  proc=plc_proc_idle;
 
  exit(99);
};
plc/plc_gas_cutting_implementation.txt · Last modified: 2021/11/02 17:20 by ivan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki