Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: hyildiz on December 12, 2019, 12:40:09 PM

Title: Mach4 positioning error
Post by: hyildiz on December 12, 2019, 12:40:09 PM
Hi all,

there is a problem which made me take apart the new built machine, there is a positioning error in every axis, here is the machine details;

Windows 10 32bit, Mach4, ESS, PMDX 126 as controller,

X Axis:

1300mm stroke, 25mm diameter with 25mm pitch Taiwan made single nut ballscrew directly attached to a servo motor with coupling(this motor replaced with 16Nm step motor to rule out the motor/driver combo error, it gave same results with servo system),
Ballscrew aligned with the guideways within 0.01mm from one end to another both vertically and horizontally,
there is a measured 10-15micron backlash.

Y Axis:

1000mm stroke, 25mm diameter, 5mm pitch Taiwan made double nut ballscrew directly attached to a closed loop step motor with coupling,
Ballscrew aligned with the guideways within 0.01mm from one end to another both vertically and horizontally,
there is a measured 4-5micron backlash.

Z Axis:

1000mm stroke, 25mm diameter, 5mm pitch Taiwan made double nut ballscrew directly attached to a servo motor with coupling,
Ballscrew aligned with the guideways within 0.01mm from one end to another both vertically and horizontally,
there is a measured 4-5micron backlash.

All the guideway(30mm schneeberger) beds scraped and aligned/paralleled within 15microns in both vertical and horizontal plane.

This is a very rigid machine which weighs 4tons, it is precisely leveled, motors has no problem while driving, no noise, no heat, there is no other error in the setup other than this positioning error.

At first i thought maybe servos doing it but Y axis has a closed loop step motor and a double nut ballscrew aligned within 10microns, which makes the exact same error with X and Zth axis.

I am confused with it, tomorrow i am going to reinstall Mach4 and ESS plugin from scratch and make the test with the standard screen which comes with Mach4 but other than that nothing comes to my mind.

It also does not cut the circles true, in 30mm diameter it makes +60micron error.

below images are the measurements in one way(to rule out the backlash), first command is 1mm forward, next is 2mm forward etc.. it always comes short, there is no errors in ballscrews or motors and their tuning, thats for sure, i am focusing on Mach4 and ESS right now, anyone has any idea about the possible cause of this positioning error? or anyone faced with a similar problem?

Regards,

Hakan



Title: Re: Mach4 positioning error
Post by: joeaverage on December 12, 2019, 01:23:07 PM
Hi,
this post should be on the Mach4 General Discussion Board, I imagine tweakie will shift it.

If the error is consistent and identical in all axes then the steps per unit are wrong.

I'm guessing that the pitch of the screws is 1 inch (25.4mm) not 25mm.

You may have seen posts where users believed they had 0.2 inch pitch screws (5.08mm) when in fact they
had very common metric screw of 5mm pitch. Depending on the supplier they may not know or care about a detail
like that, they have given enough information for a sale...and that's all they care about.

Can you use Mach and the current steps per unit value to have the stepper rotate exactly one revolution? If you can do so
measure the distance traveled......and that is the actual pitch which may be at variance to what you believe.

Craig
Title: Re: Mach4 positioning error
Post by: joeaverage on December 12, 2019, 01:44:21 PM
Hi,
another possible cause is the 'zero error window' being set to wide.

All servos, and to my knowledge, closed loop steppers have a programmable parameter called (by some manufacturers)
the 'zero error window'. What it means is that if the commanded position and the actual position, as measured by the encoder,
is within a (programmable) number of encoder pulses the drive will not try to close the error loop any closer.

It is common practice when the drive is shipped to set the zero error window and the following error window very wide so that
first time users experimenting with their new servo/drive are not plagued with following errors. In CNC practice those windows
need to shrink dramatically to have any chance of accurately following a toolpath.

If the zero window error is set to 100 encoder counts, say,  that could explain why your move apparently never completes
and therefore be inaccurate.

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 12, 2019, 02:23:14 PM
Once again hi Craig,

How are u?

I am sure about the pitches, these are metric and i ordered them directly from the manufacturer not from the distributor, so we can rule that out, also i attached an open loop 14Nm stepper motor to the X axis to check if the servo motor/driver is faulty, i thought there may be a tuning problem but it repeated the same exact error. I think this also rules out the zero error window, any other suggestions?

I noticed this odd thing while doing the measurements; i repeated the measurements in every axis multiple times, for example i commanded the axis to move to 1, then 2, then 3 until it reaches 10mm and repeat this set of commands 10 times in every axis. In one of the axis i think it was Zth, axis moved within 1 micron to the commanded positions in first set, but then in 9 sets it repeated this error. I am not noticing any noise issue in general in limit switches etc. but is it possible that this error maybe because of the noise within the control cabinet especially which may effect the ESS and pmdx? i am not sure if noise can lead this kind of consistent errors, u may know it better.

Regards,

Hakan

Title: Re: Mach4 positioning error
Post by: joeaverage on December 12, 2019, 02:31:38 PM
Hi,

Quote
I am sure about the pitches, these are metric and i ordered them directly from the manufacturer not from the distributor, so we can rule that out

Can you rule that out....have you actually measured it? It does seem unlikely given the source of supply but you are relying on someone elses say-so.

Quote
I think this also rules out the zero error window, any other suggestions?

How does this rule out the zero error window?. I would expect a fairly consistent error if indeed it is something like a zero error window fault.
I have no other suggestions, you have dismissed the two I have without investigation, would other suggestions meet a better fate?

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 12, 2019, 02:47:01 PM
 :)

Dont get angry at me, of course i am going to measure the pitches tomorrow as u suggested but i am %90 sure thats not the case, this was what i meant.

It rules out the zero error window because of this logic; as u know thats a preprogrammed  encoder count which feeds back it to the driver, by that way driver knows the commanded position reached, so to do that, there should be a encoder attached to the motor shaft. But in open loop stepper motor(16Nm one which i attached to the X axis instead of the servo) there is no encoder, its open loop and repeated the same error as the servo.

