dc motor working and principle

Download Report

Transcript dc motor working and principle

Sitarambhai Naranjibhai Patel
Institute Of Technology & R.C
SERVO MOTOR & D.C
MOTOR INTERFACING
WITH ATMEGA32
servomotor working and principle
• What is Servo Motor?
 This is nothing but a simple electrical motor, controlled
with the help of servomechanism. If the motor as controlled
device, associated with servomechanism is DC motor, then it is
commonly known DC Servo Motor.
 Servo motor is a special type of motor which is automatically
operated up to certain limit for a given command with help of
error-sensing feedback to correct the performance.
• A servo motor is basically a DC motor(in some special cases it is AC
motor) along with some other special purpose components that make
a DC motor a servo. In a servo unit, we will find a small DC motor, a
potentiometer, gear arrangement and an intelligent circuitry.
• The intelligent circuitry along with the potentiometer makes the servo
to rotate according to our wishes. As we know, a small DC motor will
rotate with high speed but the torque generated by its rotation will not
be enough to move even a light load. This is where the gear system
inside a servomechanism comes into picture.
• This amplified error signal acts as the input power of the dc motor
and the motor starts rotating in desired direction. As the motor
shaft progresses the potentiometer knob also rotates as it is
coupled with motor shaft with help of gear arrangement
• As the position of the potentiometer knob changes there will be an
electrical signal produced at the potentiometer port. As the angular
position of the potentiometer knob progresses the output or
feedback signal increases. After desired angular position of motor
shaft the potentiometer knob is reaches at such position the
electrical signal generated in the potentiometer becomes same as
of external electrical signal given to amplifier.
• At this condition, there will be no output signal from the
amplifier to the motor input as there is no difference between
external applied signal and the signal generated at
potentiometer . As the input signal to the motor is nil at that
position, the motor stops rotating. This is how a simple
conceptual servo motor works.
Types of servo motor
• Servos come in many sizes and in three basic types: positional
rotation, continuous rotation, and linear.
 Positional rotation servo:
This is the most common type of servo motor. The output shaft
rotates in about half of a circle, or 180 degrees. It has physical stops
placed in the gear mechanism to prevent turning beyond these limits
to protect the rotational sensor. These common servos are found in
radio-controlled cars and water- and aircraft, toys, robots, and many
other applications.
 Continuous rotation servo:
This is quite similar to the common positional rotation servo
motor, except it can turn in either direction indefinitely. The
control signal, rather than setting the static position of the servo,
is interpreted as the direction and speed of rotation. The range of
possible commands causes the servo to rotate clockwise or
counterclockwise as desired, at varying speed, depending on the
command signal. You might use a servo of this type on a radar
dish if you mounted one on a robot. Or you could use one as a
drive motor on a mobile robot.
 Linear servo:
This is also like the positional rotation servo motor
described above, but with additional gears (usually a rack and
pinion mechanism) to change the output from circular to back-andforth. These servos are not easy to find, but you can sometimes
find them at hobby stores where they are used as actuators in larger
model airplanes.
controlling of servomotor
• The design of the power supply unit servo motor controller
depends on the number of servo motor that are interfaced to
the board. Servo motors operate from 4.8V to a 6V supply
voltage. The typical value is 5v. The servo motor has three
terminals.
1) Position signal (PWM Pulses)
2) Vcc (From Power Supply)
3) Ground
• The servo motor angular position is controlled by applying
PWM pulses of specific width. The duration of pulse varies
from about 0.5 ms for 0 degree rotation to 2.2 ms for 180 degree
rotation. The pulses need to be given at frequencies of about
50Hz to 60Hz.
• In order to generate the PWM (Pulse Width Modulation)
waveform, as shown in figure below, one can use either the
internal PWM module of the micro-controller or the timers can
be used. Using the PWM block is more flexible as most microcontroller families design the blocks to suit the needs of
application like Servo motor.
• For different widths of PWM pulses, we need to program the
internal registers accordingly.
servo motor interfacing with Atmega 32
• Servo Motor is a DC Motor equipped with error sensing negative
feedback to control the exact angular position of the shaft. Unlike
DC Motors it will not rotate continuously. It is used to make
angular rotations such as 0-90°, 0-180° etc. Stepper Motors can
also be used for making precise angular rotations. But Servo
Motors are preferred in angular motion applications like robotic
arm, since controlling of servo motors are simple, needs no extra
drivers like stepper motor and only angular motion is possible.
• Operation of Hobby Servo Motor is very simple, it has only three
wires, two of them (Red and Brown) used to provide power and
the third wire is used to provide control signals. Pulse Width
Modulated (PWM) waves are used as control signals and the
angular position is determined by the width of the pulse at the
control input.
• we are using a servo motor having angle of rotation from 0-180°
and angular position can be controlled by varying the pulse width
between 1ms to 2ms.
Inside a servo motor
Inside a servo motor
• The DC motor is connected with a gear mechanism which
provides feedback to a position sensor which is mostly a
potentiometer. From the gear box, the output of the motor is
delivered via servo spline to the servo arm. The potentiometer
changes position corresponding to the current position of the
motor. So the change in resistance produces an equivalent
change in voltage from the potentiometer. A pulse width
modulated signal is fed through the control wire. The pulse
width is converted into an equivalent voltage that is compared
with that of signal from the potentiometer in an error amplifier.
Circuit Diagram
Fig. servo motor interfacing with Atmega32
• 8 MHz Crystal is used to provide the required clock for
Atmega32 Microcontroller. Three switch are connected to
PORTB(PB0,PB1,PB2) and1.1KΩ three resistor are connected
to this three switch.
• Control of servo motor is connected to the forth pin of PORTB
(PB3), which is declared as an output pin in the program.
• Oscillator is connected with output of servo motor and we can
seen waveform(PWM) of servo motor at different
angle(0°,90°,180°).
Output (0°rotation -1ms PWM)
Waveform (1ms PWM)
Fig. For [0 degree rotation (1ms PWM)]
Output (90°rotation -1.5ms PWM)
Waveform (1.5ms PWM)
Fig. For [90 degree rotation (1.5ms PWM)]
Output (180°rotation -2ms PWM)
Waveform (2ms PWM)
Fig. For [180 degree rotation (2ms PWM)]
Assembly Program
.include "m32def.inc"
LDI R18,HIGH(RAMEND)
OUT SPH,R18
LDI R18,LOW(RAMEND)
OUT SPL,R18
LDI R18,0XF8
// load f8 to resistor 18
OUT DDRB,R18
LDI R16,0X08
// load 08 to resistor 16
CBI PORTB,3
L1:
IN R18,PINB
SBRS R18,0
RCALL CASE1
SBRS R18,1
RCALL CASE2
SBRS R18,2
RCALL CASE3
RJMP L1
DELAY:
LDI R20,0XC2
// load c2 to resistor 20
OUT TCNT0,R20
LDI R20,0X03
// load 03 to resistor 20
OUT TCCR0,R20
L2:
IN R20,TIFR
SBRS R20,TOV0
RJMP L2
LDI R20,0X00 // load 00 to resistor 20
OUT TCCR0,R20
LDI R20,(1<<TOV0)
OUT TIFR,R20
RET
CASE1:
LDI R16,38
SBI PORTB,3
RCALL DELAY
RCALL DELAY
CBI PORTB,3
L3:
RCALL DELAY
DEC R16
BRNE L3
RET
CASE2:
LDI R16,37
SBI PORTB,3
RCALL DELAY
RCALL DELAY
RCALL DELAY
CBI PORTB,3
// load 37 to resistor 16
L4:
RCALL DELAY
DEC R16
BRNE L
RET
CASE3:
LDI R16,36
SBI PORTB,3
RCALL DELAY
RCALL DELAY
RCALL DELAY
RCALL DELAY
CBI PORTB,3
L5:
RCALL DELAY
DEC R16
BRNE L
RET
// load 36 to resistor 16
DC MOTOR WORKING AND
PRINCIPLE
• A motor is an electrical machine which converts electrical
energy into mechanical energy.
• The principle of working of a DC motor is that
"when a current carrying conductor is placed in a
magnetic
field, it experiences a mechanical force".
• The direction of this force is given by Fleming's left hand rule
and it's magnitude is given by
• F = magnetic flux density (B) * current (I) * length (L)
DC MOTOR
Fig. d.c motor
• Fleming's left hand rule: if we extend index finger, middle
finger and thumb of our left hand, perpendicular to each other,
and direction of magnetic field is represented by index finger,
direction of current is represented by middle finger, then the
thumb represents the direction of the force experienced by the
current carrying conductor.
Dc motor interfacing with atmega32
• we can’t connect a DC Motor directly to a microcontroller due to
following reasons.
• A microcontroller can’t supply the current required for the
working of DC Motor. ATmega32 Microcontroller can source or
sink currents up to 40mA but a DC Motor needs current very
much more than that. The negative voltages created due to the
back emf of the motor may affect the proper functioning of the
microcontroller. we may need to control the direction of rotation
of the motor by changing the polarity of the motor supply.
• The operating voltage of the DC Motor may be much higher than
the operating voltage of the microcontroller.
• To solve these problems we may use an IC driver such as L293D
or L293 instead of making your own H Bridge, which simplifies
our project.
• L293D is a Quadruple Half H-Bridge driver commonly used for
motor driving. We needn’t connect any transistors, resistors or
freewheeling diodes.
• All the four outputs of this IC are TTL compatible and output
clamp diodes are provided to drive inductive loads.
• L293D can provide up to 600mA current, in the voltage raging
from 4.5 to 36v. L293 is a similar IC which can provide up to 1A
in the same voltage range. L293 or L293D contains four Half H
Bridge drivers and are enabled in pairs.
• Input EN1 is used to enable pair 1 (IN1-OUT1, IN2-OUT2) and
input EN2 is used to enable pair 2 (IN3-OUT3, IN4-OUT4).
• We can drive two DC Motors with one L293D,
Use of DC Motors:
• The most common actuator in mobile robotics
• simple, cheap, and easy to use.
• come in a great variety of sizes, to
accommodate different robots and tasks.
THANK YOU