Setting up probe....confusing....

If you have a question about the software please ask it here.

Setting up probe....confusing....

Postby MRob » Mon Dec 09, 2019 11:07 pm

OK so I'm trying to migrate to UCCNC since mach3 running the plugin for AXBB keeps on randomly stopping on me. I've got everything set up fine, but the guide for setting up a probe a very unclear.

My setup is a fixed probe, using the end mill to touch to ground to give me position. Using a round bushing stuck to PCB as touch plate. After a few hours of playing around, I have managed to get it to probe Z, and when I switch to pocket it probes fine for X and Y, all if I place it in the right spot first. I got it to "save mobile probe position", but I have no idea how to set a fixed probe position, how to move it to this position, or how to set non-zero vales for this position in X Y and Z (e.g. "gauge height" didnt seem to do anything). There is a bunch of other stuff I could ask, but this seems like the best place to start.

Going up a level, what I actually need are three probe routines. In all cases go to Z machine zero, move to fixed co-ordinates, and then drop down to a fixed Z. First routine is probe Z, lift 1mm up or so, then probe for X and Y. A second routine that just probes Z. And a third routine to probe Z, but starting from a lower Z position for stubby end mills (not critical, but nice). In all three cases, X Y and Z positions need to be set, with e.g. the PCB touch surface being about 25mm underneath where my Z0 point need to be. Can I get the probe routines to do this? Or should I just give up on them, create my own M codes and give making my own buttons a go? I have all this working in Mach3 VB, so perhaps this would be the easiest, especially if there are copy/paste sections of code I could use....??

Thanks for your time...
MRob
 
Posts: 49
Joined: Wed Dec 04, 2019 10:10 pm

Re: Setting up probe....confusing....

Postby dezsoe » Tue Dec 10, 2019 6:26 pm

Use the mobile probe mode even if you have a fixed. The fixed probe mode is for a future module for ATC.

The most important thing is to have your machine homed. The program has to know where the tool is.

Jog your machine above your fixed probe. Be sure to have enough space for longer tools. Press "Set as mobile probe pos". After confirming the position it will be saved. (You cannot edit the probe positions manually.) Because your probe has a fixed place, check "Save mobile probe pos. on exit" on the setup page. Don't forget to set the Safe Z (in your case to 0) and check "Greater Z is safer in G17" if your Z is positive up and negative down. If you don't want your machine to traverse at the highest speed to the probe and back then check "Limit traverse speed" and set the speed. Once the mobile probe position is set you can press "-> probe pos" to send the tool there. It will move to the Safe Z height in machine coords, move to the saved X-Y coords and finally to the saved Z coord.

If you use a gage then set its height in the "Gage height" field. When you probe with the gage you have to turn on the "Axis 1 count gage" (or axis 2 too if you probe in 2 axes).

The most of the probe functions can be automated and called from macros. Please, write more details of the automated probes that you need.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Setting up probe....confusing....

Postby MRob » Tue Dec 10, 2019 7:50 pm

Thanks for the reply - explains why I couldnt get fixed probe to work! Suggest maybe a note to that effect in the guide? Save other people the frustration...

I can give the steps you have outlined a go , and maybe your reply will be helpful for other people, but I've just finished converting the first of my old VB macros over into c# now, and found the functions for editing screens, so I'll probably carry on with that as it gives me more control over specific routines. I've got it to Z probe fast and then fine, now I just need to add X and Y.

However, I do have one other thing I need to ask - when I hit "cycle stop", it goes fast to Z0 and then starts moving the X and Y axis - I have no idea where it is going because I hit e-stop, gave me quite the surprise - any idea why?! I'm pretty sure this is not supposed to happen...
MRob
 
Posts: 49
Joined: Wed Dec 04, 2019 10:10 pm

Re: Setting up probe....confusing....

Postby dezsoe » Wed Dec 11, 2019 6:08 am

Mach3 kills your macro when you press stop. In UCCNC you have to handle the stop condition. Use exec.Ismacrostopped() function to check if stop was pressed. If you have exec.Wait calls in your code then it will not wait after the stop is pressed.

E.g.:
Code: Select all
if (exec.Ismacrostopped())
{
  exec.AddStatusmessage("Stopped!");
  return;
}
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Setting up probe....confusing....

Postby wright » Wed Dec 11, 2019 10:44 am

I have just set up my new cnc mill conversion with UCCNC. It is a mill not a gantry router and I have no need to probe the Z as I set the Z height with the individual tools each time I do machining. However I do need to be able to set the X and Y coordinates to 0 when probing a hole or a square recess. This enables me to fix parts in the vice accurately centred for continued operations. I also have a need to find edges and corners in a similar way. In the past on my old mill I used Mach 3 and I used a macro that I adapted from another users efforts. It was a bit crude but it worked without any issues for several years. On my new mill I have bought a very nice (expensive) probe with a ruby tip and I just am nervous of crashing it and having to buy another tip. In the manual I downloaded I saw no reference to probing and was pleased to find there are some routines as standard in the software. I managed to find on line the manual and have struggled a bit to understand how it works. It would be a big help if someone would explain in simple terms how to probe. I have been used just to lowering the probe into the hole and pressing an icon. I do not know why there are 2 speed probes as I have been used one that runs at a modest speed. I did have to set the tip diameter in the macro.

