encoder value

seee

Member
Join Date
Dec 2010
Location
singapor
Posts
112
hello.

i have an absolute encoder which is 12 bit and 4096 revolutions.
the maximum output value of the encoder is 2^12=4096*4096(revolution)=16777216
i read the encoder value in plc s7-300 in variable table with instruction
pid256 and it showed dw#16#51d72800 this value is greater than the maximum
output value of the encoder(16777216)! why?(if i turn encoder 4096 the maximum output value must be 16777216)!

how can i read encoder value and compare it with 4096 in order to know that
the encoder has been rotated 1,2,3 etc turns?

best regards.
 
What make and type is the encoder ?
How is the encoder value entering the PLC ? A-B pulses ? SSI ? Profibus ? Or..?
Is there a reset function for the encoder ?
If so, have you programmed it ?
What happens if you reset the encoder, and you turn the encoder 1 revolution ?
 
hello.

i read the encoder value in plc s7-300 in variable table with instruction
pid256 and it showed dw#16#51d72800 this value is greater than the maximum
output value of the encoder(16777216)! why?(if i turn encoder 4096 the maximum output value must be 16777216)!

The encoder value is a DINT not a DWORD.
 
Last edited:
I read the encoder value in plc s7-300 in variable table with instruction pid256...
Make sure that you are looking at the actual encoder count that come directly from the encoder. You could be looking at a number that has been scaled or changed for some other purpose.
 
Stop your condesending behaviour Pego !! :D

It,s a statment as in... look into the details of your encoder more closely...
An absolute encoder generates digital words that represent the encoder’s actual
position, as well as its speed and direction of motion. If power is lost, its output will
be correct whenever power is restored. It is not necessary to move to a reference
position as with incremental type encoders. Electrical transients can only produce
transient data errors, usually too brief to effect the dynamics of a control system.
An absolute encoder’s resolution is defined as the number of bits in its output word.
This output can be in straight binary or in gray code, which produces only a singlebit change at each step to reduce errors.


The difference between incremental and absolute encoders is analogous to the
difference between a stop watch and a clock.
A stop watch measures the incremental time that elapses between its start and
stop, much as an incremental encoder will provide a known number of pulses
relative to an amount of movement. If you knew the actual time when you started
the watch, you can tell what time it is later by adding the elapsed time value
from the stop watch. For position control, adding incremental pulses to a known
starting position will measure the current position.
When an absolute encoder is used, the actual position will constantly be transmitted,
just as a clock will tell you the current time.

Single vs. Multi-Turn
In a single-turn encoder, the output codes are repeated for every revolution of the
encoder’s shaft. There is no data provided to indicate if the encoder had made one
revolution—or 1000 revolutions. With multi-turn absolute encoders, the output is
unique for each shaft position, through every rotation, up to 4096 revolutions.

 
I have a crystal ball.

hello.

i have an absolute encoder which is 12 bit and 4096 revolutions.
the maximum output value of the encoder is 2^12=4096*4096(revolution)=16777216
This is a standard 24 bit absolute encoder. The lower 12 bits indicate the fraction of a turn and the upper 12 bits indicate the turn number.

i read the encoder value in plc s7-300 in variable table with instruction
pid256 and it showed dw#16#51d72800 this value is greater than the maximum
output value of the encoder(16777216)! why?(if i turn encoder 4096 the maximum output value must be 16777216)!
The upper 8 bits are usually either garbage or status bits. In either case you should do a AND instruction with 0x00FFFFFF to strip off the upper garbage or status bits before using the encoder counts. This happens when the hardware designer doesn't tie the upper bits low and lets them float.

how can i read encoder value and compare it with 4096 in order to know that
the encoder has been rotated 1,2,3 etc turns?
best regards.
After ANDing with 0x00FFFFFF I would then do a shift right double 12 bit locations. The result is the number of turns.

Bicker, bicker, fuss, fuss. How silly do the rest of you feel? The answer is easy. I will let the S7 programmers redeem themselves by showing you the STL that does what I said above. It should take about 3 instructions.
 
Peter Nachtwey said:
This is a standard 24 bit absolute encoder. The lower 12 bits indicate the fraction of a turn and the upper 12 bits indicate the turn number.

Eureka. I've never used a multi-turn absolute, so that made my light go on.


Peter Nachtwey said:
Bicker, bicker, fuss, fuss. How silly do the rest of you feel? The answer is easy. I will let the S7 programmers redeem themselves by showing you the STL that does what I said above. It should take about 3 instructions.

Careful, Peter, you're gonna get lumped in with us old, arrogant, rude pharts...

Thanks for the explanation and the kick in the arse. Your ESP exceeds most all others when it comes to this stuff.
 

Similar Topics

Hi experts, im new to PLC programming im using siemens plc(315) and Fraba absolute encoder my project is to activate output (Q4.5) when encoder...
Replies
4
Views
1,977
Hi, I want to know how we show the inremental encoder value in 360 degree at wincc flexible runtime. Encoder is Omron E2B2-CWZ6C 200P/R PLC is...
Replies
2
Views
2,321
Hi, guys, how r u? We have a small project to control a blade up and down. After the configuration on 1768-L43, we downloaded the program and DIs...
Replies
2
Views
1,231
I am using RSLogix 5000 with a Kinetix 6000 servo system and I sometime see the value of the Master Encoder change after a very simple program...
Replies
9
Views
9,604
hi everyone. I have a problem with 231 parameters (0 encoder feedback). when engine control with encoder feedback, the value of the feedback as I...
Replies
0
Views
1,851
Back
Top Bottom