Problem with gantry alignment

Post Reply
Neale
Posts: 6
Joined: Fri May 01, 2020 7:09 pm

Problem with gantry alignment

Post by Neale »

I am very new to the ET6 and the myCNC software so the answer might be in the documentation somewhere - but I haven't found it!

My CNC router uses dual motors for the X axis, driving the gantry (X and A). I used the "gantry alignment" wizard to generate the relevant macro. However, the machine did not seem to run the "double-check" when I selected this, and it did not set the machine coordinate to zero.

After some investigation, it looks as if the wizard generates a line starting "M150...". However, I cannot find any definition of this macro (as a macro or hardware PLC) and it looks as if the macro crashes at this point. Any code after the "M150..." is ignored. Something that makes this even worse is that some combinations of input to the wizard (possibly involving the "double-check" option although I'm not absolutely certain about this) mean that there is some motor or sensor switching involved after the "M150..." and if this is not executed, you can end up with the X and A motors going in opposite directions when the X axis is jogged.

I have a feeling that the M150 should be M87 (as used earlier in the macro) but at least if I comment out this line, the macro runs to completion. I'm not sure that the "double-check" is happening, though.

ivan
Posts: 292
Joined: Tue Apr 16, 2019 5:30 pm
Location: Ottawa, Canada

Re: Problem with gantry alignment

Post by ivan »

Hello there, thank you for reaching out!

We are looking into the issue - in the meanwhile, please attach your latest version of the profile so that we can take a look at your settings.

mycnc
Posts: 823
Joined: Thu May 10, 2018 2:42 pm
Location: Ottawa, Canada
Contact:

Re: Problem with gantry alignment

Post by mycnc »

I don't see M150 in the macro generated
image.png

Neale
Posts: 6
Joined: Fri May 01, 2020 7:09 pm

Re: Problem with gantry alignment

Post by Neale »

I think that the M150 is generated when you select "Double Check". I have attached my test profile, and M139 is the gantry alignment macro that I use. This version has M150 commented out. When I do this, the macro appears to complete, the two G0 instructions are executed, and machine coordinate is set to zero. With M150 enabled, the two movements do not happen and the machine coordinate is not set to zero.
Router_Mk2 - test.zip
(193.03 KiB) Downloaded 4 times
Happy to provide any other information that might help!

Thanks,

mycnc
Posts: 823
Joined: Thu May 10, 2018 2:42 pm
Location: Ottawa, Canada
Contact:

Re: Problem with gantry alignment

Post by mycnc »

"Double check" option was added as a custom option for a customer about 5 years ago.
According to the customer requirements, a machine after the alignment procedure moves again to the sensors,
stores coordinates where each sensor is triggered then calculates the difference and save it in a Global register.

As far as we know, the option was never used by anyone else.

I'd recommend you to disable "Double check" and use the gantry alignment without it.

However, if you like to try it, I found M150 in archives and attached it here

Code: Select all

main()
{
  input1=eparam&0xFF;	//P-parameter, 
  input2=(eparam>>8)&0xFF;//P-parameter

  state=eparam>>16;	//L-parameter

  timer=0;

  message=PLCCMD_MOTION_CONTINUE;
  timer=10; do{ timer--;}while(timer>0); //pause to push the message

  x1=0;
  x2=0;
  result=0;

  do  {
   data=portget(input1)^state;
   k=result&1;
   if (k==0)
   {
     if (data==0)
      {
        x1=gvarget(5021);
        result=result|1;
      };
  };
  
  data=portget(input2)^state;
  k=result&2;
  if (k==0)
  {
    if (data==0)
     {
       x2=gvarget(5021);
       result=result|2;
    };
  };

}while(result!=3);

  x1=x1-x2;

  gvarset(1000,x1);
  timer=10; do{ timer--;}while(timer>0); //pause to push the message

  do { timer++; } while(1); //wait till next procedure loaded

  exit(99);
};


Neale
Posts: 6
Joined: Fri May 01, 2020 7:09 pm

Re: Problem with gantry alignment

Post by Neale »

Many thanks - I shall deselect that option!

As I want to work on a few macros for my own machine, I am trying to quickly learn the art of writing macros and PLC routines, and I am using the supplied macros and PLC as well as output from the wizards as examples. This is why things that do not work are a bit of a puzzle!

Post Reply