Setup ET 7 Plasma gantry alignment

Post Reply
Deian
Posts: 7
Joined: Thu Aug 23, 2018 1:33 pm

Setup ET 7 Plasma gantry alignment

Post by Deian » Thu Aug 23, 2018 4:05 pm

Questions:

Do we need M144 for gantry alignment?
Do we need M201?
How they should look if our motors are Y, and limit switches are 3 and 4 ?

-------------------------------------------------------------------------------------------------------
M144

Code: Select all


#include pins.h

//Look after input_s1 & input_s2 sensors
//Position X is stored in register #801 when sensor s1 triggered 
//Position X is stored in register #802 when sensor s2 triggered

main()
{
 timer=0;

 message=PLCCMD_MOTION_CONTINUE;
 texit=timer+2;do{timer++;}while(timer<texit);

 mode_12=0;

 ready=0;

 s1_old=portget(INPUT_GANTRY_S1);
 s2_old=portget(INPUT_GANTRY_S2);

 do
 {
 timer++;

 s1=portget(INPUT_GANTRY_S1);
 s2=portget(INPUT_GANTRY_S2);

 mode1=mode_12&1;

 if (mode1==0)//if sensor 1 wasn't triggered
 {
  if (s1!=s1_old) //if triggered now
   {
     mode_12=mode_12|1; //set flag for sensor1
     position1=gvarget(5021+0);	//Save Machine X position
   };
 };

 mode2=mode_12&2;

 if (mode2==0)//if sensor 2 wasn't triggered
 {
  if (s2!=s2_old) //if triggered now
   {
     mode_12=mode_12|2; //set flag for sensor2
     position2=gvarget(5021+0);	//Save Machine X position
   };
 };

 }while(mode_12!=3);

 message=PLCCMD_MOTION_SKIP;
 //message=PLCCMD_MOTION_SOFT_SKIP;
 timer=2;do{timer--;}while(timer>0);

 gvarset(801,position1); //send the position to myCNC software Register #801
 timer=10;do{timer--;}while(timer>0);
 gvarset(802,position2); //send the position to myCNC software Register #802
 timer=10;do{timer--;}while(timer>0);

 offset=position1-position2;

 gvarset(800,offset);
 timer=10;do{timer--;}while(timer>0);

 exit(99);
};

mycnc
Posts: 160
Joined: Thu May 10, 2018 2:42 pm

Re: Setup ET 7 Plasma gantry alignment

Post by mycnc » Thu Aug 23, 2018 6:11 pm

If you mean Method 2 described here - http://docs.pv-automation.com/mycnc/gan ... cro_wizard
then yes, you need these PLC procedures.

Actually, you need any procedure you going to use.

Code: Select all

