Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: lrgoodger on December 13, 2024, 03:39:16 PM

Title: Auto Tool Zero issue
Post by: lrgoodger on December 13, 2024, 03:39:16 PM
The Smooth Stepper folks are not responding, so I will try here.

I have encountered an unusual problem with Mach 3 and the ESS that I cannot get past.  I am trying to set up the Auto Tool Zero function and it isn't working correctly.  I suspect the issue lies within the visual basic code, but I know little to nothing about visual basic.

Here is what is happening.

I have a 6 foot length of 16 gauge wire connected to the ESS ground and the machine chassis.  I have another 6 foot piece connected to port 2 pin 13.

When on the Mach 3 diagnostic screen, the digitize indicator turns green whenever I touch the input wire to the machine chassis or ESS ground.

When I click the ATZ button, the Z axis begins its slow, downward motion.  If it touch the input wire to ESS ground, the axis stops and auto zeros properly.  If I touch the input wire to the chassis, the digitize input flag turns green but the Z axis does not stop. Its almost like there is some kind of aura around the chassis that is interfering with the signal.  I am an electrical engineer and have extensive experience troubleshooting these types of issues, but this one has me stumped.  I even unwrapped the 120 VAC power cord to the computer monitor from around the  mill swing arm in case the current was inducing voltage on the arm.

Now, here's the strange part.  If I touch the input wire directly to ESS ground pin. I can start and stop ATZ as many times as I want and it works every time, UNTIL I touch the input wire to the machine chassis at the other end of the 6 foot ground wire.  When I do that, it does not stop the Z axis (even though the digitize flag in Mach turns green).  Once I have touched to the chassis, I can no longer stop it by touching to the ESS ground.  It is like there is a flag getting set somewhere in software that I cannot reset until I reset Mach.  Once I reset, It works again every time I touch directly to ESS ground UNTIL I once again touch to the chassis and then it locks up again.

I don't know how to continue.  You guys got any ideas?
Title: Re: Auto Tool Zero issue
Post by: Tweakie.CNC on December 14, 2024, 12:14:32 AM
Quote
I have a 6 foot length of 16 gauge wire connected to the ESS ground and the machine chassis.  I have another 6 foot piece connected to port 2 pin 13.

My thoughts...

Good chance you are picking up electrical noise.
The 6 foot Probe input wire should be shielded (screened) with the screen connected to GND at one end only.
Treat Earth and GND as two seperate circuits.
Check for and eliminate any Earth loops.

Tweakie.
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 14, 2024, 04:22:46 AM
Noise was my first thought as well.  I measured for it in every way I could with the voltmeter.  Both AC and DC readings settled to zero at very, very low levels (but should have been solid zeros).  That is why I unwrapped the AC power cord from the swing arm.  The readings, as low as they were, would trickle down slowly kind of like when you try to measure a circuit that has capacitance in it.

What gets me is the digitize flag in Mach turns on and off without fail.  My thinking as a programmer is that if Mach can see that the input has changed, it should implement the Auto Tool Zero routine.  I am not understanding how that flag can change and the routine not work, and especially how touching a possibly noisy ground source can lock the routine out until Mach is reset.  It seems like there is something going on there at a deeper programming level, kind of like those Windows bugs that Microsoft denies exist, but they go away when they release a new update.

Your suggestion of using shielded  wire is a good one.  I will try that.

Thanks for responding.
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 14, 2024, 05:43:09 AM
OK, I tried the shielded wire.  I shielded both the ground wire and the input wire.  First I tried grounding the shield at the Smooth Stepper end and it made absolutely no difference.  On a whim, I reversed the wires so the shield was grounded at the machine end.  Again no difference.

As an electrical engineer, I have experience with assembly language programming of PIC and Motorola processors (not to mention many other computer languages), and circuit design of microprocessor based controllers (like the Smooth Stepper).  Everything in my 20+ year career as an engineer tells me this is a programming issue in Mach 3.  I don't understand what the physical difference in the electrical signal could be other than noise, but I am not having issues with any of the other I/O signals on the machine.  E-stop, motor controls, and even my home made tach circuit are working fine.

I shortened the wire to 4 feet hoping that might help a bit, but no joy.  The problem cannot be the Smooth Stepper because it sees the input change every time, as does Mach 3 (indicated by the digitize flag change).  The only thing that makes sense to me is that there is a software noise filter on the ATZ function that sets a 'no go' flag on the routine at a certain noise level.  This filter is not implemented on the digitize indicator flag, so it changes to green EVERY time.  However, as I said, if I touch the input to the machine chassis at any time, regardless of whether or how many times I have successfully auto zeroed by touching directly to the ESS ground terminal, it locks up the function and will not stop the Z axis downward travel until I reset Mach.  Then it works fine again as long as I touch the input directly to the ESS ground terminal.

By the way, if I disconnect the 4 foot ground wire from the machine chassis and touch the wires together, the ATZ works fine, even with unshielded wire.  It's just the machine chassis that is screwing up the signal.  I guess it's time to pull out the oscilloscope and look at the signal, but I will be surprised if it shows anything different at the two ends of the wires, especially the shielded ones.

This is a tough one.
Title: Re: Auto Tool Zero issue
Post by: Tweakie.CNC on December 14, 2024, 09:00:14 AM
Quote
Now, here's the strange part.  If I touch the input wire directly to ESS ground pin. I can start and stop ATZ as many times as I want and it works every time, UNTIL I touch the input wire to the machine chassis at the other end of the 6 foot ground wire.  When I do that, it does not stop the Z axis (even though the digitize flag in Mach turns green).  Once I have touched to the chassis, I can no longer stop it by touching to the ESS ground.

That sounds like there is a potential difference between one end of the 6 foot ground wire and the other end. If your multimeter can measure current I would be interested to hear if any current is flowing in that 6 foot wire.

Tweakie.
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 15, 2024, 05:54:03 PM
I've not had a chance to get back to this issue yet, but I was thinking it through logically and I realized what I said about a software noise filter in Mach cannot be true.  The only thing Mach knows is what the Smooth Stepper sends it over the ethernet link.  The ESS will have digital logic level inputs, so there will be a threshold voltage, generally about one volt on 5 volt logic.  The ess will have noise considerations, but the logic is either on or off in the end.  Since the digitize flag comes on without fail in Mach, the ESS is obviously detecting the ground input from the possibly noisy chassis of the machine.  The noise would possibly affect the ESS, but not Mach since Mach has no physical connection to the circuitry, only a datastream connection.  What on earth can Mach be seeing that is preventing it from running the ATZ function?  It obviously sees that the input has been triggerd because the digitize flag always turns green.
Title: Re: Auto Tool Zero issue
Post by: JohnHaine on December 16, 2024, 04:19:57 AM
I would have thought that the ESS will handle all the probing process internally since tha additional delay in the link would be fatal for accuracy.
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 16, 2024, 04:39:33 AM
That cannot be because Mach obviously has a standardized communication protocol that allows it to function with a variety of machine controllers.  I have used several.  Mach is configurable to use any input pin on the controller.  The controller has no way of knowing which pin you will select for that, but Mach knows because you select it in the Mach configuration.
Title: Re: Auto Tool Zero issue
Post by: JohnHaine on December 16, 2024, 06:23:09 AM
No, it's not standardised which is why each motion controller needs its own plugin!  If you think about what is happening in the probing process it is clear that any delay between the probe hitting the workpiece and the system telling the axis to start decelerating will cause a dimension error and potentially damage the probe.  The original Mach3 used the PP, or more than one, and allowed different pins to be allocated to given functions.  Probing worked by starting to decelerate when the probe signal was asserted and taking the axis reading when it had stopped moving.  With a Motion Controller, if the probe signal has to wait while it's queued to get across the serial protocol, then wait again for the decelerate command, during that delay the axis just carries on.

When motion controllers came along they essentially mirrored the parallel port so they could plug into a BoB instead of the parallel cable.  So part of the connection process between Mach and the MC is to tell the latter which pins are allocated to what.   But some time-critical functions need to be delegated to the controller to make sure they work properly.   
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 16, 2024, 07:18:27 AM
It's refreshing to meet someone who can knowledgeably talk about a subject like this.

My fist question was, how does the ESS know which pin I am going to select for the ATZ function?  Then it occurred to me that this is not a one way communication with the ESS sending data to Mach.  Apparently the ESS is querying Mach to find out which pin to send the ATZ data to.  That makes the can of worms deeper.

It means that even though the ESS is telling Mach the input status has changed, therefore causing Mach to set the digitize flag to green.  It must also, however, be telling Mach something more that is causing Mach not to process the ATZ command.  Perhaps the noise filter IS on the ESS.

I've got to get busy and figure out what is wrong with that ground signal.

