Pin for manual command is running
07 Feb 2023 13:31 #263930
by HiSH
Replied by HiSH on topic Pin for manual command is running
>>Does your HAL component need to know _why_ the spindle speed has changed?
No not the reason, but the new setpoint of the speed and from which source the speed is valid.
Then the new setpoint is compared with the last and calculated, wether the gear has to change.
if, as i described, the halui.program.is-running remains in true state, the my user hal-component is back in the default state,
the spindle.0.at-speed is set and the wait-cmd M66 on motion.digital-00 in my remap function is triggert.
No not the reason, but the new setpoint of the speed and from which source the speed is valid.
Then the new setpoint is compared with the last and calculated, wether the gear has to change.
if, as i described, the halui.program.is-running remains in true state, the my user hal-component is back in the default state,
the spindle.0.at-speed is set and the wait-cmd M66 on motion.digital-00 in my remap function is triggert.
Please Log in or Create an account to join the conversation.
07 Feb 2023 14:09 #263938
by andypugh
Replied by andypugh on topic Pin for manual command is running
I really think that you are over-complicating this.
Why would the spindle speed ever not be valid?
Why would the spindle speed ever not be valid?
Please Log in or Create an account to join the conversation.
07 Feb 2023 14:41 #263940
by HiSH
Replied by HiSH on topic Pin for manual command is running
May be, that i make unnecessary complicated.
There a two events for changing the spindle speed:
a) The user run a gcode-file with for example a S1000 command in it or enter the S1000 command on the mdi-page self. This demands a speed at 1000, so i make a remap for the S-command and set the motion.analog-out-00 pin to 1000
b) The user press the "+"-button on the manual tab and change the speed too and this changes the spindle.0.speed-out
Now, how will my user-hal-component know, which speed is the actual valid and which shall it use for switching?
The user can change the input modes (manual button or mdi-command), whenever he wants. I can't prevent changing the tabs or disable buttons etc.
May be, using of the motion.analog-out pin for the remaping is the wrong way. I need the remap of S gcode, to delay the running of the command until the switching of the gear is done. Is it posible to remap the S-gcode and set the given speed to the spindle.o.speed-out too?
My remap function:
o<s> sub
S#<s> <- this didn't work
M68 E0 Q#<s> <- this sets the motion.analog-out-00 pin
M66 P0 L3 Q10 <- this waits until the motion.digital-input-00 is triggered
o<s> endsub
M2
There a two events for changing the spindle speed:
a) The user run a gcode-file with for example a S1000 command in it or enter the S1000 command on the mdi-page self. This demands a speed at 1000, so i make a remap for the S-command and set the motion.analog-out-00 pin to 1000
b) The user press the "+"-button on the manual tab and change the speed too and this changes the spindle.0.speed-out
Now, how will my user-hal-component know, which speed is the actual valid and which shall it use for switching?
The user can change the input modes (manual button or mdi-command), whenever he wants. I can't prevent changing the tabs or disable buttons etc.
May be, using of the motion.analog-out pin for the remaping is the wrong way. I need the remap of S gcode, to delay the running of the command until the switching of the gear is done. Is it posible to remap the S-gcode and set the given speed to the spindle.o.speed-out too?
My remap function:
o<s> sub
S#<s> <- this didn't work
M68 E0 Q#<s> <- this sets the motion.analog-out-00 pin
M66 P0 L3 Q10 <- this waits until the motion.digital-input-00 is triggered
o<s> endsub
M2
Please Log in or Create an account to join the conversation.
07 Feb 2023 15:16 #263946
by andypugh
I am not sure that you do.
Your HAL component can handle that, by delaying the setting of the spindle.0.at-speed and/or the VFD enable signal.
Replied by andypugh on topic Pin for manual command is running
I need the remap of S gcode, to delay the running of the command until the switching of the gear is done
I am not sure that you do.
Your HAL component can handle that, by delaying the setting of the spindle.0.at-speed and/or the VFD enable signal.
Please Log in or Create an account to join the conversation.
07 Feb 2023 15:45 #263949
by HiSH
Replied by HiSH on topic Pin for manual command is running
I tried without remaping. Executing the mdi command S1000, i didn't find any pin which delivers this speed-value. Which pin
contains the speed-value requested by the S-command? Or can the user-hal-component get by an alternative way?
contains the speed-value requested by the S-command? Or can the user-hal-component get by an alternative way?
Please Log in or Create an account to join the conversation.
07 Feb 2023 15:55 #263950
by andypugh
Replied by andypugh on topic Pin for manual command is running
spindle.0.speed-out (or one of it's friends, as there are also speed-out-abs, speed-out-rps and speed-out-rps-abs for when those would be more convenient.
Please Log in or Create an account to join the conversation.
07 Feb 2023 15:57 #263951
by andypugh
Replied by andypugh on topic Pin for manual command is running
Ah, but, the spindle.0.speed-out doesn't take a value until M3 is active.
That sets spindle.0.on, which you would pass through your HAL component, only setting it when appropriate.
That sets spindle.0.on, which you would pass through your HAL component, only setting it when appropriate.
Please Log in or Create an account to join the conversation.
08 Feb 2023 08:36 #264013
by HiSH
Replied by HiSH on topic Pin for manual command is running
Yes, thank you, that was my error. Without enabling the spindle with "M3" (or "M4"), the S-command has no impact on spindle.0.speed-out.
So now i can use spindle.0.speed-out for both cases and switching my gear is much easier.
So now i can use spindle.0.speed-out for both cases and switching my gear is much easier.
Please Log in or Create an account to join the conversation.
Time to create page: 0.074 seconds