M144                  (# Set watching for GANTRY Sensors)
G91 G0 X-1000 F500    (# Move toward Gantry Sensors)

G10 L81 P810 Q800     (# Get offset in pulses)
G10 L192 P810 Q5531   (# Calculate offset in units/mm)
 
G10 L190 P810 Q805    (# Add adjustment offset)
 
M210 P0               (# OFF the second motor, the Only first motor is ON )
 
G10 L190 P810 Q5021   (# Add current machine position)
G28.9 X810            (# Move 1 motor to adjust)
 
M210 P1               (# ON the second motor, both motors are moved together)
Macro example M139 for gantry alignment described on the page above contains M-functions M144 and M210.
So you need this codes (either as a macro or PLC) to get this procedure working properly.

Deian
Posts: 7
Joined: Thu Aug 23, 2018 1:33 pm

Re: Setup ET 7 Plasma gantry alignment

Post by Deian » Fri Aug 24, 2018 4:17 pm

Hello could you please send script for :
M144 and M210

Deian
Posts: 7
Joined: Thu Aug 23, 2018 1:33 pm

Re: Setup ET 7 Plasma gantry alignment

Post by Deian » Fri Aug 24, 2018 4:22 pm

In macro list or PLC software and hardware there NO M144 and M210 Listed

Deian
Posts: 7
Joined: Thu Aug 23, 2018 1:33 pm

Re: Setup ET 7 Plasma gantry alignment

Post by Deian » Fri Aug 24, 2018 4:43 pm

In your text for Macro example M139 which limit switch is corresponding to which motor ?

In our configuration :
Limit switch - 3 is positioned on Y
Limit switch - 4 is positioned on Y2

mycnc
Posts: 160
Joined: Thu May 10, 2018 2:42 pm

Re: Setup ET 7 Plasma gantry alignment

Post by mycnc » Sat Aug 25, 2018 4:22 pm

Deian wrote:
Fri Aug 24, 2018 4:17 pm
Hello could you please send script for :
M144 and M210
M144 and M210 PLC procedure examples described in documentation area here

If you like to have a copy, M144.plc

Code: Select all

#include pins.h
     
    // Look after INPUT_GANTRY_S1 & INPUT_GANTRY_S2 input pins
    // Position X is stored in register #801 when sensor s1 triggered 
    // Position X is stored in register #802 when sensor s2 triggered
    // If both sensors triggered, then 
    //  - Motion stopped
    //  - Position difference is calculated and stored into register #800
     
    main()
    {
     timer=0;
     
     message=PLCCMD_MOTION_CONTINUE;
     texit=timer+30;do{timer++;}while(timer<texit);
     
     mode_12=0;
     
     ready=0;
     
     s1_old=portget(INPUT_GANTRY_S1);
     s2_old=portget(INPUT_GANTRY_S2);
     
     do
     {
     timer++;
     
     s1=portget(INPUT_GANTRY_S1);
     s2=portget(INPUT_GANTRY_S2);
     
     mode1=mode_12&1;
     
     if (mode1==0)//if sensor 1 wasn't triggered
     {
      if (s1!=s1_old) //if triggered now
       {
         mode_12=mode_12|1; //set flag for sensor1
         position1=gvarget(5021+0);	//Save Machine X position
       };
     };
     
     mode2=mode_12&2;
     
     if (mode2==0)//if sensor 2 wasn't triggered
     {
      if (s2!=s2_old) //if triggered now
       {
         mode_12=mode_12|2; //set flag for sensor2
         position2=gvarget(5021+0);	//Save Machine X position
       };
     };
     
     }while(mode_12!=3);
     
     message=PLCCMD_MOTION_SKIP;
     timer=2;do{timer--;}while(timer>0);
     
     gvarset(801,position1); //send the position to myCNC software Register #801
     timer=50;do{timer--;}while(timer>0);
     gvarset(802,position2); //send the position to myCNC software Register #802
     timer=50;do{timer--;}while(timer>0);
     
     offset=position1-position2;
     gvarset(800,offset);
     timer=50;do{timer--;}while(timer>0);
     
     exit(99);
    };

M210.plc

Code: Select all

    #include vars.h
     
    main()
    {
     connect=eparam;
     
     message=PLCCMD_SET_CNC_VAR;
     if (connect==0)
     {
      parameter=15;   //OFF
     }else
     {
      parameter=0+16; //"0" is axis X; "16" is axis inversion.
     };
     command=112+1; //Motor output #1
     timer=2;do{timer--;}while(timer>0);
     
     exit(99);
    };


mycnc
Posts: 160
Joined: Thu May 10, 2018 2:42 pm

Re: Setup ET 7 Plasma gantry alignment

Post by mycnc » Sat Aug 25, 2018 4:40 pm

Deian wrote:
Fri Aug 24, 2018 4:43 pm
In your text for Macro example M139 which limit switch is corresponding to which motor ?

In our configuration :
Limit switch - 3 is positioned on Y
Limit switch - 4 is positioned on Y2
For this example, the M144 PLC procedure looks to input pins INPUT_GANTRY_S1, INPUT_GANTRY_S2.
If S1 pin activated, position stored in s1 variable,
If S2 pin activated, position stored in s2 variable.

Then difference (s1-s2) calculated and one of motors moved to compensate the difference.

Names INPUT_GANTRY_S1, INPUT_GANTRY_S2 should be defined in "pins.h"

Code: Select all

 #define INPUT_GANTRY_S1 3
 #define INPUT_GANTRY_S2 4
Which of motors is disabled before adjustment motion is defined in M210.plc procedure.

Post Reply