Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Tarak on August 13, 2016, 06:54:20 PM

Title: G31 alternative
Post by: Tarak on August 13, 2016, 06:54:20 PM
Because of some of the strange issues I am having with G31, is there any alternative probing function to use instead of G31?
I am writing a probing routine that is fairly standard, but occasionally when it runs a line like "G31 Z-5. F100", the A axis will rotate as well????
But the next time I run the code it may not rotate??????
It's a very strange issue, has anyone experienced anything like this?

Title: Re: G31 alternative
Post by: Tarak on August 13, 2016, 09:42:11 PM
Sorry I should of mentioned, I am using Mach3 with a Ethernet Smooth Stepper (I'm starting to wonder if the ESS could be the issue)
Title: Re: G31 alternative
Post by: Tweakie.CNC on August 14, 2016, 03:19:52 AM
The problem does relate to the ESS and it is believed to be caused by electrical noise. This same issue was discussed on the Warp9 forum a little while back in this thread

Title: Re: G31 alternative
Post by: robertspark on August 14, 2016, 04:05:23 AM
Probing is unfortunately a motion controller function (which is why some buyers of far eastern motion controllers in their early days of cnc become disappointed later when realising some motion controller functions do not work at all or as intended),

That being said, m3 can be unpredictable and occasionally do something unexpected....

One place to look (before something other than m3 + ess) may be the probe it's self, or its wiring arrangement, is everything running off the same electrically supply, is it maybe because when the touch probe touches the object, the ground or vcc is all of a sudden causing a spike via other ground connection (motors, prox sensors, grounded table etc) back to the ess

One suggestion may be to run the probe off a small battery supply, via an optoisolator/ optocoupler then into the probe input of the ess.... hence no chance of shared ground or vcc connection....

Hence check your wiring and circuits being formed
Title: Re: G31 alternative
Post by: Tarak on August 15, 2016, 12:15:13 AM
Thanks Tweakie.CNC and robertspark, I was wondering about something like this, it's just such a random issue.
I was going to check the probe wiring, but then I realised it's doing all the weird behaviour before the probe even touches the part.

I am going to try a good old fashioned parallel port controller card, I think I have an old one around here somewhere.
I will let you know how I go.
Title: Re: G31 alternative
Post by: joeaverage on August 21, 2016, 03:24:06 AM
Hi All,
very interested it Rob's comment about the probe setup.

I have an issue with my machine which doesn't prevent me using it but is a

I use Vexta 5phase steppers and I would swear one or more of them are leaking
to earth. The frame of the machine is earthed via the spindle earth. At one
stage I had the spindle dismounted and lo and behold the frame of the machine
goes to about 130V!!! Yeah, that's correct 130V.

I fitted an earth wire back to the common point in the controller box and measured
30mA return current. I did an insulation test on each of the steppers with the drive
disconnected with a 500V tester, no problems. But the fault is definitely in the stepper/
drive arrangement because when you depower the drives the fault disappears and yet
no leakage from the steppers???

The Vexta drivers I use produce around 130V at the DC link so its related somehow.
Vexta is really good quality Japanese gear and having paid thru the nose for it don't
want them to be faulty but what other conclusion can I come to? Even worse is that
the steppers and low (3 arc min) backlash planetaries work like real troopers. They
maintain good torque right up to 2400rpm. At cutting speeds the thrust they and
the gearbox produce is formidable, 1500lbf, and these are 23 size. I refuse to throw
them away, they are just too damn good!

My best guess is the dreaded 'homopolar' current, which according to Kirchoffs laws shouldn't
be. Then again I don't think Kirchoff ever published anything about CNC! Two hundred years
or so before his time... but still.

When I made a probe circuit I certainly didn't want any mystery currents flowing back into the
BOB/controller so I made an opto-isolated probe. Additionally I put a bridge circuit in the open
collector lead so that the hook-up to the BOB is polarity insensitive. It raises the low output voltage
to about 1.5V but my BOB has no trouble with it. Really simple and fits battery and all into a little
plastic cup a bit bigger than an eggcup and worked flawlessly from the start.

Title: Re: G31 alternative
Post by: Tweakie.CNC on August 21, 2016, 04:24:15 AM

As you say the motors all pass the insulation test but I would be very concerned about measuring a current as high as 30mA between the machine frame and Earth.

Title: Re: G31 alternative
Post by: Davek0974 on August 21, 2016, 04:26:21 AM
Can you not bring the electrical stuff on bit by bit and measure the leakage at each stage?
Title: Re: G31 alternative
Post by: robertspark on August 21, 2016, 04:26:50 AM
Don't carry out an insulation test on anything electronic!

Test the wiring, but don't test the device.  Doing a 500 volt DC test on a device not rated for 500v is a sure way to end up with problems in my opinion (being a young spark (electrician) many years ago I tested a lighting circuit only to kill a whole load of electronic lighting ballasts).

Earthing and providing a means of earth differs around the world by locality, and it can be a very emotive issue with everyone believing they, the system they learnt, or that in their locality is right.  

However... a basic rule remains.... if the device is wired up with live and neutral (or hot wire to hot wire), the leakage to the casing or earth point should be zero.... or you have a problem.

30mA is a high leakage current, and I'd suggest in plugging each of your drives and motors, testing the wiring, and then plugging each of the drives and motors in in turn to establish which drive and motor has the leakage issue.  If you need to swap the drives and motors around to establish which drive or driver is creating the problem exactly, then I'd suggest doing that.

I'd suggest running a gcode file which tests just that one axis motion at full rapid movement.... such as g0 x100, g0 x0 back and open up Microsoft excel and drag 150 lines of g0 motion, and copy and paste it into a tap file.  So it will give you time to test the machines leakage.

I suspect you have a wiring problem (note I've not seen your machine, don't shoot the cnc messenger!)... I'd suggest that somewhere the wiring is getting mixed up with ground, 0volt or something like that.

I'd suggest stop for a moment (as I know this can be emotive), and just reconsider all of the circuits in your machine, as they need to be wired relative to each other because of the way that they manipulate voltages

Start at the electrical supply... you have two main wires (forget about earth for a moment as some parts of the world use one of the hot wires as earth as its also the grounded neutral point, instead of the centre tap neutral which seem to be the way it's done in to US for domestic supplies (nomenclature different, outcome the same)

These two wires will be wires up to your low voltage supplies one for the 5v, 24v and another for your drives.

The output of these (however many you have and whatever their voltages) are relative to the two output wires... do not at any point connect these to the earth terminal, even if they say zero volt (0v)

These lower voltage power supplies are then connected to your motion controller, and break out boards, and spindle and drives.... some of these have outputs... such as the motor drives... take the wires out of these and wire them direct to the motors... at no point should any of these output wires be connected to the earth point, casing, frame etc, even if they say GND or 0V.

Same thing with bob sensors....

Now, at this point your earth is wired, and it is basically only connected to the casing of each device, or a dedicated terminal that says earth...

Be very careful when the device says "GND" as it may not actually be the earthing point.... test it with a voltmeter set on ohms or diode beep test between the terminal and the casing.

Only this casing earth hours back to your incoming electrical supply earth.

Sorry for the long post

Title: Re: G31 alternative
Post by: robertspark on August 21, 2016, 04:33:47 AM
Whilst I look for my tin hat and sand bags...

However... a basic rule remains.... if the device is wired up with live and neutral (or hot wire to hot wire), the leakage to the casing or earth point should be zero.... or you have a problem.

Please note that with motors, it is possible to obviously get an induced leakage current, by the very nature of their operation of generating a magnetic field... more so with steppers and servos because the frequency their supply switches is much much higher than your run of the mill electrical supply appliances at 50 or 60hz supply voltage....

But 30mA leakage is still very high for an induced leakage imho.

Title: Re: G31 alternative
Post by: robertspark on August 21, 2016, 04:44:22 AM
Oh, and another common error with power supplies of differing output voltages is to join the 0v lines together.... be careful.... the 0v is zero volts relative to the other output line (5v 12v 24v 36v etc).... don't join the 0v or sometimes marked gnd connections together.... or you end up with a ground loop problem as the zero volt lines can be offset from the earth and can be offset from other 0volt outputs from other power supplies.

Title: Re: G31 alternative
Post by: joeaverage on August 21, 2016, 08:26:12 AM
Hi Guys.
thanks for your replies, welcome and instructive.

Rob, when I meggered (is that a term you use?) the motors were certainly disconnected from the drives.
I went thru much of the procedure you outlined, disconnected every circuit that goes to the machine and
bought each one online one at a time. The culprits are the steppers, not identical but all near enuf to 10mA
a piece.

Heres the odd bit, the leakage occurs with small variation only wether the axis is driving or not. Even when
stationary the drives still PWM current to the motors.

I've been thru the wiring again and again. All circuits from the BOB to the drives are opto types, I had the
limits and home switches disconnected, in fact removed, the spindle was dismounted and on the other side
of the room!

Vexta specify a 500v isolation result and max rated input voltage of 150V for the motors. The drives themselves
are 230V input. Their size tells me that they have inverter powered DC link. I have not pulled one to bits yet but am
thinking that the DC link may not be isolated from earth. Certainly most AC servo drives are not isolated (what
a surprise that was!!!). I was guessing that the leakage was in the drives but each drive frame is earthed back
to the common rail and I could not for the life of me see why leakage would flow in the mill frame earth.

Since I did that testing I have bought a Tectronrix current probe. One day soon I'll apply it to this problem,
I promise!

In absence of anyother explanation I concluded it was induced current, aka homopolar current in defiance of
Kirchoff. I thorougly agree it way too high but I'm not throwing these things out... they're superb in every
other respect.

I am very careful about power supplies fighting one another. I repair welding equipment or a living and have
seen numerous occasions where weld voltage, a very beefy power supply, blow up boards and their power
supplies should it inadvertently get connected.

Title: Re: G31 alternative
Post by: robertspark on August 21, 2016, 08:52:13 AM
Craig, seems like you've done the insulation test the right way (yeah, used to be called meggered as the instrument was an AVO Megger (after megaohm I suspect... I've still got and use my old but prestine AVO CM500).

I unfortunately don't know your drives and motors well enough, but I'll try to spend a bit of time reading up on them (you haven't got any links to datasheets have you). (Unfortunately I'm a cheap stepper man not servos, some of the more experianced servo users (like hood I suspect) may have a view)

The other bits are if you're using screened cable... only ground (earth) one end or you end up with eddy currents (but not 30mA floating about of imbalance).

Back when I used usb motion controllers i found out that some usb leads have s grounded shielding cable that created a real pia ground loop between motion controller and pc.

Seems like you've got a good knowledge and ain't going to fall foul of some of the common pitfalls for new cnc users.

I need to have a think.

Title: Re: G31 alternative
Post by: robertspark on August 22, 2016, 08:23:33 AM

Having a look at page c90 here, and the insulation tests, I would have said that what you did was fine if your drives are the same, but I would not have expected any leakage current.

Suggest digging a little deeper to see if one, some or all are leaking to earth by removing and fuctionally testing them in operation, and measuring the current at the earth terminal.

Title: Re: G31 alternative
Post by: joeaverage on August 23, 2016, 05:26:11 AM
Hi Rob,
you're right of course, roll up my sleeves and get stuck in, I certainly have the gear, inductive current probe
to 5Mhz, differential voltage probe to 25Mhz with common mode range of 1400V....

The point is I just don't want to!  I'm happy making chips and have a new coil winding script to try out
and then there's the board for my 'you beaut' servo drive not to mention finish grinding the micrometer
head mounts then there's that straight edge and end clamps for a measurement jig and..... You know
how it goes interesting projects and must do jobs always come up and solving this leakage problem
is mere safety, I sniff at it!!!

Truth be told when I first discovered this problem is when I demounted the spindle and promptly got
quite a tingle from the mill frame. Additionally I laid the remote pendant down on the bed and managed
to take out one buffer channel in the BOB. Fortunately the fault didn't progress back into the PC but still
damage was done.

The solution is of course to demount each stepper so I can measure earth return current but I have just
not got around to it yet. Pretty slack and cavilier of me...

Title: Re: G31 alternative
Post by: Tweakie.CNC on August 23, 2016, 06:04:36 AM
solving this leakage problem is mere safety, I sniff at it!!!

It's your business but something to perhaps keep in mind...

"Even a small leakage current can mean a risk of harm or death due to electric shock if the leaking electric current passes through a human; a current of around 30 mA (0.030 amperes) is potentially sufficient to cause cardiac arrest or serious harm if it persists for more than a small fraction of a second".  (extract from Wikipedia).

Title: Re: G31 alternative
Post by: robertspark on August 23, 2016, 06:11:41 AM

I know how it goes, and whilst I don't advocate it... I've had a few shocks in my time (230v here), don't recommend 415v ph-ph.... 230 has kept me sharp.

Can you not unplug the drives or motors... remove a fuse to the drives or turn off a circuit breaker?

Only slaved drives will be difficult

Title: Re: G31 alternative
Post by: joeaverage on August 23, 2016, 06:24:48 AM
Hi Rob,
great find on the info, I have bits and pieces but nothing as complete as this.

Supposedely these steppers can run at 3000 rpm with gear reduction 300 rpm. When I first
set the mill up I experimented and got axis speeds of 2200mm/min which equates to 440rpm
at the coupler and 4400 rpm at the motor. I ran everything at max to do it and of course they
got hot and were prone to stall. In more recent times I run 1200mm/min for a motor speed of
2400 rpm at 75% current output and they run comfortably and reliably pretty much irrespective
of whats loaded on the table.

The drives I have I think must be an earlier model as they don't have microstepping, full and half step
yes but otherwise look identical. Thanks again for the info.


PS just read your latest post and yes I've had a few close encounters with 230, and about 3 months
ago while at work I slipped probing a 400V circuit, it hurt!
We have a sign up saying "DANGER this will kill you and really, REALLY hurt while you die"

I can disconnect each motor and drive individually but when mounted I can't break the common
earth. Provided  I do one at a time I could measure return current in each, will do it and report
back, not this weekend as I have to work but maybe the next.
Title: Re: G31 alternative
Post by: joeaverage on August 23, 2016, 06:38:24 AM
Hi Tweakie,
I've always regarded LD50 (lethal dose 50% of the time) as 20mA.

In this case the open circuit voltage I measured was 130V but any moderate path to
earth drops the voltage bigtime. I can only guess but theres no way I could have stood
30mA and still write this to you...

You are correct that I should be much more concerned about this than I am or perhaps
appear to be.

Your concern is noted and appreciated.

Title: Re: G31 alternative
Post by: robertspark on August 23, 2016, 06:54:00 AM
... sorry off topic, the 30mA current flow at the bodies"normal" impedance I believe is fairly difficult to achieve.

Note... normal is skin surface to skin surface ... left hand finger tip to right hand fingertip or feet.

Impedance more than resistance I would have said as the resistance is fairly easy to measure with a high resistance reading ohmmeter... think it's about the 1mohm range from memory (not read mine for a while) but this doesn't take into account the bodies surface capacitance, which will probably help current flow under ac (alternating current) conditions (mains voltage).

However... if you're in water, or wet... that is a different animal.. or break the skin (as I did once with a minor shock, tensed muscles, and inserted arm onto a sharp bit of electrical trunking (solid cable tray...) that was lights out for me, but thanks to a quick acting electrician working along side me who pounced on me to get me off, I'm still here... probably why I'm no longer on the tools day job 20 yrs later... as a consulting engineer (aka them what are not actually good at producing the end job... better at telling someone else what it should look like and not how to do it)

Yeah, it bites, and you can't see it.

Title: Re: G31 alternative
Post by: joeaverage on August 23, 2016, 07:45:21 AM
might be off topic but interesting none the less.

Some years ago one of the local linesman took a bad hit from 11kV. The first thing
the foreman noticed was the tyres of the truck carrying the 'cherry picker' sprouted leaks
and the water ballast in them started to squirt out. The current was passing thru Tony,
local guy and friend, thru the truck and earthing via surface conductance of the tyres.
Tony survived but was a very sick man for quite a long time. Most of the discharge had
passed around him, like surface conduction. Sharp bits like hands, elbows and knees were
badly injured but internal organs survived.

Evindently the probability of surviving a high voltage incident is actually higher than medium
voltage, 800-1700V. These voltages are found in traction systems like trains. Rectified 3 phase
(in New Zealand at least) is 580V. Any system using boost PFC correction like industrial
VFD's and some Miller Inverter welders have DC link voltage of 800V, the danger zone.

I deal with rectified 3 phase machines daily including some of those Millers. With those your
first mistake is your last and the capacitors are formidable!