dcservo icon indicating copy to clipboard operation
dcservo copied to clipboard

Question: Is it possible to run 4 slow motors with 4 encoders on one DUE?

Open Fireflaker opened this issue 5 years ago • 2 comments

All Arduino DUE pins can be used for interrupt and I think the controller clock speed is sufficient. Motor speed=60RPM, Encoder = cheap quadrature rotary knobs taped to the shaft. I am wondering if this code can possibilly work with multiple encoders sending pulses at the same time. Thanks!

Fireflaker avatar Apr 29 '19 23:04 Fireflaker

Sure, but you will need to adapt the code that checks for the pin values (direction and encoder pins). Using a rotary knob is not something I would you. For around $10 you can get a higher resolution optical one that will give you better resolution, long lasting operation and noise-free signals. Make sure the one you but can work at 3V3 (most can do that).

Code can work with multiple motors, but you need to create a PID object for each one, and call its compute method within the main loop, plus each encoder will need to use a different interrupt code and location variable.

Bluepill can be a cheaper alternative to an Aduino DUE.

misan avatar Apr 30 '19 09:04 misan

Thanks!!

Fireflaker avatar Apr 30 '19 15:04 Fireflaker