User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 586
Joined: Sat Nov 02, 2013 2:06 pm

Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 9:32 am

Hi;

What differences are there between connecting and controlling DC Motors and Servos?
I understand motors have + and - and are controlled using PWM via the + line and know that Servos have three wires, + - and Signal is this PWM or something different?

I have a collision avoidance robot which uses an Arduino Nano / L298N Motor Driver. I am about to upgrade this to control it by interfacing a Raspberry Pi which will be used to control the Motors via the Arduino over a Web Interface using a mounted USB Webcam and MJPG-streamer for vision.
I also want to add some Servos such as a Pan and Tilt Camera hence the question.

Many thanks
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 9:49 am

You can put PWM on the + or the - side of a DC motor.
PWM on + : Direction 1 (left or right)
PWM on - : Direction 2 (right or left)

For servo motor's you'll need something a little different.
+ and - is power (mostly 5V)
signal is a servo signal:
Image
The period is always 20ms and the on time is always between 1ms and 2ms, to set to position of the servo. ;)
(if something isn't clear, please let me know.)

Laurens

ame
Posts: 3729
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 9:56 am

The key difference is that generally you need a driver to control a DC motor, and varying the control signal changes the motor's speed. For a servo, the driver is built in to the unit and the control signal varies the output position.

Yes, there are subtleties, but that's the executive summary.

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 586
Joined: Sat Nov 02, 2013 2:06 pm

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 11:38 am

So for a Servo I don't necessarily need a Motor Driver board?
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

User avatar
joan
Posts: 15736
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 12:08 pm

JonnyAlpha wrote:So for a Servo I don't necessarily need a Motor Driver board?
No, you don't need a driver board for a servo. You just need a power source for the servo and a control wire to a Pi gpio. You need also to connect the power source ground to a Pi ground.

User avatar
JonnyAlpha
Raspberry Pi Certified Educator
Raspberry Pi Certified Educator
Posts: 586
Joined: Sat Nov 02, 2013 2:06 pm

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 12:24 pm

Excellent :-) thanks
Raspberry Pi Certified Educator. Main Hardware - Raspberry Pi 1 model B revision 2, Raspberry Pi 2 model B, Pi Camera

ame
Posts: 3729
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 12:28 pm

joan wrote:
JonnyAlpha wrote:So for a Servo I don't necessarily need a Motor Driver board?
No, you don't need a driver board for a servo. You just need a power source for the servo and a control wire to a Pi gpio. You need also to connect the power source ground to a Pi ground.
Indeed. Three wires and you're done. Set the output shaft anywhere within an approximately 180° range under software control.

If you're really keen you can modify a regular servo for continuous rotation, instead of just +/- 90°. This means the control signal will change the speed of the output instead of the position.

But, sometimes dc motors are what you want.

danjperron
Posts: 3870
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Difference Between Controlling DC Motors and Servos

Sun Jun 21, 2015 12:48 pm

Well in reality a R/C servo is a DC motor but it contains the driver and the control inside the box!

There is a gear box to increase the torque of the motor. The control is made by a small potentiometer which change the oscillator pulse rate. The difference between the oscillator pulse rate and the pulse provide by the control will drive the motor from CCW or CW.

http://pcbheaven.com/wikipages/How_RC_Servos_Works/

B.T.W. A real servo motor is not an R/C servo. A real servo motor is a three phase motor . They are used in airplane. You change the phase to set the position of the motor. So the term 'R/C' is very important to specify!

Return to “Automation, sensing and robotics”