Is my logic wrong?

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: joeaverage on December 12, 2019, 03:16:14 PM
Hi,

Quote
Dont get angry with me,

I didn't but you have not fully investigated either suggestion.

I understand that you are certain of the pitch and I would too under the same circumstances but then you are on the forum asking. That suggests
that you have tried all the things you can think of and still have no answer. Can you rule out a pitch error ABSOLUTELY?

If a servo has a zero error window set too high, say 100 encoder counts, it will approach its commanded position until it gets to within 100 counts and stop.
That is the meaning of the zero error window. If you MDI successive 1mm movement commands its possible that a wide zero error window, having a linear
equivalent of 4-5um, would occur at each movement with the inaccuracy accumulating at each move. If however you commanded one movement of 5mm
then with the same zero error window I would expect the same basic 5um inaccuracy in 5mm verses 25um inaccuracy had you commanded five successive
movements.

Quote
Is my logic wrong?

I can't fault your logic but the problem persists......

Your suggestion about noise is not impossible, just improbable. Is it likely that noise, by definition random electrical noise, would cause such a consistent
inaccuracy?. I doubt it, but neither do I have a simple test to prove or disprove that.

What I am suggesting is that you use such tests as you can devise to prove/disprove certain things. As items are eliminated off the list those remaining potential
causes must contain the answer.

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 12, 2019, 03:28:08 PM
Hi again,

I understand what u are saying, its ok i am going to measure it, last couple of days i was thinking the error was mechanical so i took apart many things and saw that i was wrong and put them back together within a specific precision so it melted half of my brain down :)

While browsing the documents all over again, i found out that servo drive shows the commanded pulse and actual pulse in its display by using that i can make the shaft rotate one exact turn and measure the exact pitch.

And one other thing, i remember reading in the Mach4 user manual a warning for the user which strongly suggests not to tweak the count per unit value(because it is a calculated value), but if your suggestion is true that value should be tweaked according to the actual measurements, it may not be defined as tweaking because actually its still the same calculation what we are doing is measuring the pitch and putting it back to formula but it still sound like tweaking.

When u read that statement in the user manual u just dont touch that value  ;)

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: Overloaded on December 12, 2019, 04:52:31 PM
This may, or may not apply. If all else checks out .......
I did have a similar event. What I found was that the AB servo drives I am using recommended differential inputs for the step & direction inputs. I had them single ended and saw similar to what you are seeing. I installed differential line drivers and all has been perfect since.
I don't see where you mention your drives so this might be something to check.
Just a guess.
 :)
Title: Re: Mach4 positioning error
Post by: hyildiz on December 12, 2019, 05:58:53 PM
Hi Overloaded,

and thanks for the advice, i checked the manual of the servo drive it also suggests what your drive manual suggests i think, see the attached image.

The differential line driver u connected was something like this? and how did u connect it to pulse and direction signals? how is the wiring? i never used one, if all other fixing attempts fail i am definitely gonna try it, thanks.

https://www.amazon.com/Cnc4Pc-C72-Differential-Line-Driver/dp/B06Y3M2ZB2
Title: Re: Mach4 positioning error
Post by: joeaverage on December 12, 2019, 06:55:49 PM
Hi,
what Russ is proposing is that open collector outputs from your BoB will result in 'missed' pulses by the drive, given that the drive is optimized
for differential inputs.

This would be detected by the same test as I proposed earlier.

If you command a move of 10mm and x number of steps were missed by virtue of open collector signaling, then surely a command of 20mm would
miss twice as many steps.

What I'm trying to establish is the error proportional to the distance moved or the number of moves.

Pactual=a x Pcommanded + d

In an ideal world a would equal one and d would be zero. What we are trying to do is find the actual and existing inaccuracies described by the two
parameters a and d.

If Russ's proposal is correct then a will be close to but not exactly equal to one. If my contention is correct, ie zero window error, or I suppose some
type of backlash compensation error, then d will be non zero.

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 13, 2019, 04:20:49 AM
Hi again,

Yes, i will perform the following test today;

gonna send 1 turn pulse from Mach4 to one of the servo drives and check the pulse reaches the driver, if it displays 10000(4x2500) it means there is something wrong with the lead of the balscrew(its not actually 25mm, its something like 24,89..), but if the pulse number is below 10000 then it means there is a loss in pulse signal.

Personally i dont think Mach4 or ESS causing this, since the error is persistent in every axis, its always short and its not adding up with the distance i am leaning more towards the differential thingy side. We will see..

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: Overloaded on December 13, 2019, 07:22:05 AM
Hi Overloaded,
 
The differential line driver u connected was something like this? and how did u connect it to pulse and direction signals? how is the wiring? i never used one, if all other fixing attempts fail i am definitely gonna try it, thanks.

https://www.amazon.com/Cnc4Pc-C72-Differential-Line-Driver/dp/B06Y3M2ZB2

These weren't available when I needed them so I made up my own. Otherwise, I would have used these. Here is more info from the CNC4PC website for that item.
https://www.cnc4pc.com/pub/media/productattachments/files/C72-R1.1_USER_MANUAL_VER.1.pdf
Title: Re: Mach4 positioning error
Post by: RICH on December 13, 2019, 08:52:51 AM
Interesting thread and I'll post some info later for a reality check.
Later,

Rich
Title: Re: Mach4 positioning error
Post by: hyildiz on December 13, 2019, 11:17:04 AM
well

none of us was right.

I sent the necessary pulse signal for 1 full turn of the ballscrew to every axis which has servo installed, checked the settings and made measurements with precision 1micron marcator and tesa indicators;

drivers received exactly 10000pulses(4x2500) for 1 full turn, received and actual encoder pulses are same(10000), so nothing wrong with the pulse signals or signal generators,

measured the 25mm(X axis), 10mm(Y axis) and 5mm(Zth axis) ballscrew pitches, they are exactly 25.001mm, 10mm and 5.001mm, i assume 1micron is the measuring error of the dial indicator, so nothing wrong with the ballscrews,

before measured backlash is still there and its not the problem,

