Hello,
I have little troubles with my spindle, I have to S1200 to get 12000RPM, S1800 to get 18000RPM etc, i tried many things with parameters but without results:
Generally PWM signal from motion controller card drive a 0-10V signal to spindle, when scale set to 24000 it won't work at all.
MAX_OUTPUT = 24000.0
OUTPUT_SCALE = 1
OUTPUT_MIN_LIMIT = 5000
OUTPUT_MAX_LIMIT = 24000
hal:
net spindle-pid-out pid.s.output => scale.gear.in
setp scale.gear.gain 0.00035
net spindle-output <= scale.gear.out
setp hm2_7c81.0.pwmgen.01.output-type 1
setp hm2_7c81.0.pwmgen.01.scale [SPINDLE_0]OUTPUT_SCALE
net spindle-output => hm2_7c81.0.pwmgen.01.value
net spindle-enable => hm2_7c81.0.pwmgen.01.enable
net spindle-at-speed <= hm2_7c81.0.gpio.051.in_not
second thing I like to drive LED in qtdragon_hd which is instantly powered on after spindle enable:
in ini file in DISPLAY section I've added :
USER_COMMAND_FILE = CONFIGFOLDER/qtdragonrc.py
and code in file:
print('\nUser command file for following spindle.0.at_speed\n')
# needed to instance patch
# reference:
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_handler as SELF
###############################################
# add hook to add a status request
###############################################
def before_loop__(self):
try:
#self.w.led_at_speed.setProperty('halpin_option',False)
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)
but led won't work (i tried 'self.w.led_at_speed' and 'self.w.hal_led_atspeed'), i have simple relay to inform that spindle reach speed, which is working correctly but only led on screen not working
Thank You in advance for help