Hello Guest it is October 22, 2019, 08:17:30 AM

Author Topic: First post: Mach3 machine and workspace offsets, auto home, and auto tool offset  (Read 1800 times)

0 Members and 1 Guest are viewing this topic.

I have a small CNC mill and I'm stuck trying to navigate the whole offset thing. Here's what I'm trying to do:

I have a number of fixture plates, each set up to hold multiple copies of a particular part so that I can make five left handed skyhook brackets at a time, for instance. Only one fixture plate fits on the machine at one time.
Each plate has an x-y-z target that I can probe to locate the plate.

I'd like to locate the plate, and on each tool change, set Z offset relative to the plate.

My original approach was to auto-home the mill using the target on the current plate, so the machine coordinates match the plate coordinates. That works fine.

In the part program, I define a workspace coordinate system (G54, G55, etc.) for each part station on the plate. That also works fine.

However, when I change a tool and determine the new Z offset, that only applies to the current workspace. I can make a proper part in one workspace, but not in any of the others.

Is there a way to do Z axis tool offset and have it apply to all workspaces? Is there a better way of thinking about this?

Thanks for any help or insights.
Think of it this way. The Z offset is relative to the spindle, not the part and not the machine home position. So in order to 'share' the Z tool length you must use a tool length offset for every tool INCLUDING the tool used to pick up the part Z zero. If the tool length is enabled for that tool then using it to set the part Z zero for each work offset will work as you want.
Thanks. I'm also experimenting with G52 offset, which seems to apply to all workspaces. I set the G52 Z offset to zero, touch the target, then set a new G52 offset based on the reading. I *think* it works, but I need to test it more thoroughly.

What is G52 usually used for?

Online Tweakie.CNC

*
  • *
  •  7,956 7,956
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Please check out the Coordinate spaces pdf in the Members Documents section http://www.machsupport.com/forum/index.php/topic,33595.0.html
It will answer all your questions and create a few more of it's own.  :)

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.
Thanks. Based on a fair amount of reading and research, I was using a different individual workspace (G54, G55, etc.)for each fixture on the plate.

After reading this and thinking a bit more, it seems like it might make more sense to leave machine coordinates alone, use X-Y-Z tool offsets to establish the fixture plate location in the G54 workspace, and then use G52 offsets for each fixture on the plate. I'll try that today.

How are you generating your g-code?
How are you generating your g-code?

I'm creating 2D drawings with Draftsight. I use 'dxf2gcode' to generate the initial gcode. I then manually edit to fine-tune the results as needed.

I pass the initial Draftsight DXF through a simple homebrew post-processor that modifies the layer names to match what dxf2gcode wants to see - it is smart about how to handle a layer named 'DRILL:' for instance, and Draftsight doesn't allow special characters like ':' in layer names.

Offline RICH

*
  • *
  •  7,368 7,368
    • View Profile
Quote
I'm stuck trying to navigate the whole offset thing.
Is there a better way of thinking about this?

I would suggest that you use a single industrial recognized source to gain understanding of how to set up a machine and
programming techniques. One book that covers it all is Programming Handbook by Peter Smid. It will save you research
and reading time. Supplement the handbook with the mach manuals ( Mach4  agrees with Smid and is Fanuc  based
but Mach 3 has a similar / different dialect of code ).

Some info:
- Once the software controller "Mach" has the machines pyhsical location ( Machine Coordinate System) defined the it      
  can properly use defined  work / fixture offsets, tool offsets, and Gcode for CNC.

- Work Offsets ( Work Coordinate System ) / Fixture Offsets  
   There are many....in  Fanuc and Mach  there are six work offsets G54 to G59 and then the code changes for additional
    offsets namely in the form of G54.1 P( offset number ) but in Mach3 it's ( G59 P(offset number) ).  

    The work offset is a distance  from a machine coordinate  / home / referenced point to the Program zero.
    The program is the gcode instruction to do machining and has an origin / zero reference point.
     ? So what is you program zero  related to? Fixture location or the actual work pieces mounted on the fixture?
      So your thinking / how you setup / how you program can change depending on how you answer the questions.

Consider,
Five duplicate pieces located  on a fixture, and if multiple fixtures are used the fixture itself provides for repeatable
location of the pieces on the fixture and additioinaly the fixtures alll go to a repeatable location on the machine.
Thus only 4 work offsets required, G54, G55, G56, G57, G58 and they don't change from the referenced machine
coordinate.

Now if you deviate from the above, variable fixtures and or piece location then you make things more complicated
for no good reason. Rather than production mode you end up with doing multiple setups.

- G52 is a local offset from the current work offset. It proivdes for the ability to cancel the local offset and not affect the
  the current work offset. Additonaly it proivdes for convienience in programing. It was not meant as a replacement
  for the G5? work offsets. See the Smid book for details.

Frankly the only time I have used it is to provide a temporary offset so a tool could be adjusted for the pre-compensated
gcode from LazyTurn.

Times have changed and there are a lot of programs that produce good code at a reasonable price and inport dxf
drawings.May want to look into Cambam.

Consider using the master tool concept and providing for it.

RICH
Thanks, Rich. I'll look for the Peter Smid book. I think I started out following exactly your suggested route. I find machine zero (Ref All Home in Mach3).

I have fixture plates, each with multiple stations that are fixed relative to the plate.

I used G54, G55 etc. to specify the locations of each fixture relative to the plate. That didn't work, since each local workspace has to be defined by offsets from machine coordinates. Not a big problem - I know where the plate is in machine coordinates, so I can translate. I define G54 etc. relative to machine coordinates. So far, so good.

Now, I measure Z offset for a tool. That applies ONLY to the current coordinate system - G54, for example. Works great on the first fixture, but not so much when I switch to G55 for the next fixture.

An added wrinkle is that currently, my machine zero to plate offset isn't as repeatable as I'd like. I've considered probing the plate and setting machine coordinates based on the current plate. Cheating, I know, but I think it would work in this situation and eliminate one source of errors.
Clearly I need to do a bit more reading. Thanks again for the pointers.
Rather than spending time manipulating G-code and exploring the various methods you are looking at, you would, as Rich eludes, be better served by exploring different drafting and CAM techniques. Since you are using a rack method already you should model the rack, then duplicate the part you are machining in each of the rack spaces. At which point you can either remove the rack for CAM or leave it in if your CAM package allows you to do so. Once all of this is completed you should be able to optimize your tool changes so that the first operation will be completed on all parts with the first tool, no changes required. Once you load the second tool, the second operation on all parts will be completed, and so on and so forth. So even if you don't use a tool library with stored tool length offsets you are at a minimum reducing your tool changes and z-height settings to the number tools. That said, with a touch plate or even a light up touch block and some modifications to Mach 3 you can easily go to a tool library with stored tool length offsets and that will completely eliminate setting your offsets after that initial setup assuming you use repeatable length tool holders.

Obviously all of that is easier said than done, mainly you are looking at learning new CAD/CAM packages, but once through that learning curve the speed at which your production times will be a fraction of what they are now. My recommendation would be Fusion 360 (it's free for most) because the CAD is great and the integrated CAM is probably even better. That said, you understand your needs better than anybody so you'll have to do some shopping.