Resetting feedrate override from multiple signals

More
02 Dec 2016 19:57 #83595 by CMB
Although the method below works as expected, I'm new to LinuxCNC and I'm still trying
to sort out the cleanest way to set things up. Especially when using multiple hal files
and in cases where pins are intentionally written to from several sources using multiple signals.

Can someone comment on a better method to do the following, or if the example below is considered
an acceptable practice? :) I'm particularly concerned about the use of halcmd in the M code...

The purpose is to perform the following:
Set feedrate override to 100% when Gmocappy is initially loaded.
Set feedrate override to 100% before performing an auto tool touchoff.
Other signals must be easily added to reset the feedrate override in a uniform fashion. (using <or> in hal)

Secondly, What if I'd wish to store the current FRO value before resetting it and return it to the previous value after running the touchoff subroutine (in Gmoccapy)?

(excerpt from halfile)
setp oneshot.0.width 1
net req-rst-fro-onload => oneshot.0.in 
sets req-rst-fro-onload 1

net rst-fro-onload <= oneshot.0.out => or2.4.in0
net M110-req-rst-fro => or2.4.in1
net rst-fro <= or2.4.out => gmoccapy.reset-feed-override

(M Code that gets called from the touchoff subroutine)
(M110)
#!/bin/bash
# Mcode to reset Feedrate Override
halcmd sets M110-req-rst-fro 1
sleep .1
halcmd sets M110-req-rst-fro 0
exit 0

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

More
03 Dec 2016 13:06 #83614 by newbynobi
@CMB

if you start gmoccapy, feed override is set to 100 % automatically.
If you want to reset the feed override from hal, just use the corresponding hal pin

gmoccapy.reset-feed-override

it resets the feed override to 100 % if it gets hight (TRUE)

Norbert

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

More
03 Dec 2016 17:00 #83627 by CMB
Thanks Norbert,

After connecting an encoder knob to the feedrate override, it now defaults to max at startup.
I'll investigate this further as it may be due to me using the raw counts from the encoder, however the hal method above does solve the issue.

-cb

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

Time to create page: 0.160 seconds
Powered by Kunena Forum