i made many measurements again with +1mm, +2mm, +3mm, +4mm, +5mm, +10mm and +25mm command set, it is still repeating that odd positioning error in most of the time, but in couple times it made the exact positioning within 1-2microns for the whole 1 set in every axis.

without a hope i tried to adjust the count per unit value with the wizard and of course it didnt fix anything.

i still dont know why i am reading this positioning error in the dial indicators, when every axis commanded to go 500mm and return back to 0 all of them returns back the exact point within couple of microns.

before this error presented itself i was making a test cut which has couple of circles, tilted square and rectangles on it, weird thing is this; for the rectangle(35mmx25mm) machine made it within 20microns, it was 35.02 in the X and 25.01 in the Y direction. But according to the measurements i am reading it should have done that cut with 50-60 micron error. The rectangle and squares was ok but the circles were not true circles, they were reflecting the errors i am measuring and +60micron wrong.

I am gonna make the same test cut again, after tuning the servos and aligning the ballscrews within 10micron to guideways.

I wonder what u guys read on the dial indicator when u move one of the axis of your machines +1mm for example?

Regards,

Hakan

Title: Re: Mach4 positioning error
Post by: Overloaded on December 13, 2019, 01:23:53 PM
hmmmm..... another possible culprit could be the mounting and condition of the screws, endblock bearings and shaft couplings.
Can you run your indicator test at 2 vastly different speeds to see if there is a variation ? This might show if there is a "mechanical/inertial" aspect to the problem.
Title: Re: Mach4 positioning error
Post by: hyildiz on December 13, 2019, 01:52:03 PM
i checked all mechanical aspects for a week everything is fixed as it should be, screws are new, couplings are german made R+W, every screw tightened with torque wrench to the specified torque values. End bearings are korean and they are also new.

I already tried different speeds, speed difference had no effect on readings, 6000mm/min and 50mm/min gives same results. Inertia was the first thing came to my mind because X axis is relatively heavy(400-500kg)and there were jitters on some side cuts in the test cut so i tuned the X axis servo and they are all gone now axis moves very smooth in all speeds also i am checking both encoder displays(commanded pulse and actual encoder feedback) they are identical in every command. While driving the heaviest axis motor only use 1-2Amp, there is no noise, no heat, no sign of overload.

Also, while dial indicator touching the axis i push the axis back and forth and can see the position value on servo driver display, it is very rigid and when i push hard it fixes the error immediately within 1-2microns. While doing that i am not even reading any backlash.

By the way thank u guys for helping out, if noone else getting this kind of odd readings clearly i am missing something thats for sure.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: Overloaded on December 13, 2019, 07:36:33 PM
Since you are dealing in microns, take a closer look at the apparent angle of the indicator axis in relation to the slide rails. To bet accurate indications, these must be precisely parallel in both perpendicular planes. As illustrated, a 3 deg misalignment will result in an untrue reading.
If ALL else is perfect ......... this might be lying to you.
Could be a photo anomaly, but it doesn't look to be in line from here.

If angled, it would likely read LONGER than commanded tho .... not shorter ? ? ? ?
Title: Re: Mach4 positioning error
Post by: mcardoso on December 13, 2019, 07:40:48 PM
God I love this stuff:) ;D
Title: Re: Mach4 positioning error
Post by: Overloaded on December 13, 2019, 07:45:00 PM
God I love this stuff:) ;D
Are you serious ? ?  or just pokin fun   :D
Any ideas  :)
Title: Re: Mach4 positioning error
Post by: mcardoso on December 13, 2019, 08:43:05 PM
Dead serious! I have more metrology equipment in my shop than I do machines to use it on. That was a really bright catch to double check the parallelism. Another issue could be the flex arm. They're quite rigid but if you've used a tenths indicator, you will know that they can move on you, even from the return spring pressure on the indicator.

OP is commenting on the final dimension of a machined component which is very different from measuring table movement. I would first validate the machine one axis at a time, then later look into the machined component. Differences in the cutting path, cutting parameters, or even variability in the stiffness of the head of the machine with respect to the X and Y axes can make a difference in the final machined size.

Based on the evidence collected, Mach 4, the signal path, and the servos themselves don't seem to be the culprit. That leaves the shaft coupling, ballscrew, end supports, and machine rigidity. Also servo tuning can be done wrong to give great positioning during static measurements, but aren't configured to maintain position well during a cut.
Title: Re: Mach4 positioning error
Post by: hyildiz on December 14, 2019, 05:41:06 AM
Hi guys,

the steel part that the indicator touching was the spindle head(a machined bulky steel cube which i mount the BT40 spindle) its outer face may or may not be perpendicular with the indicator, the indicator is parallel with the moving axis since the touching point is a sphere the surface will always stay tangent to it so the indicator will only show the moved distance. There is no that much machining error on that touching surface in reality its mostly the camera's optics doing the distortion.

For me,

to get this kind of readings in linear movements and machined squares and rectangles being 10-20micron accurate is weird,
machined squares and rectangles being 20micron accurate but circles being like an ellipse in 30-60 degrees to both X and Y +60microns is weird,
sometimes getting 1-2micron positioning accuracy and mostly get 30-50micron positioning error in every axis during the measurements is weird,
in full 1 turn reading the actual pitch and in small increments reading this error is weird,
getting this positioning error in small movements and seeing that every axis return to zero after moving 500mm within couple of microns is weird,


At first i also thought that this looks like an mechanical error thats why i took apart the moving components(motors, ballscrew supports, ballscrews, nuts, couplings, etc) and realigned/fixed them all over again. Linear rails in every axis are schneeberger and aligned/paralleled within 15microns, of course there is an error in every guideway when u move the axis but it does not result a total error more than 10-15microns(in high speed movements).

But there are things which proves that this is not mechanical error(other than being checked all of the mechanical aspects), mechanical error should always be there and should be repeating. If it was ballscrews it would add with the distance moved but its not adding, it reaches to 50-60micron error in 10mm and stops, it does not add more to it.

