Absolute encoder zero problem

J

Thread Starter

Joe

An absolute encoder will have a random off-the-shelf position. Scaling the raw count to engineering units isn't a problem until the encoder wraps around to zero somewhere in mid travel of the machine, then the scaling is invalid. We want to intall them without having to first position the encoder in mid range on the bench using a motor, etc.

Need some code that will make this transition through zero transparent to the scaling code. We're using Modicon FBD but we can translate any coding example into FBD.

Any ideas are appreciated. Thanks.
 
M
You need:
Machine startup:
1. A way to tell the PLC that the current machine (encoder) position is mechanical ZERO (e.g., a push button wired to an input).
2. Store the current encoder reading (let's call it Z).

Machine operation:
3. Compare current encoder reading (let's call it C) with Z (stored in step 2 above):
4. Have another register for the real reading (let's call it R) you want to use (scale).
5. If C >= Z then R = C-Z / else R = Z+C.

Meir
 
I had the same issue on a continous motion machine with absolute feedback. I keep track of the position at the start of the cycle. Subtract it from the rollover position. Detect when the current position is less than the rollover (in any given cycle), then add the difference value to your current position. This scheme works as long as the travel of the axis is less than one complete modulo (rollover) value.

If your axis just moves back and forth between two positions, then this is relatively easy.

If your axis runs continuously in one direction, and you are looking at a probe or latched position for reference within any given machine cycle, then add a rollover check.

The devil's always in the details, but this works well in my applications.

mbrugman

 
One suggestion that I have is to consider looking at Stegmann's Absolute encoders. They have a simple button that is hidden under a screwed on cover. This button sets the encoders current position as the zero point. This way the off the shelf encoder position could always be zero, and no lossening of the shaft, turning the encoder to zero, etc is needed. Also by having the small button hidden under the screw cover I have had no problems where the button was mistakenly pressed, or maintenance persons pressed the button in error. I have found this to be a very useful feature in several projects that I have worked on.


 
J

Johan Bengtsson

hi
One possible solution....
You make something like this:

read_enc -> newpos
newpos-lastpos -> diff

if diff > half_res then diff - full_res -> diff
if diff < - half_res then diff + full_rese -> diff

actual_pos + diff -> actual_pos

newpos -> lastpos

The idea is to calculate how much difference you have from the last position
and increment/decrement with that amount. If you find out that you have a
difference more than half the possible steps of the absolute ecoder you have
a wrap arund and add (or subtract) a full turn.

full_res is the number of values you can get from the encoder, ie if the
encoder gives you values between 0 and 4095 then full_res is 4096 steps
(note: the value 0 is also a value and should be counted!)
half_res is full_res / 2

The "important" part in the middle can be done in a number of other ways,
for example with modulo calcualtions.

/Johan Bengtsson

Do you need education in the area of automation?
> ----------------------------------------
> P&L, Innovation in training
> Box 252, S-281 23 Hässleholm SWEDEN
> Tel: +46 451 74 44 00, Fax: +46 451 898 33
> E-mail: [email protected]
> Internet: http://www.pol.se/
 
D

Donald Pittendrigh

Suggest you purchase a Fraba encoder, it doesn't do this, you synchronize the encoder where ever you want it, it can only roll over if the range of
travel exceeds the number of turns the encoder is designed for, if that is the case, then you need to look at gearing, the Fraba encoders go p to 4096 counts per rev, and 5182 turns, excellent product, outputs the shaft speed and has cam switches as well.

Regards
Donald Pittendrigh
 
Joe,

From the sound of your posting, you install the encoder into your machine, then it rotates back and forth, never going more than 1/2 revolution in either direction from the initial position. Is that correct?

Save the initial count. If you want that to represent the midrange value, use the following logic:

if Initialize then Initial_Count = Encoder Input

Current_Count = Encoder_Input - Initial_Count + Half_Range_Count

if Current_Count < 0
then Current_Count = Current_Count + Full_Range_Count

if Current_Count >= Full_Range_Count
then Current_Count = Current_Count - Full_Range_Count

Now you have a value from 0 -> Full range using the initial value as the midrange position.

Rufus
 
B

Bouchard, James \[CPCCA\]

The whole reason for using an absolute encoder is to know where you are at all times. If you make the transition from full to zero transparent they you have defeated the purpose of installing an absolute encoder and might just
as well use an incremental one and count pulses.
 
Top