Page 1 of 1

G28.1 Slaved & Unslaved Axis

PostPosted: Sat Sep 17, 2016 10:15 pm
by Robertspark
My Y and B Axis are slaved, and all axis share common limit and home inputs (port 2/pin10)

I've had a problem my my proximity sensors for a while and was deciding to have a look at that (they trigger when the torch fires, so likley to be noise).

But, I was wondering if there was a way to home slaved axis and still share a common home & limit across the axis?

I came up with the macro code below, the thing is..... if my axis have been slaved, when I un-slave them I can move each axis via gcode (say G1 Y5 f120 and G1 B5 f120), but if I home the Y axis, the Y will home, and if I home the B axis (using G28.1 B)..... the Y axis still homes its self.....

I know I really should split the slaved axis home and limit prox sensors from each other, but I did think that if I unslaved the axis, then the motion controller would be able to deal with tem seperatly.

Even if you manually unslave them via the configuration > axis tab, apply and save settings, reset the machine, they still stay slaved.

My attempt at some code was here for the homing routine:
Code: Select all

// M1032
// Homing Routine, all axis using the same shared limits and home switches (port 2, pin 11)
// X-Axis, Y-Axis, Z-Axis and B-Axis (Y&B paired, to avoid conflict of A (rotary pipe cutter axis)
// Robertspark 17/09/2016

// Confirm via operator input that Z axis is clear to home machine
      DialogResult result;

      result = MessageBox.Show("Is the torch clear for homing?", "check!!!" , MessageBoxButtons.YesNo);
      
       if (result == System.Windows.Forms.DialogResult.Yes)
      {

// Home X Axis & Y Axis
exec.Code("G91");    // Switch to relative distance mode
exec.Code("G28.1 "); // Perform X and Y homing sequence (exclude Z as may have no material on table!)
while(exec.IsMoving()){}
exec.Wait(200);
exec.Code("G92 X0 Y0 B0");

exec.Code("G0 Y5"); // Move the Y axis 5mm (as unsure which home switch tripped, Y or B axis?),
                    //5mm less chance of prox sensor re-tripping when other axis squares
while(exec.IsMoving()){}
exec.Wait(200);

exec.Slaveaxis(1,0);  // Unslave B-Axis from Y-Axis.
exec.Callbutton(168); // Apply Settings
//exec.Callbutton(167); // Save Settings
exec.Wait(200);

exec.Callbutton(108); // Home Y-Axis
//exec.Code("G28.1 Y");
while(exec.IsMoving()){}
exec.Wait(200);

exec.Code("G1 Y5 f120");
while(exec.IsMoving()){}
exec.Wait(200);

exec.Callbutton(111); // Home B-Axis
//exec.Code("G28.1 B");
while(exec.IsMoving()){}
exec.Wait(200);

exec.Code("G1 B5 f120");
while(exec.IsMoving()){}
exec.Wait(200);

// Re-Slave B-Axis to Y
exec.Slaveaxis(1,4);  // Makes B-axis slaving the Y-axis.
exec.Callbutton(168); // Apply Settings
//exec.Callbutton(167); // Save Settings
exec.Wait(200);

   exec.Code("G90");  // switch back to absolute distance mode
// Reset machine
exec.Callbutton(144);  //turns reset button off (i.e. Reset state active!)

      }
      
      if (result == System.Windows.Forms.DialogResult.No)
      {
         MessageBox.Show("Jog torch to clearance height and restart");
      }

// End of Macro


Re: G28.1 Slaved & Unslaved Axis

PostPosted: Sat Sep 17, 2016 10:19 pm
by ger21
Even if you manually unslave them via the configuration > axis tab, apply and save settings, reset the machine, they still stay slaved.

Did you restart the software? Changes probably don't take effect until after a restart.

Re: G28.1 Slaved & Unslaved Axis

PostPosted: Sat Sep 17, 2016 10:26 pm
by Robertspark
Gerry, no, didn't restart it (I suspect that it may be like you're thinking, and I know the smooth stepper works with mach3, and only loaded the settings from the profile into the FPGA at restart.... hence g28.1 is locked until restart maybe... thought I'd check if someone knew)

Thanks for your time and consideration though

Re: G28.1 Slaved & Unslaved Axis

PostPosted: Sat Sep 17, 2016 11:07 pm
by cncdrive
The Slaving command downloads the Slave parameters to the motion controller, so then the axes should be totally unslaved or slaved depending on the parameters you give to the function, including the homing.
So, if you unslave the axes then they should work totally independently, aren't they at you?

Re: G28.1 Slaved & Unslaved Axis

PostPosted: Sun Sep 18, 2016 5:29 am
by Robertspark
Cncdrive, no they are not working that way.

When I unslave the axis, and run g28.1 B, the Y axis stepper motor homes it's self, and when I run g28.1 Y, the Y axis stepper moter again homes its self.