Hello Guest it is March 29, 2024, 02:45:02 AM

Author Topic: Mysterious signal set when probe fails ESS + G31  (Read 1920 times)

0 Members and 1 Guest are viewing this topic.

Offline Bx3mE

*
  •  68 68
    • View Profile
Mysterious signal set when probe fails ESS + G31
« on: February 06, 2021, 07:35:28 PM »
I am using the X360 plugin to control my machine and have implemented a button to execute a probe move.

If the button is pressed  i run mc.mcCntlGcodeExecuteWait("G31 X-5 F20")
if i dont strike any target, pressing the button again thus executing mc.mcCntlGcodeExecuteWait("G31 X-5 F20") again does not start a probe move.
If it strikes the first time running it a second time is no problem...

Before running any GCode in the script i check various signals and make sure the machine is up for the task by checking IsInCycle, Is Enabled, Get signal state for Idle etc. which works great but none of these indicate that the machine is in any different state than before pressing the button the the first time. I suspect that i have missed someting but i dont know where to start looking.

Which variables and signals are set different when comparing a mc.mcCntlGcodeExecuteWait("G31 X-5 F20") move which strikes and one that does not strike?
Re: Mysterious signal set when probe fails ESS + G31
« Reply #1 on: February 06, 2021, 09:15:19 PM »
Execute wait should really be done in a Mcode only. It will stop the Lua chunk from running. Please tell me a bit more how you have this setup. How and where are you calling this script?
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Mysterious signal set when probe fails ESS + G31
« Reply #2 on: February 08, 2021, 06:37:42 PM »
The X360 plugin is used in a panel located like so: wx4->Default->X360_Panel

The panel script is attached

In the script i monitor Button events

- Two buttons are used as Safe grip (to avoid accidental movement)
- Thumbsticks are used for Jog Movement
- Buttons X,A,B are used for Machine Enable, CycleStart and E-Stop
- Button Y is used like button start, as a modifier button which modifies the behaviour of the DPad
No Modifier:
-DPad up/down -> Spindle Speed
-DPad L/R -> Feedrate
Y Button Modifier:
-DPad up/down -> Probe YAxis
-DPad L/R -> Probe XAxis
Start Button Modifier:
-DPad up/down -> Probe ZAxis
-DPad L/R -> Probe AAxis

When i probe using the X360 DPad i can execute the probe move.
If the probe move fails to trigger the probe
the next time i press the DPad the mc.mcCntlGcodeExecuteWait() function seems to execute, as logging before and after indicates so, but no movement is generated on the machine.

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Mysterious signal set when probe fails ESS + G31
« Reply #3 on: February 08, 2021, 07:09:47 PM »
In cleaning up my code i found that the second time the mcCntlGcodeExecuteWait returns -18 or MERROR_NOT_NOW

Which i was suspecting but could not se because of clumsy fingers but still.... why do i get the -18 the second time?
And in what way is the first run not leaving control available?
How can I fix this?

Offline gorf23

*
  •  183 183
    • View Profile
Re: Mysterious signal set when probe fails ESS + G31
« Reply #4 on: February 08, 2021, 08:40:02 PM »
I found if i did a G31 and returned a error, then G31 didn't work correct if i ran it again, after the error i added
mc.mcCntlEnable(inst, 1) and that seemed to fix it.. for me

gary

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Mysterious signal set when probe fails ESS + G31
« Reply #5 on: February 09, 2021, 10:01:10 AM »
I tried that and it works... thanks a lot gorf23!  BUT...

I feel this to be a BIG workaround...  why? Because i have no way to check the underlying flag or resetting it without using a global function which does more than reset the flag causing the -18 MERROR_NO_ERROR to be returned.

@Brian: Better solution?

Offline gorf23

*
  •  183 183
    • View Profile
Re: Mysterious signal set when probe fails ESS + G31
« Reply #6 on: February 09, 2021, 01:22:16 PM »
Yes your probley right, but what I think is going on is if a g31 error is returned then mach4 needs to be re-enabled. the first g31 with error seems to stop the next  g31 from working endless a re-enable I'm not sure if its a bug or the way it was designed, also not sure if its mach4 or the plugin. But its does deem to work as a workaround for now.

Gary
Re: Mysterious signal set when probe fails ESS + G31
« Reply #7 on: February 09, 2021, 02:36:58 PM »
There is a setting in the ESS to tell it to do nothing if a probe is not found. We don't do a disable of the machine . I think you will find that is the ESS. It is some don't estop/disable if a probe is not found setting in the ESS dialog. Could that be the issue your having?

I can have the guys test this on a machine but I don't have one at my desk I can test with.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Mysterious signal set when probe fails ESS + G31
« Reply #8 on: February 09, 2021, 05:34:34 PM »
Well thanks Brian :P

If you open the ESS Config Dialog it is very clerar that this behaviour is induced by the ESS, BUT the behaviour is still somewhat incorrect somewhere...

It says: 'Failure disables mach4' but it does not because from what i can see my Enable button in the control group on the wx4 Screen still reads "Disable" as if the machine was still enabled. Also my other scripts can still execute as they rely on mach4 to report correctly if the machine is enabled or disabled.

Is it the ESS plugin which needs to set some flags or is the function called by the ess plugin to disable mach4 missing to set these flags?
Should i file a ticket?

PS. I will ask Andy as well to check his implementation.....
Re: Mysterious signal set when probe fails ESS + G31
« Reply #9 on: February 09, 2021, 06:29:39 PM »
Well frankly I don't really know. I would like to have the guys test it so I can see the problem. My issue is I don't have time to try everything myself :( If you can make a clear case as to how I can see the issue I am way more than happy to look at it. Only so many hours in a day and that is what I have the guys for! Save Steve and I some time getting problems so we can see them. I am willing to look at what you have if you think you have it down to a point that I can make it happen. Do I need any special hardware to make it happen?
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com