0% found this document useful (0 votes)
95 views23 pages

Servo Motor and AVR Atmel Atmega 16

Robo India in this presentation is explaining the theory and working principles of Servo motor. How to use a servo motor with AVR family microcontroller Atmel Atmega 16. Your queries and views are welcomed, we are found at- website: http://roboindia.com mail- info@roboindia.com

Uploaded by

Robo India
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
95 views23 pages

Servo Motor and AVR Atmel Atmega 16

Robo India in this presentation is explaining the theory and working principles of Servo motor. How to use a servo motor with AVR family microcontroller Atmel Atmega 16. Your queries and views are welcomed, we are found at- website: http://roboindia.com mail- info@roboindia.com

Uploaded by

Robo India
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

SERVO MOTOR

ROBO INDIA
http://roboindia.com

WHAT IS
SERVO ?

SERVO MOTOR
Servo motor is nothing but a
simple motor based on servo
mechanism.
Servomechanism is a closed loop
feedback systems uses +ve
feedback to control its motion.
With the help of servomechanism,
servo motor give precise control
of angular position.

SERVO MOTOR
Motor have a dedicated encoder
Simplest servomotors use
position-only sensing via a
potentiometer

WORKING OF SERVO MOTOR


vdo

SERVO MOTOR PROGRAM


TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|
(1<<WGM11);
//NON Inverted PWM
TCCR1B|=(1<<WGM13)|(1<<WGM12)|(1<<CS11)|
(1<<CS10);
//PRESCALER=64 MODE 14(FAST PWM)
ICR1=4999;
//fPWM=50Hz (Period = 20ms Standard).
DDRD|=(1<<PD4)|(1<<PD5);
//PWM Pins as Out

TCCR1A
TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|
(1<<WGM11);

COM1A1 = 1
COM1B1 = 1
WGM11 = 1

TCCR1A
TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|
(1<<WGM11);

WGM10 = 0 //Used in Waveform


Generation
WGM11 = 1 //Used in Waveform
Generation
COM1A1 = 1
COM1B1 = 1

TCCR1A

The COM1A1,COM1A0,COM1B1 and


COM1B0 control OC1A and OC1B

TCCR1B
TCCR1B|=(1<<WGM13)|(1<<WGM12)|
(1<<CS11)|(1<<CS10);

WGM12 = 1
WGM13 = 1
CS11 = 1
CS10 = 1

TCCR1B
TCCR1B|=(1<<WGM13)|(1<<WGM12)|
(1<<CS11)|(1<<CS10);

WGM10
WGM11
WGM12
WGM13

=
=
=
=

0
1
1
1

//
//
//
//

TCCR1A
TCCR1A
TCCR1B
TCCR1B

TCCR1B

WGM10
WGM11
WGM12
WGM13

=
=
=
=

0
1
1
1

//
//
//
//

TCCR1A
TCCR1A
TCCR1B
TCCR1B

TCCR1B

FAST PWM Mode


TOP Value = ICR1
//Timer count from 0 to ICR1

TCCR1B
TCCR1B|=(1<<WGM13)|(1<<WGM12)|
(1<<CS11)|(1<<CS10);

CS12 = 1 : CS11 = 1 : CS10 = 0

TCCR1B
TCCR1B|=(1<<WGM13)|(1<<WGM12)|
(1<<CS11)|(1<<CS10);

Prescaler is 64.
Means16MHz/64 = 250khz (4 uS
period)

PWM FREQUENCY
FORMULA

PWM FREQUENCY
FORMULA

fpwm = 20ms (50 Hz)


fcpu = 16000000Hz
n = 64
TOP = 4999 // RESULT

PWM FREQUENCY
FORMULA

fpwm = 20ms (50 Hz)


fcpu = 16000000Hz
n = 64
TOP = 4999 // RESULT

PWM FREQUENCY
FORMULA

fpwm = 20ms (50 Hz)


fcpu = 16000000Hz
n = 64
TOP = 4999 // RESULT

PWM FREQUENCY
FORMULA

fpwm = 20ms (50 Hz)


fcpu = 16000000Hz
n = 64
TOP = 4999 // RESULT

SERVO MOTOR PROGRAM


TCCR1A|=(1<<COM1A1)|(1<<COM1B1)|
(1<<WGM11);
//NON Inverted PWM
TCCR1B|=(1<<WGM13)|(1<<WGM12)|(1<<CS11)|
(1<<CS10);
//PRESCALER=64 MODE 14(FAST PWM)
ICR1=4999;
//fPWM=50Hz (Period = 20ms Standard).
DDRD|=(1<<PD4)|(1<<PD5);
//PWM Pins as Out

SERVO MOTOR PROGRAM


Servo Angle 0 need 0.388ms(388uS) pulse
Value of OCR1A = 388us/4us = 97
Servo Angle 90 need 1.264ms(1264uS)
pulse
Value of OCR1A = 1264us/4us = 316
Servo Angle 180 need 2.140ms(2140uS)
pulse
Value of OCR1A = 2140us/4us = 535

THANKS & REGARDS


TEAM ROBO INDIA

To share your views and queries please


write usWebsite: http://roboindia.com
Email- info@roboindia.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy