[SOLVED] QtDragon - Spindle at speed LED not working

More
31 Oct 2023 09:32 - 01 Nov 2023 15:19 #284162 by karnalta
Hello all,

I have wired my VFD spindle at speed pin to the input 10 of my 7i96S mesa board.

The pin work correctly when monitored in HAL Show.

In my HAL file I have declared it like so :
net spindle-at-speed spindle.0.at-speed         <= hm2_7i96s.0.inm.00.input-10

But in the QtDragon UI, the At Speed LED turn on immediately at spindle startup.

I am probably missing something ?

Thank for help.
 
Last edit: 01 Nov 2023 15:19 by karnalta.

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

More
31 Oct 2023 10:14 #284168 by rodw
I think you need to
net  spindle-at-speed => some-qtdragon-pin-for-at-speed

check the docs.

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

More
31 Oct 2023 10:29 #284170 by karnalta

I think you need to
net  spindle-at-speed => some-qtdragon-pin-for-at-speed

check the docs.

I was thinking as you but did not find anything here :

linuxcnc.org/docs/devel/html/gui/qtdragon.html#_hal_pins

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

More
31 Oct 2023 12:47 #284180 by cmorley
Do you have a spindle speed feedback pin connected?
Qtdragon calculates spindle at speed it's self using spindle request and spindle feedback.
Can you post your config?

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

More
31 Oct 2023 13:22 #284182 by karnalta

Do you have a spindle speed feedback pin connected?
Qtdragon calculates spindle at speed it's self using spindle request and spindle feedback.
Can you post your config?

No I don't, my VFD is set to feedback a digital signal when at speed.

Here is relevant part of my config :
# SPINDLE IO
# ----------

net spindle-enable spindle.0.on                => hm2_7i96s.0.ssr.00.out-00 => hm2_7i96s.0.pwmgen.00.enable
net spindle-cw spindle.0.forward             => hm2_7i96s.0.ssr.00.out-01 
net spindle-ccw spindle.0.reverse             => hm2_7i96s.0.ssr.00.out-02
net spindle-output-rpm spindle.0.speed-out-abs        => hm2_7i96s.0.pwmgen.00.value
net spindle-at-speed spindle.0.at-speed         <= hm2_7i96s.0.inm.00.input-10

# SETUP MESA BOARD
# ----------------

# General
setp hm2_7i96s.0.pwmgen.pwm_frequency 20000
setp hm2_7i96s.0.pwmgen.pdm_frequency 6000000
setp hm2_7i96s.0.watchdog.timeout_ns 5000000
setp hm2_7i96s.0.dpll.01.timer-us -50
setp hm2_7i96s.0.stepgen.timer-number 1
setp hm2_7i96s.0.inm.00.input-10-slow 1

# Spindle
setp hm2_7i96s.0.pwmgen.00.output-type 1
setp hm2_7i96s.0.pwmgen.00.scale 24000

net spindle-manual-cw         halui.spindle.0.forward
net spindle-manual-ccw        halui.spindle.0.reverse
net spindle-manual-stop       halui.spindle.0.stop
 

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

More
01 Nov 2023 05:35 #284236 by cmorley
you can try this.

add the file into your config folder
add this line to the INI under the [DISPLAY] setting:

USER_COMMAND_FILE = CONFIGFOLDER/qtdragonrc.py

This should make the led automatically follow the pin spindle.0.at-speed state
Attachments:

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

More
01 Nov 2023 05:44 #284237 by cmorley
save the file as qtdragonrc.py

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

More
01 Nov 2023 11:55 #284248 by karnalta

you can try this.

add the file into your config folder
add this line to the INI under the [DISPLAY] setting:

USER_COMMAND_FILE = CONFIGFOLDER/qtdragonrc.py

This should make the led automatically follow the pin spindle.0.at-speed state

I have no error or warning but it does not work.

Here is my full qtdragonrc.py file because you already helped me out in another thread :)
print('\nUser command file for button hiding found\n')

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

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

###############################################
# add hook to hide buttons
###############################################
self.w.action_flood.hide()
self.w.btn_ref_laser.hide()
self.w.btn_laser_on.hide()

###############################################
# add hook to bind at-speed to pin
###############################################
def before_loop__(self):
    try:

        self.w.led_at_speed.setProperty('follow_halpin_state',True)
        self.w.led_at_speed.setProperty('halpin_name','spindle.0.at-speed')
        self.w.led_at_speed. _hal_init()
    except Exception as e:
        pass

# 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.before_loop__ = types.MethodType(before_loop__, self)

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

More
01 Nov 2023 12:43 #284249 by cmorley
Sorry yes dragon_hd has a different name for the led.
change all references of 'self.w.led_at_speed' to 'self.w.hal_led_atspeed'

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

More
01 Nov 2023 15:18 #284264 by karnalta

Sorry yes dragon_hd has a different name for the led.
change all references of 'self.w.led_at_speed' to 'self.w.hal_led_atspeed'

Yep, working fine now :)

Thank you.

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

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