i was sure that this is because of the pulse signal loss and differential drive gonna fix it when Russ suggested that but seeing the actual pulse reaching the driver and drivers performing the commanded pulse without loosing even 1 digit in 10000 pulse per revolution made me more confused.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: joeaverage on December 14, 2019, 06:20:24 AM
Hi,
have you read the zero error window setting? With a 10000cpr encoder I would set it to 4.

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 14, 2019, 08:52:27 AM
Hi Craig,

I think in this driver they call it "positioning deviation out of tolerance detection" but i am not sure, check the attached page, there is 2 settings related with this as far as i can see and 11 is related with an output signal if i understood correct, 12 must be the setting u are talking about but its factory default looks like 20000 which may show that its not the setting u are talking about  ;)

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: joeaverage on December 14, 2019, 01:13:58 PM
Hi,
parameter 11 is the 'zero error window' and parameter 12 is the 'following error window'

Different manufacturers use different names but they mean the same thing.

In this case parameter 11, the zero error window, is set to 20 counts as default. Thus if the actual (encoder)
position gets to within 20 counts of the commanded position the drive ceases to try to get any closer. Is this what
you want?. I think its too high, I set mine (8000 cpr) to 4 counts.

The reason for having a zero error window is to that the drive does not 'hunt'. If the drive attempts to reduce the error
to zero counts then it will overshoot by one count, and then reverse until it overshoots by one count in the other
direction, and keep repeating, called 'hunting' or 'dithering'.

Why don't you try setting parameter 11 to zero, and see what happens?

Parameter 12 is the following error window and its way WAY WAY too wide. Its factory default is 30000 counts,
that's three revolutions!!!. It should be something like 20 counts.

If the servos actual position lags the commanded position by a significant amount, called following error, it's supposed to alarm.
As it stands the servo can be miles and miles out of sync without an alarm, good for while you are experimenting with your
drive but absolutely bloody hopeless for CNC.

If you program parameter 12 to a very small value (<10) then the servo will fault frequently because the servo cannot
'stay within the following error window' and yet if the following error window is set too wide then the servo could lag
the commanded position by a large amount and cause bad inaccuracies in your work.

Craig
Title: Re: Mach4 positioning error
Post by: joeaverage on December 14, 2019, 01:18:55 PM
Hi,
sorry misread the default setting for the following error window, factory default is 20,000 counts or two revolutions.

With a direct coupled 25mm pitch ballscrew that would mean that the X axis could be 50mm out of sync with the commanded
position WITHOUT an alarm!!!!

The factory default is for new users, serious users will shrink that WAY down, I have mine set to 20 counts.

Craig
Title: Re: Mach4 positioning error
Post by: Overloaded on December 14, 2019, 02:38:23 PM

drivers received exactly 10000pulses(4x2500) for 1 full turn, received and actual encoder pulses are same(10000), so nothing wrong with the pulse signals or signal generators,

 Hakan

Hi Craig, quick questions till the OP gets back here.
Where the OP stated in the quote above that the drive reported the actual encoder counts received for the move, would the  'zero error window' being large not reflect the actual counts that would fit in the window ? ie: where the encoder stopped if not in the exact 1:1 position ?

If the  'zero error window' was quite large and the axis velocity was quite low as well, wouldn't that encoder count be reported as well short of the target ?
Thanks,
Russ
Title: Re: Mach4 positioning error
Post by: hyildiz on December 14, 2019, 03:53:09 PM
Hi again Craig,

well i haven't got in to that much detail yet, most probably they left it like that to give the user space for starting up and tuning the motor/drive without causing any error.

I will adjust p11 to 4 and p12 to 20 as u suggest and check if it makes any difference in measurements or not. Then i am gonna make the test cut to see how machine actually cuts after i tuned the servo and increased the ball quantity within the ballscrew nut.

During the week i took apart the machine components i thought that maybe there is something wrong with the nuts(a broken ball, contaminants, etc) and contacted with the ballscrew manufacturer(gten), then i took all balls out of the nut and check(for the X axis) nothing was wrong but there were a space for 1 more ball in every complete set(there were 2 sets within) so i asked them why they left that empty space and if anything bad may happen when i add 1 more ball to each set, they said they done it for keeping the noise level down, for smoother operation and adding a ball wont harm anything.

I cant say i bought the "smooth operation" thing but of course it may also be true, as u know there are precision classes for these ballscrews, 3 class i think one is regular, one is more precise and one with a preload so it is the most precise one, actually i felt that the nut is more stiffer and has less pitch movement after adding that 2 balls but who knows? we will see if it is going to make any difference after the test cut.

Regards,

Hakan


Title: Re: Mach4 positioning error
Post by: joeaverage on December 14, 2019, 04:45:04 PM
Hi,

Quote
well i haven't got in to that much detail yet, most probably they left it like that to give the user space for starting up and tuning the motor/drive without causing any error.

This NO mere detail, it absolutely fundamental to the operation of any servo or closed loop device. With the
factory default settings you will get very poor results. The following error window is just a joke.

You may recall back in post #3 that I explained that the manufacturers deliberately set both parameters very wide
so that first time users can operate the servo without nuisance alarms but they were never intended to be in use
in a real CNC machine.

Do the calculations....don't just guess.

If parameter 11 (zero error window) is set to 4 counts:

4/10,000 x 25=0.01mm or 10um. This is the effective resolution of your X axis as a result of setting the zero error window to 4,
but your current setting (default) is 20 and therefore your effective resolution is 40um....way less impressive don't you think!

Likewise if you set the following error window to 20 counts then Mach will alarm and Estop if the mill lags the commanded toolpath
by 40um whereas the current (default) setting is 20,000 or 50mm. Would you expect an alarm or Estop before your machine
deviated from the toolpath by 50mm?

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 14, 2019, 05:34:25 PM
Hmmm..

u are right, i thought that those are detailed tweaking parameters and left them to the end, first i adjusted the main parameters of the drive and when i got these readings dived into mechanical and controller side, well it does not explain why an open loop stepper did the same positioning error in the X axis but i will do the adjustments as u say before i go on.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: hyildiz on December 14, 2019, 07:37:39 PM
Hi again Craig,

Attached is the easy servo(closed loop stepper) driver "in-position" parameter adjusting page, its factory setting is 0 which means "not enabled" i guess.

The double nut ballscrew has 10mm pitch, i am gonna adjust it to D  for a 5micron resolution, is this the correct approach?

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: Overloaded on December 14, 2019, 09:35:02 PM
That is similar to the description of some drives I'm using. (pic)
The "in position window" is merely a selectable value that allows the associated "in position" output to be activated before the axis reaches its actual commanded position.
In one example, I have a servo driven ballscrew slide that goes to an exact position to where a pneumatic pick n place takes over. The position is exact but the pneumatic cycle can initiate a short distance before the move completes. Hence, the "window" is set quite large but the positioning is perfect.
Yours looks similar and maybe has nothing to do with reaching the "actual" position.

Title: Re: Mach4 positioning error
Post by: hyildiz on December 15, 2019, 05:22:15 AM
Hi Russ,

Yes i also thought the same thing when i read it first, it looks like they done it to turn on an output for a PLC/controller or any other equipment but internally within the driver circuit it is possible that they are using it also for positioning adjustment so i agree with Craig, it is better to be adjusted as smaller values to keep the tolerances tight. It may not have any effect in fixing the error i am reading but in normal cnc usage(especially for Mach4) those should be small values.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: Overloaded on December 15, 2019, 10:38:58 AM
After reading a bit, depending on the quality of your servo components, this problem might be solely related to the accuracy of your motor encoder.

https://cdn.usdigital.com/assets/general/usd-encoder-precision.pdf

pages 8,9,10

Did you mention the make and model of your servo components ?
Russ
Title: Re: Mach4 positioning error
Post by: RICH on December 15, 2019, 11:24:08 AM
hyildiz,

First I must say, in a positive manner, that I appreciate your quest for perfection which is desired
but never achieved. So here is my reality check!

There are TWO standards relative to this thread on positioning error. One is electronic and one is
mechanical and idealy one should agree with the other. The electronic standard (ie; closed loop
and servo related ) I am going to leave to those folks that have in-depth knowledge of that
"system". Doubt you any way to confirm the electronic standard to a traceable basis.

The mechanical standard becomes some "value" based on testing and how the testing is done,
ability to measure accurately, etc, etc, etc. Nothing is perfect, accuracy is a matter of degree, and
the "value" is will represent the "system" of total components.

Thus the real end quest, practical end product of  your efforts, will be a "system" that provides for
some expected tolerence of that machines capability. Note machines capability, not machined part
final tolerence, since that is different matter.

-------------------------------------------------------------------------------------------------
KNOW WHAT YOU HAVE

1.Should have manufacturers spec " Taiwan made single nut ballscrew directly attached to a servo
motor with coupling, ball screw grade, etc.  Exactly what kind of coupling is used?

2.Torque specs for whatever relates to installation.

3.Calculated inertion etc required to move the 900# + table. There are programs that can be used
to determine axis system loadings.

------------------------------------------------------------------------------------------------
 UNDERSTAND
1. All "systems" have backlash / play in movement, for both static and dynamic loading, since if
there were NONE the axis could not move. Just a matter of degree.

2.Know what you are actualy measuring. It can get difficult to isolate components of a system
   to see how each component adds to the total.

3. You must be methodical, focused, meticulous as heck, for what ever you measure.

4. The smaller the measurement gets the more difficult  it gets to acquire meaningfull data.
    Other influences come into play when you get to the micron levels.

5. Do you have the calibrated tools to aquire the data and what are their specs.

-----------------------------------------------------------------------------------------------
MEASUREMENT - for each axis
1. When you measure a screw you should actualy "profile" the screw over intended table     
    movement. For 30", with initial backlash removed, record measurements in 0.1" increments.
    It's done for both directions of travel. Say you have a spec for a ground screw and it says
    "0.001" / foot". What your interested in is how linear that screw is. I have seen all kinds of
     variations, such as, it was very linear, or had a section / sections that varied, the reverse           
     direction profile varied from the other direction profile, but, overall  it did meet meet  the
     spec. No screw is "perfectly" linear. A graph of measured movement relative to distance will     
     show the non liearity.  The above is a PITA to do, rather quick and easy for me since I do it   
     opticaly.

2. Now note that depending on how the screw and nut is mounted there is play. How will you try
    to measure that component of the system? For setting preload, a rationalization could be, to
    have the static load condition set such that an measured applied torque minimizes play and
    allows for the table to just move. Just making a point that a micon here and there for every
    component can up quickly. How dose calculated force to just move the axis compare to
    your measured force? Maybe one wants to minimize usage of available motor torque to move
   the table so that gained torque is available for actual machining.

3. Inline solid coupling of the screw to a motor eliminates non linear movement of the screw due
    to motor shaft rotation, BUT, depending on how it's installed, loads may be  thrown back into
    the motor. I had a bellows type that overtime started to add backlash to the system and the 
    backlash was not repeatable. Just another component which can affect measured table
    movement. 

4. Motor construction varies and can add varied / non-repeatable linear movement depending on
    how installed or made.

5. 1 micron = 0.00003937"  Human hair is approx 0.003" diameter. So 5 microns =0.0002"
   
Post collecting all the data, and in consideration of the data, you will rationalize to some practical
value of the  mechanical standard.

HYILDIZ, Have fun and Happy Holidays,

RICH
Title: Re: Mach4 positioning error
Post by: hyildiz on December 15, 2019, 03:39:15 PM
Dear Rich,

Thanks for the info but a human being who does not take all of that to consideration can not build a 4 ton milling machine and bring the accuracy within 15micron linearity and parallelism.

We are not talking about chasing 1-2 micron in here there is a 50-60micron positioning error in every axis of the machine in 10mm(20-30micron in 1mm), 50-60 micron is not a small value. With that error u can not do anything with a milling machine. And it is way out of the limits of any standard ballscrew tolerance, the ones i use has 10micron max. error in 500mm. and even both ends machined directly by the manufacturer with spinder precision CNCs not by a local shop or by me.

