Hi , Is there a way that I can read the input of TR1 rotary encoder .and convert the represent the data in Milimeters (mm).

## convert rotary encoder input to mm

mm = rotary_count * MAGIC_SCALE_FACTOR;

Since you probably don't have MAGIC_SCALE_FACTOR defined yet, we'll all need more info.

If each detent on the represents X millimeters, then:

dist = numberOfDetents * X;

And of course, MAGIC_SCALE_FACTOR depends on the diameter of the wheel and any gearing...

/mike

I bet this is to see how far the wheel has turned by counting encoder pulses. Wheel circumference is pi x diameter. If the encoder has 12 pulses per rev, you can calc the mm per pulse.

The easy way?

Move the thing some known distance, say 1 meter and count the pulses. Save this as SF.

Then, for any number of pulses, you can figure the distance in mm by multiplying by 1000 and dividing by SF.

(There's no accumulated error if your scale factor happens not to come out to a reasonable clicks/mm.)

**arpit007 wrote:**

Hi , Is there a way that I can read the input of TR1 rotary encoder .and convert the represent the data in Milimeters (mm).

What is rotating along with the encoder? Without knowing this, there is no way to answer your question.

Is it a lead screw? Is it a belt or chain?

If it is a lead screw, what is the pitch?

If it is a belt or chain, what are the specs of the sprocket or pulley and the pitch of the belt or chain?

hii

i have a system in which i have to calculate the length in mm from the encoder pulse which is connected to GEAR BOX and after gear box there is a chain and that chain is moving a lead screw . so i want to know what are the parameters i need to consider for the length calculation

thank you

Isn't it just simple arithmetic? Think the spokes of a bicycle wheel....

Say the wheel has a diameter of 45cm and has 28 spokes. The 45cm diameter means the Pid circumference is 3.14 x 45 = 141.3 cm and if there are 28 spokes then the passage of one spoke represents 141.3 / 28 = 5.04cm of travel. If there's gearing involved then that will introduce further division/multiplication factor but this is basically just junior school maths.

Has that not all been covered in the preceding posts in this 7 year old thread ?

**maxsingh wrote:**

i have a system in which i have to calculate the length in mm from the encoder pulse which is connected to GEAR BOX and after gear box there is a chain and that chain is moving a lead screw . so i want to know what are the parameters i need to consider for the length calculation

Sounds like you need a friend who is a mechanical engineer!

You will need to know for one turn of the gear box input shaft, how far did the lead screw follower move! Be as precise as possible with this measurement as any error will accumulate with each turn.

It may be better to turn the input 1000 turns and take the measurement of distance moved, then divide by 1000.

Good luck.

Jim