6 Replies Latest reply on Dec 17, 2014 9:28 PM by hemalchevli

    Control 20 DC motors with edison?


      I have a problem for which I have one of the way of solving it, I'm not sure its the best one.

      So I have to control 20 DC motors with speed and direction control using H bridges so in a perfect universe I need 40 PWMs.

      At a time 1-3 motors will be active.

      My solution :

      Connect edison to an arduino mega2560 with 15 dedicated PWMs pins and use softPWM library and communicate edison and arduino via i2c. This just a thought yet to be implemented. I'm sure if I walk down this path I be able to do it.

      There is an PWM expansion board called TLC5940 which gives 16 PWM channels and can be daisy chained, but the libarary is not compatible with edison yet.


      Later on in the development I plan to use edison's wifi/BT to connect to handhelds and control motors from it.


      Thanks for you help.

        • 1. Re: Control 20 DC motors with edison?

          Hi hemalchevli,


          It is interesting. Let me take a look to the TLC5940 because I'm not familiar with it. I will investigate also about other options that might be helpful for what you want to do.




          • 2. Re: Control 20 DC motors with edison?

            Have you considered the I2C-bus controlled PCA9685? It seems a lot simpler to interface to Edison.

            • 3. Re: Control 20 DC motors with edison?

              Thanks Rubidium, it does seem simpler method of implementation. I need to figure how it can be chained.

              • 5. Re: Control 20 DC motors with edison?

                Hi hemalchevli,


                I've been testing the libraries for the TLC5940 and the PCA9685. I don't know if you already were able to find a solution but I will explain what I got:


                I downloaded the TLC5940 library from here: http://playground.arduino.cc/Learning/TLC5940. Then I tried to compile an example but I was not able to do it, so I decided to try with the PCA9685.


                I downloaded the PCA9685 library from here: adafruit/Adafruit-PWM-Servo-Driver-Library · GitHub. Again as before, I tried to compile an example but I was not able to do it, but in this case I modified the Arduino.h file in the Arduino IDE and I was able to compile the code using the Edison. Also I replace the line 21 in the file Adafruit_PWMServoDriver.cpp with this:


                #if defined(__AVR__) || defined(__X86__)


                I don't have the Adafruit board to test the code in order to know if it is really working, however I have a logic analyzer so I decided to check the I2C lines in order to know if at least there were any data flowing through them. I took a screenshot, check below:


                I2C Screenshot.JPG


                Since I don't have the Adafruit board I'm not able to check all the data flowing through the I2C lines but I got something, so I think the library is working in the Edison.


                I attached the Arduino.h file if you want to do the test. You have to copy it in ...\arduino-1.5.3-Intel.1.0.4\hardware\arduino\edison\cores\arduino. Just replace the existing file. I hope you find this useful.




                • 6. Re: Control 20 DC motors with edison?

                  Hello Diego,

                  Yes we landed on the same thing, Even I could not get the TLC5940 as it relies heavily on internal AVR registers.

                  WIth the PCA9858, I didn't know how to define "edison" in library, thanks to you now I know its  __x86__ ,  So I took the dirty route and changed 27 line to #define WIRE Wire. I did not to modified the Arduino.h file and was able to compile the servo example , the pwm test example uses an internal register TWBR, so was not able to compile it, if commented out it works.


                  Since you getting the data stream, library is working.

                  I don't have a PCA9858 board as I'm short on deadline I could not wait for the parts to arrive, so I used the tools at hand.

                  Currently  I'm sending data from edison using Serial, all the commands are stored in an array , on the slave side I'm using arduino mega adk and parsing the serial string and taking the appropriate action. When the command is executed on arduino board, it requests for next command and edison sends the next one and it keeps on looping.


                  Thank you for your time and effort.



                  Hemal Chevli