I have the same board as MRob.

The software diagnostics page does show the LEDS lighting up when the probe is triggered. So far UCCNC software seems pretty good and will do what I need, I just need to understand the probing routine so I can do my very simple probes. I just need a little hand holding please.

John
wright
 
Posts: 18
Joined: Sat Jul 13, 2019 3:13 pm

Re: Setting up probe....confusing....

Postby MRob » Wed Dec 11, 2019 11:44 am

John - the two probe speeds are first fast to get rough position, back off then take it slow for more precision. Makes it both faster and more accurate. Anyway I'll include the code I am playing with below, like you in mach3 I basically pulled out the code sections I needed and put it together in VB, very much done the same here by searching threads and other peoples implementations to convert my code over. So this is designed to probe Z fast and slow, and then find X and Y outside edges. For each axis going to the middle after probing + and then -, and setting an offset from that midpoint. It *was* working just 10 minutes ago on my first test, but then I added in some feedrates and now for some reason it is not going to YCenter. Not sure why, probably some stupid errpr, I have to head out now but I'll fix it later. Still, you'll be able to pull out the relevant functions from this I think. Oh and in mach I was using G28 G91 Z0, but for some reason uccnc tries to take all axis to 0 rather than just z, so I'm using G53 here.

Code: Select all
double Feed = exec.getcurrentfeedrate();

exec.Code ("G53 Z-1 F2000");
while(exec.IsMoving()){}

double YS=402.6;
double XS=254.7;

double DIF=2;  //move out from centre this far on X & Y before starting probe in each direction


double XSM=XS-DIF;
double XSP=XS+DIF;
double YSM=YS-DIF;
double YSP=YS+DIF;


exec.Code ("G53 Y" + YS + " X" + XS + " F2000");
while(exec.IsMoving()){}

//exec.Code ("G53 Z-46 F1500");
exec.Code ("G53 Z-26 F1500");
while(exec.IsMoving()){}

exec.Code ("G31 Z-250 F300");
while(exec.IsMoving()){}

exec.Code ("G91 Z0.3");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 Z-250 F50");
while(exec.IsMoving()){}
double ZProbePos = exec.Getvar(5063);


exec.Code ("G1 Z" + ZProbePos + " F100");
while(exec.IsMoving()){}


AS3.Setfield(-19.5, 228);
AS3.Validatefield(228);

exec.Code ("G91 Z1 F2000");
while(exec.IsMoving()){}
exec.Code ("G90");


//  ************ Z NOW SET, Y NEXT ************



exec.Code ("G53 X" + XS + " Y" + YSM);
while(exec.IsMoving()){}

exec.Code ("G31 Y-1000 F250");
while(exec.IsMoving()){}

exec.Code ("G91 Y0.5 F500");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 Y-1000 F50");
while(exec.IsMoving()){}
double YPos1 = exec.Getvar(5062);


exec.Code ("G53 Y" + YSP + "F500");
while(exec.IsMoving()){}

exec.Code ("G31 Y1000 F250");
while(exec.IsMoving()){}

exec.Code ("G91 Y-0.5 F500");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 Y1000 F50");
while(exec.IsMoving()){}
double YPos2 = exec.Getvar(5062);


double YCenter = ((YPos1 + YPos2) / 2);
exec.Code ("G53 Y" + YCenter + " F500");
while(exec.IsMoving()){}

MRob
 
Posts: 49
Joined: Wed Dec 04, 2019 10:10 pm

Re: Setting up probe....confusing....

Postby MRob » Wed Dec 11, 2019 11:46 am

Dezsoe - OK I think I understand you, but not the solution - would one way to fix this be to edit the "cycle stop" button to something which kills all processes?? If so, please suggest a macro for me to put in place!
MRob
 
Posts: 49
Joined: Wed Dec 04, 2019 10:10 pm

Re: Setting up probe....confusing....

Postby MRob » Wed Dec 11, 2019 2:01 pm

Oops, copied wrong code section over, that was with X etc stripped out so I could start debugging. Try again...

Next to try and debug...

Code: Select all
double Feed = exec.getcurrentfeedrate();

exec.Code ("G53 Z-1 F2000");
while(exec.IsMoving()){}

double YS=402.6;
double XS=254.7;

double DIF=2;



double XSM=XS-DIF;
double XSP=XS+DIF;
double YSM=YS-DIF;
double YSP=YS+DIF;


