Set Feed Override to 0 every cycle start

More
06 Nov 2018 11:50 #120097 by mydani
Hi guys,

I am currently thinking about how I can get LinuxCNC to set the feed override to 0% whenever a program is started.
Reason for this - I want to manually control the feed via my MPG but I do not want to manually need to turn down the feed rate before pressing cycle start. If you forget and the machine moves to fast... it's to late.

Anyone has a helping idea how to sort this one out?

Thanks!

Regards,
Daniel

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

More
06 Nov 2018 18:12 #120112 by alan_3301
try putting this in your custom.hal or postgui.hal
setp halui.spindle−override.counts 0

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

More
06 Nov 2018 18:14 - 06 Nov 2018 18:15 #120113 by alan_3301
oops, thats for spindle.

try this instead

setp halui.feed−override.counts 0

you may also have to add this next line.. not sure.

setp halui.feed−override.direct−value true


Edit - sorry, reading and replying too quickly. That won't do it after a cycle start....
Last edit: 06 Nov 2018 18:15 by alan_3301.

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

More
06 Nov 2018 18:45 - 06 Nov 2018 18:46 #120114 by Todd Zuercher
It is a little more complicated because you are also using the MPG for setting the feed.

But here is how I'd try to tackle it. Assuming you already have the encoder connected and working with halui.feed-override.
1st I'd set the halui.feed-override.direct-value to true. That way setting the count to 0 sets your feed feed override to 0. Then make a custom M-code that resets your mpg encoder count to 0 and insert it at the start of each milling file.
The cusome M-code would look something like this:
M100
#!/bin/bash
# file to set feed-override to 0
halcmd setp encoder.0.index−enable 1
sleep .100 
halcmd setp encoder.0.phase−Z 1
sleep .100 
halcmd setp encoder.0.phase−Z 0
exit 0
That should in theory reset your mpg count to zero and indirectly set halui.feed-override.counts to zero (assuming the MPG count out is connected to it.) Which would set the feed override to 0.

But there would be a whole new layer or three of complexity added if you also use that encoder for other purposes, such as jogging.
Last edit: 06 Nov 2018 18:46 by Todd Zuercher.

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

More
07 Nov 2018 01:45 #120138 by cmorley
maybe an easier idea is using a python HAL program to monitor the start status on linuxcnc and if it starts then send a command to set the override to what ever you want. you could add a HAL pin that you can set to adjust the initial setting.

This avoids having to trick the encoder at all.
A HAL program isn't realtime but I bet it's fast enough to do the job well.

Chris M

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

More
14 Nov 2018 09:56 #120658 by mydani
Hello Chris,

I do have custom RT components and python components.
Detecting the cycle start to react on is also easy.
But where I struggle is that all comps are integrated via the HAL pins.

And the halui.feed-override.counts pin is already connected to my MPG, so I have no clue how to set the feed override from within my component. Is there some direct python call to do it instead? Maybe I need to mod the UI with the logic instead?

Regards,
Daniel

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

More
14 Nov 2018 12:59 #120671 by andypugh

Is there some direct python call to do it instead?


Yes
linuxcnc.org/docs/2.7/html/config/python...c_command_tt_methods
s.set_feed_override() and s.set_spindle_override()

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

More
14 Nov 2018 13:23 #120675 by cmorley
There are two python modules: hal and linuxcnc
HAL for manipulating HAL objects and linuxcnc for linuxcnc status and commands.

Something tells me that it's actually 'feedrate()', I believe set_feed_override() sets the ability of feed override to be ignored.
A little test will give the answer.

Chris M

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

More
14 Nov 2018 16:03 #120686 by mydani
Hi guys,

did it, it's working fine! Thanks for the hint reg the python interface - read the documentation but must have forgotten this part. :) Btw. it is feedrate like Chris said.

Regards!
Daniel

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

Time to create page: 0.673 seconds
Powered by Kunena Forum