Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Multiple DC motor and encoders on a Teensy 4.1

  1. #1
    Junior Member
    Join Date
    Aug 2020
    Posts
    9

    Multiple DC motor and encoders on a Teensy 4.1

    Hello forums!

    I am a student that is relatively new to electronics. I wanted to PID control six different DC motors with encoders using a Teensy 4.1. Each encoder is 2048 counts/rev, and the motor shaft will run at no more than 55 rpm. Based on the simple calculations, the number of counts per second would be around 11264 counts/s, and the Teensy 4.1 should be able to handle this just fine (it's probably overkill?).

    I guess I am posting just to confirm that my logic is right and also to ask: What else do I need to consider when writing the code for controlling all of the motors simultaneously? I don't think I need to be concerned about interrupts, but I wasn't sure if it was important (or possible) to time the interrupts...

    One more question just for my own general knowledge: Say the total number of counts per second was 100x higher. What would I have to be concerned about?

    Thank you in advance!

  2. #2
    Senior Member
    Join Date
    Feb 2020
    Posts
    104
    If you map the pins on a t4.1, you will see it can handle 4 motors using hardware quadrature decoding, 11khz is no problem. Use interrupts for tight loop timing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •