Can we change the default behaviour for the retract to happen AFTER completing the WHOLE .nc file.
As of now it shuffles the the last M commands to after retract. For my part it means it will continue to weld as long as retract is happening.
This is from the bottom of the .JBI:
SMOVL C01506 V=50.0 +MOVJ EC01506
CALL JOB:M110
CALL JOB:M100
CALL JOB:M200
nc code ends with:
M110
M100
M200
I want to see:
CALL JOB:M110
CALL JOB:M100
CALL JOB:M200
SMOVL C01506 V=50.0 +MOVJ EC01506
It is not so easy to change the default behavior as we would break backwards compatibility.
Why not add the retract in the Gcode and remove the retract from RoboDK? Even if it is small, you can add a larger retract in RoboDK afterwards. Or you could trigger another program when the G-code program completes to move to a retract position.
What software do you use to generate your G-code? We can help you parse this G-code, creating a temporary file to add such retract and feed it to your project. If you can provide us with more information we can help you create an Add-in to automate this.
I mostly use grasshopper.
I have already made some trial retract options and they work to some extent, but the code base to calculate the normal vector of welding gun to move safely is not that pretty, ie: It is case to case, that means I have to oversee what other people around me are using my programs for and adjust accordingly. It is very generic and one have to set a Z height enough for a reconfiguration away from anything crashable and allow access for human interaction. 500mm in z direction is ok for one job, and if you do that in another cell or job you may crash.
I commented on this since it is weird that it does not parse the .nc file completely before going to the next command and then back into the nc file again. I see no way this is useful. I know G53 and (mazak) M152 is not supported and G28 is wonky, but lifting tools out of the workpiece should always be in the gcode. Up and away on the other hand is useful between robot reconfiguration or human access and is very specific to each robotcell. Does not belong in a gcode.
What I aim for is to get the gcode interpreter to pass through motoman codes like TIMER=60, RESET, DOUT and what not without removing them from the code.
I have read this https://robodk.com/doc/en/PythonAPI/exam...structions but have yet to figure out howto.
05-25-2025, 09:34 PM (This post was last modified: 05-25-2025, 09:34 PM by Albert.)
My suggestion is to use a very small retract along the Z axis in your Gcode so that you can turn the tool off at the right time (for example, just a retract along the tool Z axis of 1 to 5 mm should be enough to not pose issues with the crash while turning off the welder at the right time).
Then, you can add your retract in RoboDK and the tool will remain off.
I thought of that decided to ask about finishing the nc file first. In GH it is easy to go backwards a step along the route I just ran or maybe just add the last movement line again... I'll test both. Thanks Albert
Btw for the gcode interpreter. Do you have any pointers on how to pass through commands like TIMER DOUT and such?
FYI, I added the last movement after the m codes as suggested and that worked perfectly. Gcode interpreter does not ignore the point even if there is no position change. IE 00478 and 00479 is the same position/point. Thanks