QtDragon probe and remap G38.2

More
31 Aug 2023 08:47 #279456 by looping
Hello,

I have a relay on my probe input. The relay is driven using M64 P0/M65 P0 to enable/disable the probe.
With Axis/ProbeScreen I modified the plugin sources to enable the probe before the G38.2 line and disable just after.
With Axis/PsNg the modification was simpler due to the file hierarchy so I had to patch only one file.
I looked at the remap function but G38.2 is not part of the "Existing codes which can be remapped" list.
For QtDragon, what would you recommend ?

Please Log in or Create an account to join the conversation.

More
31 Aug 2023 17:14 #279496 by cmorley
Well that is going to be more difficult. Why do you need to have the relay?
You could have a couple of macro buttons that turn the relay on and off and do that before pressing the probe routine button. That would be pretty easy.

To do exactly what you did before would require you to modify the probe_routines.py file in quite a few places.
github.com/LinuxCNC/linuxcnc/blob/master...ts/probe_routines.py

Please Log in or Create an account to join the conversation.

More
01 Sep 2023 07:05 #279548 by looping
File Attachment:

I have something that look like the above pict.
Instead of putting the croco clip on and off, I activate/desactivate the relay.
I'm also picking up some noise on the long black wire when the spindle is running. So breaking the line close to my G540 allows me not to unplug the whole wire.
May be I can acheive the same result with a software solution using and2 but I didn't dive in yet

Please Log in or Create an account to join the conversation.

More
01 Sep 2023 07:53 #279552 by cmorley
Which probe routines are you using?
Just the touchplate button?

Please Log in or Create an account to join the conversation.

More
01 Sep 2023 08:16 #279558 by looping
I would like to use:
[PROBE]
USE_PROBE = versaprobe

Please Log in or Create an account to join the conversation.

More
01 Sep 2023 15:30 #279584 by looping
Also want to use the tool length auto measure function

Do you known I should look to see how the remap allowed GCode are handled and may try to add G38.2 to the list.

Please Log in or Create an account to join the conversation.

More
01 Sep 2023 18:14 - 01 Sep 2023 18:19 #279597 by cmorley
Pretty sure remapping g38 is going to require source code changes.

auto tool probe is pretty easy - one ngc (qt_auto_probe_tool.ngc) file needs to be changed.

Another option is a component that watches the pin motion.motion-type
and when it's 5 close the relay. probably want a 2 second delay on opening too.
Last edit: 01 Sep 2023 18:19 by cmorley.

Please Log in or Create an account to join the conversation.

More
02 Sep 2023 11:16 #279656 by looping
I'll start with the second option as it has no impact on linuxcnc sources
Thanks

Please Log in or Create an account to join the conversation.

More
03 Sep 2023 14:08 #279717 by looping
probe_enable
#!/usr/bin/env python
import hal
import time

h = hal.component("probe_enable")
h.newpin("motion-type-in", hal.HAL_S32, hal.HAL_IN)
h.newpin("probe-enable-out", hal.HAL_BIT, hal.HAL_OUT)
h.ready()
start_time = 0
h['probe-enable-out'] = False
try:
    while 1:
        time.sleep(0.1)
        if h['motion-type-in'] == 5 :
            h['probe-enable-out'] = True
            start_time = time.time()

        else:
            if start_time and (time.time() - start_time) > 2:
                h['probe-enable-out'] = False

except KeyboardInterrupt:
    raise SystemExit

probe_enable.hal
setp hm2_7i92.0.gpio.007.is_output true

loadusr -Wn probe_enable probe_enable

net probe_enable  =>     hm2_7i92.0.gpio.007.out
net probe_enable  <=     probe_enable.probe-enable-out

net motion-type  =>     probe_enable.motion-type-in
net motion-type <= motion.motion-type

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.180 seconds
Powered by Kunena Forum