Machsupport Forum

Mach Discussion => FAQs => Topic started by: Bush Flyer on December 26, 2013, 09:15:07 AM

Title: Zero tool height.
Post by: Bush Flyer on December 26, 2013, 09:15:07 AM
I'm having real trouble with setting the zero tool height.
I have followed a few threads here on machsupport forum and on you tube but still cannot get it to work correct can someone please help.
This is what I have first my breakout board is a HG07 and is wired as instructed with a 250 resistor, with the probe as port 1 pin 12 the E-Stop is on port 1 pin 15, this is as the instruction that came with the board and I have checked this with other instalment instruction that came with my stepper motor drivers.

My Mach 3 setup is in metric ( MM.)
The Machine touch plate is brass which is 0.80mm thick.

I first press enable button script next I press the Auto tool zero, this opens a Hidden script editor  window I paste this to the box.

Z zeroing macro by Scott Worden - Timber Lake Creations (and a little "Probe Var" tip from Brian ;-).

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = GetUserDRO(1151) 'You could put your z-plate thickness here instead
ProbeFeed = GetUserDRO(1152) 'You could put a probing feedrate here instead.

Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z2.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If

I save script when the box closes.
when I try to run the auto tool zero I get error no feed speed. and the Z axis vibrates up and down very quick.

I changed the
PlateThickness = GetUserDRO(1151) 'You could put your z-plate thickness here instead
to this PlateThickness = GetUserDRO(0.80) 'You could put your z-plate thickness here instead
and changed the
ProbeFeed = GetUserDRO(1152) 'You could put a probing feedrate here instead.
to this ProbeFeed = GetUserDRO(20) 'You could put a probing feedrate here instead.

Can someone tell me what I'm doing wrong. as This is a large learning curve for me, and I would like to understand it.
also could you please adjust the script to the correct values ie. Plate thickness and speed in metric.

Title: Re: Zero tool height.
Post by: ger21 on December 26, 2013, 09:49:11 AM
Use these instead, as you're doing it wrong.

PlateThickness = 0.8
ProbeFeed = 20
Title: Re: Zero tool height.
Post by: Bush Flyer on December 26, 2013, 10:30:10 AM
Hi ger21,
Thanks for the quick answer.
So instead of this line       PlateThickness = GetUserDRO(0.80) 'You could put your z-plate thickness here instead     
 All I should have is this.
 
PlateThickness = 0.8
and the same as the next line
Probefeed=20

Is this correct, I can delete all the rest of the two lines?
Title: Re: Zero tool height.
Post by: ger21 on December 26, 2013, 10:34:49 AM
Yes
Title: Re: Zero tool height.
Post by: Bush Flyer on December 27, 2013, 11:01:03 AM
Hi ger21,
Many thanks for your help I got it working this afternoon, Changed a couple of things set the  Probefeed = 100
Code "G31Z-5 F" &ProbeFeed is now changed to Code "G31Z-15 F" &ProbeFeed
and Code "G0 Z2.0" 'Change the Z retract height here is now changed to Code "G0 Z12.0" 'Change the Z retract height here

The only thing I'm not sure is when I lower the Z axis just off the work piece, I have to ZERO the Z before pressing the Auto Tool Zero to get it working correct, I just thought the script would automatically do this. Don't get me wrong I'm happy with the way it's working, it's just a question why and if there was a way to add this to the script.

Title: Re: Zero tool height.
Post by: ger21 on December 27, 2013, 11:38:38 AM
I don't have the code handy, but you want to check if your in G90 or G91 mode, then set to G91 mode, and after zeroing, set it back.
Since most people never run incremental code G91, It's probably safe to add
Code "G91" at the top, and Code "G90" at the bottom.
Title: Re: Zero tool height.
Post by: Bush Flyer on December 28, 2013, 05:12:34 AM
Many thanks for all your help and advice, That's another bit sorted.
Mike.
Title: Re: Zero tool height.
Post by: Eli on March 02, 2014, 04:05:27 PM
I set my machine for plasma and router. I also have a Z height problem. I know "0" about "G"code. I have a G540 with 4 outlets, 3 of which are used by limit switches and I need to Z the tool height and then set the edges of the starting corners. I'm 80 and have been working on my machine for 2 years. Two heart attacks and several strokes have not stopped me from cutting my first piece. I soldered a wire from my only open inlet to a flatened penny and ground the bit that when I make contact reads 1-12 but when I click on the flashing "auto tool zero", it reads not yet implementd. I hate to take the machine with me if it does not work.
Title: Re: Zero tool height.
Post by: Bush Flyer on March 03, 2014, 03:59:26 AM
Hi Eli,
This is the Easiest way to explain how to configure the input for the probe and to enable the button script. have a look at this youtube video its not mine but it did help me out. If this video does not help I can wright it out set by step the way  I set mine up.     http://www.youtube.com/watch?v=l5ijj_Gn2zw  
have a look. and see how you get on.
Title: Re: Zero tool height.
Post by: Eli on March 03, 2014, 11:39:18 AM
As a J3 flyer in 1958, thank you, even if it does not work. Eli
Title: Re: Zero tool height.
Post by: Eli on March 03, 2014, 02:30:32 PM
Hi Bush flyer. I have used that video before, that's where I kept getting "Not yet Implemented". I made some changes with the wiring to the limit switches and i got rid of the Not yet Implemented and now I get 4 lines of DoButton(24)  Now on the ststus bottom I get "error on line 1 "Argument Not optional."
                                                                         "          "  (23)
                                                                         "             (22)
                                                                         "             (25)
                                                                 DoOEMButton (133)
                                                      "                               (134)
                                                                                      (135) 
