Hi,
this is my first time posting here but I’ve read many of the topics in the last year. All are very helpful and informative. However I did not find any that addresses my issue.
First some background. I am building a rover that will eventually be automatous, and I still have a long way to go on the systems integration. But each month I get a little closer to that end. About 99% of Ivan is designed and printed on my 3D printer. The other 1% was purchased from a variety of vendors.
Now to the details. I have two 37Dx57L mm motors and two 18v7 drivers; each motor has its own driver. I have each of these drivers plugged into separated USB port on a raspberry pi 2, model ‘B’. Each motor drives a track on rover.
I would like both motors to start at the same time, but, unfortunately, they do not. Here is the python code I am using and it is running as a background process.
if os.path.isfile("/mnt/robot/BMF"):
os.system("./smc/smc_linux/SmcCmd --device 52FF-6F06-7283-5255-3352-2467 --resume --speed 3200") # right motor
os.system("./smc/smc_linux/SmcCmd --device 52FF-7206-7283-5255-1221-2267 --resume --speed 3077") # left motor
os.remove("/mnt/robot/BMF")
Currently I have two raspberries talking with each other through NFS. One pi is motorPi and the other is sensorPi. In the future additional Pis will be added for different functionality (including voice control). The “BMF” file the code is looking for is on the NFS share.
I know I am sending two different commands through the os and this is why the two motors start at different times.
From reading through the forums I learned that the two controllers can be daisy-chained. If I do this, will both motors start at the same time? (I will need to adjust the above code accordingly too). If daisy-chain will not work, do you have any other suggestions?
Bill