Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: monstrum on August 22, 2010, 06:14:05 PM

Title: Zeroing machine coordinates
Post by: monstrum on August 22, 2010, 06:14:05 PM
Hi,
I am quite new to all of this CNC-stuff, but I have successfully got my milling machine up and running and have run my very first program.

But, I have trouble with changing tools within the same program. I change tools manually, and I don't have any home-switches or means of detecting tool length.
So, the way I run a program now is:
Mount tool #1
Jog down until tool-tip touches table
Zero Z machine-coordinate
Jog to corner of work piece with tool-tip touching the top, which is my (0,0,0) in the CAM-program (and (0,0,0) in G54 fixture)
Run until next tool change
Mount tool #2
Jog down until tool-tip touches table
Zero Z machine-coordinate
Run rest of program

I plan to semi-automate the Z-zeroing using a switch later.

Anyway, all this works just fine. The problem is that I can not just press the ZeroZ-button to zero that coordinate (nothing happens). I must use the "REF ALL HOME", with auto-zero enabled only for Z. As I have no home-switches, the only effect is that Z is zeroed. This also means that to actually home the machine, I'll have to turn of the drivers, move to home, enable auto-zero for all axis, "REF ALL HOME" and turn on the drivers. Then I have to disable auto-zero for X and Y before doing the program run procedure above.
Sure, it's not very hard to do, but it would be much better if I could just click the ZeroZ-button and have it zero that machine coordinate (and not affecting the work piece coordinate system G54).

Is there a better way, or can I enable the ZeroZ-button, or could I perhaps do this with a script of some sort?

Regards
Alex
Title: Re: Zeroing machine coordinates
Post by: ger21 on August 22, 2010, 06:24:09 PM
Quote
Zero Z machine-coordinate

How are you doing this?

And why do you need to unplug the drives to Ref All Home? Without switches, the machine won't move.

I can zero my Z in G54 anytime, even as soon as I start mach3?

You should be able to just turn on the machine, click ref all home, then just set you G54 zero and work from there. When you change tools, just zero Z in G54. Not sure why your Z zero button isn't working??
Title: Re: Zeroing machine coordinates
Post by: Hood on August 22, 2010, 06:27:27 PM
Machine coords are how Mach keeps track of where it is.
The easiest way I can see for you is  to touch off your work with the first tool and zero the Z DRO, then jog to the side and touch off the table and take a note of the number. When you come to use the next tool just jog to the table then enter the value you previously noted into the DRO and you should be all set.
Hood
Title: Re: Zeroing machine coordinates
Post by: BR549 on August 22, 2010, 07:10:56 PM
You should be working in user coordinates not machine coordinates. Sounds like you are in machine coordinates if the zero axis button does not work.

Just a thought,(;-)
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 22, 2010, 07:26:10 PM
BR549: I am working in user coordinates, but I want to reference tool-tip touching table as machine Z=0

Let me explain better.
The G54 is no problem to zero or set to any value at any time. But, as I don't have home switches and still want the machine-coordinates to be accurate, I have to zero the machine manually. I do this by moving it to zero with the drivers turned off and then pressing ref all home (with auto-zero on x and y) to get the machine coordinates to zero. Now when I turn the driver on real position of the machine is the same as the machine coordinates.

Hood:
Yes, that is almost how I do it now. I would also touch off the second tool on the work-piece, but it's not always possible as the whole surface might be machined by a previous tool. Therefore, I use machine coordinate Z=0 when the tool-tip touches table.


Actually I think I found a solution by my self. SetMachZero(2) script-command seems be the equivalent off ZeroZ (for machine coordinate). Maybe mapping it to the Auto Tool Zero would make good use of that button.
Title: Re: Zeroing machine coordinates
Post by: Hood on August 22, 2010, 07:34:03 PM
Yes SetMachZero(2) will indeed do it, so will DoButton(24)

