Go Down

Topic: Several motors simultaneously - what is the best strategy? (Read 1 time) previous topic - next topic

alexander_ino

Hi all.

I have to control 4 servo motor, simultanously.

The motors has to move in different speeds each one.

So, I don't know what would be the best strategy for deal with it... since the different speeds implies in different 'delay' values... but at the same time all the motors has to move together.

Any idea?

I've started an software to do serial communication (send position, what motor, etc) and the Arduino would be in charge only with the most basic job (evalutate the data and turn the motor). But I've realized that: if I have to send a single bunch of data to do a movement... I can't move several motors simultanously... or, maybe, I have to send a chain of data but each chunk should be so small (to make everything works like simultanously) that the overal speed (prepare data, send via USB cable, be interpreted, etc) probably would be too slow (and so my project ruined).

I thought using an single Arduino for each motor would be a better idea... but... 4 USB ports... 4 Arduinos, syncronize everything, etc... doesn't seem to be a good idea.

Thanks!
Alex
Brazil - Rio de Janeiro

Grumpy_Mike

You can't directly control the speed of servo motors. All you can do is give them repeated small position changes.
You can do this for many motors at the same time if you use the technique in the blink without delay example you find in your IDE.

unexpectedly

Also read this page on the Rugged Motor Shield. He gives instructions on how to stack multiple shields as well as giving link to a library which allows the simultaneous control of multiple motors of varied speeds.

Grumpy_Mike

Quote
instructions on how to stack multiple shields

Yes but you don't need a motor shield for driving a servo, just a controlling pulse train. So no great current to drive, it can be connected directly to an I/O pin.

retrolefty

Well first you have to decide if you using modified 'continuous rotation' servos or standard servos. The first are easier if you just need to control the speed of your servos and require no precise position control.

Go Up