PID feedback & Position Controller with DC motor/encoder
问题 I'm having a hard time getting both PID feedback and positioning to run at the same time. My thought to calculate the RPM is to: start a timer and count encoder pulses using an interrupt. use some simple math to convert to RPM. reset variables used and start over. I can calculate RPM but then I can only call my PID controller after the calculation (however long I want to wait to get good resolution.) This results in very messy code. Is there a simpler method or something I'm missing? Info