I'm not sure if I have a G540 problem or a Mach 3 problem. I bought a plug and play kiit thinking I would not have a problem with wires all over. The only wires I had to make was with the limit switches, which work fine.   Eli         
Title: Re: Zero tool height.
Post by: Eli on March 03, 2014, 03:03:40 PM
Hi Bush flyer. I have used that video before, that's where I kept getting "Not yet Implemented". I made some changes with the wiring to the limit switches and i got rid of the Not yet Implemented and now I get 4 lines of DoButton(24)  Now on the ststus bottom I get "error on line 1 "Argument Not optional."
                                                                         "          "  (23)
                                                                         "             (22)
                                                                         "             (25)
                                                                 DoOEMButton (133)
                                                      "                               (134)
                                                                                      (135) 
I'm not sure if I have a G540 problem or a Mach 3 problem. I bought a plug and play kiit thinking I would not have a problem with wires all over. The only wires I had to make was with the limit switches, which work fine.   Eli         
Title: Re: Zero tool height.
Post by: ger21 on March 03, 2014, 03:14:05 PM
You have to add the code to the button yourself. It would appear that you somehow copied some of the Ref All script into your auto zero button. You need to get an auto zero script.
Then go to Operator > Edit button script. Click on the auto zero button, and paste in your auto zero script. Then File >Save in the script editor.
Title: Re: Zero tool height.
Post by: Eli on March 04, 2014, 01:01:12 PM
Thank you Gerry. I copied one  and when my basement warms up I'll give it a shot. Eli
Title: Re: Zero tool height.
Post by: scoobystu on March 18, 2014, 07:20:59 PM
Mike,

I am in the same position you were a wee while ago. I am trying to figure out the zeroing procedure for my new router. Is there any chance that you could post the code you are using now for me to see? I would be really really grateful!

I am also looking to find out how I go about setting the machine up to implement tool changes. Also to return the gantry to the rear of the table when the job is finished so that I can remove and replace materials without the gantry getting in the way....

Any help would be appreciated.
Title: Re: Zero tool height.
Post by: ger21 on March 18, 2014, 10:03:17 PM
Mike,

I am in the same position you were a wee while ago. I am trying to figure out the zeroing procedure for my new router. Is there any chance that you could post the code you are using now for me to see? I would be really really grateful!

I am also looking to find out how I go about setting the machine up to implement tool changes. Also to return the gantry to the rear of the table when the job is finished so that I can remove and replace materials without the gantry getting in the way....

Any help would be appreciated.


My 2010 Screenset does all those things.
Title: Re: Zero tool height.
Post by: Bush Flyer on March 19, 2014, 04:30:34 AM
This is what I have as my script, it is set up as a metric script. you can change the plate to whatever thickness of plate you have.   After you have finished setting up auto tool zero and are testing it make sure the touch plate will stop the Z axis by touching the plate, with your clip before testing it by lowering to the work piece. Also when testing auto tool Z lower the Z axis to near the work piece, then zero the Z axis before you press the auto tool zero, if the Z axis travels in the wrong direction you may have forgot to zero the Z axis I got caught out with this when I first tried it.
I am pretty sure this is how I have the script, but I will check later on today. Hope this helps.


Z zeroing macro by Scott Worden - Timber Lake Creations (and a little "Probe Var" tip from Brian ;-).

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = 0.80
ProbeFeed = 100

Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-15 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z12.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If
Title: Re: Zero tool height.
Post by: Bush Flyer on March 19, 2014, 12:47:03 PM
I have just copied  the script straight from my Mach3. The thickness of my brass plate was changed to 0.63  that is where you put in the thickness of your plate. I hope this helps if not I will try to help as much as I can. Just now I am learning all about chip load there's lots to learn.  Let me know how you get on.
Mike.


CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = 0.63
ProbeFeed = 100

Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P5" 'Time to get to the z-plate
Code "G31Z-15 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z12.0" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If 


Title: Re: Zero tool height.
Post by: scoobystu on March 19, 2014, 06:57:09 PM
Hi Mike,

