Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Romanr9999 on October 05, 2012, 04:13:48 PM

Title: Encoders config
Post by: Romanr9999 on October 05, 2012, 04:13:48 PM
Hi everyone.

I converted a manual mill to CNC and installed ballscrews, steppers and also encoders, so I can keep the 'manual mode' where the encoders tell Mach3 how far I manually move the table.

My encoders have 1000 ppr and the ballscrews have a 5mm pitch, so the counts per unit should be 800. This is my current setup.

Now, after some testing I discovered the following:

I marked the 400mm on the table and double checked this with movements with the steppers.

To make sure I'm not dealing with any noise coming from the steppers or the drivers, I turned them all off and moved the table manually.
I move the table 400mm and the encoder says I moved 404.125mm (not sure if the decimal portion of the 404.125 is ok, but for sure it was a little over 4mm more than expected).
This means I have over 10% of error, way too high.

Why could this be happening?

Thanks in advance to everyone.
Title: Re: Encoders config
Post by: Hood on October 05, 2012, 04:37:11 PM
Ballscrews definitely 5mm pitch and not 0.2inch pitch?
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 05, 2012, 04:48:07 PM
Yes, ballscrews are 5mm pitch.
Automatic movements (with the steppers) seem to be moving the desired distance. At least in this test of 400mm I checked and it's definitely closer to 400 than the 404 the encoders give (measured manually with a tape).
Title: Re: Encoders config
Post by: Hood on October 05, 2012, 04:57:45 PM
What kernel do you have Mach set to? Encoder input is not that great via the Parallel Port but still should be more accurate than that.
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 05, 2012, 06:13:11 PM
I 'm using the default 25 kHz.
I just tried with 35 kHz and 45 kHz with no changes. I still get little over 4mms in a table 400mm movement.
Title: Re: Encoders config
Post by: Hood on October 05, 2012, 06:24:52 PM
25KHz would be the one that would give best results so its not that.
Was thinking maybe encoders were 1024 but that would give you 9.6mm over reading I think so not sure where the issue is.
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 05, 2012, 06:49:11 PM
Encoders are 1000ppr.

The error is always close to 1% of table displacement, not a constant value.
Title: Re: Encoders config
Post by: Hood on October 06, 2012, 01:37:03 PM
So if you MDI a move do the encoders show the difference?
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 06, 2012, 02:04:29 PM
That's right.
I tested it both with MDI movements and manual and in both cases I get the error.
When doing MDI movements, I start with same position indication in DROs and encoders position, after the move both values do not match.
Title: Re: Encoders config
Post by: Hood on October 06, 2012, 02:11:18 PM
Are you putting the encoder signals in via a breakout board?

Hood
Title: Re: Encoders config
Post by: Dan13 on October 06, 2012, 03:05:29 PM
Is the error the same on all axes? Are the encoders the modular bearing-less type? If so, the accuracy would depend on the installation accuracy. If a modular encoder is not well aligned you could easily get 40 counts error over a one nominal 4000 counts revolution.

Dan
Title: Re: Encoders config
Post by: Romanr9999 on October 06, 2012, 04:10:26 PM
The signals go to a board that isolates the PC's parallel port
Title: Re: Encoders config
Post by: Hood on October 07, 2012, 02:52:30 AM
Might be something to do with the isolation although I would expect that to miss pulses if it was a problem rather than add.
Dan may be on to something, is it a bearing-less type of encoder?
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 07, 2012, 10:13:50 AM
The encoders always show more distance than the DROs, so there are no missing pulses but extra ones.

Some of you may have read my recent post about electric noise affecting my probe. The solution was to a dd a few small capacitors across the inputs.

I'm starting to thing there may be noise here too, although what's strange is that the results are too similar over repetitions. If the problem were noise it should be random.
Title: Re: Encoders config
Post by: Romanr9999 on October 07, 2012, 01:08:38 PM
Right now I'm using the same parallel port (LPT1) to control the 3 axis and also to input 5 of the 6 signals from the 3 encoders.

So in all the tests I've run every signal when in and out through the same port.

Would it make any difference if I use the second LPT port to input the encoder signals?
could this help get both the encoders and the DROs read the same values?
Title: Re: Encoders config
Post by: Hood on October 08, 2012, 03:04:39 AM
It may make a difference connecting direct to a port rather than going through a breakout board.
What about Dans question, what kind of encoders do you have?
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 10:27:31 AM
Not completely sure although in the encoders data sheet ((http://gap-sa.com.ar/pdf/HE.pdf) there's a 'bearing life' parameter, so I guess the do have bearings. 
Title: Re: Encoders config
Post by: Hood on October 08, 2012, 10:44:37 AM
Yes they have bearings, the type Dan is talking about you place the encoder disc onto the motor shaft and the base fits to the motor and there are no bearings in it.
Hood
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 12:21:36 PM
No, this is a completely separate unit coupled to the motor shaft with a plastic coupler to adjust miisalignments.
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 12:23:01 PM
Now, any ideas why the encoders are not giving the same measurement as the DROs ????

This is driving me nuts. If I can't get this solved, I won't be able to use the machine in manual mode.
Title: Re: Encoders config
Post by: BR549 on October 08, 2012, 12:31:07 PM
Does the error repeat exactly each time ??

I would try calibrating the encoders to MACH3    Move a certain distance (exactly) then calculate the encoder steps required to do so. TEST then adjust till exact . OR as close as you can get based on the encoder and MACH3s steps per unit .

MACH3 is not known for errors in its math channels (;-)

IF the error does not repeat exactly each time then that is another problem.

(;-) TP
Title: Re: Encoders config
Post by: Overloaded on October 08, 2012, 12:43:59 PM
Double check your part # and pulses per.
The data sheet doesn't show a 1000 (4000 quad) pulse.
There is a 250 (1000), and 240 though.
I'm guessing the count values are not set appropriately in Mach.
Russ
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 01:12:36 PM
TP, The error is usually close but not 100% exact all the times. I thought about trying to adjust the ppr setup. Right now is setup in 800 and using something like 803 doesn't sound like a proper way to solve it. Anyway, the error is not exactly the same all the times.

RUSS, I know what you say and I saw it when I ordered the encoders. The encoders are HE50B-8-1000-3-T-24, so based on the model # they are 1000 ppr and that's what I ordered. The only thing I missed when I ordered was to try 5v instead of 24v. Now I put a BC547 transistor on each signal to adjust form 24v to the 5v I need at the board input.

The board I'm using to interface with the LPT uses a 74HC244P to isolate the LPT from the machine, although I don't think this could be causing a problem.
Title: Re: Encoders config
Post by: Overloaded on October 08, 2012, 01:28:37 PM
Just as a test, as in your first post.
Start at 0, manually move 400 then back to 0 several times. Does more error accumulate ?
Or is 0 always 0 ?
One would indicate noise, the other calibration.
Just curious,
Russ
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 01:35:39 PM
No, the error accumulates. If i MDI from 0 to 400 and back to 0 the encoders don't show 0, although the won't show everytime the exact same number.
Title: Re: Encoders config
Post by: BR549 on October 08, 2012, 01:39:26 PM
I think you have a problem in your Circuit to adjust your signals probably a noise issue.

The encoder will replicate the exact signals each time and MACH3 will interput them exactly each time so the error SHOULD replicate itself exactly each time


Just a thought, (;-) TP
Title: Re: Encoders config
Post by: Overloaded on October 08, 2012, 01:44:53 PM
You might also run the MDI test at dramatically different speeds to see if that reports differently.
Could there be a possibility that there is "chatter" in the movement ? This could cause some pulses to duplicate making the count go up for a given move ?
Is the stepper direct coupled to the screw ? Or belted ?
Title: Re: Encoders config
Post by: Dan13 on October 08, 2012, 01:46:00 PM
Don't know how encoders work with PP, but did you try playing with the debounce setting? I tend to agree with Terry that there is some problem with your circuit., picking up noise.

Dan
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 01:48:26 PM
I do believe as well it may be noise. I had noise issues testing my probe, so this could be happening here too.
with the probe I put a couple capacitors across the input and that worked as a charm, although I can't do that here since the capacitor would mask the pulses. With the probe is ok because there I don't expect a pulse train.

How can I filter the noise in this case?
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 01:50:27 PM
I tested at VERY LOW and VERY HIGH speeds and I still get errors in both cases.

I also played with the debounce and no luck.

Title: Re: Encoders config
Post by: Dan13 on October 08, 2012, 02:01:31 PM
I assume you're not using the line driver version, because the manual says it outputs 5VDC.

I would try removing the transistors and putting in resistors in series. Or try using a larger value resistor in series with the base of your transistors. It could be it's too low.

Dan

Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 02:17:33 PM
I'm using a 4k7 resistor for the base. the signal from the encoder is either 0 or 24 and the switching time should be extremely high (I assume since the encoders allow up to 5000 rpm) to affect here.
Title: Re: Encoders config
Post by: Dan13 on October 08, 2012, 02:34:57 PM
This is way too low. Try a 100k resistor. I think it's picking up noise and amplifying it.

Dan
Title: Re: Encoders config
Post by: Romanr9999 on October 08, 2012, 02:41:55 PM
I'll try and let U know.
Title: Re: Encoders config
Post by: Romanr9999 on November 30, 2012, 09:50:47 AM
My apologies for not getting back to you guys with this.
Due to work priorities I had to postpone this project and I haven't been able to test changing resistors yet.
As soon as I'm able to test this I'll let everybody know whether it works or not.
Thanks to all for your help