High speed encoder, data acquisition, save data 13kHz


I have a quadrature encoder which generates 400 pulses per one rotation (1 x 100 ppr).
I'm trying to use this encoder to measure the angle of rotation of a motor.
The speed of the motor varies from 500 rpm to 2000 rpm.

At max speed of the motor, I need to capture 13,000 pulses per one second.

I need to count the number of pulses and save the number of pulses against a time stamp.
So basically, I need to save the number of pulses against time for every pulse.

which means I will have to save data at least at a rate of 13kHz. (13,000 information per one second)

What is the method I can use to store my data at such a rate.??

I bet for an X-Y problem. Usually a quadrature decoder is used to provide an accurate input for a PID, recording the time for each and every edge is useless.

Is it a school assignment?

What is the final goal of your project?

There are several ways to record data, depending on the final goal:

  • log data inside SRAM (96 Kbytes ) if recording don't last too much.
  • SerialUSB.write() to a PC , then record on the PC.
  • SDFAT Library.
  • More exotic, record on an SD card via the HSMCI peripheral :