SlideShare a Scribd company logo
www.techvilla.org.in
TECHVILLA
www.techvilla.org.in
www.techvilla.org.in
Servo motor control using
raspberry-pi
 Servo motor theory.
 Controlling servo motor using pwm.
www.techvilla.org.in
Overview
 Servo motors are used for angular
positioning, such as in radio
control airplanes. They typically
have a movement range of 180 deg
but can go up to 210 deg.
 The output shaft of a servo does
not rotate freely, but rather is
made to seek a particular angular
position under electronic control.
 They are typically rated by torque
and speed. A servo rated 40 ounce-
in/.21 means that at 1 inch from
the hub, the servo can exert 40
ounces of force and move 60 deg in
0.21 sec.
www.techvilla.org.in
What makes a Servo
 The basic hobby servo has a 180:1
gear ratio. The motor is typically
small.
 Typically, a potentiometer (variable
resistor) measures the position of
the output shaft at all times so the
controller can accurately place and
maintain it’s setting.
Servo motors and are constructed out of basic DC
motors, by adding:
• some gear reduction
• a position sensor for the motor shaft
• an electronic circuit that controls the motor's
operation
www.techvilla.org.in
Feed-back loop
open-loop
closed-loop
www.techvilla.org.in
Connection with raspberry
www.techvilla.org.in
Code
# Servo Control
import time
def set(property, value):
try:
f = open("/sys/class/rpi-pwm/pwm0/" + property, 'w')
f.write(value)
f.close()
except:
print("Error writing to: " + property + " value: " + value)
def setServo(angle):
set("servo", str(angle))
set("delayed", "0")
set("mode", "servo")
set("servo_max", "180")
set("active", "1")
delay_period = 0.01
www.techvilla.org.in
while True:
for angle in range(0, 180):
setServo(angle)
time.sleep(delay_period)
for angle in range(0, 180):
setServo(180 - angle)
time.sleep(delay_period)

More Related Content

What's hot

SERVO MOTOR CONTROLLER
SERVO MOTOR CONTROLLERSERVO MOTOR CONTROLLER
SERVO MOTOR CONTROLLER
JITENDRA SUWASIYA
 
Servo Motors Adjust
Servo Motors Adjust Servo Motors Adjust
Servo Motors Adjust
Marc Vendrell
 
Control system
Control systemControl system
Control system
Prabhu R
 
Ac servomotor
Ac servomotorAc servomotor
Ac servomotor
Ravi Kansagara
 
Stepper motors
Stepper motorsStepper motors
Stepper motors
Mihret Berhe
 
Servo motor and AVR Atmel Atmega 16
Servo motor and AVR  Atmel Atmega 16Servo motor and AVR  Atmel Atmega 16
Servo motor and AVR Atmel Atmega 16
Robo India
 
Chapter 7 stepper motor
Chapter 7 stepper motorChapter 7 stepper motor
Chapter 7 stepper motorHattori Sidek
 
Energy Conservation (Apparel Industry)
Energy Conservation (Apparel Industry)Energy Conservation (Apparel Industry)
Energy Conservation (Apparel Industry)Mansoor Cheema
 
Unit 3 steppermotors
Unit 3 steppermotorsUnit 3 steppermotors
Unit 3 steppermotors
Er.Meraj Akhtar
 
servo motor, servo systems, Types of Servo motor, Controlling a servo motor ...
servo motor, servo systems, Types of  Servo motor, Controlling a servo motor ...servo motor, servo systems, Types of  Servo motor, Controlling a servo motor ...
servo motor, servo systems, Types of Servo motor, Controlling a servo motor ...
Waqas Afzal
 
Motors types
Motors typesMotors types
Motors types
Mahmoud Hussein
 
11305119, roll. no 5, akshay kumar
11305119, roll. no 5, akshay kumar11305119, roll. no 5, akshay kumar
11305119, roll. no 5, akshay kumar
Akshay Kumar
 
Welders
WeldersWelders
Unit 2 servo motor
Unit 2 servo motorUnit 2 servo motor
Unit 2 servo motor
Er.Meraj Akhtar
 
S-4000 axial inserter machine
S-4000 axial inserter machine S-4000 axial inserter machine
S-4000 axial inserter machine
Jessica xiong
 
Servo motor and servo drive
Servo motor and servo driveServo motor and servo drive
Servo motor and servo drive
Sai Kumar
 
