version 2106 probe macro

If you think you've found a bug post it here.

version 2106 probe macro

Postby neptunier » Tue Feb 12, 2019 7:29 pm

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
neptunier
 
Posts: 23
Joined: Sun Dec 09, 2018 4:03 pm

Re: version 2106 probe macro

Postby cncdrive » Tue Feb 12, 2019 9:58 pm

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.
cncdrive
Site Admin
 
Posts: 2530
Joined: Tue Aug 12, 2014 11:17 pm

Re: version 2106 probe macro

Postby neptunier » Wed Feb 13, 2019 1:03 pm

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 ;)
neptunier
 
Posts: 23
Joined: Sun Dec 09, 2018 4:03 pm

Re: version 2106 probe macro

Postby dezsoe » Wed Feb 13, 2019 3:00 pm

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?
dezsoe
 
Posts: 680
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: version 2106 probe macro

Postby neptunier » Wed Feb 13, 2019 3:13 pm

i did run it directly after uccnc start, no gcode before.

michael
neptunier
 
Posts: 23
Joined: Sun Dec 09, 2018 4:03 pm

Re: version 2106 probe macro

Postby dezsoe » Wed Feb 13, 2019 3:52 pm

Could you enable and show the console plugin, run my modified macro and show what is in your console window?
dezsoe
 
Posts: 680
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: version 2106 probe macro

Postby dezsoe » Wed Feb 13, 2019 3:53 pm

FYI, I tested with version 1.2109.
dezsoe
 
Posts: 680
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: version 2106 probe macro

Postby neptunier » Wed Feb 13, 2019 4:08 pm

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
neptunier
 
Posts: 23
Joined: Sun Dec 09, 2018 4:03 pm

Re: version 2106 probe macro

Postby dezsoe » Wed Feb 13, 2019 4:12 pm

Fine!
dezsoe
 
Posts: 680
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Report a bug

Who is online

Users browsing this forum: No registered users and 5 guests