Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: MachBruce on August 26, 2008, 06:17:44 AM

Title: Auto Tool zero. Which Input etc. do I Use?
Post by: MachBruce on August 26, 2008, 06:17:44 AM
Hi,

The never ending saga of tool Tool zeroing!

I think I understand the macro posted elsewhere.

My questions are:
How and/or which pin do you wire the touch plate into the parallel port input.

How does the macro read the touch signal?

Is there somewhere I can find a how to it guide to setting up this common and popular feature in Mach3 mill. I know the videos explain (similar macros, but I cannot find a tutorial or guide on how to set up the hardware, screen buttons etc. to implement this common feature.
I am sure many starting out using Mach3 would welcome insight into how to easily do this. (There has been many posts on this and similar topics) I know it will encourage me to try other in house enhancement of my machine.

I appreciate any help on this post.

Thanks,


Bruce

(very keen Mach3 cnc-er)
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: jimpinder on August 26, 2008, 12:04:36 PM
If you look on the list of Ports and Pins/Input Pins then whatever pin you allocate to "Probe" is the one.

I haven't used this feature (yet) but I assume that if it is then "earthed" then movement on the aixis will stop.
I would try it and see. What I have seen of this is that the pin is connected to the pad. The tool (which should be earthed)comes down and touches the pad and the axis stops.

I can't really say much more - I am sure someone who uses it will comment.

Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: budman68 on August 26, 2008, 12:09:01 PM
Yes, Jim is correct but as for what exact pin you use depends on your setup. Depending on what BOB you use, the pins can be different from card to card or setup to setup so it's up to you to read your manual to find out what available input pins you can use.

Hope that helps-  :)
Dave
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Chaoticone on August 26, 2008, 01:41:43 PM
Yup, Jim is right. I use my probe input. I have a piece of printed circuit board with a wire soldered to one side of the copper clad. This is landed on the input I assigned my probe to. So, it is hot and my tool in my spindle is the ground that sinks the voltage on the printed circuit board to 0. The probe pin is set up as active low so when it sees the change from 5V to 0, Mach considers it made. Adding a VB button in screen 4 is not bad at all to do. Once you have that you can make code to do as you wish. I have posted my Auto tool touch off button code below.


'Auto Tool Touchoff

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness =0.059
ProbeFeed = 5


Code "G90 F" &ProbeFeed

If GetOemLed (825)=0 Then
Code "G4 P2" '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 Z0.25" '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   
     

Brett
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: MachBruce on August 26, 2008, 04:35:36 PM
Thankyou,

I will try the probe input tonight.

Another quickie: do you put the VB script "directly in the Button" or do you store the VB script as a Macro M********* and call the Macro M********* from the button?
If it can be stored as a Macro can you please tell me the correct VB code to call this Macro. Is it "Call M*********" I tried this and it has not worked for me- maybe the syntax is wrong?



Thanks again,

Bruce
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Chaoticone on August 26, 2008, 04:39:56 PM
In screen 4 you'll make it a vb button. When you open the screen from Mach, go to the top, operator, edit button script. At this point the button starts blinking. Click on it, paste the code in and save and exit.

Brett
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Greolt on August 26, 2008, 11:56:23 PM

Another quickie: do you put the VB script "directly in the Button" or do you store the VB script as a Macro M********* and call the Macro M********* from the button?



Bruce

If you want to use the zero script from more than one on screen button (Might have one on offsets page for example)

or you want to call it from a pendant, then it is smarter to have it in the macros folder and call it from the various buttons etc.

Any fine tuning you do to the script can be done in the one place instead of several.  Easily forgotten.  Don't ask how I know.   ;D

Greg
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: josh on August 27, 2008, 12:14:57 AM
interesting subject,
thats because I want to see if anyone can post pictures off how they went about doing the set up
I have no electronic skills so if anybody has time can you please post some pictures of your plate and
how its wire ,
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: MachBruce on August 27, 2008, 07:02:53 PM
Thanks Greg,

