Probing question again...

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

Re: Probing question again...

Postby cncdrive » Sat Jan 21, 2017 1:35 am

ger21 wrote:On a related note, does adding an

exec.Wait(200);

after the

while(exec.IsMoving()){}

Have any effect on probing?

In the default M31 macro, the probe moves are followed by an exec.Wait(200);

My probing and auto zero macro's do not have the exec.Wait(200);
Someone using them said he got better repeatability after adding exec.Wait(200);? I didn't get any details, but is this required, and why?


I think we've placed that Wait there to make sure the probing and so the Moving starts before the code execution gets to the while ismoving check.
However how it works now is that the G31 internal probing routine waits until the probing ongoing and does not gives the handle back to the macro until the probe bit goes off, so the wait is not required.
The while ismoving is still required though if you want to wait until the movement totally ends, because the probing routine gives the handle back as soon as probing ends and the probing ends when the probe triggers (or the endpoint is reached) and that does not include the decceleration movement.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Probing question again...

Postby ger21 » Sat Jan 21, 2017 7:14 pm

cncdrive wrote:The while ismoving is still required though if you want to wait until the movement totally ends


After probing, I'm writing what should be the current position to the Field, but it appears that the machine is sometimes still moving when I write to the field, resulting in an incorrect position.
I've stripped out most of the code to show what I'm doing.
When this code is finished, Field #227 should read -0.375, but about 10% of the time, it was reading values of -0.418 or similar)
I would expect the While...IsMoving to allow the move to finish before my Setfield occurs, but it appears that it doesn't always happen, resulting in position errors after probing. Perhaps this is what the others are seeing?


Code: Select all
double XYClear = 0.25
double ProbeD = 0.25

exec.Code("G31 Y" + ProbeL + " F" + Frate2); // Do Slow Probe move
while(exec.IsMoving()){}
exec.Wait(200);
   
Yhit = exec.Getvar(5062); // Read the touch point
exec.Code("G0 Y" + (Yhit - XYClear));
while(exec.IsMoving()){}

AS3.Setfield(0 - XYClear - ProbeD/2, 227); // Set Y axis DRO to new zeroed position
AS3.Validatefield(227);
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Probing question again...

Postby ger21 » Sat Jan 21, 2017 9:42 pm

It should not matter if you are reading #vars for trip positions


Yes, it does. The trip position is correct, and has nothing to do with this issue. At some point you need to write a new value to the Field, based on the trip position.
The issue is that the machine appears to still be moving when I write to the Field.
You can actually take probing completely out of the equation, as the issue is happening after that.

Look at my code.
After I probe, and move away, I'm writing the value to the field. The value is a constant, that never changes, and yet I'm seeing different results. I believe that this is because the machine is still moving when I'm writing to the fields. Which means the macro is continuing while the machine is still moving.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Probing question again...

Postby ger21 » Sat Jan 21, 2017 10:11 pm

Vmax549 wrote:OK you confused me talking about probe AND your problem. I see your issue now.


Well, it was a probing macro where I noticed it... :lol:



Each line HAS to finish before teh next can start. NO EXCEPTIONS to that rule.


Yes, and I would have thought that
while(exec.IsMoving()){}

would have taken care of that, but apparently it does not.

So, will this get fixed, or do I need to add "wait" times to ensure movement has stopped before updating my Fields??
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Probing question again...

Postby ger21 » Sat Jan 21, 2017 10:47 pm

No ,what does it do? It's not listed in the macro document.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Probing question again...

Postby ger21 » Sun Jan 22, 2017 12:35 am

Well, I think that adding a 200ms Wait in the right places will be a temporary fix, but I want to see what CNC Drive has to say.
As you said, this should not be allowed to happen.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Probing question again...

Postby A_Camera » Sun Jan 22, 2017 9:33 am

cncdrive wrote:Yes, that is a great idea.

No, it's not. With 4000mm/min probing speed the overshoot I get is about 4mm. Moving slowly back to that point takes loner time than doing in two steps, first a fast probing than a rapid move just slightly above and last a slow probing. Much faster than slowly moving back 4mm to find the actual trigger point.
A_Camera
 
Posts: 639
Joined: Tue Sep 20, 2016 11:37 am

Re: Probing question again...

Postby cncdrive » Sun Jan 22, 2017 11:20 am

We will verify when the Ismoving changes state when probing.
It should only go false when the probing movement completely stops, but from what you wrote it probably changes state earlier ... it should not.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Probing question again...

Postby ger21 » Sun Jan 22, 2017 11:53 am

cncdrive wrote:We will verify when the Ismoving changes state when probing.


What I posted is not about the probing. It appears to be an issue with all movement.

Here's a more simple code showing the issue:
Code: Select all
double XYClear = 0.25
double ProbeD = 0.25
   
Yhit = exec.Getvar(5062); // Read the touch point
exec.Code("G0 Y" + (Yhit - XYClear));
while(exec.IsMoving()){}

AS3.Setfield(0 - XYClear - ProbeD/2, 227); // Set Y axis DRO to new zeroed position
AS3.Validatefield(227);


About 1 in 10 times, the SetField occurs before the G0 movement has stopped.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Probing question again...

Postby cncdrive » Sun Jan 22, 2017 12:19 pm

OK, thank you for the clarification. We will look into this asap.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

PreviousNext

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 6 guests