Programming paths for (stud) welding

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
luminize
Posts: 6
Joined: Fri Nov 01, 2019 7:44 pm

Programming paths for (stud) welding

Post by luminize »

Hi Developers,

I'm looking at problem concerning stud welding programming. I recently got asked if I knew how to speed up the process of getting an industrial robot programmed quickly. This is a workcell where a Panasonic robot welds studs on a sheet metal casing. The sheet metal case is clamped on a "4th axis", and can rotate +/- 90 degrees to bring the sides of the casing in a horizontal orientation for the welding.

here's an example I made to give you an idea
2019-11-01 21_30_14-FreeCAD 0.18.png
2019-11-01 21_30_14-FreeCAD 0.18.png (61.04 KiB) Viewed 789 times
Programming is done by a proprietary program from Panasonic, called DTPS, and it's taking a lot of grunt to program the positions of the studs (180 pcs on one side). This production facility manufactures low volume high mix parts. So same type of products, but a lot of varying sizes.

The process now consists of an engineer opening a STEP file in a CAD program, converting the studs to a thumbnail pin model, saving the entire model as VRML (mesh). Then, the robot programmer imports the VRML model, and has to select a vertex on the thumbnail pin so the proprietary program knows the position the tool has to travel to. Times 2 actually, because after the welding, the robot has to move straight op because the stud is in the clamp.
It's a shame really the convoluted way these relative simple operations are programmed.

Yesterday evening I've played around with FreeCAD a bit, and it seems that traversing the attributes list (after importing the STEP file) will quickly give me all the stud positions. If I can come to a solution where I can generate a path for positioning all these studs (different types) then it would enormously simplify the workflow. Being able to work from the original data.

So I guess my question to you developers is:
What are the best steps to approach this problem. If I can contribute something to an open source project I'd be happy to do just that. I have programming experience and Python is not a problem. However I dread diving headlong into a codebase I'm not familiar with at all, or do not know the design considerations / best practises. I guess I'm trying to limit this to a certain scope so I can decide if this is something within my abilities and time.

Summarized, the way I see a working solution is like so:
  • load the STEP model
  • define an axis (4th axis) in relation to the imported STEP assembly
  • be able to define which side is op (4th axis rotation)
  • select a plane to touch off heigh
  • select a hole/cylinder to touch off by probe (the center will be the starting point for the probing routine)
  • Automatically select studs by name
  • move studs around in a list, so the order can be changed
  • per stud, define some offsets, like approach above a plane, so an initial gap is between stud and sheet metal case, and travel so the stud is out of the clamp before moving on.
  • output the tasks to an ASCII type file which can be further processed.
Any pointers to workflows on how to program this would be highly appreciated. Just so you'd know, I do not expect you to solve this for me, I'm perfectly fine doing leg work and asking questions. Just trying to get a sense what I'm getting myself into.

Thank you for reading this far :)
Best,
Bas
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Programming paths for (stud) welding

Post by mlampert »

Interesting problem.

You probably want to have a look at PathDrilling.py and PathCircularHoleBase.py. The latter has a function called "findHoles(..)" note that it discards anything that is not a pocket - you want to change that to return the studs.
As a result you get back a list of tuples - you can then use each tuple as input to "holePosition()" and "holeDiameter()" to get the parameters for each individual hole - sorry, stud.

This assumes that you have a Part - so you might have to look into converting your mesh into an object which can be done by the Part workbench.

PathDrilling.py is a simple example in how to use PathCircularHoleBase. There is currently an automated sorting function, from the sounds of it you want to not do that.

Note that drilling does support a 4th axis if you enable it in the Job settings.
luminize
Posts: 6
Joined: Fri Nov 01, 2019 7:44 pm

Re: Programming paths for (stud) welding

Post by luminize »

Thanks for the pointers.
Looking thru those files, I'm a bit lost. I'm a top-down guy :)

Where does everything start. When are those scripts called? I guess I'm looking for an overview.
Consider me a FreeCAD dev noob, when I click on a button to add a new job. Where does that happen. What happens afterwards? I can follow the breadcrumbs downwards a bit easier I think.

Regarding the part, What I do is to create a new part, and import a STEP model. I've just been playing around with creating jobs for holes and selecting by hand I can create some paths with the 4th axis. Although these did not get selected automatically (couldn't find the button if there is one) Does that work only on native FreeCAD created holes?
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Programming paths for (stud) welding

Post by mlampert »

You either call those scripts (Create) directly in the python console, or you'll have to create menu and/or toolbar entry for a new op to become available through the UI. Unfortunately there's currently little documentation for the latter - although I think sliptonic has a guide on his github wiki.

As for the STL, you'll need to convert that into a "Solid" before Path can make sense of it. Check the "Part" workbench menu, there's a tool to convert. Once you have the solid as a model for the Job in the Drilling task panel is a "Reset" button which looks for all holes and adds the one it finds (if you have a better name for "Reset" - by all means, it's been criticised before).

I'm volunteering the whole day today so won't be online for the next 9 hours, will check in afterwards again.
luminize
Posts: 6
Joined: Fri Nov 01, 2019 7:44 pm

Re: Programming paths for (stud) welding

Post by luminize »

Thx,
The STL is not around. I directly import a STEP file and work on that.
Post Reply