How to make Linuxcnc open with the feed and override 0?
- tommylight
- Away
- Moderator
Less
More
- Posts: 19435
- Thank you received: 6517
22 Jul 2024 16:07 #305861
by tommylight
Replied by tommylight on topic How to make Linuxcnc open with the feed and override 0?
Merged, moved, corrected tittle.
Thank you.
Thank you.
Please Log in or Create an account to join the conversation.
- Thayloreing
- Offline
- Senior Member
Less
More
- Posts: 72
- Thank you received: 2
28 Jul 2024 14:36 - 28 Jul 2024 16:05 #306239
by Thayloreing
Replied by Thayloreing on topic How to make Linuxcnc open with the feed and override 0?
I managed to make Linuxcnc start with the 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 anyone 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 for lines:
widgets.feedoverride.set(0)
command.set_feedrate(0)
widgets.rapidoverride.set(0)
Command.set_rapidrate(0)
Then save and close the file. You will need to give permission to the file, right-click on it and go to properties, then go to the permissions tab, check the option allow execution of the file as a program, close the screen.
Then, if you open Linuxcnc, it should already open with the feed override and the rapid override at 0%.
Simple but difficult to find information about.
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 for lines:
widgets.feedoverride.set(0)
command.set_feedrate(0)
widgets.rapidoverride.set(0)
Command.set_rapidrate(0)
Then save and close the file. You will need to give permission to the file, right-click on it and go to properties, then go to the permissions tab, check the option allow execution of the file as a program, close the screen.
Then, if you open Linuxcnc, it should already open with the feed override and the rapid override at 0%.
Simple but difficult to find information about.
Last edit: 28 Jul 2024 16:05 by Thayloreing.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23313
- Thank you received: 4861
28 Jul 2024 18:06 #306253
by andypugh
Replied by andypugh on topic How to make Linuxcnc open with the feed and override 0?
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
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.
- rodw
- Offline
- Platinum Member
Less
More
- Posts: 10752
- Thank you received: 3543
28 Jul 2024 18:29 #306258
by rodw
Replied by rodw on topic How to make Linuxcnc open with the feed and override 0?
NotedÂ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.
- Thayloreing
- Offline
- Senior Member
Less
More
- Posts: 72
- Thank you received: 2
01 Aug 2024 12:39 #306604
by Thayloreing
Replied by Thayloreing on topic How to make Linuxcnc open with the feed and override 0?
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.
- Aciera
- Offline
- Administrator
Less
More
- Posts: 3969
- Thank you received: 1717
01 Aug 2024 15:11 - 01 Aug 2024 15:22 #306626
by Aciera
Replied by Aciera on topic How to make Linuxcnc open with the feed and override 0?
Save this as 'feed_zero.py', mark as executable and save to a folder called 'python' inside your machine config:
Then add this line to the [HAL] section of your ini file:
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.
#!/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.
- Thayloreing
- Offline
- Senior Member
Less
More
- Posts: 72
- Thank you received: 2
01 Aug 2024 16:07 #306633
by Thayloreing
Replied by Thayloreing on topic How to make Linuxcnc open with the feed and override 0?
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.
- Thayloreing
- Offline
- Senior Member
Less
More
- Posts: 72
- Thank you received: 2
06 Aug 2024 18:41 #307114
by Thayloreing
Replied by Thayloreing on topic How to make Linuxcnc open with the feed and override 0?
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.071 seconds