physical start button + pause switch
- SenorAguas
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
19 Nov 2016 21:13 #83010
by SenorAguas
Replied by SenorAguas on topic physical start button + pause switch
Thanks for the try, but it still gave me the alarm.
Also, as far as making the code simple, I made a mistake when I said that your simplified code was doing what I wanted it to do. I didn't test it enough. I want the stop switch to keep the program from running, and to stop it if it is already running. To do that, I think I need the and2's and or2's. This stop switch is actually a switch to tell the machine if a part is loaded. The machine glues and UV cures parts, and I dont want it to run if there is no part loaded or if the operator decides to pull it out.
I tried adding the "setp halui.mode.teleop 1" to my more complicated code. It didn't prevent the error message, but I may need to add it into the logic and not just on its own line?
Also, my code stops the program but when you hit restart, it goes to the previous line in the g code. I would like it to re-start from the beginning of the program. This is something else that I missed due to running an extremely short test program. Is there a way to force it to restart from the beginning?
Also, as far as making the code simple, I made a mistake when I said that your simplified code was doing what I wanted it to do. I didn't test it enough. I want the stop switch to keep the program from running, and to stop it if it is already running. To do that, I think I need the and2's and or2's. This stop switch is actually a switch to tell the machine if a part is loaded. The machine glues and UV cures parts, and I dont want it to run if there is no part loaded or if the operator decides to pull it out.
I tried adding the "setp halui.mode.teleop 1" to my more complicated code. It didn't prevent the error message, but I may need to add it into the logic and not just on its own line?
Also, my code stops the program but when you hit restart, it goes to the previous line in the g code. I would like it to re-start from the beginning of the program. This is something else that I missed due to running an extremely short test program. Is there a way to force it to restart from the beginning?
Please Log in or Create an account to join the conversation.
07 Dec 2016 00:00 #83722
by an92626
Replied by an92626 on topic physical start button + pause switch
did anyone every solve the problem with the error message "can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" appearing when one trys to stop the program using halui.program.stop. I figured out what th actual problem is, but I do not know how to solve it.
The error message "can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" will appear if you stop the program using halui.program.stop and the program is doing an interpolated move using two axes. If the halui.program.stop command is used while the machine is moving only one axis, there is no error message. If one stops the nc program during an interpolated move using the soft key on the gui, there is no error, so there should be a way to do this. Would it be possible to dig into the gui code that sets up the XIS gui to see how the software key works? If so, does anyone know where this code would be?
The error message "can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" will appear if you stop the program using halui.program.stop and the program is doing an interpolated move using two axes. If the halui.program.stop command is used while the machine is moving only one axis, there is no error message. If one stops the nc program during an interpolated move using the soft key on the gui, there is no error, so there should be a way to do this. Would it be possible to dig into the gui code that sets up the XIS gui to see how the software key works? If so, does anyone know where this code would be?
Please Log in or Create an account to join the conversation.
07 Dec 2016 13:33 #83743
by andypugh
Replied by andypugh on topic physical start button + pause switch
Halui has two pins that do the same thing, program_stop and abort:
github.com/LinuxCNC/linuxcnc/blob/master..._intf/halui.cc#L1229
Axis would appear to do something very similar.
github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L2200
(Which uses the Python interface, defined here:
github.com/LinuxCNC/linuxcnc/blob/b9fc3b...s/emcmodule.cc#L1002 )
And that looks to be the same thing
github.com/LinuxCNC/linuxcnc/blob/master..._intf/halui.cc#L1229
Axis would appear to do something very similar.
github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L2200
(Which uses the Python interface, defined here:
github.com/LinuxCNC/linuxcnc/blob/b9fc3b...s/emcmodule.cc#L1002 )
And that looks to be the same thing
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
07 Dec 2016 16:43 - 07 Dec 2016 16:46 #83745
by Todd Zuercher
Replied by Todd Zuercher on topic physical start button + pause switch
Been busy, with other things. Lets start over, with a good description of what your hardware is and what exactly you want it to do.
Please correct:
You have a gluing machine,
It has a switch/sensor that detects if the part is in position.
The operator places the part on the machine, presses your cycle start button.
The operator can interrupt the cycle by removing the part?
-if the cycle is interrupted you want the machine to:
a) Always restart from the beginning
b) Continue from where stopped
c) Something else?
d) Operator's choise of a, b, or c
Are you very limited in the number of inputs you have available?
Please correct:
You have a gluing machine,
It has a switch/sensor that detects if the part is in position.
The operator places the part on the machine, presses your cycle start button.
The operator can interrupt the cycle by removing the part?
-if the cycle is interrupted you want the machine to:
a) Always restart from the beginning
b) Continue from where stopped
c) Something else?
d) Operator's choise of a, b, or c
Are you very limited in the number of inputs you have available?
Last edit: 07 Dec 2016 16:46 by Todd Zuercher.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
07 Dec 2016 16:58 #83747
by Todd Zuercher
Replied by Todd Zuercher on topic physical start button + pause switch
Went back and looked at some of the 1st posts, and you said something about the program starting as soon as you load it. That doesn't sound right, how are you loading the program? Maybe there are other problems with your configuration that need addressed? Might be helpful to zip your config dir and upload it for us to peek at.
Please Log in or Create an account to join the conversation.
08 Dec 2016 00:00 #83760
by an92626
Replied by an92626 on topic physical start button + pause switch
I figured out a solution to avoid the "can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" error when stopping the program while the program is performing a interpolated move. What seems to work is first pausing the program, and then stopping it. I issue a halui.program.pause command, and then the halui.program.stop command and it seems to do the trick. I was able to stop a nc program in the middle of an interpolated move without getting the error.
The following user(s) said Thank You: SenorAguas
Please Log in or Create an account to join the conversation.
- SenorAguas
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
08 Dec 2016 03:01 - 08 Dec 2016 16:25 #83768
by SenorAguas
Replied by SenorAguas on topic physical start button + pause switch
an92626, Almost none of my moves are 2 axis interpolated moves. Its a simple machine that moves one axis at a time for 95% of its program. This error has been consistent.
Thanks, I'm editing this post because I was wrong. I checked with the machine this morning and there's more interpolated moves than I thought. You are correct about it only happening in interpolated moves.
Thanks, I'm editing this post because I was wrong. I checked with the machine this morning and there's more interpolated moves than I thought. You are correct about it only happening in interpolated moves.
Last edit: 08 Dec 2016 16:25 by SenorAguas. Reason: bad info the first time around
Please Log in or Create an account to join the conversation.
- SenorAguas
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
08 Dec 2016 03:12 #83769
by SenorAguas
Replied by SenorAguas on topic physical start button + pause switch
Corrected:
You have a gluing machine, YES, it also cures with UV light using a different area of the "spindle"
It has a switch/sensor that detects if the part is in position. YES
The operator places the part on the machine, presses your cycle start button.YES
The operator can interrupt the cycle by removing the part? YES, unfortunately
-if the cycle is interrupted you want the machine to:
a) Always restart from the beginning YES, after restart button is hit
b) Continue from where stopped This would be ok too, but I don't want it to restart the previous line of code like it is doing now
c) Something else? NO
d) Operator's choice of a, b, or c interesting idea..
Are you very limited in the number of inputs you have available? YES, but I could probably add another or two
You have a gluing machine, YES, it also cures with UV light using a different area of the "spindle"
It has a switch/sensor that detects if the part is in position. YES
The operator places the part on the machine, presses your cycle start button.YES
The operator can interrupt the cycle by removing the part? YES, unfortunately
-if the cycle is interrupted you want the machine to:
a) Always restart from the beginning YES, after restart button is hit
b) Continue from where stopped This would be ok too, but I don't want it to restart the previous line of code like it is doing now
c) Something else? NO
d) Operator's choice of a, b, or c interesting idea..
Are you very limited in the number of inputs you have available? YES, but I could probably add another or two
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
08 Dec 2016 15:03 - 08 Dec 2016 15:06 #83774
by Todd Zuercher
Replied by Todd Zuercher on topic physical start button + pause switch
Does the machine need to do any movements when the part is not in place?
If it does not, how about using motion.feed-hold or motion.feed-inhibit. This would prevent the machine from making any moves when a part is not in position.
If you also want it to wait to start moving until it receives some operator input, you could use some hal logic (or classicladder would probably be my choice) to make a "latching circuit" to make it wait for the appropriate user input.
Such as the user pressing a "stop/reset" button or a "go" button.
The hal logic would look something like this:
sensor-input=>or2.in0
or2.out=>xor2.in0
stop/reset=>and2.in0=>halui.program.abort
go-button=>and2.in1=>halui.mode.auto=>halui.program.run
and2.out=>xor2.1
xor2.out=>or2.in1=>motoin.feed-hold
(I think this would all make more sense and be easier to look at in a ladder diagram but I don't have an easy way to print that fast.)
If it does not, how about using motion.feed-hold or motion.feed-inhibit. This would prevent the machine from making any moves when a part is not in position.
If you also want it to wait to start moving until it receives some operator input, you could use some hal logic (or classicladder would probably be my choice) to make a "latching circuit" to make it wait for the appropriate user input.
Such as the user pressing a "stop/reset" button or a "go" button.
The hal logic would look something like this:
sensor-input=>or2.in0
or2.out=>xor2.in0
stop/reset=>and2.in0=>halui.program.abort
go-button=>and2.in1=>halui.mode.auto=>halui.program.run
and2.out=>xor2.1
xor2.out=>or2.in1=>motoin.feed-hold
(I think this would all make more sense and be easier to look at in a ladder diagram but I don't have an easy way to print that fast.)
Last edit: 08 Dec 2016 15:06 by Todd Zuercher.
The following user(s) said Thank You: SenorAguas
Please Log in or Create an account to join the conversation.
- SenorAguas
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
08 Dec 2016 17:09 #83783
by SenorAguas
Replied by SenorAguas on topic physical start button + pause switch
I just checked the machine and how it is operating. I've been away from it for the last 2 weeks, so I got some of my details wrong in previous posts. I've had so many versions of this HAL file that I wasn't able to keep its behavior straight in my head!
It starts with the start button as it should.
It stops with the part unloaded switch like it should.
It won't start if a part is not loaded.
It restarts from the beginning of the program with the start button.
It occasionally has the ""can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" error which apparently only happens on interpolated moves.
Basically, I'm happy with it. It could be better, but the colleague that I'm building it for is happy with it and I can't spend much more time on it.
Here's my HAL file:
It starts with the start button as it should.
It stops with the part unloaded switch like it should.
It won't start if a part is not loaded.
It restarts from the beginning of the program with the start button.
It occasionally has the ""can't do that (EMC_TRAJ_SET_TELEOP_ENABLE) in auto mode with the interpreter idle" error which apparently only happens on interpolated moves.
Basically, I'm happy with it. It could be better, but the colleague that I'm building it for is happy with it and I can't spend much more time on it.
Here's my HAL file:
loadrt and2 count=2
loadrt or2 count=1
addf and2.0 servo-thread
addf and2.1 servo-thread
addf or2.0 servo-thread
# External Program Pause and Run Buttons
# Run Section
net run-step-btn or2.0.in0 and2.1.in0 <= parport.0.pin-13-in
net pause-on and2.1.in1 <= halui.program.is-paused
net my-or1 or2.0.in1 <= and2.1.out
net run-sig halui.mode.auto halui.program.run <= or2.0.out
# Pause Section
net pause-resume-btn and2.0.in0 <= parport.0.pin-15-in-not
net run-on and2.0.in1 <= halui.program.is-running
net pause-sig halui.program.stop <= and2.0.out
setp halui.mode.teleop 1
Please Log in or Create an account to join the conversation.
Time to create page: 0.089 seconds