Still having trouble getting it sorted - it should be easy I know.

1. I have assigned the probe input to a Parallel port input.  eg. +5V on pin12 when in normal state.  The input from the touch plate will
    ground pin 12 and should make the probe input true.
2. Grounding pin 12 makes the led on the Diagnostic screen work OK . (so far so good)
3. The VB script has been installed into the "Auto Tool Zero Button" on the Program Run Screen
4.  Pressing the Auto tool Zero starts the Z axis moving down.  ( so far very good!)
5. Grounding Pin 12  does nothing! The Z just keep going down till it reaches the minimum value set in the VB Script (somethings amiss here - not very good!)

What line of VB code picks up the input from pin 12?

What code do I need to place into the Auto Tool Zero Button to "Call a Macro" instead of just running the VB Script directly from the button.


Thanks for all help.

I will post a little "How to" Tutorial when I overcome these problems that I am sure others have encountered.

Bruce,
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Greolt on August 27, 2008, 07:09:37 PM

2. Grounding pin 12 makes the led on the Diagnostic screen work OK . (so far so good)



Does the "Digitise" LED light up when you ground the touch plate?

The code to call a macro is simply    M615  or whatever the number is.

Greg
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: MachBruce on August 27, 2008, 11:20:27 PM
Thanks Greg,

The digitise led does light
 


Bruce


Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Greolt on August 28, 2008, 12:35:34 AM
Bruce

I ran Brett's macro on my machine and it works fine. 

Don't think the pause after the probe move (Code "G4 P0.25") is needed but it does not stop it working.

So I guess your problem may lie elsewhere.  Are you using LPT?    My SmoothStepper likes the macro to be a little different.

Also I found a gotcha in  Brett's macro.

If, starting a job, I jog down close to material and call the tool zero, it is likely to move the Z in the wrong direction as the Z DRO is already a negative number.

I don't like my machine doing anything I am not expecting.  :)    So my macro zeros the Z DRO before the probe move.

You can try this one of you like but if Brett's won't work then this probably won't make any difference to that.


CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = 1.5 'Z-plate thickness

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get probe in place
Code "G31Z-20 F100" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Sleep 20
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z20" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" ' this message goes in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
Exit Sub
End If
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Chaoticone on August 28, 2008, 07:07:19 AM
Bruce, What version of Mach are you running?  If it is 3.042.00* please go back to the previous version. 3.041 or earlier.

Brett
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: MachBruce on August 28, 2008, 07:45:41 AM
Brett: I am running Version R2.63


Greg: Your Code worked for me as VB script in the button But I still cant run it as a macro.
To try to run as a Macro,I  stored the VB script as M975 in the Mach3 Macro folder. I then used MachScreen to code the ATZ button ie. checked the VB script button, typed in M695, saved changes.
I then restarted Mach3 and pressed the ATZ button and it returns a error in line 1.

Bruce
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Hood on August 28, 2008, 08:25:07 AM
Brett: I am running Version R2.63


Greg: Your Code worked for me as VB script in the button But I still cant run it as a macro.
To try to run as a Macro,I  stored the VB script as M975 in the Mach3 Macro folder. I then used MachScreen to code the ATZ button ie. checked the VB script button, typed in M695, saved changes.
I then restarted Mach3 and pressed the ATZ button and it returns a error in line 1.

Bruce

If you are adding VB to a button to call a macro you will need to do it as follows
Code "M975"


Or whatever your macro number is , you have two different ones above ;)

Hood
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: MachBruce on August 28, 2008, 04:51:25 PM
Thankyou all for the assistance.
The use of VB script syntax is a little lacking at the moment. The Books i have looked at on VB all seemed to be aimed at the www of business application's.
Perhaps this could be a good topic for an "expert" to produce a small video tutorial on syntax and the common comands used for our purposes, for the Mach support site? It would certainly remove some of the mystery surrounding similar uses of VB for Mach.

Thanks,

