Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: BOGIE on June 20, 2010, 05:55:45 AM

Title: auto Z setter adjusting
Post by: BOGIE on June 20, 2010, 05:55:45 AM
I have noticed that auto z setting is not accurate on our router.  In the near future plans are to to do some engraving so z tolerance. will be very important.  How do I go about correcting this.  Is there a setting that can be adjusted in the program and if so where is it.  We now use a .125 plate and it seems to be off about .0100.  This hasn't been a problem since any work we did was not critical on the Z. Any help would be a blessing, thanks in advance.
Title: Re: auto Z setter adjusting
Post by: Tweakie.CNC on June 20, 2010, 06:39:29 AM
Hi Bogie,

There have been many changes to the Auto Tool Zero macro in recent months in the light of problems that were experienced by some users.
My latest version is attached and as it is commented and if you wish to use it you should be able to change the parameters to suit your application. Alternately by comparison you should be able to see where to modify your existing macro to correct for your error.

Hope this helps,

Tweakie.
Title: Re: auto Z setter adjusting
Post by: GeorgeRace on June 20, 2010, 08:32:44 AM
Attached is the Z Zero code that I am using.  It automatically detects if you are running Imperial or Metric.  It does a double touch, to assure exact touch point.  It is always accurate within .001 and very repeatable.

Code was originally written by BigTEX with modifications that I added a couple of months or so back.

Also make sure you are using the "locked down" version of Mach3 as well.

One last thing to check.  Under Config/General Configuration I have to make the Debounce Interval and Index both at 5000 or a bit higher to make sure there is no noise being detected which will upset the Z Zero point as well.

Hopefully one of these things will help you overcome your accuracy problem with your Z Touch routine.

George
Title: Re: auto Z setter adjusting
Post by: BOGIE on June 20, 2010, 12:28:46 PM
How do I use this ?  It seems it is a txt file and I would use it as if it were a G code program file.  Am I correct?
Title: Re: auto Z setter adjusting
Post by: Tweakie.CNC on June 20, 2010, 12:39:38 PM
Hi Bogie,

No you are not correct - They are VB code and must be put into the 'Auto Zero Button' on the Mach screen.

Within Mach click:-  Operator / Edit Button Script - (the VB buttons will flash) then click on the Auto Tool Zero button - your macro will be in there and that is where you make the corrections etc (don't forget to save it).

Tweakie.
Title: Re: auto Z setter adjusting
Post by: BOGIE on June 20, 2010, 12:44:26 PM
Do I just copy this file to that area and over write what's their.
Title: Re: auto Z setter adjusting
Post by: Tweakie.CNC on June 20, 2010, 12:50:38 PM
Hi Bogie,

I suggest you make a copy of what is there already and save it for safety.
Look at my macro and see where the changes have to be made to suite your machine (all units in my macro are metric - change them to inch units if that is what you require). You will certainly want to change the plate thickness.
Then copy and past it into the button - you can always make corrections as you test it but do not use a good cutter for testing just in case things go pear shaped  ;)

Tweakie.

btw. If you post a copy of your existing macro I will look at it and suggest what changes are needed to correct your error.
Title: Re: auto Z setter adjusting
Post by: GeorgeRace on June 20, 2010, 12:59:48 PM
Hi BOGIE:
If you are using my Z Zero routine there is some additional information you need to set your Z Axis height after the touch.

In the code look for "ZNew = Plate Offset + .937  This is in the Imperial section at the top of page.

You will need to change the number .937 to compensate for the touch plate thickness and your new Z height after the touch.

Here is how it works.
My touch plate is .063 thick.  I wanted to withdraw the Z Axis to 1 inch above the work surface.  I subtracted .063 from 1 inch, the result, .937 goes in the line of code.

So to set your final Z height after touch, subtract your touch plate height from the final height you want Z to go to and put that number in the "ZNew" line in the VB Code.

As my routine does both Imperial and Metric in the same routine, for Metric you need to go down further in the program and do the same calculations, using Metric numbers, in place of the "20" shown there now.

Hope this helps,
George
Title: Re: auto Z setter adjusting
Post by: Greolt on June 20, 2010, 05:03:47 PM


 Under Config/General Configuration I have to make the Debounce Interval and Index both at 5000 or a bit higher to make sure there is no noise being detected which will upset the Z Zero point as well.

Just for your info George,

Debounce setting has no direct bearing on the probe input.

Greg
Title: Re: auto Z setter adjusting
Post by: Ya-Nvr-No on June 20, 2010, 05:42:27 PM
Does debounce come into use only if he is using a micro switch to detect instead of completing a circuit by shorting an input?
Title: Re: auto Z setter adjusting
Post by: Greolt on June 20, 2010, 08:18:23 PM
Does debounce come into use only if he is using a micro switch to detect instead of completing a circuit by shorting an input?

It does not make any difference to the debounce setting in general config, what method is used to change the active state of an input.

Index has its own separate debouce setting, but all other inputs EXCEPT probe, are grouped together under the debounce setting.

In older versions of Mach, probe was included in that group, but was removed about two years ago.

Greg
Title: Re: auto Z setter adjusting
Post by: Ya-Nvr-No on June 20, 2010, 08:55:08 PM
So adding a capacitor across the contacts is the only way to control the responsiveness?

Thanks for the explanation on the probe exception.
Title: Re: auto Z setter adjusting
Post by: Greolt on June 20, 2010, 09:18:24 PM
Just for your info,

On my setup all I need to stop any noise affecting the probe input, is a pullup resistor.

Every setup will be different.

Greg
Title: Re: auto Z setter adjusting
Post by: BOGIE on June 21, 2010, 07:26:46 AM
Here is a copy of my file


REM Zzero plate macro
Code"( Setting Z Axis zero)"
If IsSuchSignal (22) Then
code "g20 g31 G90 z-8 f10"
While IsMoving()
Wend

code"g0"
code "G4 p0.5"
code "G92Z0.182"  ' 0.182 = Enter Metal Plate thickness
code"g0"
While IsMoving()
Wend

code "(Moving to safe Z )"
code"g53 g00 1 z0 f 150"
code "( Z Axis has been zeroed )"
End If
   
Title: Re: auto Z setter adjusting
Post by: BOGIE on June 21, 2010, 07:29:50 AM
Additionally my plate is not .125 it is actually .183"
Title: Re: auto Z setter adjusting
Post by: BOGIE on June 21, 2010, 08:14:24 AM
Did some testing this morning and found that when I z auto z set the machine it seems that it repeats very well and the setting is off the same each time so If I correct the plate size in file to compensate where enter metal plat thickness this should correct the problem.  The "G92Z0.182" would become "G92Z0.192" I appreciate all the input from everyone.  I'm not real up on changing things I know nothing about but with all the suggestions I'm learning
Thanks to all

Bogie
Title: Re: auto Z setter adjusting
Post by: Tweakie.CNC on June 21, 2010, 08:17:36 AM
Quote
The "G92Z0.182" would become "G92Z0.192"

Sounds like the best solution to me - simplicity is best  ;)

Tweakie.
Title: Re: auto Z setter adjusting
Post by: BOGIE on June 21, 2010, 09:57:40 AM
Made the adjustment to file and seems that the problem is solved.  I just cant understand why the plate thickness had to be modified but after auto Z setting several times and MDI to a Z height of .001" I check it with a feeler and I'm pretty darn close.

Again thanks for all the help I had no idea where to start.
Title: Re: auto Z setter adjusting
Post by: GeorgeRace on June 21, 2010, 01:37:15 PM
Does debounce come into use only if he is using a micro switch to detect instead of completing a circuit by shorting an input?

It does not make any difference to the debounce setting in general config, what method is used to change the active state of an input.

Index has its own separate debouce setting, but all other inputs EXCEPT probe, are grouped together under the debounce setting.

In older versions of Mach, probe was included in that group, but was removed about two years ago.

Greg

One of the things I really like about this group is the knowledge that is just out there waiting to be shared.  Greg's comment set me off in a new direction to find out what was really happening with my touch plate hookup.

When I did my initial hookup of the touch plate, I had an intermittent problem where sometimes it worked, and for no apparent reason sometimes it would stop short of the touch plate.  I tried everything I could to figure out what was causing the problem.  I knew it was not the VB routine so it had to be more on the electromechanical side of things.  At that time I noticed the debounce setting, and setting it to 5000 seemed to solve my problem.  Notice I said SEEMED, but I remember even after doing that occasionally it would still fail, stopping short of the touch plate, but it seemed a lot less than it was.

Next I looked at the electronics.  I was using pin 10 for the probe lead.  It had a 10K pull up resistor to the +5 volt line.  To assure a clean signal to the pin, I installed a .1mfd and 10mfd miniature capacitors between pin 10 and ground.  From that time on I have not had even one time where the zero touch did not work exactly as expected.

So today armed with the fact that debounce had nothing to do with solving my problem I tried several other things to see what was REALLY happening.  First, I set the debounce to 0 in both columns.  Ran the touch probe routine about 20 times, worked perfect every time!  Tried homing the mill and WOW, it stopped before getting to the home switches.  Tried several times with the same results, always stopping in a different place, but not home every time.  Setting the debounce to 2000 solved the problem, homed perfectly every time.  My conclusion, there must be something being detected by the X, Y, and Z pins that was not a home switch closure.

