Using Renishaw Incremental Encoder to Collect Distance

I have recently purchased a LM10 incremental magnetic encoder from Renishaw encoders to help record position. I purchased the analog output version, but it uses a DB-9 output plug. I have figured out the pinouts from the datasheet, but am unable to record data. I have attempted to use a simple analogRead, but it isn't working. If someone could provide a step in the right direction would be much appreciated. The link to the product page that contains the datasheets is:
Linear magnetic encoder | LM10 encoder - www.rls.si

the LM10 datasheet indicates the output is differential sinusoidals - recommended termination is a 120ohm resistor
what Arduino are you using?
upload circuit schematic showing how you have connected the LM10
upload the test program (using </> code tages)

I'm using a MEGA. My basic code is just :

void setup() {
Serial.begin(9600);
}

void loop() {
analogRead(A2);
Serial.println(A2);
delay(1000);

And my circuit schematic is very simple with just plugging directly off the pins on the connector into the arduino board.

Pin 1 = GND > Arduino GND
Pin 5 = 5v > Arduino 5v
Pin2 = V1 > Arduino A2

Is there a missing brace after the loop functions?

This appears to be a quadrature type of encoder. There are 2 outputs V1 and V2 and each is presented by a differential pair - e.g. V1+ amd V1-. Each of these seems to vary up and down relative to some reference voltage between 0v and the supply voltage - probably at mid rail. So you have to sense and sample each of the 4 voltages and take the differences V1+ - V1- and the same for V2; then you compare these to estimate position. So 4 analog inputs are needed and you may need better precision than the standard analogue input ADCs give. Alternatively you could do the differencing in analogue with a pair of differential amplifiers and then digitise their outputs.

Looks like fun! Good luck!

which version of the LM10 do you have?
have you had a look at the output signals using an oscilloscope?
maybe worth contacting RLS for advice on connecting the LM10 to a microcontroller

I have the LM10AV and that was my next course of action.

Sorry I forgot the ending bracket in my pasting. Thanks for the advice I'll go and try that next to see if I get anywhere.

Your code is completely non-functional.
First line of the code above is useless, because you don't save the result of analogRead(). The next one will be print the pin number and not the signal value from pin.

For doing it correct you should first save the return value of analogRead() to the variable and than print it

int value = analogRead(A2);
Serial.println(val);

I advise you to start by studying some arduino manual, because without basic concepts of what pins are, what they are and how to work with them, you can hardly succeed

Aha, so the AV has the additional short reference logic level pulse which may help to do the decoding. Looks like you still seem to have to do some computing with the sinusoidal signals to resolve position down to less than 2mm (which is the sinusoidal period length).

Did you make any progress please? Where did you get the sensor from, direct from Renishaw? I'd be quite interested to see how you get on. I have equipped a milling machine with magnetic scales though not the Renishaw ones, I suspect they would be much more expensive!

I have still not made progress, but I did get the encoder directly from Renishaw. They are pretty reasonably priced though.

Hmm, what is "reasonable" please?

I don't remember the exact number cause I ordered for a work project. But I believe it was in the ball park of around $500 for a very accurate model. This is significantly cheaper than a lot of the other "high-end" encoders.

Ah! That's about what I paid for a complete 3-axis DRO with scales and readout! Not Renishaw quality of course...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.