Re: ESP32 GPIO Interrupts Missing
Posted: Sun Nov 10, 2024 7:59 am
Unfortunately it looks like the motor hardware is the problem - on some motors the rising edge on CHA is before the falling edge on CHB and on others it's the other way round. I'm getting very consistent results across the batch of motors I'm testing with ~50% counting less pulses than the other 50%
However I do know which way the motor should be running, so I'm going to try a couple of different approaches:
However I do know which way the motor should be running, so I'm going to try a couple of different approaches:
- Before turning on the power to the motor, configure the counter for the expected direction.
- Set up two counters for each motor - one configured for clockwise rotation the other for anticlockwise, and then use these to derive the correct number of shaft rotations