Серводвигатели серии BSM Baldor
Серводвигатели серии BSM BaldorСерводвигатели серии BSM Baldor
Серводвигатели серии BSM Baldor
Arve
 
Robot basics
Robot basicsRobot basics
Robot basics
Suren Morey
 
Servo motor drive
Servo motor driveServo motor drive
Servo motor drive
Tanmay Popat
 

What's hot (20)

SERVO MOTOR CONTROLLER
SERVO MOTOR CONTROLLERSERVO MOTOR CONTROLLER
SERVO MOTOR CONTROLLER
 
Servo Motors Adjust
Servo Motors Adjust Servo Motors Adjust
Servo Motors Adjust
 
Control system
Control systemControl system
Control system
 
Ac servomotor
Ac servomotorAc servomotor
Ac servomotor
 
Stepper motors
Stepper motorsStepper motors
Stepper motors
 
Servo motor and AVR Atmel Atmega 16
Servo motor and AVR  Atmel Atmega 16Servo motor and AVR  Atmel Atmega 16
Servo motor and AVR Atmel Atmega 16
 
Chapter 7 stepper motor
Chapter 7 stepper motorChapter 7 stepper motor
Chapter 7 stepper motor
 
Energy Conservation (Apparel Industry)
Energy Conservation (Apparel Industry)Energy Conservation (Apparel Industry)
Energy Conservation (Apparel Industry)
 
Unit 3 steppermotors
Unit 3 steppermotorsUnit 3 steppermotors
Unit 3 steppermotors
 
servo motor, servo systems, Types of Servo motor, Controlling a servo motor ...
servo motor, servo systems, Types of  Servo motor, Controlling a servo motor ...servo motor, servo systems, Types of  Servo motor, Controlling a servo motor ...
servo motor, servo systems, Types of Servo motor, Controlling a servo motor ...
 
Motors types
Motors typesMotors types
Motors types
 
11305119, roll. no 5, akshay kumar
11305119, roll. no 5, akshay kumar11305119, roll. no 5, akshay kumar
11305119, roll. no 5, akshay kumar
 
Welders
WeldersWelders
Welders
 
Unit 2 servo motor
Unit 2 servo motorUnit 2 servo motor
Unit 2 servo motor
 
S-4000 axial inserter machine
S-4000 axial inserter machine S-4000 axial inserter machine
S-4000 axial inserter machine
 
Servo motor and servo drive
Servo motor and servo driveServo motor and servo drive
Servo motor and servo drive
 
Серводвигатели серии BSM Baldor
Серводвигатели серии BSM BaldorСерводвигатели серии BSM Baldor
Серводвигатели серии BSM Baldor
 
Robot basics
Robot basicsRobot basics
Robot basics
 
Servo motor drive
Servo motor driveServo motor drive
Servo motor drive
 
Accelerometer 1
Accelerometer 1Accelerometer 1
Accelerometer 1
 

Viewers also liked

Raspberry pi Part 22
Raspberry pi Part 22Raspberry pi Part 22
Raspberry pi Part 22
Techvilla
 
Motor Part 12
Motor Part 12Motor Part 12
Motor Part 12
Techvilla
 
Rasperry pi Part 9
Rasperry pi Part 9Rasperry pi Part 9
Rasperry pi Part 9
Techvilla
 
Light & humidity Part 10
Light & humidity Part 10Light & humidity Part 10
Light & humidity Part 10
Techvilla
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16
Techvilla
 
EEPROM Part-21
EEPROM Part-21EEPROM Part-21
EEPROM Part-21
Techvilla
 
Raspberry pi Part 23
Raspberry pi Part 23Raspberry pi Part 23
Raspberry pi Part 23
Techvilla
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25
Techvilla
 
Rasperry pi Part 13
Rasperry pi Part 13Rasperry pi Part 13
Rasperry pi Part 13
Techvilla
 
Raspberry pi Part 5
Raspberry pi Part 5Raspberry pi Part 5
Raspberry pi Part 5
Techvilla
 
Bluetooth Part-17
Bluetooth Part-17Bluetooth Part-17
Bluetooth Part-17
Techvilla
 
Raspberry pi Part 26
Raspberry pi Part 26Raspberry pi Part 26
Raspberry pi Part 26
Techvilla
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
Techvilla
 
Raspberry pi Part 1
 Raspberry pi Part 1 Raspberry pi Part 1
Raspberry pi Part 1
Techvilla
 