What bugs me is when I first tried to use this function seveal years ago, it worked, but I think I was using that Chinese controller from Xulifeng at that time.  It apparently did not have as discriminating an input circuit as the ESS.

That Xulifeng controller worked fine, but the precision and sensitivity of the ESS on manual jog commands is far superior and worth the extra bucks.  I just did not anticipate a problem like this one popping up.
Title: Re: Auto Tool Zero issue
Post by: JohnHaine on December 16, 2024, 12:01:09 PM
I have never had sort of problem with the probe signal, either using Mach via the parallel port or more recently a UC100 motion controller.  It sounds very much like a grounding issue, and you must have a very long distance between the ESS and the machine to need a 6ft wire.  That would imply long cables to the steppers too perhaps?
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 16, 2024, 01:39:47 PM
Not long at all.  I went to 4" when I tried the shielded wire.  The 6" unshielded works if I use just the wire.  It is being connected to the machine chassis that it doesn't like.  I only have about 12" from the ESS to the nearest chassis point.  I can try that, but whatever it is about the chassis that is causing the problem will still be there.
Title: Re: Auto Tool Zero issue
Post by: JohnHaine on December 16, 2024, 05:51:48 PM
6"?  You said 6 ft in one of the first posts...
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 16, 2024, 06:13:17 PM
Oops! typo.  Yes, it was 6'.  There is nothing wrong with the wire.  It works over the 6' unless I connect the end of it to the chassis.  That does something to it.  I'm going to go out there an try putting a capacitor on the line.  That might settle any noise.
Title: Re: Auto Tool Zero issue
Post by: JohnHaine on December 17, 2024, 06:20:12 AM
From what I recall the ESS inputs have a 4k7pullup to +5V.  If there's a lot of noise around that could be marginal.  A 470R resistor from the input to +5V may improve things though when the probe is grounded it will take 10mA from the supply which ought not to be a problem.
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on December 17, 2024, 07:25:29 AM
I have made some progress on this issue this morning.  My findings are interesting.  The original 6' ground wire I used was 16 gauge stranded copper.  This morning I decided that if ATZ worked at the ESS terminal end of that wire, but not at the machine chassis end, then somewhere between those two points something was happening to the signal.  So I grabbed a piece of 16 gauge solid bare copper from my copper scrap bucket and connected it from the ESS to the chassis at the closest point, which was about 12" away.  It worked.  I was able to stop the Z axis with the ATZ input wire at any point on the chassis.

Not being one to just quit at that point because I like to understand what the heck is happening, I continued my investigation.  I grabbed a 16 gauge stranded bare copper 1" long and tried it.  It worked.  I pulled 3 hair fine strands off it and tried that.  It worked.  I went back to the original 6" copper insulated wire.  Won't work.  I stripped insulation off 12" of it and tried that.  It worked.  I tried 6' of bare 16 gauge copper.  works up to about 4' then gets flaky and won't work at 6' or on the chassis.  Then I cut 12" off the original 6' wire and tried that.  It works.

So, my conclusion is that the ESS has to see as pure a ground as it can get to work.  The slightest resistance in the wire connecting its ground to the chassis keeps it from working.  Don't know why.  It shouldn't, but it does.  At least I can use the function now.

What I don't understand is why the ESS and Mach lock out the ATZ function if there is not a solid ground at the ESS input.  It won't work again until Mach is reset.

Thanks guys for all your input and suggestions!
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on January 03, 2025, 01:51:25 PM
I'm still having trouble with this function.  I can sit at the mill and try it three times and get three different results, only one of which is correct.  Sometimes it works right.  Sometimes it will stop the quill downward travel but not retract to the height specified in the visual basic file.  And other times it will not stop at all and I have to hit reset.  I all three cases, the digitize LED in diagnostics comes on.  At that point it should always execute all of the visual basic file, but it does not.

I have downloaded Mach 4 to see if it will work with that.  Hopefully the demo version will allow that function to work.  If it does, I will probably buy the hobby version because I could use the ability to run larger files than the free version of Mach 3 allows.

My question right now is, how do I port the Mach 4 demo over to my mill computer?  It is not all contained in an exec file like Mach 3 was.  I don't have internet on the mill computer so I can't use the online downloader.
Title: Re: Auto Tool Zero issue
Post by: lrgoodger on January 03, 2025, 04:07:34 PM
Looks like Mach 4 hobby demo IS all in one file, so I think I'm all set.  I just put it on a flash drive and I'm taking it out to the mill to try installing it.  If it doesn't work, I will get back to you guys.