'Run from here' calls remapped M-code multiple times
- chowderhead
- Offline
- Senior Member
- Posts: 57
- Thank you received: 11
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
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 or Create an account to join the conversation.
- chowderhead
- Offline
- Senior Member
- Posts: 57
- Thank you received: 11
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 or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19202
- Thank you received: 6436
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 or Create an account to join the conversation.
- chowderhead
- Offline
- Senior Member
- Posts: 57
- Thank you received: 11
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19202
- Thank you received: 6436
Please Log in or Create an account to join the conversation.
- chowderhead
- Offline
- Senior Member
- Posts: 57
- Thank you received: 11
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 or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19202
- Thank you received: 6436
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 or Create an account to join the conversation.