How to make Linuxcnc open with the feed and override 0?

More
2 years 3 months ago #305861 by tommylight
Merged, moved, corrected tittle.
Thank you.

Please Log in to join the conversation.

More
2 years 3 months ago #306239 by Thayloreing
I managed to get Linuxcnc to start with feed override and rapid override at 0, I had a lot of difficulty, but it was simple, I'll leave what I did here in case someone needs it someday.

Add the following to the ini in the [DISPLAY] section: USER_COMMAND_FILE = feed.py .

After doing this, save and close the ini. Then create a file inside the folder where the hal and ini folders are on your machine.

Create the file with the following name: feed.py.

Inside it, add these lines for:
widgets.feedoverride.set(0)
commands.set_feedrate(0)
widgets.rapidoverride.set(0)
commands.set_rapidrate(0)

After saving and closing the file. You will need to grant permission to the file, right-click on it and go to properties, then go to the permissions tab, check the option to allow execution of the file as a program, and close the screen. Then, if you open Linuxcnc, it should open with feed replacements and quick replacements at 0%. Simple, but hard to find information about it

Please Log in to join the conversation.

More
2 years 3 months ago #306253 by andypugh
Something strange in the config on my lathe (I think it's an old driver for one of the boards that counts MPG pulses) does this to me sometimes. I don't like it.
Maybe I should use your idea to set them to 100% instead,

Note to self: Never mention that my own machines are still running 2.8.0~pre

Please Log in to join the conversation.

More
2 years 3 months ago #306258 by rodw

Note to self: Never mention that my own machines are still running 2.8.0~pre
Noted 

Please Log in to join the conversation.

More
2 years 2 months ago #306604 by Thayloreing
Good morning, I don't know if I should make a new topic, but I discovered from the worker with the machine that just opening Linuxcnc with feed and rapid at zero doesn't completely solve my problem, when I open Linuxcnc it opens at zero as expected, but it works only for the first piece of the day, because then I adjust the feed override and rapid override as I work, when I load a new file without closing Linuxcnc and run gcode, the feed and rapid override are in the last position I placed, I wanted to know How can I make it read when I open a new gcode it resets the feed and the fast again? I don't know much about Python, but I believe it is possible to check LinuxCNC's status to perform zeroing in Python. Could you give me a tip on how I can write this? I'm kinda lost

Please Log in to join the conversation.

More
2 years 2 months ago #306626 by Aciera
Save this as 'feed_zero.py', mark as executable and save to a folder called 'python' inside your machine config:


Code:
#!/usr/bin/env python import hal import linuxcnc h = hal.component("feed_zero") h.ready() # create a connection to the status channel s = linuxcnc.stat() # create a connection to the command channel c = linuxcnc.command() file_last = None try: while 1: s.poll() # get values from the status channel if s.enabled: file = s.file if s.task_mode != 2 and file != file_last : c.feedrate(0) c.rapidrate(0) file_last = file except KeyboardInterrupt: raise SystemExit

Then add this line to the [HAL] section of your ini file:
Code:
HALCMD = loadusr ./python/feed_zero.py

This should then zero the feedrate and rapid-feedrate when the machine is first enabled and also whenever a new gcode file is loaded.
Note this will not zero the feedrates if the same file is loaded/reloaded.

Please Log in to join the conversation.

More
2 years 2 months ago #306633 by Thayloreing
Thank you very much, I will test it as soon as possible, get back to you if everything goes well

Please Log in to join the conversation.

More
2 years 2 months ago #307114 by Thayloreing
Thank you very much for your help, it worked, I've been trying to get this to work for a while, thank you for your help, I hope I have enough knowledge to be able to reciprocate someday

Please Log in to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum