Sie sind auf Seite 1von 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

Das könnte Ihnen auch gefallen