I'm running into a problem right now with a project I'm working on.
I have to control the position of 2 DC motors and therefore have attached an encoder (HEDM-5500) with 1000 counts per revolution to each one of them.
I'm running my motor control loop at 1kHz (Timer interrupt), where I generate my position setpoint, handle the PID calculation and measure some data with the ADC.
If I'm only ever reading one of the encoders using the Encoder library from Paul Stoffregen everything works fine, but If I start to control both motors and therefore read both encoder values one of the starts to temporarily not count steps.
I think I'm running into a problem with the interrupts not being called, but I don't know.
My PID calculation stuff is definitely fast enough, it takes at max. 750 µs out of the 1000 µs available, but even if I lower the control loop frequency and therefore give the system more idle time nothing changes with the encoder behaviour.
I hope someone can help me out with my problem.