Bruce
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Hood on August 28, 2008, 04:55:39 PM
VB is a complete mystery to me as well, there are bits and pieces dotted around in the customising manual and the Wiki. I also find looking at the VB in the wizards helps a lot in the understanding.
Hood
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Greolt on August 29, 2008, 01:18:36 AM


If you are adding VB to a button to call a macro you will need to do it as follows
Code "M975"


Ahh that was my fault.  Sorry about that Bruce.

I should check and not just go from the old memory.  ;D

Greg
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: SailFl on January 14, 2009, 08:51:04 AM
This may not be the correct place and there may be a thread that address my problem but I can not get the Auto Tool Zero Touch Plate to work.

This is my set up.

I am not using any screen in Mach.  I have added an LED to my touch plate.  I have 2.5 volts to power things.

I am using the code that is at the top of the thread.  Before I run the macro from my Shuttle Pro, I touch the plate to the router or bit and the LED lights and I can see on the Diagnostic page that a complete circuit has been made.

When I run the macro, the router is driven through the plate and wants to continue.  It does not stop. 

What am I doing wrong or what do I need to change.  it would seem to me that I should be able to hold the plate in the air and once the router has touched the plate, it would stop driving downwards and set the Z to zero and move upward to stop.

Help please.  If you need additonal information, let me know.

Thanks
 
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: softselect on January 14, 2009, 01:05:11 PM
Hi MachBruce
check this link it may help
http://www.machsupport.com/forum/index.php/topic,9934.0.html
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Greolt on January 14, 2009, 03:15:04 PM
This may not be the correct place and there may be a thread that address my problem but I can not get the Auto Tool Zero Touch Plate to work.

This is my set up.

I am not using any screen in Mach.  I have added an LED to my touch plate.  I have 2.5 volts to power things.

I am using the code that is at the top of the thread.  Before I run the macro from my Shuttle Pro, I touch the plate to the router or bit and the LED lights and I can see on the Diagnostic page that a complete circuit has been made.

When I run the macro, the router is driven through the plate and wants to continue.  It does not stop. 

What am I doing wrong or what do I need to change.  it would seem to me that I should be able to hold the plate in the air and once the router has touched the plate, it would stop driving downwards and set the Z to zero and move upward to stop.

Help please.  If you need additonal information, let me know.

Thanks
 

Sounds to me like either your "ports and pins" are set incorrect or the touch plate is not triggering a signal to Mach.

There is some potential for confusion with Mach's terminology.  On the diagnostics page the LED is called "digitise".    In "ports and pins" the input is called "probe"

If you are sure you have that setup correctly and Mach is seeing the probe input change state on tool touching the plate then try this,

enter G31 Z-5 F5 into the MDI and as the Z moves down activate the touch plate.  The Z move should stop when this happens.

If not then I strongly suspect that one of the aforementioned setup issues is in need of attention.

Greg
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: SailFl on January 14, 2009, 05:17:58 PM
Greg,

Thanks, I will try that and get back with you.

Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: Chaoticone on January 14, 2009, 09:19:14 PM
This link may help.

http://www.machsupport.com/forum/index.php/topic,10088.0.html

Brett
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: SailFl on January 18, 2009, 02:21:10 PM
Greg,

That was my problem.  I did not have the correct Input set up for Probe in Ports and Pins.  Once I fixed that the touch plate worked great.  I had to do a little adjusting to the height.

I have attached a pic of my plate.  I currently have an alligator clip that attaches to the bare wire that is above the LED.  I will most like attach that to the red wire and cut off the bare wire and the black one.

Thanks for your help.
Title: Re: Auto Tool zero. Which Input etc. do I Use?
Post by: john123 on March 21, 2009, 03:32:21 PM
Hello i also start with a zero tool but i am looking for a macro under one button that is doing two things first edge finding or centerfinding and then z-axe zeroing .
Who can help me with this i am from Holland so if the English isn't,t perfect sorry for it .
thanks John.M

www.cncworks.nl (http://www.cncworks.nl)