Page 1 of 1

version 2106 probe macro

PostPosted: Tue Feb 12, 2019 7:29 pm
by neptunier
hello,
i just updated to 2106 which worked fine. there is just one issue with my z probe macro which worked fine in 2049. between the g31 moves it does not move the z axis up 2mm. here is the macro:

//Simple Probe for Zero
//This routine probes in negative Z at the current XY location
//Z offsets for G54 to G59 are then re-written to the new Z0

double ZRetractHeight = 2; //Height above Z0 to which probe will retract
double CoarseRate = 200; //Feedrate for initial probing
double FineRate = 100; //Feedrate for fine probing
double Zmin = -20; //maximum probing distance

double PlateThickness = 32.44; //thickness of the probing plate
double MaterialOffset = 0; //compensation for part thickness

double CombinedOffset = PlateThickness - MaterialOffset; //really for use later when PlateThickness and MaterialOffset are DROs



exec.Code("G91 G31 Z" + Zmin + "F" + CoarseRate); // Probe Z quickly to get rough height
while(exec.IsMoving()){}
exec.Wait(200);

exec.Code ("G00 Z" + 2 ); // Retract 2mm above the plate /////////////////////////////////////////////////////////////////////////here it is not working any more :o :o :o
while(exec.IsMoving()){}
exec.Wait(100);

exec.Code("G31 Z" + Zmin + "F" + FineRate); // Probe Z slowly for better resolution
while(exec.IsMoving()){}
exec.Wait(200);

exec.mainform.sumoffsetcontrol1.G54.newCzinput(CombinedOffset); // Set G54 to new Zzero
exec.mainform.sumoffsetcontrol1.G55.newCzinput(CombinedOffset); // Set G55 to new Zzero
exec.mainform.sumoffsetcontrol1.G56.newCzinput(CombinedOffset); // Set G56 to new Zzero
exec.mainform.sumoffsetcontrol1.G57.newCzinput(CombinedOffset); // Set G57 to new Zzero
exec.mainform.sumoffsetcontrol1.G58.newCzinput(CombinedOffset); // Set G58 to new Zzero
exec.mainform.sumoffsetcontrol1.G59.newCzinput(CombinedOffset); // Set G59 to new Zzero

exec.Code ("G00 Z" + ZRetractHeight); //Retract Z axis
while(exec.IsMoving()){}
exec.Wait(200);
exec.Code ("G90");

thanks for help,
michael

Re: version 2106 probe macro

PostPosted: Tue Feb 12, 2019 9:58 pm
by cncdrive
The test version 1.2106 had many issues due to lots of updates in a single update. Please try it with 1.2109 which is the latest test release.

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 1:03 pm
by neptunier
version 2109 works better, it executes one time the g31, retracts 2mm, does not execute the second g31 and then retracts the last z move.
i change the macro to just probe one time so it works for me now.

great that you added the tangential control. maybe i have to get ucccnc for my second machine then :D

i really like uccnc, it feals much more solid then mach3. much less prayer when working with the machine ;)

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 3:00 pm
by dezsoe
Hi Michael,

I modified your macro to show the Z machine coords at the beginning and after each movement. (Also commented out the G55..G59 resets, only to save my offsets.)

Code: Select all
//Simple Probe for Zero
//This routine probes in negative Z at the current XY location
//Z offsets for G54 to G59 are then re-written to the new Z0

double ZRetractHeight = 2; //Height above Z0 to which probe will retract
double CoarseRate = 200; //Feedrate for initial probing
double FineRate = 100; //Feedrate for fine probing
double Zmin = -20; //maximum probing distance

double PlateThickness = 32.44; //thickness of the probing plate
double MaterialOffset = 0; //compensation for part thickness

double CombinedOffset = PlateThickness - MaterialOffset; //really for use later when PlateThickness and MaterialOffset are DROs


Console.WriteLine("");
Console.WriteLine("0: " + exec.GetZmachpos().ToString("F6"));

exec.Code("G91 G31 Z" + Zmin + "F" + CoarseRate); // Probe Z quickly to get rough height
while(exec.IsMoving()){}
exec.Wait(200);

Console.WriteLine("1: " + exec.GetZmachpos().ToString());

exec.Code ("G00 Z" + 2 ); // Retract 2mm above the plate /////////////////////////////////////////////////////////////////////////here it is not working any more :o :o :o
while(exec.IsMoving()){}
exec.Wait(100);

Console.WriteLine("2: " + exec.GetZmachpos().ToString());

exec.Code("G31 Z" + Zmin + "F" + FineRate); // Probe Z slowly for better resolution
while(exec.IsMoving()){}
exec.Wait(200);

Console.WriteLine("3: " + exec.GetZmachpos().ToString());

exec.mainform.sumoffsetcontrol1.G54.newCzinput(CombinedOffset); // Set G54 to new Zzero
/*
exec.mainform.sumoffsetcontrol1.G55.newCzinput(CombinedOffset); // Set G55 to new Zzero
exec.mainform.sumoffsetcontrol1.G56.newCzinput(CombinedOffset); // Set G56 to new Zzero
exec.mainform.sumoffsetcontrol1.G57.newCzinput(CombinedOffset); // Set G57 to new Zzero
exec.mainform.sumoffsetcontrol1.G58.newCzinput(CombinedOffset); // Set G58 to new Zzero
exec.mainform.sumoffsetcontrol1.G59.newCzinput(CombinedOffset); // Set G59 to new Zzero
*/

exec.Code ("G00 Z" + ZRetractHeight); //Retract Z axis
while(exec.IsMoving()){}
exec.Wait(200);
exec.Code ("G90");

Console.WriteLine("4: " + exec.GetZmachpos().ToString());

I got the following results in the console window after running the macro 4 times:

dc.png

As you can see, all the movements were perfect. Does it work as you described when you start UCCNC or do you run any g-code before the probe? Maybe, the g-code changes something?

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 3:13 pm
by neptunier
i did run it directly after uccnc start, no gcode before.

michael

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 3:52 pm
by dezsoe
Could you enable and show the console plugin, run my modified macro and show what is in your console window?

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 3:53 pm
by dezsoe
FYI, I tested with version 1.2109.

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 4:08 pm
by neptunier
oh, now it seems to work. here is the console output. dont worry about the exact numbers, i did it kinda freehand. but it probed two times with z moves correct

UCCNC - Debug console
The Console can be used for macros and plugins debugging.
It shows strings written using the Console.Write and Console.Writeline commands.
-----------------------------------------------------------------------------------------------------------------------------------

0: -201.708413
1: -205.546449
2: -203.547426
3: -206.278547
4: -204.279525

0: -197.269793
1: -201.057415
2: -199.058393
3: -201.022345
4: -199.023322

0: -199.023322
1: -200.914941
2: -198.915918
3: -200.871103
4: -198.87208

i retried the original macro and now it works fine. i dont know what happened. i will report if there are again problems.
thanks for your help,
michael

Re: version 2106 probe macro

PostPosted: Wed Feb 13, 2019 4:12 pm
by dezsoe
Fine!