Thanks for that, much appreciated. I will give it a go tomorrow. I found a document on the onsrud website that was pretty good with regard to chip calculations. I could be completely wrong on this as I have just started as well but it seemed to make sense. I see you are in Elgin, just up the road!

Ger, I like your screen it is much cleaner. I think I will be making a purchase. When watching your youtube video I noticed you have two touchplates. I take it you can just use one with your Z zero function.

Thanks, Stu
Title: Re: Zero tool height.
Post by: ger21 on March 19, 2014, 10:12:31 PM
For single tool auto zeroing, you only need to use one. The second plate is required to do automatic auto zeroing during a tool change.
Title: Re: Zero tool height.
Post by: scoobystu on March 20, 2014, 05:54:29 PM
I tried running the script today. Bit of brief history here, I purchased this CNC and am trying to set up the mach 3 myself. Whenever I tried to use the remote control that has a probe macro whenever the tool hit the plate it gave an e-stop.

I put the code in for the Auto tool zero to try it from Mach3 screen. The code half worked and it registered that the touch plate is 12.0mm thick (which it is) once. Ever since then it is just giving an e-stop message. I tried an auto pin check to see if I had the right pin allocated for the probe as I was told to set it to pin 7 by the manufacturer. Mach thinks it should be 10. I checked to see what else was allocated to pin 10 and of course it is the e-stop. So can I sort this via the software or will I have to change a wire position in the break out board or elsewhere? I have a feeling that the probe and all the limit switches are wired together. Is this the correct configuration?

I tried to find out via the Mach manual but I am struggling a bit if I am being honest.
Title: Re: Zero tool height.
Post by: ger21 on March 20, 2014, 06:00:54 PM
You just go into Config > Ports and Pins, and assign the proper pin #s to trhe inputs you're using. You shouldn't have to move any wires.

But, you can't have the limits and probe on the same input. You'd trip the limits when the probe activated. The Probe needs to be on it's own pin.
Title: Re: Zero tool height.
Post by: scoobystu on March 20, 2014, 06:16:42 PM
Thanks Ger, I will put it back to pin 7 then. I was getting an e-stop when using pin 7 as well which is why I ran the automatic pin check. I suppose it makes sense that it would find pin 10 having re-read the manual and that all the limit switches can be wired together. I must be missing something in my settings. Finding the problem is the problem!

Would having it at active high / active low make a difference?
Title: Re: Zero tool height.
Post by: ger21 on March 20, 2014, 06:22:50 PM
The Probe won't work on Pin 7. If you look at the bottom of the Input Pins page, it says that you can only use pins #10-13, and #15.
Pin #7 id output only.

And yes, active high low makes a difference.
Title: Re: Zero tool height.
Post by: scoobystu on March 20, 2014, 06:59:17 PM
You make a good point, that did not occur to me as I was blindly following instructions. So if the software finds pin 10 for the touch probe but I can't use it as the other limits are on it how do I choose the correct pin...?

I am so close to getting this thing working it is driving me mental!
Title: Re: Zero tool height.
Post by: ger21 on March 20, 2014, 07:01:46 PM
You need to move the touch plate (or limits) to another pin.
Title: Re: Zero tool height.
Post by: scoobystu on March 20, 2014, 07:07:31 PM
So I can just check which pins are not already allocated and select a free one (provided it is in the range given for inputs)?
Title: Re: Zero tool height.
Post by: ger21 on March 20, 2014, 07:16:57 PM
Yes.
Title: Re: Zero tool height.
Post by: Eli on March 27, 2014, 01:16:36 PM
I notice that when I watch other videos zero in, when the grounded bit touches the positive plate, the bit stops and rises 1 inch and stops again.
On my diagnostics (Alt 7) section, one of the center top of port 1 pins remains lit until i lower the the grounded bit to the positive plate then the light goes out but router keeps going down until the limit switch is activated. Prior to testing the zeroing, the probe was automated set to 1-13 the only free space with out a problem. Any help will be  appreciated. Eli
Title: Re: Zero tool height.
Post by: Bush Flyer on March 31, 2014, 06:14:54 AM
Hi Eli,
This is the different script that I found online that was working with a G540. I have sent it as a PDF so that you can print it out. I also have found the manual for your G540 which didn't help much about Z Height.
Sorry I'm not much help.  You really need someone that has a lot more knowledge.
I will always Try to help but am just learning myself.  Please see my PM to you.
Title: Re: Zero tool height.
Post by: Eli on March 31, 2014, 06:02:32 PM
thank you for your concern and advise. I will send you pictures of where i am at this point. The G540 has 4 inputs, 3 are taken with NC limit switches and the last in put is being used to set the Zero which is NO until the bit touches the copper coin and sets my only open number which is 12. I'll send pictures to make things clearer.Eli