QTDragon spindle raise issues

More
2 years 2 months ago #308742 by gardenweazel
I'm getting this feedback in my logs:
cut
Code:
[QTvcp.QTVCP.QT_MAKEPINS][DEBUG]  Calculating geometry of main window using natural placement: 0 0 1920 1080 (qt_makepins.py:200) [QTvcp][INFO]  Postgui filename: ['qtdragon_hd_postgui.hal'] (qtvcp:431) [QTvcp][INFO]  Postgui commands: None (qtvcp:443) [QTvcp][DEBUG]  Calling handler file's before_loop__ function in qtvcp.qt_makegui.VCPWindow object at 0x7fcc7d590790 (qtvcp:414) [QTvcp.QTDRAGON_HD_HANDLER][b][color=#e74c3c][WARNING]  not connected qtdragon.eoffset-is-active (qtdragon_hd_handler.py:574)[/color][/b] [QTvcp.QTDRAGON_HD_HANDLER][b][color=#e74c3c][WARNING]  HALUI pause/resume pin(s) connected - spindle lift not available (qtdragon_hd_handler.py:581)[/color][/b] [QTvcp][INFO]  Preference path: /home/andy/linuxcnc/configs/my_LinuxCNC_machine_QTDragon/qtdragon_hd.pref (qtvcp:420)

cut



Code:
Here's part of my qtdragon_hd.hal file: Line numbers included for readability. [b]Do I need both lines 41 and 46?[/b] I am using the pause_pin.py optional file.   28 # connect signals to LinuxCNC's motion component   29 ########################################################################   30   31 net eoffset-clear    axis.z.eoffset-clear   32 net eoffset-counts   axis.z.eoffset-counts   33 #setp axis.z.eoffset-scale .001   34 #setp axis.z.eoffset-enable True   35   36 # external offsets for spindle PAUSE function   37 ########################################################################   38 net eoffset-clear              qtdragon.eoffset-clear   39 net eoffset-spindle-count   <= qtdragon.eoffset-spindle-count   40 net spindle-pause              qtdragon.spindle-inhibit        =>  spindle.0.inhibit   41 #net eoffset-state              qtdragon.eoffset-is-active      <=  motion.eoffset-active   42 net eoffset          qtdragon.eoffset-value <= axis.z.eoffset   43   44 # This is used in pause_pin.py   45 net external-pause              qtdragon.spindle-inhibit        =>  spindle.0.inhibit   46 net eoffset-state    qtdragon.external-eoffset-state <= motion.eoffset-active   47 setp axis.z.eoffset-enable 1   48 setp axis.z.eoffset-scale 1.0   49  

Please Log in to join the conversation.

More
2 years 2 months ago #308748 by cmorley
Do you have halui.pause or resume pin connected somewhere?
from the docs:

If using the Spindle lift option, HALUI can not be used to pause/resume the program. There is a pin, QtDragon.external-pause available to pause/resume from an external source. You must also enable external offsets. In the setting tab check use external offsets

also for qtdragon_hd line 41 should be un commented

Please Log in to join the conversation.

More
2 years 2 months ago #308753 by gardenweazel
The halui.pause nad halui.resume are coming from the xhc-whb04b-6.hal file.

I'm not sure how to change those entries.

17 # program related signals
  18 net pdnt.program.is-idle                  whb.halui.program.is-idle             halui.program.is-idle
  19 net pdnt.program.is-paused                whb.halui.program.is-paused           halui.program.is-paused
  20 net pdnt.program-is-running               whb.halui.program.is-running          halui.program.is-running
  21 net pdnt.program.resume                   whb.halui.program.resume              halui.program.resume
  22 net pdnt.program.pause                    whb.halui.program.pause               halui.program.pause
  23 net pdnt.program.run                      whb.halui.program.run                 halui.program.run
  24 net pdnt.program.stop                     whb.halui.program.stop                halui.program.stop
 

Please Log in to join the conversation.

More
2 years 2 months ago #308754 by cmorley
Could try this change and remove the resume (line 21).
I might need to make a separate resume pin for you for this case.
or add some logic to convert the pause/resume pins to one pin that is true for pause and false for resume.

Code:
  22 net pdnt.program.pause   whb.halui.program.pause  QtDragon.external-pause

Please Log in to join the conversation.

More
2 years 2 months ago #308815 by gardenweazel
What about the other question that I had? Not sure if you noticed that?

"Do I need both lines 41 and 46?"

Please Log in to join the conversation.

More
2 years 2 months ago #308825 by cmorley
Please remind (show) me of the pause pin code you are using.

Please Log in to join the conversation.

