Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Having problems with or questions about SheetCam? Post them here.
Post Reply
Bookmann
Posts: 4
Joined: Thu Apr 25, 2024 2:59 pm

Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Post by Bookmann »

Hey all, had a customer turn us on to SheetCam recently, we're working through the trial version and getting post processors figured out now. I was going to start this thread to pick brains and document the process for others who might find it useful.

Background: We're a laser shop in central KY, USA. Primarily O2 cutting carbon steel, but growing demand for N2, air, stainless, aluminum, and galvanneal. Parts are a mix of job-shop-style unique runs and build to stock/order recurring runs. We're programming & running Mitsubishi 4kW 3015LPV/LC20 and Trumpf 1.5-2.5kW L2503/Bosch C220 machines, with an Acra/Mits CNC mill & a CNC press brake for support ops (tap, chamfer, bend, etc.). We're coming from BobCAD v27 with roots back in BobCAD v21 & AutoCAD 2000. I got frustrated with BobCAD back in the v27 switch and we did a lot of work on the post processors in-house to get them where we wanted. No previous experience with Lua, but I can get by with variations of Basic and G-Code.

Situation: If I can get these posts lined out, we'll probably pick up a couple seats and move to SheetCAM full-time for CAM (heck, we've already transitioned to QCad for CAD). Still working through tutorials and wrapping my head around SheetCam, but the documentation is already loads better than what i was fighting with BobCAD. I already have a tweak of the existing Mitsubishi LC10 post about 80-90% of where we need to be, and was planning to start from the "Trumpf L250" post to get the old girls going. Was able to roughly replicate a Mits cutfile for a part yesterday (the Trumpf still has a ways to go).

Questions:
1.) Trying to figure out cutter comp - with all the various machines, materials, and parameters in the shop, it works best for us to fight offset at the machine. Les got me started with OnOffsetRight(/Left/None). Just basically turning it on is already getting workable code for the Mits lasers - they just need G41/G42 kicked on for the lead in. They don't mind kicking it off/none while rapiding to the next contour. For the Trumpfs I need to figure out how to insert a G40 on the lead out move, otherwise they get emotional and error out.
2.) Line numbering - I'm trying to figure out how to "N###" lines of code. Every line or only appended to the start of each feature/contour is fine. Memory is so limited on the Trumpfs that we're already only numbering the start of features. This lets us readily pick back up a partially cut part that was interrupted, and has saved our bacon (or at least scrap) repeatedly.
3.) Automatic stock usage - I'm trying to figure out how to automate accounting for the size of the cutfile - the post was already doing material size X & Y when I started with it, but that's for the stock, not the part (unless you use part CAD to define stock). This is a nice-to-have that would partially automate something that is currently a manual process in our workflow.

Here's what I've got so far:
MITS LC20 GRAAS_1-1.post
customeized post ver 1.1
(3.35 KiB) Downloaded 7 times
I'm also welcoming to any hints, tips, or suggestions y'all might have for someone new to SheetCam - be they for tweaking/building post processors, plugin recommendations, best practices, or ???. Seems like it offers a lot of capability for the money, and I don't even pretend to have my head fully wrapped around it, haha.

Thanks!
Production Manager @ Graas Mfg
User avatar
Les Newell
Site Admin
Posts: 3672
Joined: Thu May 11, 2006 8:12 pm

Re: Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Post by Les Newell »

Bookmann wrote: Thu Apr 25, 2024 4:40 pm Trying to figure out cutter comp - with all the various machines, materials, and parameters in the shop, it works best for us to fight offset at the machine. Les got me started with OnOffsetRight(/Left/None). Just basically turning it on is already getting workable code for the Mits lasers - they just need G41/G42 kicked on for the lead in. They don't mind kicking it off/none while rapiding to the next contour. For the Trumpfs I need to figure out how to insert a G40 on the lead out move, otherwise they get emotional and error out.
There are a couple of options. One would be to use a 'on lead out' path rule in SheetCam to output the G40.
Alternatively in the post there is the leadinType variable. This is set to the value 2 on a lead out. In function OnMove and OnArc you could add something like this:

Code: Select all

   if leadinType ~= oldLeadin then
         oldLeadin = leadinType
         if leadinType == 2 then
            post.Text("G40\n")
         end
      end