For your information couplings are german made R+W precision elastomer servo couplings which is backlash free, has excellent vibration damping capabilities and balanced to 12000rpm. One of those couplings price is 60euros.

Most of the mechanical and electronic parts used in this machine are high quality and some are the highest quality.

All linear rail beds, guideways and ballscrews scraped/aligned with a 000 granite straight edge + 00 granite table and 0.5-1 micron precision Mahr and Tesa indicators within 10microns. Ballscrew nuts fixed to steel blocks which are fixed to the axis of the machine with 4 M10 screws, every single screw used in the machine mounted with a torque wrench with specified torque values written in the spec. sheets of every single component.

I didnt buy these components from stores, i got most of them directly from the manufacturers, linear rails manufactured and sent to me by schneeberger in 3 months and they are high precision not regular precision. 4th axis has Kamo Cycloid installed which has 4micron runout. I got these components and bring them all together from the manufacturers around the globe, from Japan, Germany, Korea, China, USA etc..

After bringing all mechanical parts to some accuracy(which is below 1520microns in total) if u get an 50-60micron error reading in 10mm free forward move, it touches your nerve little bit.

So dont give me lessons about precision or measuring, measurements are not complicated measurements and we are not talking about 5-6micron in here its 50-60microns within 10mm u dont need a micron dial indicator or optics or laser interferometer to measure it, even a 10bucks worth chinese dial indicator can measure it.

Before everything u said, if u dont warm up the machine(linear guideways/blocks and ballscrews) prior to the measurements u get different measurements every time.

So if u have an idea which may cause this kinds of errors shoot it, if u dont then shut it.

Regards,
Title: Re: Mach4 positioning error
Post by: hyildiz on December 15, 2019, 03:57:43 PM
Hi Russ,

That may also be the reason but the thing is there is 2 servo motor and 2 closed loop step motor installed in this machine, servos has 10000ppr, steppers has 30000ppr resolution encoders. If one is faulty what is the possibility of all being faulty? these are not cheap chinese motors, servos are Gservo aka golden age motor(one of the biggest servo and torque motor manufacturer in china) and steps are easyservo brand korean made. I didnt go for panasonic or delta since i used these motors before they work quite nice and precise in other machinery.

Also as i wrote before, to rule out the mistakes for parameters or any other problem within the servo motor/driver combo in X axis, i removed the servo motor, connected 16nm open loop(without any encoder) stepper motor and send the same set of commands to it, it repeated the exact same error.

After adjusting the settings that Craig suggested i am gonna connect the X axis drive directly to the pmdx bob with very short cables like 50-60cm and then send the commands to see if it is going to change anything.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: Overloaded on December 15, 2019, 04:56:53 PM
Hi Hakan.
If your mechanicals are as precise as you describe, and the electronics are of best quality, I am at a loss for other possibilities. ( btw, I'm not a big fan of elastomer spider type couplings, although many are)
One way I see to make this happen intentionally (other than changing the "steps per unit") is to implement a very small ratio in the electronic gearing parameters.
I feel certain that has been verified as 1:1 though.
Good luck with this. I'll be curiously standing by ...........
Cheers,
Russ
 :)

edit: There is also an "encoder output scaling factor" parameter that might have an effect, but likely you've checked that also (if present).
Can you post the manuals for your drives ?
Title: Re: Mach4 positioning error
Post by: RICH on December 15, 2019, 05:55:46 PM
So if u have an idea which may cause this kinds of errors shoot it, if u dont then shut it.

Guess I don't , but be carefull when you tell someone to shut up.

Off to the side lines........., :)
RICH
Title: Re: Mach4 positioning error
Post by: hyildiz on December 15, 2019, 06:46:59 PM
Hi again Russ,

Attached is the documentation of the servo driver i am using in this one, i played with the electronic gear ratio values(in every manual they describe it and the math different though) and it does the same thing with the step per unit value. At last i set p13 and p14 to 1 so it is 1:1.

Well i played with many parameters to see if there may be any effect on the motion and i am not sure about the "encoder output scaling factor" i dont recall something like that. Adjusting that parameter would be a better idea then adjusting the gear ratio, i am gonna check it for sure, thanks.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: joeaverage on December 15, 2019, 07:50:12 PM
Hi,
I use Delta B2 series servos which have a 160,000cpr encoder (40,000 line) and the electronic gearing applies to that native encoder pulse stream.

It is possible for the drive to produce an encoder signal (A,B,Z) which is synthesized from the native encoder pulse stream. These encoder output
channels could be used to drive stand-alone DROs for instance, and they are programmable from 4 lines to 40000 lines per rev.

This is an example of "encoder output scaling factor" but has no relevance to your electronic gearing (which applies to the native built in encoder)
or your steps/unit values.

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 16, 2019, 10:45:15 AM
Hi Guys,

I adjusted p11 to 4 and p12 to 20 but the servo gave an alarm with that settings so i increased the p12 to 4000 with that setting it works without giving any alarm.

But these values has nothing to do with the error i am reading, today i checked X and Y axis, X axis works more noisy, there is noticeable backlash and it is almost 100micron short in 10mm movement. So i guess increasing the ball number within the ballscrew nut was not a good idea. I am gonna reverse it to its original ball number(105) tomorrow.

In Y axis before measured error still there but it is also increased by 10micron and its not a reading error. I didnt touch anything related with that axis but its error increased.

I am where i was at the beginning of this post, this does not look like a mechanical or servo/step motor based error to me, because nothing changes when i tweak the parameters or realign the ballscrews. Tweaking the step per unit value or electronic gear ratio value does not make it any better, it makes it worse and the error readings changes with days.
 
Today while taking the measurements i noticed something within the controller which i think should not be happening, there is "step" led on PMDX bob which flashes when u send pulse signal to the servo/step drives. While the machine was at rest and i wasnt touching anything that "step" led was flashing in high frequency intervals like it does when u send a pulse signal.

I believe that led should flash only when u move an axis. Anyone has an idea about this?

another thing; Delta spindle drive shows on its display 0.1-0.2 changing frequency input in idle state.

There is a 3phase EMC filter in main line input, but no EMC filter before the control cabinet.

I didnt have time to test one axis with a shorter cable directly connected to the pmdx bob, tomorrow i am gonna try it and if it does not work, i am gonna completely bypass the controller, hook up another motherboard and a parallel port bob from outside, connect it to the Y axis for example and send signal to it then we will see if this is related with the noise within the controller.

There is no HF source within the controller, its just the motherboard, PMDX+ESS+spindle board attached to pmdx and input boards, there is only a small PSU(with metal cover) which supply power to the motherboard. There is no noise source that i know of but that led should not be flashing in idle state.

Regards,

Hakan


 
Title: Re: Mach4 positioning error
Post by: joeaverage on December 16, 2019, 12:09:19 PM
Hi,

Quote
I adjusted p11 to 4 and p12 to 20 but the servo gave an alarm with that settings so i increased the p12 to 4000 with that setting it works without giving any alarm.

When it gives repeated alarms with the following error (P12) set to 20 means that the servo cannot accurately follow the
toolpath. You need to work out why. With the setting at 4000 what you are saying is that you'll tolerate:

4000/10000 x 25=10mm of deviation before the machine faults.

The most likely problem is that you have too high acceleration set in Mach4 so the toolpath will zoom off in a new direction
but the servo can't keep up because it has to lunk a huge piece of iron around.

Set all the acceleration parameters in the servo drive as high as you possibly can then reduce Machs acceleration in that axis until
the machine no longer alarms. That then is the true measure of the acceleration the servo is capable of producing with
that axis mass.

Craig
Title: Re: Mach4 positioning error
Post by: joeaverage on December 16, 2019, 12:16:23 PM
Hi,

Quote
There is no HF source within the controller, its just the motherboard, PMDX+ESS+spindle board attached to pmdx and input boards, there is only a small PSU(with metal cover) which supply power to the motherboard. There is no noise source that i know of but that led should not be flashing in idle state.

You are correct, the step signal should not be flashing unless the axis is moving.

Do you have an oscilloscope? I would probe the step output of the ESS and the step output of the BoB.

Craig
Title: Re: Mach4 positioning error
Post by: hyildiz on December 16, 2019, 02:28:43 PM
Hi Craig,

I will adjust p12 later as u describe when i solve this huge problem.

I forgot to mention that i saw that flashing led 2 times in machine idle state and it didnt go away until i move an axis back and forth for some time.

I dont have an oscilloscope but if tomorrow Y axis moves as it should be with parallel port commands from another computer, i will take apart all the controller cabinet and build it from scratch electric/electronic wise, thanks.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: joeaverage on December 16, 2019, 06:39:16 PM
Hi,

Quote
I forgot to mention that i saw that flashing led 2 times in machine idle state and it didnt go away until i move an axis back and forth for some time.

I believe you have found the root cause of the problem which inspired this thread.

Quote
with parallel port commands from another computer, i will take apart all the controller cabinet and build it from scratch electric/electronic wise, thanks.

You are in danger here of identifying the problem area WITHOUT finding out why. You may succeed in fixing the problem with a rebuild but still be none the
wiser as to what is happening.

Clearly you have invested a lot of time and money into this project, find a technician with an oscilloscope and pay him/her to indentify the problem properly
or risk having the same thing occur later.

Quote
I will adjust p12 later as u describe when i solve this huge problem.

With regards this problem there may be a software oscilloscope in the tuning software, if any. If you monitor the position error you will learn a huge amount about
your machine and controller. I have attached a screenshot of part of the Delta software scope. Note how you can identify and monitor certain variables, like
commanded position and feedback position etc. Very useful for identifying problems.

Craig
Title: Re: Mach4 positioning error
Post by: RICH on December 17, 2019, 08:54:33 AM
I believe that led should flash only when u move an axis. Anyone has an idea about this?

The PMDX manual has detailed info about the LED's.

RICH
Title: Re: Mach4 positioning error
Post by: Overloaded on December 17, 2019, 11:17:19 AM
Nice catch RICH.  :)

From that manual:

"Steps LED Flickers when activity is detected on pins that may
be used for step signals. The PMDX-126 does not know which
pins are being used as “step” signals, which are used as “direction” signals or which are used
for some other function.  The PMDX-126 assumes that all of the signals listed in Table 14
could possibly be step signals and monitors them for activity. 
The PMDX-126 also does not know the polarity of the step signals, so it looks for a rising edge on
any of the signals listed in the table and calls that “step activity”. 
This has the side effect that changing a direction signal may cause the “Steps” LED to flicker. 
Likewise, any activity on parallel port #1 pin 1 or parallel port #2 pins 1 or 16 will cause the “Steps” LED to flicker."

"When using outputs “1”, “14”, ‘16”, 17”, “A”, “B”, “C” or “D” for step and direction
signals, connect the “step” signal to pins “1”, “16”, “A” or “C” in order for the
activity monitor to function correctly."
Title: Re: Mach4 positioning error
Post by: hyildiz on February 19, 2020, 12:11:42 PM
Hi Guys,

I wanted to close this thread by writing the real cause of the errors i was reading.

I was not the electronics, noise or Mach4, i changed the controller from mainboard to bob completely and it was repeating the same errors.

The error was there because of the mechanical problems, half of it was because of the angle errors in the support units i ordered from a manufacturer in China(they should be 0.01 accurate but manufacturer did them 0.1 accurate because of the misunderstanding) which i connected the ballscrew bearing units and motors. And the other half was because of the backlash and error in the real pitch values, when backlash compensation done and step per unit pulses tuned after scraping the support pieces and paralleling/squaring them to the each axis by hand within 5 microns, now, every axis has good positional repeatability with max 15microns error.

I think the best thing can be done in here is to replace the longest axis's ballscrew/support units with 40mm diameter, double nut, C3 precision, mid preloaded ballscrew and C3 heavy duty support units because the one i have in hand in the Y axis has the best backlash value of 5microns.

And for measuring the positioning error and tuning the every axis of this type of machines i think the best way is to get a precision linear scale from a good brand like mitutoyo and use it to take the measurements via Mach4.

The one i attached below should be more than enough for my purpose it has 5-6microns accuracy within 1000mm, any of u connected this kind of linear scale to Mach4 before? or know how to connect it to Mach4 via pmdx-124 and ess? any other breakout board needed?

My aim is just reading the encoder values with Mach4 and tune the axis manually.

Thanks to all of u for your help.
 
Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: mcardoso on February 20, 2020, 09:40:45 AM
Hakan,

Thanks for getting back to us with the root cause of your issue!

You should be able to read encoders into Mach 4 given you have enough pins and your BOB supports it.

The ESS is able to use all inputs for encoder input as far as I know. The one limitation is that you must use single ended quadrature encoders. The ones you linked look to be FANUC output which wouldn't work directly. There are some companies which sell converters for converting SIN/COS, LVDT, resolver, or other types of feedback to quadrature, but they are not super cheap.

I'd recommend finding encoder that directly output quadrature (5V TTL), however here are some links for converter boards if you prefer to go that route.

http://www.pico-systems.com/resolver.html

http://pico-systems.com/osc2.5/catalog/product_info.php?products_id=33&osCsid=qgn1d3kdkqc3v8b254gs00sj51

http://pico-systems.com/osc2.5/catalog/product_info.php?products_id=27

https://www.vegacnc.com/hardware/resolver-to-encoder-w-hall-din-panel-mount/vega-2790502/

Mike
Title: Re: Mach4 positioning error
Post by: hyildiz on February 20, 2020, 11:10:16 AM
Hi Mike,

Thanks for the info, that encoder is the one i can get with very suitable price so it would be better for me to go in that direction.

I think in its documents it says that the output method is "differential line driver" i do not have much knowledge in encoders but what i understand is it has output like A, A-, B, B- right? and as much as i know ESS accepts the encoder signals as A, B(i think they call it TTL) so i thought that if i get this;

https://www.cnc4pc.com/c46-differential-to-single-ended-converter.html#description

I could connect the encoder at one end and connect the other end(A, B output) to the ESS via BOB, so in my mind it should work but in real world nothing works like the way it works in my mind :)

So u are saying that i should get this;

http://pico-systems.com/osc2.5/catalog/product_info.php?products_id=27

and connect the encoder's A, A-, B, B- pins to input of it and connect the output of it to ESS via BOB and it will give the output as A, B right?

that encoder is worth 2700USD so buying the 150USD board to make it work with Mach4 is not a problem, i just want to make sure that its gonna work like that.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: mcardoso on February 21, 2020, 09:49:28 AM
I had to dig deeper on that encoder. Let me revise my earlier comment. Based on this data sheet from Mitutoyo (https://www.mitutoyo.com/wp-content/uploads/2012/11/E4189-539_579NC_Scale.pdf), the encoder outputs EIA RS-422A which is compatible with FANUC controls using quadrature counting with serial backup and absolute positioning.

It seems you can use pins 1-7 on the connector to read the scale as a traditional differential quadrature encoder (compatible with ESS), however you will not be able to interface with the serial connections without some special effort and custom interfaces. Without the serial data, this encoder is no longer absolute, but remains fully functional as incremental.

The FANUC control that this encoder is designed for would read the serial data at startup to get the absolute position of the scale, and then use the quadrature signals afterwards to count pulses. Every so often it will query the serial channel to make sure that the position that it has counted to matches what the encoder thinks is right. Any error here would trigger an alarm.

I would still think that a more traditional encoder such as the Mitutoyo AT202 (identical in size to your selected AT332) or the AT211 (smaller in cross section and available in higher resolution) would be the best choice since you won't be able to use the serial channels of the AT332 anyways. I bet they are less expensive too.

You will need a differential to single ended receiver, but I would check to make sure the CNC4PC is going to be fast enough for your application (email them since it is not published). The resolution x travel speed of your scale will set the output frequency. This must be lower than the capacity of the chip they use on their converter.

With the information posted above, you will not require any boards from pico-systems as all the encoders we are looking at output quadrature signals. Those boards would be used if conversion from another type of feedback was required.

Lets make sure we are on the same page before you go buy stuff. I don't want to mislead you here.

Mike
Title: Re: Mach4 positioning error
Post by: hyildiz on February 21, 2020, 11:17:09 AM
Hi Mike,

I think the same, it should work with cnc4pc diff. to single ended converter board, in some forums i read that people make these encoders work by just connecting the A and B phases to ESS(i am not sure that it works as it should be like that) but i will try it with cnc4pc board.

Again, that model would be better in my case, i will not pay the original amount to it i found it way more cheaper than that, and since i am going to use it as a ruler basically to check the positioning accuracy of each axis, i am not going to need the absolute option, incremental reading should be enough for me. I will write a lua script which will make the axis move to different positions, say 10-15 different locations in different speeds, check the commanded and actual movements(from the linear scale) and then calculate and output an average positional error value. I will also use this method to check/tune the positioning accuracy of the small machines i am going to manufacture and sell.

I will check with the Andy from Warp9 and CNC4PC guys before i order anything, i just wanted to get someone's opinion who knows more then me about the encoders and this technical stuff.

So thanks for your help and the document u attached.

Regards,

Hakan
Title: Re: Mach4 positioning error
Post by: mcardoso on February 21, 2020, 11:24:58 AM
Perfect!

I bet you could use it without the converter to be honest, but it would be more susceptible to issues with noise.

Mach 4 also has screw mapping which could be useful for you using these scales. You can fix lead and cyclic error, but not backlash or mechanical inaccuracy.

Mike
Title: Re: Mach4 positioning error
Post by: hyildiz on February 21, 2020, 11:52:27 AM
Yes,

in current machines i use(with ballscrews) i am gonna tune them more accurately with it and fix the lead error as much as possible via Mach4, i fixed the backlash issue for now with backlash compensation but its not an healthy way to solve it as u know, i am gonna fix it by changing the ballscrews/support units with more precise(preloaded double nut, C3 precision) ones.

In the machines i am gonna manufacture from now on i am gonna use linear motors so there wont be any backlash problem at all.  ;)

Regards,

Hakan