exec.Code ("G53 Y" + YS + " X" + XS + " F2000");
while(exec.IsMoving()){}

//exec.Code ("G53 Z-46 F1500");
exec.Code ("G53 Z-26 F1500");
while(exec.IsMoving()){}

exec.Code ("G31 Z-250 F300");
while(exec.IsMoving()){}

exec.Code ("G91 Z0.3");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 Z-250 F50");
while(exec.IsMoving()){}
double ZProbePos = exec.Getvar(5063);


exec.Code ("G1 Z" + ZProbePos + " F100");
while(exec.IsMoving()){}


AS3.Setfield(-19.5, 228);
AS3.Validatefield(228);

exec.Code ("G91 Z1 F2000");
while(exec.IsMoving()){}
exec.Code ("G90");


//  ************ Z NOW SET, Y NEXT ************



exec.Code ("G53 X" + XS + " Y" + YSM);
while(exec.IsMoving()){}

exec.Code ("G31 Y-1000 F250");
while(exec.IsMoving()){}

exec.Code ("G91 Y0.5 F500");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 Y-1000 F50");
while(exec.IsMoving()){}
double YPos1 = exec.Getvar(5062);


exec.Code ("G53 Y" + YSP + "F500");
while(exec.IsMoving()){}

exec.Code ("G31 Y1000 F250");
while(exec.IsMoving()){}

exec.Code ("G91 Y-0.5 F500");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 Y1000 F50");
while(exec.IsMoving()){}
double YPos2 = exec.Getvar(5062);


double YCenter = ((YPos1 + YPos2) / 2);
exec.Code ("G53 Y" + YCenter + "F500");
while(exec.IsMoving()){}

AS3.Setfield(40.328, 227);
AS3.Validatefield(227);

// *********** Y NOW SET, X Next



exec.Code ("G53 X" + XSM);
while(exec.IsMoving()){}

exec.Code ("G31 X-1000 F250");
while(exec.IsMoving()){}

exec.Code ("G91 X0.5 F500");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 X-1000 F50");
while(exec.IsMoving()){}
double XPos1 = exec.Getvar(5061);


exec.Code ("G53 X" + XSP + "F500");
while(exec.IsMoving()){}

exec.Code ("G31 X1000 F250");
while(exec.IsMoving()){}

exec.Code ("G91 X-0.5 F500");
while(exec.IsMoving()){}
exec.Code ("G90");

exec.Code ("G31 X1000 F50");
while(exec.IsMoving()){}
double XPos2 = exec.Getvar(5061);


double XCenter = ((XPos1 + XPos2) / 2);
exec.Code ("G53 X" + XCenter + "F500");
while(exec.IsMoving()){}

AS3.Setfield(87.708, 226);
AS3.Validatefield(226);


//********** All Done!!




exec.Code ("G53 Z-1 F2000");
while(exec.IsMoving()){}

exec.Code ("F" + Feed);

//Variables 5061-5066 are the probe trip points
//for axis X, Y, Z, A, B, and C.     
//226 xpos
//227 ypos   
MRob
 
Posts: 49
Joined: Wed Dec 04, 2019 10:10 pm

Re: Setting up probe....confusing....

Postby dezsoe » Wed Dec 11, 2019 2:40 pm

No, there's no way to kill macros. This is by design. You have to handle the stop condition as I showed.

Code: Select all
...
exec.Code ("G0 G53 Z0");
while(exec.IsMoving());
if (exec.Ismacrostopped())
{
  exec.AddStatusmessage("Stopped!");
  return;
}
...

Normal code executes quickly, usually you need to check Ismacrostopped() only after exec.Code() calls or if you wait for something. E.g.: you wait for port 1 pin 15 to become high:

Code: Select all
while (!exec.GetLED(15))
{
  Thread.Sleep(50);
  if (exec.Ismacrostopped())
  {
    exec.AddStatusmessage("Stopped!");
    return;
  }
}
// Pin 15 is high now, continue
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Setting up probe....confusing....

Postby MRob » Wed Dec 11, 2019 3:14 pm

OK for John or whoever else might come along, figured out why my probing was having issues - using a G53 instead of a G1 to go to the centre positions for x and y. Swap it out and it works fine.

Dezsoe, afraid I dont really understand, there is too much of a gap between our levels of knowledge, just in your explanations there are assumptions to knowledge that I do not possess. If I am understanding correctly however, the cycle stop doesnt work for trying to kill a macro, in that case it would be better for me to reset instead. I presume "cycle stop" will work correctly when running normal gcode, stopping it dead and without sending the gantry off to places unknown, and that is the main thing. So we can probably leave it at that for now! I can come back to trying to understand your explanations later if needed. Thanks for trying anyway :).
MRob
 
Posts: 49
Joined: Wed Dec 04, 2019 10:10 pm

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: Google [Bot] and 31 guests

cron