Just to be sure, in OnInit add this:

Code: Select all

   oldLeadin = 0
Either way it falls over for outlines without a lead out. As long as you can guarantee you'll always have a lead in and lead out you should be fine.
Bookmann wrote: Thu Apr 25, 2024 4:40 pm Line numbering - I'm trying to figure out how to "N###" lines of code. Every line or only appended to the start of each feature/contour is fine. Memory is so limited on the Trumpfs that we're already only numbering the start of features. This lets us readily pick back up a partially cut part that was interrupted, and has saved our bacon (or at least scrap) repeatedly.
At the moment you are using the OnNewLine event to output a line number for each line. You could remove that function and put the same code in OnPenDown() instead. That would only output a line number on each cut.

Code: Select all

function OnPenDown()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
.. the rest of the code
Bookmann wrote: Thu Apr 25, 2024 4:40 pm Automatic stock usage - I'm trying to figure out how to automate accounting for the size of the cutfile - the post was already doing material size X & Y when I started with it, but that's for the stock, not the part (unless you use part CAD to define stock). This is a nice-to-have that would partially automate something that is currently a manual process in our workflow.
Ah, that gets a bit more tricky. The job report shows this info but calculating it in the post is a bit of a pain. Something like this may help.
In OnInit initialize the extents:

Code: Select all

   minX = 100000
   minY = 100000
   maxX = -100000
   maxY = -100000
Now in OnMove and OnArc:

Code: Select all

   if endX > maxX then maxX = endX end
   if endX < minX then minX = endX end
   if endY > maxY then maxY = endY end
   if endY < minY then minY = endY end
Now in OnFinish you can use those min and max values to output the total area. Note that it won't be perfectly accurate because it doesn't take into account the bulge in arcs. If you are cutting big circles for instance it will probably be wildly inaccurate. Calculating the true extent of arcs is a pain.
Bookmann
Posts: 4
Joined: Thu Apr 25, 2024 2:59 pm

Re: Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Post by Bookmann »

Les:

Thanks for all the input! You've got us up and running with what look like fully functional post processors for our machines by the end of the day. I didn't expect to be rolling this fast - the software is ready to go before a new batch of parts has come around to exercise it!

We'll keep evaluating with some small parts and make sure everything is working as it should, got the trial with posts set up on the owners laptop as well so he can get his feet wet. I'll get with you over the next couple of weeks regarding single vs multiple licenses.

I'll follow-up with this thread next week regarding the updated post processors. We should have some production rolling out and hopefully some "live fire" testing of the code. If they're running I'll post them, along with any questions and tweaks that come up.

Regards,

Joey B
Production Manager @ Graas Mfg
Bookmann
Posts: 4
Joined: Thu Apr 25, 2024 2:59 pm

Re: Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Post by Bookmann »

Here are the updated posts for Mits 3015LVP/LC20 & Trumpf L2503/Bosch C220. Both allow cutter comp at the machines (G42/G40) setup with tool of 0.0" diameter.

Both assume a nominal hand edit to select laser parameters & variables at the top of the file. This is the same workflow as our existing CAD/CAM pipeline.

I was getting good looking code re-posting existing parts & manually comparing code. But we're a little slow, so they haven't done live cutting as yet. I'll try and keep this up-to-date as updates & tweaks roll in. Feel free to kick me to see if I'm awake or to check on updates.
Attachments
Trumpf L2503-C220 GRAAS_1-1.scpost
(3.42 KiB) Downloaded 5 times
MITS LC20 GRAAS_1-2.scpost
(4.81 KiB) Downloaded 3 times
Production Manager @ Graas Mfg
Bookmann
Posts: 4
Joined: Thu Apr 25, 2024 2:59 pm

Re: Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Post by Bookmann »

Update for any interested:

Got good parts out yesterday. We're still running on the trial, so just simple stuff, but the Mits controllers had no issues with the code.

Still adjusting to changes in workflow, but very pleased so far.
Production Manager @ Graas Mfg
User avatar
Les Newell
Site Admin
Posts: 3672
Joined: Thu May 11, 2006 8:12 pm

Re: Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

Post by Les Newell »

What extra parameters do you need to add by hand? It is possible to add extra parameters to your tool definitions if needed. Take a look at the post.DefineCustomToolParam documentation.
Post Reply