- Posts: 10
- Thank you received: 0
G-Code to turn machine OFF
- MasterSpoon
- Offline
- New Member
-
Less
More
7 years 4 months ago #138143
by MasterSpoon
Replied by MasterSpoon on topic G-Code to turn machine OFF
Ok I feel like an idiot now...
I have a G-code folder that I use to transfer G-code from my main computer to the milling computer, I have then been doing my custom M code files in the linuxcnc/nc_files folder
Forgot that it checks the default folder first, which was the G-code folder and I had a duplicate in there so when I was editing the one in the nc_files folder it wasn't doing anything as it was reading the one from my G-code folder first.
Sleep works fine now that I have solved the operator error.
I was still having trouble with andypugh's script not working, it seemed to work once then when I ran it a second time it wouldn't turn the machine off. I used a simplified and probably not quite as graceful script but doing
seems to do exactly what I want so I will leave it at that for now.
Thanks again for the help
I have a G-code folder that I use to transfer G-code from my main computer to the milling computer, I have then been doing my custom M code files in the linuxcnc/nc_files folder
Forgot that it checks the default folder first, which was the G-code folder and I had a duplicate in there so when I was editing the one in the nc_files folder it wasn't doing anything as it was reading the one from my G-code folder first.
Sleep works fine now that I have solved the operator error.
I was still having trouble with andypugh's script not working, it seemed to work once then when I ran it a second time it wouldn't turn the machine off. I used a simplified and probably not quite as graceful script but doing
Code:
#! /bin/bash
halcmd setp halui.mist.off 1
halcmd setp halui.spindle.stop 1
sleep 5
halcmd setp halui.estop.activate 1
sleep 1
halcmd setp halui.estop.activate 0
halcmd setp halui.mist.off 0
halcmd setp halui.spindle.stop 0
exit 0
seems to do exactly what I want so I will leave it at that for now.
Thanks again for the help
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
-
Less
More
- Posts: 19899
- Thank you received: 4655
7 years 4 months ago #138237
by andypugh
Replied by andypugh on topic G-Code to turn machine OFF
Your version of the script has the potential problem that if the machine takes more than 1 second to respond to the e-stop then it might never see it as the signal then resets regardless of machine state.
I also really do think that machine-off would be better than e-stop.
machine-off should shut down all the amps and stop all motion.
e-stop should be reserved for emergency stops, and probably ought to lock-out a machine re-start unless a hardware button is pressed. (though I confess that nether of my machines have this for the sofware e-stop, only for the hardware stop)
I also really do think that machine-off would be better than e-stop.
machine-off should shut down all the amps and stop all motion.
e-stop should be reserved for emergency stops, and probably ought to lock-out a machine re-start unless a hardware button is pressed. (though I confess that nether of my machines have this for the sofware e-stop, only for the hardware stop)
Please Log in or Create an account to join the conversation.
Time to create page: 0.350 seconds