More
2 years 2 months ago #308827 by gardenweazel
andy@file03:~/linuxcnc/configs/my_LinuxCNC_machine_QTDragon$ cat pause_pin.py
print('\nUser command file for pause pin found\n')

# import the handlerfile to get reference to it's libraries.
# use <screenname>_handler
import qtdragon_hd_handler as SELF

# needed to instance patch
# reference: ruivieira.dev/python-monkey-patching-for-readability.html
import types

############################################
# add new functions for new HAL pins to call
############################################

# external pin will call this
def external_pause_changed(data):
    # only if runnung a program
    if not SELF.STATUS.is_auto_running():
        return
    # only on true state of pin
    # mean can only pause with the external pin
    # toggle might be nicer...
    if data:
        # set pause button
        self.w.action_pause.setChecked(data)
        self.w.action_pause.clicked.emit(data)

        # set spindle pause button
        self.w.btn_spindle_pause.setChecked(data)
        self.w.btn_spindle_pause.clicked.emit(data)

# unpause machine if external offsets state is false
def external_offset_state_changed(data):
    # only if running a program
    if not SELF.STATUS.is_auto_running():
        return
    # only if machine in on
    if not SELF.STATUS.machine_is_on():
        return
    # only if pin is false
    if not data:
        print('automatic unpause')
        # set pause button
        self.w.action_pause.setChecked(data)
        self.w.action_pause.clicked.emit(data)

###############################################
# add hook to make HAL pins at the right time
###############################################

# add a HAL pin with a call back
def after_override__(self):
    try:
        pin = SELF.QHAL.newpin("external-pause", SELF.QHAL.HAL_BIT, SELF.QHAL.HAL_IN)
        pin.value_changed.connect(external_pause_changed)

        pin = SELF.QHAL.newpin("external-eoffset-state", SELF.QHAL.HAL_BIT, SELF.QHAL.HAL_IN)
        pin.value_changed.connect(external_offset_state_changed)
    except Exception as e:
        print(e)

# Here we are instance patching the original handler file to add a new
# function that calls our new function (of the same name)
# defined in this file
self.after_override__ = types.MethodType(after_override__, self)

#########################################
# override disable_spindle_pause method
#########################################
def disable_spindle_pause(self):
    if self.w.action_pause.isChecked():
        # set spindle pause button
        self.w.btn_spindle_pause.setChecked(True)
        self.w.btn_spindle_pause.clicked.emit(True)

# instance patch voodoo
self.disable_spindle_pause = types.MethodType(disable_spindle_pause, self)

#####################################
# override pause key binding method
#####################################
def on_keycall_pause(self,event,state,shift,cntrl):
    if state and SELF.STATUS.is_auto_mode() and self.use_keyboard():
        if not SELF.STATUS.stat.paused:
            external_pause_changed(state)
        else:
            self.w.btn_spindle_pause.setChecked(False)
            self.w.btn_spindle_pause.clicked.emit(False)

# instance patch voodoo
self.on_keycall_pause = types.MethodType(on_keycall_pause, self)

##############################################
# modify stop button to call an MDI command
##############################################
self.w.action_abort.setProperty('abort_action',False)
self.w.action_abort.setProperty('true_python_cmd_string', 'ACTION.ABORT();ACTION.CALL_INI_MDI(0)')
 

Please Log in to join the conversation.

More
2 years 2 months ago #308854 by cmorley
So from memory I made that pause_pin.py modification because qtdragon_hd had no external way to pause the program.

In master at least there now is an external pin for pausing, so you might not need that part.
I see you have a bit for running a oword sub on abort - you'll still need that.

So please confirm you are using current master.
If so you will probably see two external pins qtdragon.external-pause and qtdragon.external-pause-2 is that true?
if so you should not need line 46.
finally you could try commenting out the halui pause/resume lines temparaily.

Please Log in to join the conversation.

More
2 years 2 months ago #308901 by gardenweazel
Confirmed that I am using the most current master of linuxcnc.

I don't see the pause_pin.py anywhere other than when you posted on a previous thread .

qtdragon.external-pause-2  does not exist.

Please Log in to join the conversation.

More
2 years 2 months ago #308914 by cmorley
What I meant is, in that latest master code the external-pause pin is built in to qtdragon/hd so you don't need the pause_pin.py file to add the pin.
You would still need the part that calls an oword program on abort.

Can you run linuxcnc in a terminal, with DISPLAY = qtvcp -d qtdragon_hd in the INI and post it?

Please Log in to join the conversation.

Time to create page: 0.151 seconds
Powered by Kunena Forum