Robotics part-1
Robotics part-1Robotics part-1
Robotics part-1
Techvilla
 
RF MODULE Part-15
RF MODULE Part-15RF MODULE Part-15
RF MODULE Part-15
Techvilla
 
Raspberry pi Part 3
Raspberry pi Part 3Raspberry pi Part 3
Raspberry pi Part 3
Techvilla
 
RFID Part-19
RFID Part-19RFID Part-19
RFID Part-19
Techvilla
 

Viewers also liked (18)

Raspberry pi Part 22
Raspberry pi Part 22Raspberry pi Part 22
Raspberry pi Part 22
 
Motor Part 12
Motor Part 12Motor Part 12
Motor Part 12
 
Rasperry pi Part 9
Rasperry pi Part 9Rasperry pi Part 9
Rasperry pi Part 9
 
Light & humidity Part 10
Light & humidity Part 10Light & humidity Part 10
Light & humidity Part 10
 
Serial Communication Part-16
Serial Communication Part-16Serial Communication Part-16
Serial Communication Part-16
 
EEPROM Part-21
EEPROM Part-21EEPROM Part-21
EEPROM Part-21
 
Raspberry pi Part 23
Raspberry pi Part 23Raspberry pi Part 23
Raspberry pi Part 23
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25
 
Rasperry pi Part 13
Rasperry pi Part 13Rasperry pi Part 13
Rasperry pi Part 13
 
Raspberry pi Part 5
Raspberry pi Part 5Raspberry pi Part 5
Raspberry pi Part 5
 
Bluetooth Part-17
Bluetooth Part-17Bluetooth Part-17
Bluetooth Part-17
 
Raspberry pi Part 26
Raspberry pi Part 26Raspberry pi Part 26
Raspberry pi Part 26
 
I2C And SPI Part-23
I2C And  SPI Part-23I2C And  SPI Part-23
I2C And SPI Part-23
 
Raspberry pi Part 1
 Raspberry pi Part 1 Raspberry pi Part 1
Raspberry pi Part 1
 
Robotics part-1
Robotics part-1Robotics part-1
Robotics part-1
 
RF MODULE Part-15
RF MODULE Part-15RF MODULE Part-15
RF MODULE Part-15
 
Raspberry pi Part 3
Raspberry pi Part 3Raspberry pi Part 3
Raspberry pi Part 3
 
RFID Part-19
RFID Part-19RFID Part-19
RFID Part-19
 

Similar to Raspberry pi Part 17

Ac servomotor
Ac servomotorAc servomotor
Ac servomotor
Ravi Kansagara
 
Servo_motor.pptx
Servo_motor.pptxServo_motor.pptx
Servo_motor.pptx
9731735920
 
detailed Presentation on Servomotor.pptx
detailed Presentation on Servomotor.pptxdetailed Presentation on Servomotor.pptx
detailed Presentation on Servomotor.pptx
hariharasudan17
 
Cnc feed drives
Cnc feed drivesCnc feed drives
Cnc feed drives
Akhil Krishnan G
 
servo motor.pptx
servo motor.pptxservo motor.pptx
servo motor.pptx
ArpitMistry6
 
Actuators.pptx
Actuators.pptxActuators.pptx
Actuators.pptx
bhaveshagrawal35
 
Ppt of servomotor
Ppt of servomotorPpt of servomotor
Ppt of servomotor
Dhaval Solanki
 
Stepper motor Presentation
Stepper motor Presentation Stepper motor Presentation
Stepper motor Presentation
Engineering Garage V=ir
 
Servo amplifier
Servo amplifierServo amplifier
Servo amplifier
FAHAD KHAN
 
It 5170 stepper motor
It 5170 stepper motorIt 5170 stepper motor
It 5170 stepper motor
Ishfaqah
 
Motor
MotorMotor
BLDC Motor Speed Control With RPM Display
 BLDC Motor Speed Control With RPM Display BLDC Motor Speed Control With RPM Display
BLDC Motor Speed Control With RPM Display
Edgefxkits & Solutions
 
Arm
ArmArm
Step ppt
Step pptStep ppt
Step ppt
Akash Maurya
 
3.HVDC_CONTROLS.pdf
3.HVDC_CONTROLS.pdf3.HVDC_CONTROLS.pdf
3.HVDC_CONTROLS.pdf
ShahrukhAhmed66
 
Part 2 SSB LECT AC SERVOMOTOR okpoei.pptx
Part 2 SSB LECT AC SERVOMOTOR okpoei.pptxPart 2 SSB LECT AC SERVOMOTOR okpoei.pptx
Part 2 SSB LECT AC SERVOMOTOR okpoei.pptx
sourabhghatage1
 
Nitish servo system
Nitish servo systemNitish servo system
Nitish servo system
Akash Maurya
 
Introduction_to_Mechatronics_Chapter3.pdf
Introduction_to_Mechatronics_Chapter3.pdfIntroduction_to_Mechatronics_Chapter3.pdf
Introduction_to_Mechatronics_Chapter3.pdf
Bereket Walle
 
SERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptx
SERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptxSERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptx
SERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptx
Divya Somashekar
 

Similar to Raspberry pi Part 17 (20)

Ac servomotor
Ac servomotorAc servomotor
Ac servomotor
 
Servo
ServoServo
Servo
 
Servo_motor.pptx
Servo_motor.pptxServo_motor.pptx
Servo_motor.pptx
 
detailed Presentation on Servomotor.pptx
detailed Presentation on Servomotor.pptxdetailed Presentation on Servomotor.pptx
detailed Presentation on Servomotor.pptx
 
Cnc feed drives
Cnc feed drivesCnc feed drives
Cnc feed drives
 
servo motor.pptx
servo motor.pptxservo motor.pptx
servo motor.pptx
 
Actuators.pptx
Actuators.pptxActuators.pptx
Actuators.pptx
 
Ppt of servomotor
Ppt of servomotorPpt of servomotor
Ppt of servomotor
 
Stepper motor Presentation
Stepper motor Presentation Stepper motor Presentation
Stepper motor Presentation
 
Servo amplifier
Servo amplifierServo amplifier
Servo amplifier
 
It 5170 stepper motor
It 5170 stepper motorIt 5170 stepper motor
It 5170 stepper motor
 
Motor
MotorMotor
Motor
 
BLDC Motor Speed Control With RPM Display
 BLDC Motor Speed Control With RPM Display BLDC Motor Speed Control With RPM Display
BLDC Motor Speed Control With RPM Display
 
Arm
ArmArm
Arm
 
Step ppt
Step pptStep ppt
Step ppt
 
3.HVDC_CONTROLS.pdf
3.HVDC_CONTROLS.pdf3.HVDC_CONTROLS.pdf
3.HVDC_CONTROLS.pdf
 
Part 2 SSB LECT AC SERVOMOTOR okpoei.pptx
Part 2 SSB LECT AC SERVOMOTOR okpoei.pptxPart 2 SSB LECT AC SERVOMOTOR okpoei.pptx
Part 2 SSB LECT AC SERVOMOTOR okpoei.pptx
 
Nitish servo system
Nitish servo systemNitish servo system
Nitish servo system
 
Introduction_to_Mechatronics_Chapter3.pdf
Introduction_to_Mechatronics_Chapter3.pdfIntroduction_to_Mechatronics_Chapter3.pdf
Introduction_to_Mechatronics_Chapter3.pdf
 
SERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptx
SERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptxSERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptx
SERVO MDNBMFBKDJVB KDZFVCJNFJVBKZJMOTORS.pptx
 

More from Techvilla

Raspberry pi Part 24
Raspberry pi Part 24Raspberry pi Part 24
Raspberry pi Part 24
Techvilla
 
Raspberry pi Part 21
Raspberry pi Part 21Raspberry pi Part 21
Raspberry pi Part 21
Techvilla
 
Raspberry pi Part 20
Raspberry pi Part 20Raspberry pi Part 20
Raspberry pi Part 20
Techvilla
 
Raspberry pi Part 19
Raspberry pi Part 19Raspberry pi Part 19
Raspberry pi Part 19
Techvilla
 
Raspberry pi Part 18
Raspberry pi Part 18Raspberry pi Part 18
Raspberry pi Part 18
Techvilla
 
Raspberry pi Part 16
Raspberry pi Part 16Raspberry pi Part 16
Raspberry pi Part 16
Techvilla
 
Rasperry pi Part 15
Rasperry pi Part 15Rasperry pi Part 15
Rasperry pi Part 15
Techvilla
 
Rasperry pi Part 12
Rasperry pi Part 12Rasperry pi Part 12
Rasperry pi Part 12
Techvilla
 
Rasperry pi Part 10
Rasperry pi Part 10Rasperry pi Part 10
Rasperry pi Part 10
Techvilla
 
Rasperry pi Part 8
Rasperry pi Part 8Rasperry pi Part 8
Rasperry pi Part 8
Techvilla
 
Rasperry pi Part 7
Rasperry pi Part 7Rasperry pi Part 7
Rasperry pi Part 7
Techvilla
 
Raspberry pi Part 6
Raspberry pi Part 6Raspberry pi Part 6
Raspberry pi Part 6
Techvilla
 
Raspberry pi Part 4
Raspberry pi Part 4Raspberry pi Part 4
Raspberry pi Part 4
Techvilla
 
WIFI MODEM Part-22
WIFI MODEM Part-22WIFI MODEM Part-22
WIFI MODEM Part-22
Techvilla
 
GSM Part-20
GSM Part-20GSM Part-20
GSM Part-20
Techvilla
 

More from Techvilla (15)

Raspberry pi Part 24
Raspberry pi Part 24Raspberry pi Part 24
Raspberry pi Part 24
 
Raspberry pi Part 21
Raspberry pi Part 21Raspberry pi Part 21
Raspberry pi Part 21
 
Raspberry pi Part 20
Raspberry pi Part 20Raspberry pi Part 20
Raspberry pi Part 20
 
Raspberry pi Part 19
Raspberry pi Part 19Raspberry pi Part 19
Raspberry pi Part 19
 
Raspberry pi Part 18
Raspberry pi Part 18Raspberry pi Part 18
Raspberry pi Part 18
 
Raspberry pi Part 16
Raspberry pi Part 16Raspberry pi Part 16
Raspberry pi Part 16
 
Rasperry pi Part 15
Rasperry pi Part 15Rasperry pi Part 15
Rasperry pi Part 15
 
Rasperry pi Part 12
Rasperry pi Part 12Rasperry pi Part 12
Rasperry pi Part 12
 
Rasperry pi Part 10
Rasperry pi Part 10Rasperry pi Part 10
Rasperry pi Part 10
 
Rasperry pi Part 8
Rasperry pi Part 8Rasperry pi Part 8
Rasperry pi Part 8
 
Rasperry pi Part 7
Rasperry pi Part 7Rasperry pi Part 7
Rasperry pi Part 7
 
Raspberry pi Part 6
Raspberry pi Part 6Raspberry pi Part 6
Raspberry pi Part 6
 
Raspberry pi Part 4
Raspberry pi Part 4Raspberry pi Part 4
Raspberry pi Part 4
 
WIFI MODEM Part-22
WIFI MODEM Part-22WIFI MODEM Part-22
WIFI MODEM Part-22
 
GSM Part-20
GSM Part-20GSM Part-20
GSM Part-20
 

Recently uploaded

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 

Recently uploaded (20)

Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 

Raspberry pi Part 17

  • 2. www.techvilla.org.in Servo motor control using raspberry-pi  Servo motor theory.  Controlling servo motor using pwm.
  • 3. www.techvilla.org.in Overview  Servo motors are used for angular positioning, such as in radio control airplanes. They typically have a movement range of 180 deg but can go up to 210 deg.  The output shaft of a servo does not rotate freely, but rather is made to seek a particular angular position under electronic control.  They are typically rated by torque and speed. A servo rated 40 ounce- in/.21 means that at 1 inch from the hub, the servo can exert 40 ounces of force and move 60 deg in 0.21 sec.
  • 4. www.techvilla.org.in What makes a Servo  The basic hobby servo has a 180:1 gear ratio. The motor is typically small.  Typically, a potentiometer (variable resistor) measures the position of the output shaft at all times so the controller can accurately place and maintain it’s setting. Servo motors and are constructed out of basic DC motors, by adding: • some gear reduction • a position sensor for the motor shaft • an electronic circuit that controls the motor's operation
  • 7. www.techvilla.org.in Code # Servo Control import time def set(property, value): try: f = open("/sys/class/rpi-pwm/pwm0/" + property, 'w') f.write(value) f.close() except: print("Error writing to: " + property + " value: " + value) def setServo(angle): set("servo", str(angle)) set("delayed", "0") set("mode", "servo") set("servo_max", "180") set("active", "1") delay_period = 0.01
  • 8. www.techvilla.org.in while True: for angle in range(0, 180): setServo(angle) time.sleep(delay_period) for angle in range(0, 180): setServo(180 - angle) time.sleep(delay_period)