G-code from Cura to Rapid using Python

  • Hey,


    So for my diploma in engineering i have an assignment to make a softwere/program using python to take a g-code from program Cura for 3d printing and translate it to Rapid code. What they ask is to download a vase from internet in STL file put that STL file in Cura that translates to G-code for 3d printing and then manipulate that code with python that translates to Rapid code. The ABB robot in our school has a welding arm and that arm wil 3d weld that vase. Any help will be welcome from you guys.

    I am more or less a newby for rapid programing or using python. I have a 3d printer so that i understand g code and functions in CURA.

  • Sounds more like an assignment for a programming degree rather than engineering(or your teacher wants this ability and has no idea how to do it.) The best place to start would be to create a known point (origin). Then track each Gcode as a point and a vector(90 degrees to the table). Python should record each Gcode as new position offset from the origin. From this data set it should then be possible using python to format to rapid(you will have to write this code) as "programmed offsets". From these you should be able to apply the perpendicular vector to run a "jtCalc" to create your "RobTargets". You will need to use the "Move C' quite a bit.


    Get a copy of the users manual that matches your controller model for the robot, get the rapid commands manual as well, from the manuals part of the this forum. Start studying the terms in quotes. I am no expert and am sure others will be better able to help out on the technical side on rapid things


    Remember that all the data you need is supplied or implied and that your problem is one of formatting. Good luck and keep us informed. If you can get it to work, I am sure there are people here that would be interested in seeing how you got it done.


    Good luck!

  • This is a very basic (motions only) converter I wrote for converting GCode to KUKA KRL code, years ago. Obviously, it won't work for ABB RAPID, but it wouldn't be too hard to alter the output syntax.


    One trick, though, is going to be GCodes that don't translate simply into robot actions. One of the biggest issues in turning a robot into a 3D printer, for example, is that the printer E axis values for extrusion don't really map to anything in the robot, unless your make your extruder an external robot axis for synchronized motion (probably the best approach).


    In your case, it's going to be the control of the welder current and wire-feed speed (I assume you're using a wire-fed MIG welder?). You're going to want to leverage the welding software the robot (probably) already has for translating the torch motion speed in realtime into analog outputs to the welder. That'll be your best bet for handling the accel/decel on corners and matching the wire feed to the robot speed.


    Another thing you'll probably have to handle is inserting the weld on/off commands at the correct points in the converter output. Again, the robot probably has built-in subroutines that can be called for this, but inserting the correct calls and parameters at the correct points in your converted program will be up to you.

Advertising from our partners