Go Down

Topic: Possible to move 2 motors, simultaneous, smoothly, accurately? (Read 2007 times) previous topic - next topic



I am trying to build a laser motion controller that can rotate a laser diode horizontally and vertically using sparkfun's pan-tilt bracket.
The overall goal is:
- intervace with arduino via Matlab
- to move smoothly and accurately at various speeds - from 5deg/s to 60deg/s
- has to move both pan and tilt angles simultaneous, this is to compensate for the angle of placement. I need the laser to "draw" a horizontally moving
dot, but the laser will be mounted on the ceiling, i.e,  there will need to be tilt compensation based on the pan angle.
- need to speed to vary within the motion if possible (this is part of our experimental requirement)

So far I have got 2 servo's to prototype and have come to the limits of the system.

1) the servos do not operate well at low speed -there is too much jitter, i guess there is not enough low speed torque
2) I cannot move the servos in parallel, using the arduino's inbuilt servo library.

I have now ordered 2 micro gear motors 1000:1, that supposedly can drive at much lower speeds but don't know how smooth they will be.

Does anyone have any experience with this type of project? Any advice on how I can solve this problem?



What type of servos were you using?  Not all servos are created equal.  What sort of positioning resolution do you  need out of the system?

The micro gear motors are only going to be half of what you need.  The motors themselves have no positional control to speak of.  You'd need some form of encoder feedback and then a controller to handle positioning of the motors, not a trivial task.  So actually, they're only about a third of what you need.

What you may want to do is look at the dynamixel servos.  They may provide the control you need.  They will not work with the sparkfun pan/tilt, but Trossen Robotics provides a dynamixel compatible pan/tilt platform as well as the dynamixel servos themselves.


[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


If you want to do this right, use two servos (or better, two steppers) with mirrors (preferable front-surfaced) mounted on the shafts, then place the stepper/servos such that the mirrors are at right angles to one another (btw - depending on the range of motion of the first stepper/servo/mirror combo, you might need a larger mirror for the second mirror).

Basically, you want the mass being moved to be as light as possible, to maximize speed, and minimize "settle" time (as well as overshoot). You won't get very high speed or accurate (or repeatable) drawing with this method (aka, open-loop control) - and even if you closed the loop, you still wouldn't have a lot of speed (for that, you need to buy or build custom galvos with some form of position feedback).

However, I don't think you are going for a laser vector drawing system anyhow (because your original idea wouldn't stand a chance - plus your stated needed speeds were fairly low).

Do some research on "homemade laser light show" and "homemade laser galvanometers" for more ideas...

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.


I've enjoyed the EiBotBoard by Eric Schmalz. It is a board that can drive servos and two steppers simultaneously using simple serial commands. Plus, it's only like $50 bucks, which is cheap for what it does, IMO. Google "EBB Sparkfun" and its the first item on the results page. hope that helps!


You can move two servos at the same time, "almost smoothly" with the servo library.

When you do a srv.write(A) the servo will "instantly", as quick as its little motor allows it to, snap to the new angle. You write "slow movement" somewhere so I suspect you have worked out code along the lines of
Code: [Select]
for (int A=45; A<120;A++) {
  srv.write(A) ; delay (10) ; }
(unless you rather mistakenly lowered the voltage supplied for the servos to run slower - defenitly the wrong solution. Always give the servos the rated voltage)

I do not like to use delay() - the code will block, ie the Arduino can do little else while it is positioning (except handle interrupts). So this is just for "illustrative purposes"

All you have to do is to work out to do both servos in the same loop, like:
Code: [Select]
for (int n=0; n<100; n++) { // slow movement will take up 100 "steps"
  srvA.write(map(n,0,100, 45, 120) ; // move servo A from 45 to 120 slowly
  srvB.write(map(n,0,100, 90, 60) ; //  whilst servo B does 90 to 60
delay(10) ; // slowness of movement (smaller is faster)

I agree with those that worry if the servos are accurate enough - but we dont know enough of yor mechanical setup and final project/machine requirements.

Go Up