HomeНаука и техникаRelated VideosMore From: O'Reilly

Controlling Servo Motors with Raspberry Pi

374 ratings | 108771 views
Use the PWM to control the width of pulses to a servo motor to change its angle. Buy the Raspberry Pi CookBook Guide - http://shop.oreilly.com/product/0636920029595.do Don't miss an upload! Subscribe! http://goo.gl/szEauh Stay Connected to O'Reilly Media by Email - http://goo.gl/YZSWbO Follow O'Reilly Media: http://plus.google.com/+oreillymedia https://www.facebook.com/OReilly https://twitter.com/OReillyMedia
Html code for embedding videos on your blog
Text Comments (21)
aqib2000 (5 months ago)
No you mean use a special servo library
sanjay bhatikar (5 months ago)
Please explain concepts more clearly.
SanvedTechton (11 months ago)
What servo motor would you suggest which would be powerful enough to press a button ? How much torque should I look for ?
Robert Hatfield (10 months ago)
Any hobby servo would have enough force to press a button designed for humans to press. Buy the cheapest one. :)
Sean O'Neill (1 year ago)
What of make of servo is that?
Florin Radoi (1 year ago)
Hy ! This is not working. The code loops always through the "pwm.start(5)" line. The code will generate an oscilation between the commanded position and the initial position of 5 ! How can we solve this problem ? Thx.
Arjan van Vught (1 year ago)
Why not using hardware PMW? Software PWM in Linux is guaranteed to jitter.
Ivan Stefanov (1 year ago)
Is this possible without the virtual potentiometer but rather a bluetooth keyboard?
hurrdurr25 (2 years ago)
Software pwm doesn't really work for servos
Buddy Lampson (2 years ago)
duty = float(angle)/(180/(12.5-2.5)) + 2.5
Chuck Clift (2 years ago)
At 3:50, you say that the servo control wire should be connected to GPIO pin 18, but you then proceed to connect the wire to GPIO pin 12. You need to distinguish between the GPIO pin 18 and the GPIO pin that is labelled "BCM 18" (which is pin 12). I just wanted to leave the comment for anyone else who may run into that problem.
Blake Lombard (10 months ago)
a year later you got my back man
Aric Wang (2 years ago)
shake always, and servo getting hot. How to use hardware PWM, hardware timer? The frequency can't low to 100 50Hz right?
amrosik (2 years ago)
is there a solution to the yittering problem?
Nero Azmi (3 years ago)
1. at line def__ init__(self,master): the line doesnt turn into blue when i wrote it 2.so i copy n paste... continue write the code but the gui slider is empty when executed, any way to troubleshoot this?
VALIS Machine (3 years ago)
Is it only feasible to run one servo? Would two be possible? Not even necessarily independent.
matteo barsanti (4 months ago)
VALIS Machine just use different pwm pins
jay shah (3 years ago)
why we not used the 3rd control lead?
TelloBotello (3 years ago)
link of the code?
Miro M (2 years ago)
Andrea Bettati (4 years ago)
Thank you very much! Like all your videos!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.