Still not clear why you are doing things the way you are but if it works for you then I suppose thats what counts :)
Hood
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 22, 2010, 07:39:16 PM
This way I don't have to enter any coordinates at all. I just have to jog the tool to table and press a button. Unless I have a Z-level which is not machine with a previous tool, then I can off course just zero the user coordinate touching off on the work-piece.
Title: Re: Zeroing machine coordinates
Post by: Hood on August 22, 2010, 07:42:00 PM
Major drawback I see is you will not be able to use Soft Limits.
Hood
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 22, 2010, 07:44:16 PM
Well, semi-true. The limit for max-Z will not be accurate, but the low-Z will make sure I don't slam the tool into the table. X and Y still works fine.
Title: Re: Zeroing machine coordinates
Post by: Hood on August 22, 2010, 07:47:05 PM
each to their own I suppose :)
Hood
Title: Re: Zeroing machine coordinates
Post by: ger21 on August 22, 2010, 08:33:04 PM
Quote
But, as I don't have home switches and still want the machine-coordinates to be accurate, I have to zero the machine manually

This has nothing to do with accuracy. What's the difference if the machine coordinate is 0 or 5.68754?? Your using G54 coordinates. Zero them, and your good to go.
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 22, 2010, 08:35:00 PM
If I zero the G54-coordinates I loose the reference for Z. I need the tool-tip of the G54 Z to be exactly the same after tool-change.
Title: Re: Zeroing machine coordinates
Post by: BR549 on August 22, 2010, 10:40:24 PM
The machine coords are just that coords for the machine to use to keep track of where it is at in 3d space. They are not there for you to use on a daily basis. and that is WHY you cannot zero them as you think you should(;-)

The user coorrds are what you use to do work.  Set up your machine and touch off Z zero it.   Then whatever you do after that tool wise that you simply change tool ,touch off rezero the z and you are done machine away.

You don't base tool height offsets from Machine coords Z0.000 you use the Coords base you are in at the time for example G54 or G56 or G55.

YOu might want to consider getting a good primer on cnc and gcode to get a good understanding about offsets and how they are used in CNC. It will save you a lot of hair pulling

Just a thought, (;-) TP
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 23, 2010, 05:23:55 AM
I know very well this is not how it's supposed to be done. The problem that I see is that I can not always touch off the second tool on the work piece as the surface might all have been machined off. But I guess the best would be to manually, or preferably by a script, be able to touch off each tool on the table or another fixed surface then have the G54 coordinate system update so that its Z=0 would be where the work piece surface would be.
Title: Re: Zeroing machine coordinates
Post by: RICH on August 23, 2010, 06:45:06 AM
You could use a planer gauge  as a Z =0 reference such that if you machined the original reference you still have a
reference to go back to. Actualy you can use anything as a reference since your manualy adjusting. Everynody works a
little differently.

RICH
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 23, 2010, 07:15:00 AM
But then the code have to be referenced to this gauge level also. I really like to use Z=0 in the CAM as the top of the work-piece. Then, no matter what fixture I use, the code will always be the same.

I think I should look into the offset functions a little more. Perhaps it can be automated so I touch off the first tool on the table, set the offset to zero. Then touch off on the work-piece, zeroing the G54. Then, after tool-change I can just touch off on the table and set the offset to the difference in machine Z. This would also work if I used some kind of pressure actuated switch for semi-automatic operation.
Title: Re: Zeroing machine coordinates
Post by: BR549 on August 23, 2010, 01:27:31 PM
The way I do with manual tool changes is touch off to the TOM(top of material) then set z zero. Now touch off on another spot on either the actual fixture if used OR the table top or some other permant spot. Then write down the number.

Then at next tool change change tool and touch off on the reference point and set the Z to the saved number.

BUT to each his own(;-) what ever works for you.

(;-) TP

Title: Re: Zeroing machine coordinates
Post by: monstrum on August 23, 2010, 02:37:41 PM
That sounds like a good way to do it. Now I just need to make a script so I don't have to manually enter any numbers. Should be possible. Anyway, thanks for your help.
Title: Re: Zeroing machine coordinates
Post by: monstrum on August 24, 2010, 04:34:45 AM
After some research of the vb-scripting, I put together something that actually worked very well. So now I have my machine coordinates set as they are, permanently. Basically, I added an unused M-code in the post-processor that gets run at the very start of the program. This runs a script in Mach3 that sets a gauge-level variable from the machine Z. Then, I mapped a button to another script that sets the current tool-offset to the difference in current machine Z and the previously stored gauge-level.

So, now all I do is move first tool to stock zero and zero fixture coordinates. Then I move to some table-related constant, either the surface or something else and start the program. Upon each tool change, fit the new tool, move it to the gauge-surface and press my custom button and continue the program.

So, this is effectively what BR549 suggested, but without having to write anything anywhere.

Thanks for your help guys!