Next, just to find out what would happen, I unsolder-ed one end of both the .1mfd and 10 mfd capacitors on pin 10.  Immediately my Z touch routine failed just about every other time.  Putting them back into the circuit again restored the touch plate operation, perfect every time!

Next I took a small service Oscilloscope to the shop.  Looking at the X, Y, and Z pins in my controller I was really surprised to find a constant hash riding on the pin anytime I moved any axis. The "hash" was about one half the voltage level of the DC pull up voltage on the wire.   For some reason the X axis seemed to be the worse.  Every now and then there was a larger spike that looked like it was the same amplitude as the DC pull up voltage on the wire.  It was a very narrow pules, but never the less it was there, I surmise that by setting the debounce time it was wide enough so that the pulses were not seen.   So nothing was happening until it got to the home switch which provided a nice solid ground and stopped the mill.

Next I installed a .1mfd and 10mfd capacitor in the controller box at the X, Y, and Z port pins.  Now looking at the pins with the scope, nice and clean, only a solid steady 5 volt DC line showing.  I set the debounce to 0 again and the mill homed perfectly every time.   Had my controller been provided with those noise suppressing capacitors I would not ever seen any false triggering on any of the axis at any time.

Yes, I am using shielded wire to all the devices and stepper motors.  All shields are grounded at the controller end.  I also have a nice heavy ground lead that is separately run between  the mill frame and the controller power cord ground terminal, which is grounded to the power supply ground terminal.

Hopefully this will help someone else solve some of their intermittent problems.  I guess that my controller is very susceptible to noise being generated within the electronics that drive the stepper motors.  Probably some of the more expensive commercial systems do not have this problem.  My controller is a very nice one that I built up from a kit and really has worked very well for over 2 years now.  Adding the noise suppression capacitors on the port pins seems to have really settled my mill controller down.

George




Title: Re: auto Z setter adjusting
Post by: Tweakie.CNC on June 21, 2010, 01:51:12 PM
Hi George,

Did you place the 0.1uf and 10uf capacitors on both the step and direction pins for each axis ?

Tweakie.

(My apologies to Bogie for hijacking his thread).
Title: Re: auto Z setter adjusting
Post by: GeorgeRace on June 21, 2010, 05:30:49 PM
Hi Tweakie:

I probably did not make it clear where I put the noise suppression.  No, not on the Step and Direction Pins!

My controller has a wire lead header, on the PCB, where you hook the leads from the EStop, Probe, and X, Y, and Z home switches.  Those are the pins that I added the capacitors to.  My EStop is on 15, my Probe is on 10, My X Switch is on 11, my Y Switch is on 12, my Z Switch is on 13.  

Those are all input pins to my controller and are all pulled high with a 10K on board resistor.  It was those wires that I saw all the noise on in the ungrounded condition.

You would think that the low impedance of the 5 VDC Power Supply would be enough to suppress any spikes on the lines, but the 10K pull up resistor raises that impedance and allows the noise to ride along on the wires between the open home switches and my controller.  I have all the wires in a bundle that runs around the machine and go as a group to the controller box.  

Incidentally, I noticed that I DID NOT use shielded wire to the three Home Switches.  That is probably why they are picking up the pulse noise from the motor drive wires.  Same thing on my wire to the Touch Probe.  But I DID use shielded wire to all the stepper motors.  I would bet that if I were to change all the Home Switch and Probe wires to shielded I probably would not have had any noise problems at all.

When operating the mill, the stepper motors are being driven by some pretty high current square waves.  It is easy to understand how much harmonic energy that must be riding up an down the motor leads.  I know that it is impossible to listen to an AM radio in the same area as the mill when it is in operation.

If I get around to it one of these days, I will redo all the wires, using shielded on everything.  I would also separate the input wires from the stepper drive cables, running each in separate bundles.

This stuff is always fun for me to explore.  Hopefully this was a help.

Incidentally, I love your picture.  A flying cat!  I am an airplane pilot and we have three black cats here in the house.

George
Title: Re: auto Z setter adjusting
Post by: Tweakie.CNC on June 22, 2010, 02:06:22 AM
Hi George,

Thank you for the detailed explanation for the position of the filter caps - I understand now.
(you should have known better and used shielded wire for your switches  ;D)

I spent over an hour browsing the wonderful pictures of your excellent Zenith build. I think if I had spent 3 years on it I could never have parted with N73EX.

Best regards,

Tweakie.