High speed counting - encoder Renishaw RLS RLBD01_04

Dear colleagues

I have problem with the counting impulses from the "encoder Renishaw RLS RLBD01_04". This is the magnetic incremental encoder.

For my application I am using magnetic linear tape with this encoder : Linear miniature encoder | RLB encoder - www.rls.si
With that system I am able to determine position on linear axis.

And what is problem now?

Firstly, I connected encoder to the arduino Mega and I got it working, but just like as I thought the problem is being caused by the fast movements.

The code for that is nothing special, for the test, simple example code from encoder.h library is enough.

#include <Encoder.h>

// Change these two numbers to the pins connected to your encoder.
//   Best Performance: both pins have interrupt capability
//   Good Performance: only the first pin has interrupt capability
//   Low Performance:  neither pin has interrupt capability
Encoder myEnc(5, 6);
//   avoid using pins with LEDs attached

void setup() {
  Serial.begin(9600);
  Serial.println("Basic Encoder Test:");
}

long oldPosition  = -999;

void loop() {
  long newPosition = myEnc.read();
  if (newPosition != oldPosition) {
    oldPosition = newPosition;
    Serial.println(newPosition);
  }
}

If I am moving encoder slower with speed 10 mm/s it seems everything okay, but faster speed is causing step/increment losses.

I tried than also to connect encoder with the same code to the nodemcu and now it seems that it's possible to monitor also higher speeds, but it is still not what I want.

So, after explanation of my problem, I can say that I would ask for your opinion. What to do now?
Probably, I can find a good high speed counter module?

Any suggestion is welcome.

Thank you very much in advance.

Best regards,
Ivan

Most likely you trying to print every single value (it takes about 1 ms per character at 9600 bps) is to blame.

How fast is fast? Arduinos can handle pretty fast signals. A couple thousand a second is nothing.

ivan_2:
Probably, I can find a good high speed counter module?

Don't ask me details but I'm certain it was mentioned on this board very recently that one of the Arduinos has built-in hardware quadrature decoding capability.