Home Support Profile configuration example #1

Profile configuration example #1.

Requirements:

configuration of input signals:
  • 0- probe sensor (detection sheet)
  • 1- surface sensor
  • 2- servo x1 ready
  • 3 -servo x2 ready
  • 4- servo y ready
  • 5- Key for start cutting
  • 6- Key for stop cutting
  • 7- confirmation of the arc ignition (plasma sensor)
  • 8- emergency stop
  • 9-  n.c
  • 10- n.c
  • 11- n.c
  • 12- limit y-
  • 13- limit y+
  • 14- limit x-
  • 15- limit x+

Configuration for outputs signals:
Relays:

  • 0- relay plasma source
  • 1- signal for external thc controller
  • 2- probe valve

Transistor outputs:

  • 6- servo enable
  • 7- alarm servo clear
  • 8- signal thc low speed for external thc controller
  • 9- on, when the z+ key on the main screen pressed
  • 10- on,when the z- key on the main screen pressed

Customer like to have buttons on the main screen:

  • automatic procedure home macro (release button)
  • plasma on/off - relay 1 (toggle button)
  • torch down and detection sheet  (release button)
  • thc auto/manual - relay 2 (toggle button)
  • clear servo alarm - transistor out 1  (relase button)

Solution:

We created profile Samples-Plasma-01 and made all changes in it.
Many changes should be made in XML-configuration files. Any xml-editor software can be used to edit this files, but we used simple text editor like notepad or MC/NC/FAR internal editors.

  1. Servodrive ready sensors
    CNC configuration file - "cnc-config.xml".
    Add/edit lines to configure servo-driver-ready sensors-

    <gitem inversion="no" address="inputs" number="2" type="info" name="sensor-servo-not-ready-x"/>
    <gitem inversion="no" address="inputs" number="3" type="info" name="sensor-servo-not-ready-x2"/>
    <gitem inversion="no" address="inputs" number="4" type="info" name="sensor-servo-not-ready-y"/>


    MyCNC software will watch after myCNC control board binary inputs number 2,3,4 and interpret closed contacts as "Servodrive not ready" event.
    Running motion program and jogging is blocked by myCNC software while any "Servodriver not ready" event is active.

    If opened contacts should be interpreted as servodrive error, attribute"inversion" may be used -  inversion="yes"

  2. Limit switchers.
    CNC configuration file - "cnc-config.xml".
    Add/edit lines to configure limit switchers-

    <gitem inversion="no" address="inputs" number="15" type="info" name="sensor-end-x-pos"/>
    <gitem inversion="no" address="inputs" number="14" type="info" name="sensor-end-x-neg"/>
    <gitem inversion="no" address="inputs" number="13" type="info" name="sensor-end-y-pos"/>
    <gitem inversion="no" address="inputs" number="12" type="info" name="sensor-end-y-neg"/>


    MyCNC software will watch after myCNC control board binary inputs number 12,13,14,15 and interpret closed contacts as "End Switch" event.
    Running motion program and jogging is blocked by myCNC software while any "Servodriver not ready" event is active.

    If opened contacts should be interpreted as End switch event, attribute"inversion" may be used -  inversion="yes"

  3. Emergency Stop button.
    CNC configuration file - "cnc-config.xml".
    Add/edit lines to configure emergency stop button-

    <gitem inversion="no" address="inputs" number="8" type="info" name="sensor-emergency-stop"/>


    MyCNC software will watch after myCNC control board binary input number 8 and interpret closed contacts as "Emergency stop" event.
    Running motion program and jogging is blocked by myCNC software while any "Emergency Stop" is active.

    If opened contacts should be interpreted as Emergency stop event, attribute"inversion" may be used -  inversion="yes"
    If Emergency event is occured, CNC controller stops running motion program and run "EST" PLC program that handle all actions with peripherals about Emergency stop.

    If any of above event happens, there will be message on 2D visualization window -

    myCNC - end switchers configuration
  4. External key configuration:

    CNC configuration file - "cnc-config.xml".
    Add/edit lines to configure external keys-

    <item inversion="no" address="inputs" number="5" type="key" name="player-play"/>
    <item inversion="no" address="inputs" number="6" type="key" name="player-stop"/>


    MyCNC software will watch after myCNC control board binary input number 5,6 and interpret close contacts event as "Key Button Event" with assigned events "Player Play(Go)" and "Player Stop(Pause)".

    If buttons are normally closed, attribute"inversion" may be used -  inversion="yes" to catch button press event.
  5. Low-speed signal for external THC controller:

    CNC configuration file - "cnc-config.xml".
    Add/edit line to configure external keys-

    <value name="event-manager-lowspeed-port">8</value>


    MyCNC maps "Low speed" event to output number 8. If current motion speed is lower than given "Cutting speed"*"LowSpeed percentage"/100, "Low speed" event is generated and output #8 is turned on. If current speed is higher - output #8 is turned off.

  6. Transistor outputs #9,#10 for Z (Height) Jogging:

    Z-axis jog buttons shown on a picture.
    myCNC Z-jogging buttons


    There two actions can be assigned on this buttons by default:
    1) jogging through the third axis motion (Z-axis);
    2) send jog commands to myTHC controller and control jogging through THC DC motor driver;

    For the first option there are lines in the configuration file - "cnc-config.xml":


    <gitem where="jog1" image="arrow-z+" height="60" action="jog-2-plus" type="button"/>
    .....
    <gitem where="jog3" image="arrow-z-" height="60" action="jog-2-minus" type="button"/>



    Actions "jog-x-minus", "jog-x-plus" run Jogging on "x" axis while the button pressed and stop Jogging when it is released. 0- is X axis,
    1- Y axis, 2- Z axis, so action "jog-x-minus" will run jogging on Z axis in negative direction.

    For the second option there are lines in the configuration file - "cnc-config.xml":


    <gitem where="jog1" image="arrow-z+" height="60" action="thc-jog-pos" type="button"/>
    .....
    <gitem where="jog3" image="arrow-z-" height="60" action="thc-jog-neg" type="button"/>


    Actions "thc-jog-pos", "thc-jog-neg" run Jogging through THC controller while the button pressed and stop Jogging when it is released.


    For given configuration the button action in the cnc-config.xml file can be progrmmed as:


    <gitem where="jog1" image="arrow-z+" height="60" action="plc-run:M62/9" action2="plc-run:M63/9" event="both" type="button"/>
    .....
    <gitem where="jog3" image="arrow-z-" height="60" action="plc-run:M62/10" action2="plc-run:M63/10" event="both" type="button"/>


    Action "plc-run:ABC/yyy" runs given PLC procedure with name "ABC" with given parameter value "yyy".
    PLC procedure M62 turns ON given output port bit (#9 or #10).
    PLC procedure M63 turns OFF given output port bit (#9 or #10).
    Attribute "action" describes action "KeyPress" event action, attribute "action2" describes "KeyRelease" action.
    So Transistor output #9 will be turned ON when the button "Z+" pressed, and turned OFF when it os released. The same for the button "Z-" and output #10.
  7. Creating toolbar on the main screen.

    Layout section of the cnc-config.xml file describes graphic items on myCNC GUI widgets. See the section below-

    <screen>
      <work-layouts>
        <current>as-technology</current>
        <layout name="as-technology" orientation="horizontal">
          <layout stretch="1" orientation="vertical">
            <widget stretch="0" name="work-toolbar" orientation="horizontal">myitems</widget>
            <widget stretch="4" name="nc-view">ncview</widget>
            <widget stretch="0" name="play-toolbar" orientation="horizontal">myitems</widget>
            <widget width="200" stretch="2" name="nc-list">nclist</widget>
            <widget stretch="0" hidden="1" name="jog-step-size" orientation="horizontal">myitems</widget>
          </layout>
          <layout stretch="0" orientation="vertical">
             <widget stretch="0" name="pos-tab">mytabwidget</widget>
             <widget where="pos-tab" height="80" tabname="Machine" name="machine-pos" orientation="vertical">mytabitems</widget>
             <widget where="pos-tab" tabname="Work" name="layout-work-pos" orientation="horizontal" children="yes">mytabitems</widget>
             <widget where="layout-work-pos" name="work-pos-zero" orientation="vertical">mylayoutitems</widget>
             <widget where="layout-work-pos" name="work-pos" orientation="vertical">mylayoutitems</widget>
             <widget stretch="0" name="jog-operate-tab">mytabwidget</widget>
             <widget width="60" where="jog-operate-tab" image="hand" tabname="Jog" name="layout-jogging" orientation="vertical"
    children="yes">mytabitems</widget>
             <widget where="layout-jogging" stretch="0" name="jog1" orientation="horizontal">mylayoutitems</widget>
             <widget where="layout-jogging" stretch="0" name="jog2" orientation="horizontal">mylayoutitems</widget>
             <widget where="layout-jogging" stretch="0" name="jog3" orientation="horizontal">mylayoutitems</widget>
             <widget where="layout-jogging" stretch="0" name="jog-speed" orientation="vertical">mylayoutitems</widget>
             <widget width="60" where="jog-operate-tab" image="operate" tabname="Operate" name="layout-operate-main"
    orientation="vertical" children="yes">mytabitems</widget>
             <widget where="layout-operate-main" name="layout-operate-00" orientation="horizontal" children="yes">mylayoutitems</widget>
             <widget where="layout-operate-main" name="layout-operate-1" orientation="vertical" children="yes">mylayoutitems</widget>
             <widget where="jog-operate-tab" iconsize="50" image="mdi" tabname="mdi-view" name="mdi-view" orientation="vertical"
    children="yes">mytabitems</widget>
             <widget where="mdi-view" stretch="1" name="mdi-list">mylayoutitems</widget>
             <widget where="mdi-view" stretch="1" name="mdi-buttons" orientation="horizontal">mylayoutitems</widget>
             <gitem where="mdi-view" type="stretch/1"/>
             <widget where="layout-operate-00" name="layout-operate-stop" SHWOP="-1" orientation="horizontal">mylayoutitems</widget>
             <widget where="layout-operate-00" name="layout-operate-02" orientation="vertical" children="yes">mylayoutitems</widget>
             <widget where="layout-operate-02" stretch="0" name="buttons-a" orientation="horizontal">mylayoutitems</widget>
             <widget where="layout-operate-02" stretch="0" name="buttons-b" orientation="horizontal">mylayoutitems</widget>
             <widget where="layout-operate-1" stretch="0" name="w-operate" orientation="vertical">mylayoutitems</widget>
             <widget stretch="0" name="widget-b">myitems</widget>
             <widget stretch="0" name="thc-work" orientation="vertical">myitems</widget>
             <widget stretch="1" name="widget-speed">myitems</widget>
          </layout>
       </layout>
    ..........
    ..........
    </work-layouts>
    </screen>





    There are two layouts in the main layout (highlighted by blue and green colors. The layouts are shown on a pucture below-
    myCNC GUI layout configuration

    To add new widget on the right of "Layout #2" add line just after "green lines"-


    <screen>
      <work-layouts>
    ............
    ............
          </layout>
          <widget stretch="0" width="80" hidden="0" name="RightToolbar" orientation="vertical">myitems</widget>
       </layout>
    ..........
    ..........
    </work-layouts>
    </screen>




    The line add "myitems" widget (container with graphic items) with name "RightToolbar" just after Layout #2. Width of the widget is defined as 80 px.
    Screenshot with RightToolbar is shown on a next picture.


    myCNC GUI layout configuration
  8. Homing procedure (Add button for homing into the RightToolbar, programming Macro for homing).

    To add button for Homing into Right toolbar graphic item description should be added into area outside of "Screen" section of the cnc-config file.

    Add lines to configure the button-

    <gitem width="80" where="RightToolbar" image="machine-home-find-xy" action="direct-run:M800" event="released" type="button"/>


    The line describes button (attribute "type" is "button") with-
     - size 80px (if either with or height is given, button will be square with given size; if both dimension are given, there will be rectangular button with given size);
     - skin image taken from graphic file with name "machine-home-find-xy";
     - Event described in attribute "event". Event can be generated while the button either "pressed" or "released". If event attribute is "both", events are generated while the button pressed and released. We configured action while the button released. When button released, macro M800 will be executed.

    CNC control software - Homing button

    Macro procedure for homing is listed below (file with name M800 is stored in current profile macros folder) -

    (Procedure for Finding home sensors (Simple Homing))

    ( turn on Ignoring end sensors )
    G10 L80 P5521 Q1
    G10 L80 P5525 Q1

    M83 (watching for end x- sensor and perform soft-stop)
    G91 G0 X -3100 F3000.
    G04 P1.0.

    M84 (watching for end y- sensor and perform soft-stop)
    G91 G0 Y -1600 F3000.
    G04 P1.0.

    G91 G0 X20 Y20 F1000. (roll off 20mm by X & Y )

    G10 L80 P5521 Q0
    G10 L80 P5525 Q1
    M02



    M83 & M84 are simple PLC procedures.
    Here is listing for M83.plc



    #include src/common.const.h
    #include src/plasma-simple.h

    //watching for given input port
    //switch to soft-stop, when event occured

    timer=0;
    message=PLCCMD_MOTION_CONTINUE;
    texit=timer+4; do{ timer++;}while(timer<texit); //pause to push the message

    do
    {
    a=portget(limit_xneg);
    }while(a==0);

    message=PLCCMD_MOTION_SOFT_SKIP;
    texit=timer+4;do{timer++;}while(timer<texit);

    exit(99);
  9. Plasma power source ON/OFF toggle button.

    To add Plasma source ON/OFF button into Right toolbar graphic item we need to add description line into area outside of "Screen" section of the cnc-config file after description of "Homing button".

    Add lines to configure the button-

    <gitem width="80" where="RightToolbar" image="plasma/plasma-off;plasma/plasma-on" action="plc-run:M63/5:M62/5" type="toggle-switch"/>


    The line describes button (attribute "type" is "toggle-switch") with-
     - size 80px (if either with or height is given, button will be square with given size; if both dimension are given, there will be rectangular button with given size);
     - attribute "image" describes skin images file for OFF and ON states of the toggle switch ("plasma/plasma-off" and "plasma/plasma-on");
     - attribute action describes actions for on and off toggle events. When the button toggled to off state, PLC procedure M63 with external parameter 5 (which relay number for plasma power source turn on-off) is executed; when the button toggled to on state, PLC procedure M62 with parameter 5 is executed. PLC function M63 is simple turn-off given output port number, M62 is for turn on. Listings for M62 & M63 procedure are shown below.

    //M62.plc simple turn-on given relay number
    portset(eparam);
    exit(99); //normal exit.



    //M63.plc simple turn-of given relay number
    portclr(eparam);
    exit(99); //normal exit.




    CNC control software - Cutting On/Off button
  10. Button for Initial Height Control (IHC)- Torch moves down and stops when surface sensor activated.

    To add IHC button into the Right toolbar we need to add description line into area outside of "Screen" section of the cnc-config file after description of "Plasma Power source ON/OFF button".

    Add lines to configure the button-

    <gitem width="80" where="RightToolbar" image="plasma/surface-measure" action="plc-run:M71/0" event="released" type="button">
    </gitem>


    The line describes button (attribute "type" is "button") with-
     - size 80px (if either with or height is given, button will be square with given size; if both dimension are given, there will be rectangular button with given size);
     - attribute "image" describes skin image files the button ("plasma/surface-measure");
     - attribute action describes actions for on and off toggle events. When the button is released, PLC procedure "M71" with parameter "0" will be executed.


    CNC control software - IHC button





    torch down and detection sheet  (release button)