Probe cancellation does not move the axes.

More
27 Sep 2024 11:58 #310882 by Lcvette

That would be a great addition to Probe Basic.

I'm not sure it can be done - but I'm no expert.

My initial thought is that the on_abort subroutine is run while LCNC is in auto mode... so there's no way for a program to switch to manual (or MDI) mode.

I'll dig around a little and open a new thread - the issue (or solution) may not be specific to PB.

Thanks Spumco,  I briefly looked and saw there is a python module to for the status but i don't see a method of issueing a mode change from within a subroutine, at least not at first glance, if there is a method im not sure how it would handle changing the state from within an auto mnode program to manual mode and close the running subroutine which would need to be done in auto mode.. chicken/egg scenario maybe?

task_mode
(returns integer) - current task mode. one of MODE_MDI, MODE_AUTO, MODE_MANUAL.

i used this for some of the display button states in probe basdic but not sure how much help they would be.  may need a module added or perhaps there is a feature function somewhere else im not aware of.  I also have previously considered having some way to abort to manual mode, but then i think well thats a safety thing too so you don't inadvertently move the machine when it is in a precarious spot, such as the probe down in a hole where it errors from max distance non probe trigger,   so.. while a minor inconvenience, maybe saves a major cost or crash?

 

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

More
27 Sep 2024 14:45 #310892 by Aciera
It's not possible to switch to manual from gcode but you could set an analog output in gcode to indicate to a python component that you want to switch to manual mode when the gcode finishes or aborts (ie the interpreter switches to IDLE):
#!/usr/bin/env python3
import time
import hal
import linuxcnc

h = hal.component("auto2manual")
h.ready()
s = linuxcnc.stat()
c = linuxcnc.command()
 
# wait time in milliseconds between checks 
check_interval = 500
flag = False
check_timer_start = round(time.time()*1000)

def ok_for_mdi():
    s.poll()
    return not s.estop and s.enabled and (s.homed.count(1) == s.joints) and (s.interp_state == linuxcnc.INTERP_IDLE)

try:
    while 1:
        if round(time.time()*1000) >= check_timer_start + check_interval:
            s.poll()

            if s.task_mode == linuxcnc.MODE_AUTO:
                if hal.get_value('motion.analog-out-00') == 1:
                    flag = True 

            if flag == True and ok_for_mdi():
                c.mode(linuxcnc.MODE_MDI)
                c.wait_complete() # wait until mode switch executed
                c.mdi("M68 E0 Q0")
                c.wait_complete() # wait until analog output reset
                c.mode(linuxcnc.MODE_MANUAL)
                c.wait_complete() # wait until mode switch executed
                flag = False
            check_timer_start = round(time.time()*1000)
            
except KeyboardInterrupt:
    raise SystemExit
The following user(s) said Thank You: Lcvette, spumco

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

More
27 Sep 2024 16:22 #310903 by Ismacr63

I don't know why those modes aren't shown in my version. I just downloaded it, followed the installation instructions and it looked like this. 


How can I add them?
 
Sounds like something got messed up in your PB installation.

What Linux distribution are you using, and what version of LCNC?  This might have a bearing - I've had problems in the past with certain combinations/versions of Debian/LCNC/qtpyvcp/PB.  Seems like frequently some dependency or other invisible 'backstage' issue led to weird problems with PB.

I know it'll be a bit painful, but my suggestion is to make a copy of your config and then uninstall and reinstall PB using the instructions here:
forum.linuxcnc.org/qtpyvcp/53871-probe-b...on-start-here#310377

I'm using LMD6 and LCNC 2.9.3

I'm going to try to do a reinstall.

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

More
27 Sep 2024 16:44 #310905 by Ismacr63

you are not in full screen mode, hit F11 to allow the display to correctly fit the screen.
 

I was going to do a reinstallation but first I wanted to try full screen and that was indeed it, now the man auto and mdi buttons are displayed correctly.
Forgive my ignorance but I am very new to all this.

Thank you so much.

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

Moderators: KCJLcvette
Time to create page: 0.090 seconds
Powered by Kunena Forum