- Posts: 1850
- Thank you received: 127
andypugh wrote: A user M-code to switch the control pins of some mux components would be one way to do this.
Alternatively, you could use the output of a "comp" HAL component based on spindle speed.
But, a better way might be to switch on tool-number. For example decide that tools > 50 are in the high-speed spindle. That way the tool XY offsets can account for the different tool positions of the two spindles.
You would pass the spindle speed command to both pwm generators, but only enable one at a time based on tool number.
It's slightly complicated by the fact that tool number is S32, and the comp / wcomp components want a floating point.
Code:loadrt conv_s32_float loadrt wcomp addf conv_s32_float.0 servo-thread addf wcomp.0 servo thread setp wcomp.0.min 49.5 setp wcomp.0.max 49.6 # You probably already have a HAL pin that holds the tool number, use that here. net tool-number conv_s32_float.0.in net tool-number-float conv_s32_float.0.out wcomp.0.in net spindle-slow wcomp.0.under => pwmgen.0.enable net spindle-fast wcomp.0.over -> pwmgen.1.enable net spindle-speed-rpm pwmgen.0.value pwmgen.1.value
Please Log in or Create an account to join the conversation.
Maybe not, you could try using tool-prep-number.tecno wrote: Interesting this with having tool-number to control spindles.
All I can find as regards tool is in postgui.hal = is something missing?
How is this added to my config? Assuming that the spindle setup I have now will be intact with all whistles and bells.
The new HS spindle only needs on/off and speed setting = no feedback or other whistles and bells
Please Log in or Create an account to join the conversation.
re-wire your pwmgen enable as suggested
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.