Modify Post processor to insert code

Having problems with or questions about SheetCam? Post them here.
Post Reply
larrydivesdry
Posts: 5
Joined: Wed Nov 02, 2016 5:46 pm

Modify Post processor to insert code

Post by larrydivesdry »

I recently added a low power red dot laser, for alignment purposes, to my 4x4 plasma table. The laser is offset by a couple of inches to the rear of the torch axis. I tried using a subroutine to align the torch to the point of the red dot at the beginning of the program but have been unsuccessful. But, what I don't know about CNC is scary. And I'm getting older so bare with me. I'm using Sheetcam of course and the Mach 3 with probe (scribe?)post processor.

I wanted the code to do 3 things. 1) Reset the work X and Y axis to 0.000 2) Next, offset the torch position to X -0.130 and Y 2.052 3) Once the torch moved to the new position, reset both the X & Y axis to 0.000.

This is the subroutine I was trying to use:
(Laser Offset)
G92 X 0.000 Y 0.000
G52 X -0.130 Y 2.052
G00 X0.000 Y0.000

So two questions. 1) why doesn't this work? 2) Is there a way to have the post processor incorporate this code into GCODE tap files?

Any help will be greatly appreciated.
jim1108
Posts: 74
Joined: Sat Oct 29, 2016 1:19 pm
Location: New Mexico, USA

Post by jim1108 »

Sounds like you need to use the code snippet feature. Refer to the post further down for more info. There are 3 ways to use it, and they work slightly differently. Editing start points by right clicking them is one way, inserting it directly into your operation list is another way, and adding it to your tool operation is another. It helps to know how g code works so you can post it and see the results and change if necessary.
User avatar
Les Newell
Site Admin
Posts: 3665
Joined: Thu May 11, 2006 8:12 pm

Post by Les Newell »

In Mach3 G92 and G52 use the same offset registers. A better solution could be:
G91 G0 X-0.130 Y2.052 (relative move so torch is now over where the laser dot was)
G90 G92 X0 Y0 (back to absolute, zero X and Y)

I would suggest using a code snippet for this. Create a code snippet 'tool' containing your code. Now use the g-code operation to insert this code at the start of the job.

If you will ALWAYS use the laser you could put this in your post processor but then you would have to change your post processor if you want to run a job without using the laser.
larrydivesdry
Posts: 5
Joined: Wed Nov 02, 2016 5:46 pm

Post by larrydivesdry »

Thank you both for your reply's. Using the code snippet feature does sound like something that will work for me and does provide flexibility if I do not use the red dot laser for alignment in every instance.

Les, your continued guidance is extremely helpful and much appreciated. The code you provided does help explain what I was seeing and what I as doing wrong code-wise.

Earlier I was checking out scanything and if I'm lucky, the USB microscope will slid into the holder I currently use for the red dot. Will need to look into that.

Thanks again.
Post Reply