- Posts: 60
- Thank you received: 0
'Run from here' calls remapped M-code multiple times
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
3 years 3 months ago #275833
by chowderhead
'Run from here' calls remapped M-code multiple times was created by chowderhead
I'm replacing M5 with a user defined (Python) M-code, M55, which checks and sets a few parameters before shutting off the spindle. M55 is run the number of times it appears in the g-code before the line from which I fire 'Run from here' in Axis, which causes problems. Is that the trajectory planner parsing the file up to the 'Run from here' line? In Python, is there a way to discriminate a trajectory planner traversal of the code (or whatever it is) from actual running of the g-code so I can trap for it?
Please Log in to join the conversation.
3 years 3 months ago #275869
by andypugh
Replied by andypugh on topic 'Run from here' calls remapped M-code multiple times
I think this is an attempt by the interpreter to be in same state at that point as it would be as if it had got there by running up to that point.
It's one of the problems with "run from here" that it isn't clear what the best thing to do with "stateful" elements of the system. (like, should it turn the spindle on if the spindle would have been on at that point, and in what mode)
(The reason that it isn't clear what to do is that pehaps the operator stopped the code specifically because they wanted to alter the state)
It's one of the problems with "run from here" that it isn't clear what the best thing to do with "stateful" elements of the system. (like, should it turn the spindle on if the spindle would have been on at that point, and in what mode)
(The reason that it isn't clear what to do is that pehaps the operator stopped the code specifically because they wanted to alter the state)
Please Log in to join the conversation.
3 years 3 months ago #275870
by andypugh
Replied by andypugh on topic 'Run from here' calls remapped M-code multiple times
G-code has the #<_task> parmeter
linuxcnc.org/docs/stable/html/gcode/over...ub:system-parameters
Which doesn't look like it maps exactly to either exec_state or task_state in the Python interface.
But I would start by looking at those to see if they do what you want,
Is there a compelling reason to do the remap in Python and not G-code?
linuxcnc.org/docs/stable/html/gcode/over...ub:system-parameters
Which doesn't look like it maps exactly to either exec_state or task_state in the Python interface.
But I would start by looking at those to see if they do what you want,
Is there a compelling reason to do the remap in Python and not G-code?
Please Log in to join the conversation.
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 60
- Thank you received: 0
3 years 3 months ago #275913
by chowderhead
Replied by chowderhead on topic 'Run from here' calls remapped M-code multiple times
Thanks, andypugh.
I don't see how changing g-code could solve that problem...
I'm setting welding power state using M3/M5. Some welding modes require scratch starting, wherein machine motion and welding power are initiated simultaneously with the arc establishing somewhere along the the tool path rather than precisely at the point where M3 was executed. Many welds start and end at the same point, so the delayed arc initiation results in a gap in the weld. I solve this by capturing the location where the arc initiated and create a temporary g-code file containing relevant moves from the start/stop location to that point. M55 looks for that file, executes its lines before executing M5, then deletes the file. So when I 'Run from here' the very first M55 called by the interpreter deletes the file, which is a bummer.Is there a compelling reason to do the remap in Python and not G-code?
I don't see how changing g-code could solve that problem...
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
3 years 3 months ago #275951
by tommylight
Replied by tommylight on topic 'Run from here' calls remapped M-code multiple times
A simple reed switch will do for sensing the current when welding starts, wire it to an input and in hal wire it to motion.inhibit.
That will nit let the machine move till it gets that signal that the welder is actually welding.
We use that for plasma cutting.
That will nit let the machine move till it gets that signal that the welder is actually welding.
We use that for plasma cutting.
Please Log in to join the conversation.
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 60
- Thank you received: 0
3 years 3 months ago #275952
by chowderhead
Replied by chowderhead on topic 'Run from here' calls remapped M-code multiple times
I'm using a robotic welder that sets a pin high when the arc is established - that's not the problem. The problem is the interpreter running M55 at the wrong time. My logic assumes M55 only follows an M3 when halui.mode.is-auto is high. But 'Run from here' violates that logic.
Please Log in to join the conversation.
3 years 3 months ago #275953
by Aciera
Replied by Aciera on topic 'Run from here' calls remapped M-code multiple times
Is there a compelling reason to do the remap in Python and not G-code?
I think andys question was referring to weather it may be possible to write the remap in GCode instead of python, not changing the program.I don't see how changing g-code could solve that problem...
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
3 years 3 months ago #275955
by tommylight
Replied by tommylight on topic 'Run from here' calls remapped M-code multiple times
Maybe a failure in communication, but from what you explain at length, you do not need any remap, you only need the machine not to move till the arc is on.
Please Log in to join the conversation.
- chowderhead
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 60
- Thank you received: 0
3 years 3 months ago #275961
by chowderhead
Replied by chowderhead on topic 'Run from here' calls remapped M-code multiple times
Apologies, I'm not being clear. I'll try again:
The problem is not starting, it's stopping. Assume the tool path is a closed square starting and ending at the same corner. Movement and welding power initiate simultaneously at that corner, but the arc initiates some distance along the move. (This must be done to scratch through a non-conducting coating.) To eliminate the gap that would otherwise exist between the starting corner and the point where the arc initiated, I capture the latter's position and write a temporary g-code file that M55 opens, executes, and deletes. If there's a problem, e.g. torch collision resulting in a e-stop, the subsequent 'Run from here' fires M55 multiple times, deleting the temporary g-code file, leaving the gap in the weld unfilled.
The problem is not starting, it's stopping. Assume the tool path is a closed square starting and ending at the same corner. Movement and welding power initiate simultaneously at that corner, but the arc initiates some distance along the move. (This must be done to scratch through a non-conducting coating.) To eliminate the gap that would otherwise exist between the starting corner and the point where the arc initiated, I capture the latter's position and write a temporary g-code file that M55 opens, executes, and deletes. If there's a problem, e.g. torch collision resulting in a e-stop, the subsequent 'Run from here' fires M55 multiple times, deleting the temporary g-code file, leaving the gap in the weld unfilled.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
Less
More
- Posts: 22012
- Thank you received: 4
3 years 3 months ago #275963
by tommylight
Replied by tommylight on topic 'Run from here' calls remapped M-code multiple times
"Solving hardware issues in software never works"
Parts must be clean before welding, and from anyone that i talked to regarding welding, that is not a subject open to discussion. I came to the same conclusion from several machines in serial production.
What is the bearable tolerance? 1-2mm or more?
That is a very big "no no" in welding. For a single part it might be ok, but serial production, never.Movement and welding power initiate simultaneously at that corner, but the arc initiates some distance along the move. (This must be done to scratch through a non-conducting coating.)
Parts must be clean before welding, and from anyone that i talked to regarding welding, that is not a subject open to discussion. I came to the same conclusion from several machines in serial production.
Still, you can just add an adjustable delay to switching off the welder.To eliminate the gap that would otherwise exist between the starting corner and the point where the arc initiated,
What is the bearable tolerance? 1-2mm or more?
Please Log in to join the conversation.
Time to create page: 1.315 seconds
