Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Fireflaker opened this issue Apr 29, 2019 · 2 comments

Comments

@Fireflaker
Copy link

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!

@misan
Copy link
Owner

misan commented Apr 30, 2019

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.

@Fireflaker
Copy link
Author

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants