Page 1 of 1

M31 macro

PostPosted: Wed Jul 21, 2021 11:59 am
by alanmccabe
Hi can anyone point me in the right direction to setup my UCCNC software with the M31 macro (I believe this is what I need). I have a floating Z axis and when I run the M31 macro I get an error the Machine was not et homed. I don't have a home switch on my Z though so not sure what I do. Many Thanks Alan

My switch offset is 5.47 where do I add this value would be another question



I have UC300 eth
Proma THC
Sheetcam software


Thanks in advance

Re: M31 macro

PostPosted: Wed Jul 21, 2021 2:03 pm
by Robertspark
I am out at present, can you paste the contents of the m31 macro please into a code block and I will comment out the homing section and add your switch offset and repost

won't be in front of a pc for several hours

Re: M31 macro

PostPosted: Wed Jul 21, 2021 4:31 pm
by Robertspark
for PLASMA, you should be using M203 and NOT M31 (different probing function).

Code: Select all
//Z touch with retract for plasma zero height measurement

double Zmin = -200;
double Feedrate = 200;
double retractheight = 5.47; //switch offset

int originaldistancemode = exec.actualdistmode; // remember the distance mode
int originalmodalmode = exec.actualmodal; // remember the modal mode
exec.Code("G90"); // Set system to absolute distance mode

while(exec.IsMoving()){}
exec.Code("G31 Z" + Zmin + " F" + Feedrate); // Move to the probe sensor position in XY
while(exec.IsMoving()){}
exec.Callbutton(102); // zero Z axis

if(!exec.Ismacrostopped()) // If probe action was not interrupted with a stop only then go on...
{
 exec.Code("G01 Z" + retractheight); // Move above probe plate
 while(exec.IsMoving()){}
 exec.Callbutton(102); // zero Z axis
}

exec.Code("G" + originaldistancemode); // Set system back to the original distance mode
exec.Code("G" + originalmodalmode); // Set system back to the original distance mode


Dont crosspost : viewtopic.php?f=2&t=3309

Re: M31 macro

PostPosted: Thu Jul 22, 2021 6:13 pm
by alanmccabe
I got it sorted thanks, I had refHome set to true in the Sheetcam post processor.

ps the cross post was not intentional, I posted it and I never realised it would have to be moderated so I tried again.