Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Probe Monitoring toggle via gcode. #603

Open
jschoch opened this issue Sep 17, 2020 · 10 comments
Open

Feature request: Probe Monitoring toggle via gcode. #603

jschoch opened this issue Sep 17, 2020 · 10 comments
Labels
enhancement New feature or request

Comments

@jschoch
Copy link
Contributor

jschoch commented Sep 17, 2020

Please describe the feature you would like implemented

GCode command to turn probe pin monitoring on and off

Why do you think this would improve Grbl_ESP32?

When doing multi point probing via a sender/macro the probe may contact the work when moving between probe start positions. The following edge finding example:

G91F400
G1F500X9
G1F500Z-6
G38.3F400X-5
G0X1
G38.3F200X-5
G1F500X1
G53G1F500Z-3.826
G53G1F500X1.2
G1F500Y-9
G1F500Z-6
G38.3F400Y5
G0Y-1
G38.3F200Y5
G1F500Y-1
G53G1F500Z-3.826
G53G1F500Y6.431

Each non-G38 move has the potential to crash the probe.

Another example is heightmap scanning where many moves are made to scan a PCB or other surface.

What do you need the feature for?

the longevity of my probe

Will this feature appear to a lot of users?

anyone who is creating probe macros for multi point probing.

@jschoch jschoch added the enhancement New feature or request label Sep 17, 2020
@bdring
Copy link
Owner

bdring commented Sep 17, 2020

Please explain the problem behavior and exactly what you want to happen.

What does prove on/off do for you?

I would rather not guess

@jschoch
Copy link
Contributor Author

jschoch commented Sep 17, 2020

here is a reference from linuxcnc LinuxCNC/linuxcnc#368

The behavior I am looking for is that on the start of a probing macro grbl will turn probe pin monitoring on for non-G38 movements. This will stop the machine if it attempts to move the probe through the work while moving probing start positions.

From the above example. I am probing and edge.

G1F500X9  ;  Move from Start position to "clear" part
G1F500Z-6 ;  Move down 6 
G38.3F400X-5 ; probe

The probe may crash on line 1 or line 2 and grbl would just keep going even though the probe was triggered on the pre-G38 positioning move. If probe pin monitoring was active on these intermediate moves grbl could halt and go into alarm when the probe makes contact.

So for a macro you'd turn on the monitoring at the beginning, and off at the end of your macro. Something like

M990 1; turn probe pin monitoring on for moves
G91F400
G1F500X9
G1F500Z-6
G38.3F400X-5
G0X1
G38.3F200X-5
G1F500X1
G53G1F500Z-3.826
G53G1F500X1.2
G1F500Y-9
G1F500Z-6
G38.3F400Y5
G0Y-1
G38.3F200Y5
G1F500Y-1
G53G1F500Z-3.826
G53G1F500Y6.431
M990 0; turn probe pin monitoring off

@jschoch
Copy link
Contributor Author

jschoch commented Sep 17, 2020

another option here is to have a probe detect pin which would detect the probe and ensure that the probe pin state is monitored when the probe is "on". This could also be used to lockout turning the spindle on.

@MitchBradley
Copy link
Collaborator

There is some similarity to the safety door code.

@bdring
Copy link
Owner

bdring commented Sep 17, 2020

Was that LinuxCNC feature implemented?

@MitchBradley
Copy link
Collaborator

A solution that requires no GCode involvement is to have the probe pin act as a limit switch when not probing.

@jschoch
Copy link
Contributor Author

jschoch commented Sep 17, 2020

Was that LinuxCNC feature implemented?

// not probing, but we have a rising edge on the probe.
// this could be expensive if we don't stop.

https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/motion/control.c#L620

Since recording the position per step ISR tick is expensive in the default mode for probe state monitoring, perhaps it is better to have a new routine that only checks a probe state flag in the same interval used for limit switch checking when not in an G38. I believe the expense of keeping the current stat monitor running is why it is not always on. I would also expect that monitoring probing full time combined with bad wiring and EMI noise will create newbie user issues.

@jschoch
Copy link
Contributor Author

jschoch commented Apr 4, 2021

here's why I wanted to have this available. I was probing a corner. The macro was unaware the probe triggered, there is no way to stop it if the machine is moving fairly quickly, and so the machine just kept moving Z down.

image

@bdring
Copy link
Owner

bdring commented Apr 4, 2021

If the probe were a reset switch most of the time and a probe switch when you needed it to be, that might fix your problem.

With the current code, that would rather messy. Reset switches use interrupts and probes do not. If you wired 2 inputs to the switch that would help, but you would need to turn off the reset during probing. Custom macro programming might do it.

I don't think it is something the developers would want to implement at this time. We have a lot of other things we want to work on.

@freisei
Copy link

freisei commented Apr 20, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants