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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
22 Jul 2024 16:07 #305861 by tommylight
Merged, moved, corrected tittle.
Thank you.

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

More
28 Jul 2024 14:36 - 24 Jun 2025 02:22 #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
Last edit: 24 Jun 2025 02:22 by Thayloreing.
The following user(s) said Thank You: tommylight

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

More
28 Jul 2024 18:06 #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 or Create an account to join the conversation.

More
28 Jul 2024 18:29 #306258 by rodw

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

Noted 

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

More
01 Aug 2024 12:39 #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 or Create an account to join the conversation.

More
01 Aug 2024 15:11 - 01 Aug 2024 15:22 #306626 by Aciera
Save this as 'feed_zero.py', mark as executable and save to a folder called 'python' inside your machine config:


#!/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:
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.
Last edit: 01 Aug 2024 15:22 by Aciera. Reason: Fix lost indentation
The following user(s) said Thank You: Thayloreing

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

More
01 Aug 2024 16:07 #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 or Create an account to join the conversation.

More
06 Aug 2024 18:41 #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 or Create an account to join the conversation.

Time to create page: 0.085 seconds
Powered by Kunena Forum