Developing Post Processors Mits 3015LVP & old Trumpf/Bosch

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 (3.35 KB)
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!

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:

   if leadinType ~= oldLeadin then
         oldLeadin = leadinType
         if leadinType == 2 then
            post.Text("G40\n")
         end
      end

Just to be sure, in OnInit add this:

   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.

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.

function OnPenDown()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
.. the rest of the code



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:

   minX = 100000
   minY = 100000
   maxX = -100000
   maxY = -100000

Now in OnMove and OnArc:

   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.

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

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.
MITS LC20 GRAAS_1-2.scpost (4.81 KB)
Trumpf L2503-C220 GRAAS_1-1.scpost (3.42 KB)

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.

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.

Sorry for the slow reply.

Hand edit is just to allow tuning at the machine - we can change laser parameters and offsets as needed on the floor with variables at the top of the program. Lets us adjust between machines or as the lasers’ moods change, haha.

I need to sit down and figure out those cool extra features like custom tool parameters and additional code snippets. Cool stuff!

Sheetcam has been doing great work the last few months. The only thing I miss are the extra controls for circular/tangent and parallel leads.