SlideShare a Scribd company logo
1 of 48
Graduation
Project
Supervisor:
Dr. Samer
Mayaleh
An-Najah NationalUniversity
Faculty of Engineering
Electrical Engineering Department
Prepared by:
Nihaya Dmeede
10405165
Farah Damen
10406679
Page2
TABLE OF CONTENT
Abstract________________________________________________________________________3
Chapter -1-
Theoretical Part
1.1 Why Single phase AC motor? ______________________________________________6
1.2 Single phase AC motor type __________________________________________________7
1.3 Applications on single phase AC motor_______________________________________10
1.4 Speed Control___________________________________________________________11
1.5 Direction Control__________________________________________________________12
Chapter -2-
Practical Part
2.1 Design Description ________________________________________________________14
2.2 System Description ________________________________________________________15
2.3 Full circuit Preview ________________________________________________________16
2.4 Hardware_________________________________________________________________17
2.5 Software _________________________________________________________________30
Chapter -3-
Problems & Constraints _________________________________________________________38
Chapter -4-
Cost _________________________________________________________________________42
Chapter -5-
Conclusion_____________________________________________________________________43
Chapter -6-
Recommendations Cost _________________________________________________________44
Chapter -7-
Appendix ______________________________________________________________________45
Page3
ABSTRACT
Single Phase Induction Motor
Adjustable Speed-Direction Control
Using Microcontroller
In this project, a single phase induction
motor (SPIM) adjustable speed drive control
is implemented with hardware setup and
software program in PIC-C code.
SPIM is used because it is widelyused in our
daily life.
The main feature used in microcontroller is
their peripherals to realize pulse width
modulation.
This Digital control brings low cost, small
size and flexibility to change the control
algorithm without changes in hardware.
Page4
Theoretical
Part
Practical
part
Page5
THEORETICAL PART
CHAPTER (1)
INTRODUCTION
INTRODUCTION
WHY SINGLE
PHASE AC
MOTORS ??
SINGLE-
PHASE AC
MOTOR
TYPES
SPEED
CONTROL
DIRECTION
CONTROL
APPLICATION
ON SINGLE-
PHASE AC
MOTOR
Page6
(1.1) WHY SINGLE PHASE AC MOTORS??
 They are useful -- serving as the prime power sources for a seemingly limitless array
of small-horsepower applications in industry and in the home.
 Where three-phase power is unavailable or impractical, its single-phase motors to
the rescue.
 Single phase AC electrical supply is what is typically supplied in homes, three phase
electrical power is commonly only available in a factory setting.
 Single-phase motors -- correctly sized and rated -- can last a lifetime with little
maintenance.
1ϕ AC
Power
supply
Lifetime &
Maintenece
small-
horsepower
applications
Page7
(1.2) SINGLE PHASE AC MOTOR TYPES
SPLIT-PHASE
CAPACITOR START/INDUCTION RUN
PERMANENT SPLIT CAPACITOR
CAPACITOR START/CAPACITOR RUN
SHADED-POLE
Page8
THE MOTOR WE USED IS:
PERMANENT SPLIT CAPACITOR
A permanent split capacitor (PSC) motor, Figure shown, has neither a starting switch, nor a
capacitor strictly for starting. Instead, it has a run-
type capacitor permanently connected in series
with the start (Aux.) winding. This makes the
main winding an auxiliary winding once the
motor reaches running speed. Because the run
capacitor must be designed for continuous use, it
cannot provide the starting boost of a starting
capacitor. Typical starting torque of PSC motors
is low, from 30 to 150% of rated load, so these
motors are not for hard-to-start applications.
However, unlike split-phase motors, PSC motors
have low starting currents, usually less than 200% of rated load current, making them
excellent for applications with high cycle rates. Breakdown torque varies depending on the
design type and application, though it is typically somewhat lower than with a cap start
motors.
PSC motors have several advantages. They need no starting mechanism and so can be
reversed easily. Designs can be easily altered for use with speed controllers. They can also
be designed for optimum efficiency and high power factor at rated load. And they're
considered to be the most reliable of the single phase motors, mostly because no starting
switch is needed.
Permanent split capacitor motors have a wide variety of applications depending on the
design. These include fans, blowers with low starting torque needs, and intermittent
cycling uses such as adjusting mechanisms, gate operators and garage door openers, many
of which also need instant reversing.
Page9
MEASURED MOTOR SPECIFICATIONS:
NO LOAD PARAMETERS:
 InL=0.38A
 W= 1436 rpm
LOADED MOTOR PARAMETERS:
 Pout=86w (Measured)
 𝜂 = 85% (Estimated)
 𝜂 =
𝑃𝑜𝑢𝑡
𝑃𝑖𝑛
∗ 100%
 Pin= V*I =220*I
 P.f ≈ 1
 IfL=
𝑃𝑜𝑢𝑡
𝜂∗𝑉∗𝑝.𝑓
=
86
0.85∗220∗1
= 0.45A
Imian=400mA, Iaux=670mA
Turns Ratio (α) =
𝑉𝑎𝑢𝑥
𝑉𝑚𝑎𝑖𝑛
=
𝐼𝑚𝑎𝑖𝑛
𝐼𝑎𝑢𝑥
=3.33
θ=2tan 𝛼=146.57º
TORQUE MEASUREMENT:
We measured the torque by loading the motor with some weights connected to the shaft
using a cord.
 The cord length (l)= 60cm
 Force (F)= 130N
 T=F*L(m)= 130*0.6= 78 N.m
 T≅ (Full load Torque)
Page10
(1.3) APPLICATIONS ON SPI MOTORS
The scope of motor control technology must be very wide to accommodate the wide variety
of motor applications in various fields.
A. DOMESTIC APPLICATIONS
B. OFFICE EQUIPMENT, MEDICAL EQUIPMENT… ETC.
C. COMMERCIAL APPLICATIONS
D. INDUSTRIAL APPLICATIONS
E. VEHICLE APPLICATIONS
F. POWER TOOLS
G. HOBBY EQUIPMENT
PSC MOTORS APPLICATIONS
With this motor, designs can be easily altered for use with speed controllers. It can also be
designed for optimum efficiency and high power factor at rated load.
Include fans, blowers with low starting torque needs, and intermittent cycling uses such as
adjusting mechanisms, gate operators and garage door openers, many of which also need
instant reversing.
Page11
(1.4)SPEED CONTROL
In general, ac drives work (controlling ac motor speed) by varying the frequency of the
current supplying the motor. Although frequency can be varied many ways, and in relation
to other variables such as voltage, the most common methods in use today are "volts per
hertz," open-loop vector, and closed-loop vector. How these techniques differ determines
where each drive type works best.
VOLTS PER HERTZ
Volts per hertz (V/Hz) technology is the most economical and easiest to apply of the three
speed-control methods. Here, the drive controls shaft speed by varying the voltage and
frequency of the signal powering the motor.
Now, the rotor of an ac induction motor is magnetically coupled to the stator through an
induced magnetic field. The speed at which the magnetic field rotates around the stator is
known as synchronous speed and is determined by:
n = 120 f/N
where n is synchronous motor speed, 120 is an electrical constant, f is the applied
frequency, and N is the number of motor poles.
The equation illustrates one of the basic principles of speed control: Reducing applied
frequency to an ac induction motor causes the magnetic field to turn at a proportionally
slower rate, thereby reducing rotor speed.
This is only part of the story, however. Induction motors are designed to operate from line
voltage at line frequency. But the whole purpose of V/Hz drives is that they don't hold
systems to power line shapes. What they do instead is maintain an optimal voltage-to-
frequency ratio, so that the motors their power will produce their rated torque over the
widest possible speed range.
-Air gap flux level becomes
greater than normal
-The saturation in flux
resultting can cause an
excessive magnetizing
current.
Decreasing the
developed tourqe
Page12
(1.5)DIRECTION CONTROL
HISTORICALLY BIDIRECTIONAL TECHNIQUES:
PRESENT BIDIRECTIONAL TECHNIQUES:
USING AN H-BRIDGE INVERTER
The first approach is relatively easy as far as the power circuit and control circuit are
concerned. On the input side, a voltage doubler is used and on the output side an H-bridge,
or 2-phase inverter, is used as shown in Figure bellow. One end of the main and start
windings are connected to each half bridge and the other ends are connected together to the
neutral point of the AC power supply, which also serves as the center point for the voltage
doubler.
Unfortunately, all of
these components
increase the cost of
the system for basic
ON and OFF control
in two directions.
Historically
Bidirectional
Gear
mecha
-nisms
Switches
External
relays
Page13
If the voltage applied to the main winding lags the start winding by 90 degrees, the motor
runs in one (i.e., forward) direction. To reverse the direction of rotation, the voltage
supplied to the main winding should lead the voltage supplied to the start winding.
USING A 3-PHASE INVERTER
The input section is replaced with a standard diode bridge rectifier. The output section has
a 3-phase inverter bridge. The main in Figure bellow.
difference from the previous scheme is the way the motor windings are connected to the
inverter. One end of the main winding and start windings are connected to one half bridge
each. The other ends are tied together and connected to the third half bridge, as shown
With this drive topology, control becomes more efficient; however, the control algorithm
becomes more complex. The voltages V a, V b and V c should be controlled to achieve the
phase difference between the effective voltages across the main and start windings to have a
90 degree phase shift to each other.
Now, H-bridge inverter method of controlling a PSC type motor has following
disadvantages:
 The main and start windings have different electrical characteristics. Thus, the
current flowing through each switch is unbalanced. This can lead to the premature
breakdown of switching devices in the inverter.
 The common point of the windings is directly connected to the neutral power
supply. This may increase the switching signals creeping into the main power
supply, and may increase the noise emitted onto the line. In turn, this may limit the
EMI level of the product, violating certain design goals and regulations.
 The effective dc voltage handled is relatively high due to the input-voltage doubler
circuit.
 Lastly, the cost of the voltage doubler circuit itself is high due to two large power
capacitors.
Advantages of using the three-phase control method:
 The main advantage of using the three-phase control method is that the same drive-
hardware topology can be used to control a three-phase induction motor. In this
scenario, the microcontroller should be reprogrammed to output sine voltages with
Page14
120-degree phase shift to each other, which drives a three-phase induction motor.
This reduces the development time.
 Power saving.
Microcontroller Resources Requirement (For reversing direction)
Resource
Bidirectional
H-bridge
Bidirectional with
three-phase bridge
Notes
Program
memory
2.0 Kbytes 2.5 Kbytes --
Data memory ~25 Bytes ~25 bytes --
PWM channels 2 channels 3 channels
Complementary with dead
time
Timer 1 1 8- or 16-bit
Digital I/Os 3 to 4 3 to 4
For user interfaces like
switches and displays
Complexity of
control
algorithm
Medium High --
Bidirectional with H-bridge Bidirectional with three-phase bridge
Input converter
section
High - Due to voltage doubler
circuit
Low - Single phase diode bridge rectifier
Output
inverter
section
Medium - Two half bridges. The
power switches rated higher
voltage
High - three-phase inverter. Using Integrated Power
Modules (IPM) is better choice than discrete
components
Motor
Low - Starting capacitor is removed
from the motor
Low - Starting capacitor is removed from the motor
Development
time
Mid-range Long
Overall cost Medium Medium - Efficient control for the given cost
Page15
PRACTICAL PART
CHAPTER (2)
(2.1)DESIGN DESCRIPTION
Design
Hardware
Software
Page16
(2.2)SYSTEM DESCRIPTION
OVERALL BLOCK DIAGRAM
ALGORITHMIC BLOCK DIAGRAM
Page17
(2.3)FULL CIRCUIT PREVIEW
Page18
(2.4) HARDWARE
Bridge
Rectifier
Optocoupler
DC
Chopper
PIC
Microcontroller
Basic cct
Keypad &
LCD
Connection
Dead Band
time
Generator
3-Phase
Bridge
Driver
IGBT
3-Phase
Inverter
Page19
BRIDGE RECTIFIER
SINGLE PHASE FULL-WAVE BRIDGE RECTIFIER
The full bridge rectifier (KBPC 35-10) has been used to convert the ac supply to a dc
voltage Vdc. The output of the rectifier is the input to the dc chopper which controls the
voltage level.
KBPC 35-10: a Single phase silicon bridge rectifier. Maximum recurrent peak reverse
voltage 1000 V. Maximum average forward rectified current 35 A. in 4-pin KBPC
package.
The output dc voltage:
Vdc =206 v.
Page20
OPTOCOUPLER
The Optocoupler used to isolate between high voltage of the chopper and low voltage
of the microcontroller, There are manysituations where signals and data need to be
transferred from one subsystem to another within a piece of electronics equipment, or
from one piece of equipment to another, without makinga direct ohmic electrical
connection. Often this is because the source and destination are (or maybe at times) at
verydifferent voltage levels, like a microprocessor which is operatingfrom 5V DC but
being used to control a triac which is switching240V AC. In such situations the link
between the two must be an isolated one, to protect the microprocessor from
overvoltage damage.
We used Optocoupler for isolatingbetween the chopper MOSFET gate and the PWM
output from the PIC microcontroller.
Also we were attendingto use it in the driver cct of the IGBT, but a problem occurred
which is discussed in the Problems chapter.
Page21
DC CHOPPER
A dc chopper is a dc-to-dc voltage converter
A DC chopper uses three main components to create variable speed capability
A DC chopper circuit is pictured below
The MOSFET allows current from the source to pass through it, but when it allows
current to pass through it is governed by the pulse wave modulator (PWM). The PWM
creates pulses, and the high section of these pulses turns on the MOSFET. The longer
the MOSFET is turned on, the faster the motor spins. Thus, by varying the high
section, commonly referred to as the duty cycle, it is possible to vary the speed of the
motor.
MOSFET
The MOSFET conducts for the high portion of the gating signal, and does not conduct for
the low portion of the gating signal. The higher the duty cycle of these input waves, the
longer the MOSFET acts as a closed switch. We attached a large heat sink to the MOSFET to
prevent overheating and breakdown due to large currents.
Page22
CIRCUITRY SAFETY FEATURES
The MOSFET is exposed to high currents and a lot of stress, which raises the concern
of safety, and preserving the life of the MOSFET. The MOSFET in our design is
protected by a snubber circuit it’s to protect against from the switching stresses of high
voltages and currents and to lower the power loss.
THE SNUBBER CIRCUIT
Much of the power lost when using transistors is due to switching. Snubber circuits
reduce power losses in transistors during switching and protect them from the switching
stresses of high voltages and currents. Switching contributes to a large amount of the
power lost when using transistors. Therefore, to conserve energy in our circuit it was a
good idea to implement a snubber circuit into our design.
One purpose of the snubber circuit is to alter the voltage and current waveforms produced
during switching to an advantage.
Page23
PIC MICROCONTROLLER BASIC CCT
Page24
KEYPAD & LCD CONNECTION
LCD DISPLAY:
This display shows speed in addition to the direction of rotation. The display receives its
input from the main control unit(PIC 16F877).
KEYPAD:
The keypad is used to enter the desired speed of the motor, we used the extra push
buttons on the keypad for the direction. The output of the keypad goes directly to
the control PIC, where it is processed accordingly.
(*) key press indicates Reverse Direction of rotation.
(#) key press indicates Forward Direction of rotation.
Page25
DEAD BAND TIME GENERATOR
SIMPLE DEADBAND GENERATOR TARGETS PUSH-PULL DRIVERS
This simple cct introduces any desired amount of deadband time between alternating
output control pulses.
This cct is used In order to avoid cross conduction (two on IGBTs in the same arm) during
the transition periods of our IGBT transistors, since cross conduction may results in high
current surges being drawn from the power supply.
The simple circuit shown can be used to introduce any desired amount of deadband time
between Vo1 and Vo2 control pulses. The circuit employs a Schmitt-trigger inverter IC, the
74HC14. With the diodes, different time delays can be obtained for the rising and falling
edges of the drive waveform. The deadband is determined by the RC time constant. The
waveforms shown are self-explanatory.
𝜏 = 𝑅 ∗ 𝐶
Our deadband time is 5µsec.
Page26
GATE DRIVER
IR Gate Driver ICs
Driving a MOSFET or IGBT in the high side position of a half-bridge topology or 3 phase
inverter leg offers the additional challenge that the gate voltage is referenced to the source
rather than to ground. The source voltage is a floating point at up to the maximum bus
voltage, or voltage rating of the MOSFET or IGBT, 600V and up for motor drive, lighting or
SMPS applications. IR gate driver uses a patented level shifter technology for high voltage
application and offers the only 1200V rating in the industry.
These ICs simplify circuit designs by integrating extensive functionality. They use a low
cost bootstrap supply, while opto-coupler-based circuits typically require an auxiliary
power supply. IR Gate Driver ICs offer optional single input or dual input programmable
deadtime control for low side and high side drivers as well as for 3 phase drivers to provide
design flexibility and allows to minimize cross-conduction. Unique 3-phase drivers allow
driving a 3 phase inverter using a single IC.
IR Gate Driver ICs enable rugged driver designs
IR Gate Driver ICs are specifically designed with motor drive applications in mind. The
newest soft-turn-on limits voltage and current spike and reduce EMI. In addition, they have
up to 50V/ns dV/dt immunity and are tolerant to negative voltage transient. The under-
voltage lock-out available for most drivers prevents shoot-through currents and device
failures during power-up and power-down without any additional circuitry. The output
drivers feature a high pulse current buffer stage designed for minimum driver cross-
conduction.
Noise immunity is important for the high-side position which has a floating voltage and is
susceptible to high noise levels, particularly in motor drive applications. Noise immunity
ensures that the MOSFET or IGBT doesn't turn on accidentally. Noise immunity is obtained
by using Schmitt-triggered input with pull-down.
Page27
IR Gate Driver ICs enable fast switching speeds
IR Gate Drive ICs have ten times better delay matching performance than opto-coupler-
based solutions. Delay matching between the low-side and high-side driver is typically
within ± 50ns (and as low as ± 10ns for some specialty products), allowing complete dead-
time control for better speed range and torque control in motor drive applications. Fast
switching also reduces switching power losses and allows leveraging the full benefits of the
fastest IGBTs available on the market today for better torque control over a wider speed
range.
The IR21363 is a high voltage, high speed power MOSFET and IGBT driver with three
independent high and low side referenced output channels. Over current fault conditions
are cleared automatically after a delay programmed externally via an RC network
connected to the RCIN input.
Our waveforms are as shown:
IR input:
IR output:
Page28
BOOTSTRAP CAPACITOR
Comprising a bootstrap diode and bootstrap capacitor (see the figure, below). The
bootstrap diode may be either integrated within the gate driver IC or external to it. Because
the bootstrap capacitor value must be much higher than the MOSFET gate capacitance, it is
always external to the IC. When the lower MOSFET is enabled, the bootstrap capacitor
charges up to VDD via the bootstrap diode. Thus, the high-side gate driver “floats” at the
gate voltage of the high-side MOSFET. For reliable operation, the high side driver must be
able to withstand the operating voltage of the high-side MOSFET. Typical maximum
voltage ratings for high-voltage gate drivers can range from 80 to 100 V.
Bootstrap diode power loss consists of the forward diode loss while charging the bootstrap
capacitor and reverse bias power loss during reverse recovery. These events occur once per
cycle, so this diode loss is also proportional to the switching frequency.
BOOTSTRAP CAPACITOR SELECTION:
CBOOT must be correctly selected to ensure proper operation of the device. If too large, time
is wasted charging the capacitor, with the result being a limit on the maximum duty cycle
and PWM frequency. If the capacitor is too small, the voltage drop can be too large at the
time the charge is transferred from the CBOOT to the IGBT gate.
Page29
AC INVERTER
An AC inverter is used to convert DC voltage to AC voltage. In this model the frequency is
fixed and variable output voltage is obtained by varying the pulse width of the chopper
switch.
INVERTER STRUCTURE
One end of the main winding and start windings are connected to one half bridge each. The
other ends are tied together and connected to the third half bridge.
With this drive topology, control becomes more efficient; however, the control algorithm
becomes more complex. The voltages Va, Vb and Vc should be controlled to achieve the
phase difference between the effective voltages across the main and start windings to have
a 90 degree phase shift to each other.
|Va| = |Vb| = |Vc| = |V1|
The effective voltage across the main and start winding is given as:
𝑉𝑚𝑎𝑖𝑛 = Va − Vc
𝑉𝑎𝑢𝑥 = Vb − Vc
The voltages are shown in the phasor diagram in
Page30
As seen in the phasor diagram, the voltages across phase A and phase B are out of phase.
Figure below shows the phase voltages Va ,Vb and Vc, and the other figure shows the
effective voltages across the main winding (VMAIN) and the start winding (VSTART). Also
shows that the effective phase difference between the voltages is 90 degrees and the
effective voltage ratio is α.
Page31
1. IGBT SWITCH
Power switches used for the inverter are type 2MBI50L-120 IGBTs, manufactured by
Collmer Semiconductor. They come two IGBTs in a single unit with an anti parallel diode
as shown in Figure bellow.
The insulated gate bipolar transistor (IGBT) is an attempt to unite the best features of the
bipolar junction transistor and the MOSFET technologies.
IGBT device has good forward blocking but very limited reverse blocking ability. It can
operate at higher current densities than either the power BJT or MOSFET allowing a
smaller chip size.
The IGBT is a three terminal device. The power terminals are called the emitter (E) and
collector (C), using the BJT terminology, while the control terminal is called the gate (G),
using the MOSFET terminology.
The main advantages of the insulated gate bipolar transistor (IGBT) are:
 Good power handling capabilities.
 Low forward conduction voltage drop of 2 V to 3 V, which is higher than for
a BJT but lower than for a MOSFET of similar rating.
 This voltage increases with temperature making the device easy to operate in
parallel without danger of thermal instability.
 High speed switching capability.
 Relatively simple voltage controlled gate driver.
 Low gate current.
Page32
(2.5)SOFTWARE DESIGN
After constructing the basic cct of the PIC microcontroller 16F877, the following ports are
used:
Port-B: For keypad.
Port-D: For LCD.
Port-C: RC1 for CCP2 (PWM1), RC2 for CCP1 (PWM2).
Port-A: RA0, chopper MOSFET’s gate square wave signal.
PWM (PULSE WIDTH MODULATION) SIGNALS
GENERATION:
In order to achieve 90º phase shift between main & aux windings, we concluded that the
input PWM waveforms must shape in a way or another as the sinusoidal waveforms that
the motor must have on its windings. Also, the PWM firing signal must alter its duty cycle
rapidly and it must have a nearly high frequency (around 7 KHz was used).
We need 3 signals to be generated:
Two PWM signals from the PIC, one is shifted from the other by 90º. Now the third signal
is exactly the opposite of the base (not shifted) signal.
So, we needed two 16 byte signed integer counters to be incremented like this:
From 0 to 32768 & then from -32768 to 0
Page33
The absolute value function in the PIC is used
to make use of the negative value of the
counter and to have a continued shape as
shown.
 Now how we knew that the motor will
take the signal as a semi sinusoidal one
with a frequency of nearly 50Hz??
The firing signal was entered in to an R-C (low pass) filter, the output signal which has
the nearly 5oHZ frequency obtained by adjusting the counter incremental value
(counter1 += 300), as shown below:
The triangular waveform is the wave expected to have on the terminals of the motor.
Above of it is the PWM1 signal. PWM2 signal is the same but with 90º phase shift (±0X4000,
according to the direction of rotation) as shown below:
(+): forward, (-): reverse.
Page34
SO THE PIC C CODE OPERATES THE FOLLOWING:
When the user give the PIC an order to start generating PWM signals (in both forward &
reverse direction), an signed int16 counter begin an infinite loop (see Fig. Counter values),
with an incremental value of 300 –to adjust the output frequency-. Then the absolute value
of the counter is to be taken in order to remain in the positive upper side.
Then the new value is shifted by 15 (divided by 215
) to prevent the extreme value of the
counter from reaching its unwanted maximum value. This value represents the duty cycle
of PWM signal.
As explained it is obvious that the duty cycle of both PWMs is variable as we want. The
other PWM signal is only shifted by 90º -Vc-(delayed by 90º from Va) and the same
procedure is done.
DIRECTION CONTROL
When the user want to change the direction of rotation by pressing the reverse key, the
program enter the loop of stopping the motor temporarily for a delay time period of 15ms
then it enters the loop of generating a PWM signal (Vc) that is shifted also by 90º but
(advanced from Va) so the direction will be reversed.
SPEED CONTROL
The speed was controlled by varying the duty cycle of a square wave generated signal
entered to the gate of the chopper MOSFET. Generally in PWM basic concept, when the
duty cycle is varied, accordingly the mean (average) value of the DC output voltage is
varied directly proportional according to the following relation:
𝑉𝑑𝑐 = 𝐷 ∗ 𝑉𝑠 , where D is the duty cycle
So, when the user types the wanted speed on the keypad that speed will be displayed on
the LCD, that speed represent the voltage level that by default represents the duty cycle of
the wave signal. The output voltage level goes directly to the terminals of the AC inverter
and so affects the voltage that goes to the motor.
Page35
FLOW CHART
Start
Any key
pressed
Initialize Port-C
PWM1
PWM2
Setup
Timer1,Timer2
for PWM2 & 1
setup_ccp1
setup_ccp2
Initialize (clear)
LCD
lcd_init
Initialize
Counter1 &
counter2
YES
NO
Page36
key (#)
pressed
Forward, X=0
printf
(lcd_putc,"Forward")
delay_us(1)
counter1+= 300
PWM1
counter2 = abs(counter1)
counter2 =(counter2 >>15)+64
duty_main = counter2
set_pwm1_duty(duty_main)
PWM2
counter3 = counter1 +0x4000
counter4 = abs(counter3)
counter4=(counter4>>15)+64
duty_aux = counter4
set_pwm2_duty(duty_aux)
Another
key
pressed
Key=="#"
keep forward
Key == "*"
Move to
Reversed
X==0
X==1
Motor stop
output_low(pin_c1)
output_low(pin_c2)
Delay for 15ms
2
2
4
2
3
YES NO
YES NO
Page37
4
Reverse
printf(lcd_putc,"Reverse")
Counter1=0
delay_us(1)
PWM1
counter1+= 300
counter2 = abs(counter1)
counter2=(counter2>>15)+64
duty_main= counter2
set_pwm1_duty(duty_main)
PWM2
counter3 = counter1 - 0x4000
counter4 = abs(counter3)
counter4=(counter4>>15)+64
duty_aux = counter4
set_pwm2_duty(duty_aux)
key==#
Motor stop
output_low(pin_c1)
output_low(pin_c2)
Delay for 15ms
4
3
YES NO
Page38
CHAPTER (3)
PROBLEMS & CONSTRAINTS
PROBLEM #1
DC-CHOPPER:
In our project we used the DC-Chopper to alter the DC level that represents the input of the
AC inverter in order to control the speed of the motor. That is supposed to be done using
PWM at the gate of the MOSFET, so while implementing the circuit there was a problem in
loading the chopper, why?? Because in order to see the correct output of it, we must attach
it with correct load, that is in our case the AC inverter and in that time the inverter was not
ready to operate.
Another problem appeared in VGS threshold voltage of the MOSFET used, since the PIC
gave us a voltage level only between 0 & 5.
SOLUTION:
An Optocoupler used to solve the problem of the peak-to-peak voltage entered to the gate
of the MOSFET by adjusting the collector voltage of the right side of the Optocoupler.
While processing the project
stages, SO many tough problems
faced us. So, in this section each
problem or constraint is illustrated
deeply. Also we explained how we
solved each one.
Page39
PROBLEM #2
DEAD BAND TIME:
While trying to implement the firing signals of the 3-phase inverter IGBTs –and with the
constraint of not switching on two IGBTs in the same arm at the same time- a need of a few
μ seconds appears to be inserted in the firing signals. Most of the proposals we checked
provided a solution using a feature in the PIC itself, unfortunately our PIC didn’t have that
feature and it was hard to program it from scratch.
SOLUTION:
In order to design the dead band thing, we took the decision of building the hardware
circuit you have seen in this report having the control on the dead band time according to
the input signal frequency.
PROBLEM #3
IGBT GATE DRIVER:
After taking the choice of using the IGBT type of transistors in the AC inverter
implementation, a need for a driver circuit appears in order to switch the IGBT gate on &
off.
We preferred to use an already implemented 3-phase bridge driver IC (IR21363) because of
its stability characteristics that is excellent both for high & low sides. Having this IC in our
hands took 2 weeks. During this period we thought of designing an alternative driving cct
by ourselves.
Page40
This cct was designed at the begining. This cct achieved the condition of splitting the
ground of the low & high sides,
BUT AS USUAL: A PROBLEM OCCURRED!!
Because the output of the Optocoupler is grounded to the hide side ground –not attached
directly as shown below to the IGBTs terminals-, the voltage applied (VGS) was not enough
to trigger the gate.
But since the output of the Optocoupler is from the emitter, we cannot attach it as above. So
the driver was our only choice.
ALSO,
IR Gate Drive ICs have ten times better delay matching performance than opto-coupler-
based solutions. Delay matching between the low-side and high-side driver is typically
within ± 50ns, allowing complete dead-time control for better speed range and torque
control in motor drive applications. Fast switching also reduces switching power losses and
allows leveraging the full benefits of the fastest IGBTs available on the market today for
better torque control over a wider speed range.
Page41
PROBLEM #4
INVERTER GATES SWITCHING:
So many software topologies were applied in order to trigger the IGBT gates, such as:
Also:
But we approved that they are false, because they didn’t achieve the condition of 90º phase
shift between the main & start windings.
So we thought of generating a signal that is approximately introduces the sinusoidal one as
shown in the software chapter.
Page42
CHAPTER (4)
THE COST
Elements # Of Needed
Elements
Cost (NIS)
Microprocessor 1 40
PIC Basic cct 1 30
Single phase
AC motor
1 120
LCD 1 40
keypad 1 35
MOSFET 1 10
IGBT 6 120
Uncontrolled
full wave
rectifier
1 30
Optocoupler 1 7
Resistors &
Capacitors
-- 100
IR21363
Driver
1 80
Schmitt &
inverters
5 20
Overall
Cost=632 NIS
Page43
CHAPTER (5)
CONCLUSION
First this project controls single phase induction motors in both
direction & speed. This was done by means of Hardware that is associated with the
appropriate Software in order to do the job.
It was discovered during the project that there are several problems with implementing
motor control techniques; hardware circuits & software, most notably is:
 Selecting frequency stability range for every stage in the project (i.e. Chopper,
inverter, and microcontroller stages). Every part needs to have the correct frequency
to operate as required.
Using IGBT switches in driving was more reliable and enjoyable from using BJTs, since
driving circuits for the last one is almost disappeared in presence of other rugged switches.
Also we concluded practical work differs a lot from theoretical one, although they cannot
be separated from each other.
This work here can be also applied to 3-phase AC motors, not only single phase, since 3-
phase inverter is used.
And most important, no matter what happened to our mental state while working in this
project, WE LEARNT A LOT ABOUT EVERY THING,
Especially: “HOW TO BE PATIENT”
LAST THING
PLEASE:
"DON'T LET THIS CONTROL PROJECT SIT IN A BIG FOLDER
AND NOT BE ACTED UPON!"
Page44
CHAPTER (6)
RECOMMENDATIONS
After a lot of stress and fatigue in implementing this project, we recommend the
following, hoping for everyone a good life and health with existence of “MOTORS”:
First of all we DON’T recommend anyone, anywhere, for any purpose to experiment
with the work of this project again. The reason is that one may need a whole year –
may be two- just to understand the theoretical aspects that is embedded in this kind
of subjects. Another year for doing the practical Part including hardware and
software, while maintaining health care above everything.
Don’t ever, never, let any exposed wires or any exposed charged capacitors in your
circuits. You will definatly regret doing this.
Make sure that grounds in your circuit (high side and low side grounds) are
completely separated from each other, IT IS A MATTER OF LIFE AND DEATH.
Always DOUBLE CHECK on your work before turning on
any supply, because an important & expensive part in your
circuit might be ON FIRE!
Don’t be disappointed, LIFE IS HARD!
& ASK Dr. Samer about that 
Page45
CHAPTER (7)
APPENDIX
SOFTWARE PROGRAM ON PIC C
#include "E:Software1.h"
#include<lcd.c>
char key(){
output_low(PIN_B0);
output_high(PIN_B6);
output_high(PIN_B5);
if (!input(PIN_B4)){
restart_wdt();
return '1';
}
if (!input(PIN_B3)){
restart_wdt();
return '4';
}
if (!input(PIN_B2)){
restart_wdt();
return '7';
}
if (!input(PIN_B1)){
restart_wdt();
return '*';
}
output_low(PIN_B6);
output_high(PIN_B0);
output_high(PIN_B5);
if (!input(PIN_B4)){
restart_wdt();
return '2';
}
if (!input(PIN_B3)){
restart_wdt();
return '5';
}
if (!input(PIN_B2)){
restart_wdt();
return '8';
}
if (!input(PIN_B1)){
restart_wdt();
return '0';
}
output_low(PIN_B5);
output_high(PIN_B6);
output_high(PIN_B0);
Page46
if (!input(PIN_B4)){
restart_wdt();
return '3';
}
if (!input(PIN_B3)){
restart_wdt();
return '6';
}
if (!input(PIN_B2)){
restart_wdt();
return '9';
}
if (!input(PIN_B1)){
restart_wdt();
return '#';
}
else{
restart_wdt();
return 'p';
}
}
void main()
{
signed int16 counter1=0;
signed int16 counter2=0;
signed int16 counter3=0;
signed int16 counter4=0;
long duty_main;
long duty_aux;
char t='p';
int i,flag=0,flag2=0;
lcd_init();
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL);
setup_wdt(WDT_2304MS);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_1,127,1);
setup_ccp1(CCP_PWM);
setup_ccp2(CCP_PWM);
restart_wdt();
while (true)
{
set_pwm1_duty(0);
set_pwm2_duty(0);
t=key();
restart_wdt();
while (t=='#')
Page47
{
y:
if(flag2==0)
{
printf(lcd_putc,"forward");
for(i=1;i<=15;i++)
{
output_low(pin_c1);
output_low(pin_c2);
delay_ms(1000);
restart_wdt();
}
flag2=1;
counter1=0;
}
//signal1//
delay_us(1);
counter1=counter1+600;
counter2 = abs(counter1);
counter2 =(counter2 >>7)+(counter2 >>8);
counter2 =counter2+64;
duty_main = counter2;
set_pwm1_duty(duty_main);
//signal2//
counter3 = counter1 +0x4000;
counter4 = abs(counter3);
counter4 =(counter4 >>7)+(counter4 >>8);
counter4 =counter4+64;
duty_aux = counter4;
set_pwm2_duty(duty_aux);
restart_wdt();
flag=0;
t=key();
if(t=='p')
t='#';
while(t=='*')
{
if(flag==0)
{
printf(lcd_putc,"Reversed");
set_pwm1_duty(0);
set_pwm2_duty(0);
for(i=1;i<=15;i++)
{
delay_ms(1000);
restart_wdt();
}
flag=1;
counter1=0;
}
flag2=0;
delay_us(1);
Page48
counter1=counter1+600;
counter2 = abs(counter1);
counter2 =(counter2 >>7)+(counter2 >>8);
counter2 =counter2+64;
duty_main = counter2;
set_pwm1_duty(duty_main);
//signal2//
counter3 = counter1 -0x4000;
counter4 = abs(counter3);
counter4 =(counter4 >>7)+(counter4 >>8);
counter4 =counter4+64;
duty_aux = counter4;
set_pwm2_duty(duty_aux);
restart_wdt();
t=key();
if (t=='p')
t='*';
if(t=='#')
{
restart_wdt();
goto y;
}
}
}
}
}

More Related Content

What's hot

Lectures synchronous machines(1)
Lectures synchronous machines(1)Lectures synchronous machines(1)
Lectures synchronous machines(1)Leela Marigowda
 
Types of machines|Classification of Electrical Machine|Basic Electrical Engin...
Types of machines|Classification of Electrical Machine|Basic Electrical Engin...Types of machines|Classification of Electrical Machine|Basic Electrical Engin...
Types of machines|Classification of Electrical Machine|Basic Electrical Engin...Prasant Kumar
 
single-phase-induction-motor.ppt
single-phase-induction-motor.pptsingle-phase-induction-motor.ppt
single-phase-induction-motor.pptsivaramanpsr
 
Three phase Induction Motor (Construction and working Principle)
Three phase Induction Motor (Construction and working Principle)Three phase Induction Motor (Construction and working Principle)
Three phase Induction Motor (Construction and working Principle)Sharmitha Dhanabalan
 
Induction generator and synchronous induction motor
Induction generator and synchronous induction motor Induction generator and synchronous induction motor
Induction generator and synchronous induction motor Pavithran Selvam
 
Unit 2 single phase induction motor
Unit 2 single phase induction motorUnit 2 single phase induction motor
Unit 2 single phase induction motorEr.Meraj Akhtar
 
No-load & blocked rotor test, Equivalent circuit, Phasor diagram
No-load & blocked rotor test, Equivalent circuit, Phasor diagramNo-load & blocked rotor test, Equivalent circuit, Phasor diagram
No-load & blocked rotor test, Equivalent circuit, Phasor diagramAbhishek Choksi
 
electrical machines
electrical machineselectrical machines
electrical machinesmahesh babu
 
Motor Test (Induction motor)
Motor Test (Induction motor)Motor Test (Induction motor)
Motor Test (Induction motor)Arshad Hussain
 
Special Electrical Machines
Special Electrical MachinesSpecial Electrical Machines
Special Electrical Machinesjohny renoald
 
Torque - Slip Characteristic of a three phase induction motor
Torque - Slip Characteristic of a three   phase induction motorTorque - Slip Characteristic of a three   phase induction motor
Torque - Slip Characteristic of a three phase induction motorAli Altahir
 
Electrical introduction
Electrical introductionElectrical introduction
Electrical introductionsnakeaye
 

What's hot (20)

Ac motor winding
Ac motor windingAc motor winding
Ac motor winding
 
Lectures synchronous machines(1)
Lectures synchronous machines(1)Lectures synchronous machines(1)
Lectures synchronous machines(1)
 
Induction motors
Induction motorsInduction motors
Induction motors
 
Types of machines|Classification of Electrical Machine|Basic Electrical Engin...
Types of machines|Classification of Electrical Machine|Basic Electrical Engin...Types of machines|Classification of Electrical Machine|Basic Electrical Engin...
Types of machines|Classification of Electrical Machine|Basic Electrical Engin...
 
single-phase-induction-motor.ppt
single-phase-induction-motor.pptsingle-phase-induction-motor.ppt
single-phase-induction-motor.ppt
 
Three phase Induction Motor (Construction and working Principle)
Three phase Induction Motor (Construction and working Principle)Three phase Induction Motor (Construction and working Principle)
Three phase Induction Motor (Construction and working Principle)
 
Induction generator and synchronous induction motor
Induction generator and synchronous induction motor Induction generator and synchronous induction motor
Induction generator and synchronous induction motor
 
Single phase im-lecture_10_1
Single phase im-lecture_10_1Single phase im-lecture_10_1
Single phase im-lecture_10_1
 
Unit 2 single phase induction motor
Unit 2 single phase induction motorUnit 2 single phase induction motor
Unit 2 single phase induction motor
 
Induction machines
Induction machinesInduction machines
Induction machines
 
No-load & blocked rotor test, Equivalent circuit, Phasor diagram
No-load & blocked rotor test, Equivalent circuit, Phasor diagramNo-load & blocked rotor test, Equivalent circuit, Phasor diagram
No-load & blocked rotor test, Equivalent circuit, Phasor diagram
 
electrical machines
electrical machineselectrical machines
electrical machines
 
Synchronous machine
Synchronous machineSynchronous machine
Synchronous machine
 
Induction motor
Induction motorInduction motor
Induction motor
 
Motor Test (Induction motor)
Motor Test (Induction motor)Motor Test (Induction motor)
Motor Test (Induction motor)
 
1 phase induction motor
1 phase induction motor1 phase induction motor
1 phase induction motor
 
Special Electrical Machines
Special Electrical MachinesSpecial Electrical Machines
Special Electrical Machines
 
Torque - Slip Characteristic of a three phase induction motor
Torque - Slip Characteristic of a three   phase induction motorTorque - Slip Characteristic of a three   phase induction motor
Torque - Slip Characteristic of a three phase induction motor
 
Electrical introduction
Electrical introductionElectrical introduction
Electrical introduction
 
Reluctance motor
Reluctance motorReluctance motor
Reluctance motor
 

Viewers also liked

induction motor protection system seminar report
induction motor protection system seminar reportinduction motor protection system seminar report
induction motor protection system seminar reportdipali karangale
 
Embedded projects in chennai
Embedded projects in chennaiEmbedded projects in chennai
Embedded projects in chennaiPhoenix Systems
 
Implementation of ac induction motor control using constant vhz principle and...
Implementation of ac induction motor control using constant vhz principle and...Implementation of ac induction motor control using constant vhz principle and...
Implementation of ac induction motor control using constant vhz principle and...eSAT Journals
 
Speed control of 1 φ inducton motor using traic
Speed control of 1 φ inducton motor using traicSpeed control of 1 φ inducton motor using traic
Speed control of 1 φ inducton motor using traicjawededu
 
Electric Traction
Electric Traction Electric Traction
Electric Traction ZunAib Ali
 
Electrical ac & dc drives ppt
Electrical ac & dc drives pptElectrical ac & dc drives ppt
Electrical ac & dc drives pptchakri218
 

Viewers also liked (7)

induction motor protection system seminar report
induction motor protection system seminar reportinduction motor protection system seminar report
induction motor protection system seminar report
 
Embedded projects in chennai
Embedded projects in chennaiEmbedded projects in chennai
Embedded projects in chennai
 
Implementation of ac induction motor control using constant vhz principle and...
Implementation of ac induction motor control using constant vhz principle and...Implementation of ac induction motor control using constant vhz principle and...
Implementation of ac induction motor control using constant vhz principle and...
 
Induction Motor Protection System
Induction Motor Protection SystemInduction Motor Protection System
Induction Motor Protection System
 
Speed control of 1 φ inducton motor using traic
Speed control of 1 φ inducton motor using traicSpeed control of 1 φ inducton motor using traic
Speed control of 1 φ inducton motor using traic
 
Electric Traction
Electric Traction Electric Traction
Electric Traction
 
Electrical ac & dc drives ppt
Electrical ac & dc drives pptElectrical ac & dc drives ppt
Electrical ac & dc drives ppt
 

Similar to Single phase-induction-motor(eee499.blogspot.com)

E 1005
E 1005E 1005
E 1005dvd13
 
Electrictraction 120802004329-phpapp01
Electrictraction 120802004329-phpapp01Electrictraction 120802004329-phpapp01
Electrictraction 120802004329-phpapp0176392
 
IRJET - Three-Phase Single Switch PWM Controlled Induction Motor Drive
IRJET - Three-Phase Single Switch PWM Controlled Induction Motor DriveIRJET - Three-Phase Single Switch PWM Controlled Induction Motor Drive
IRJET - Three-Phase Single Switch PWM Controlled Induction Motor DriveIRJET Journal
 
Electrical energy issues presented by arshad khan chiniot power limited
Electrical energy issues presented by arshad khan chiniot  power limitedElectrical energy issues presented by arshad khan chiniot  power limited
Electrical energy issues presented by arshad khan chiniot power limitedarshadkhanmarwat
 
ELECTRICAL AC AND DC DRIVES
ELECTRICAL AC AND DC DRIVESELECTRICAL AC AND DC DRIVES
ELECTRICAL AC AND DC DRIVESjayashreedhivya
 
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...Journal For Research
 
Performance of dc motors experiment 2
Performance of dc motors experiment 2Performance of dc motors experiment 2
Performance of dc motors experiment 2Karimi LordRamza
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
three phase induction motor drive
three phase induction motor drivethree phase induction motor drive
three phase induction motor driveRatnesh Verma
 
Speed control of three phase induction motor
Speed control of three phase induction motorSpeed control of three phase induction motor
Speed control of three phase induction motorsanagowtham
 
speed control of three phase induction motor
speed control of three phase induction motorspeed control of three phase induction motor
speed control of three phase induction motorAshvani Shukla
 
IRJET- Variable Frequency Drive Used in Treadmill
IRJET- Variable Frequency Drive Used in TreadmillIRJET- Variable Frequency Drive Used in Treadmill
IRJET- Variable Frequency Drive Used in TreadmillIRJET Journal
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 

Similar to Single phase-induction-motor(eee499.blogspot.com) (20)

E 1005
E 1005E 1005
E 1005
 
ELEKTRA_new
ELEKTRA_newELEKTRA_new
ELEKTRA_new
 
Electrictraction 120802004329-phpapp01
Electrictraction 120802004329-phpapp01Electrictraction 120802004329-phpapp01
Electrictraction 120802004329-phpapp01
 
PROJECT SEMINAR
PROJECT SEMINARPROJECT SEMINAR
PROJECT SEMINAR
 
Electric traction
Electric tractionElectric traction
Electric traction
 
IRJET - Three-Phase Single Switch PWM Controlled Induction Motor Drive
IRJET - Three-Phase Single Switch PWM Controlled Induction Motor DriveIRJET - Three-Phase Single Switch PWM Controlled Induction Motor Drive
IRJET - Three-Phase Single Switch PWM Controlled Induction Motor Drive
 
Electrical energy issues presented by arshad khan chiniot power limited
Electrical energy issues presented by arshad khan chiniot  power limitedElectrical energy issues presented by arshad khan chiniot  power limited
Electrical energy issues presented by arshad khan chiniot power limited
 
ED_Ind_Motor_Rotor.ppt
ED_Ind_Motor_Rotor.pptED_Ind_Motor_Rotor.ppt
ED_Ind_Motor_Rotor.ppt
 
Power Factors
Power FactorsPower Factors
Power Factors
 
ELECTRICAL AC AND DC DRIVES
ELECTRICAL AC AND DC DRIVESELECTRICAL AC AND DC DRIVES
ELECTRICAL AC AND DC DRIVES
 
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
ENERGY EFFICIENT VARIABLE SPEED HIGH POWER FACTOR THREE PHASE INDUCTION MOTOR...
 
Performance of dc motors experiment 2
Performance of dc motors experiment 2Performance of dc motors experiment 2
Performance of dc motors experiment 2
 
Eee 551
Eee 551Eee 551
Eee 551
 
Ijetr012032
Ijetr012032Ijetr012032
Ijetr012032
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
three phase induction motor drive
three phase induction motor drivethree phase induction motor drive
three phase induction motor drive
 
Speed control of three phase induction motor
Speed control of three phase induction motorSpeed control of three phase induction motor
Speed control of three phase induction motor
 
speed control of three phase induction motor
speed control of three phase induction motorspeed control of three phase induction motor
speed control of three phase induction motor
 
IRJET- Variable Frequency Drive Used in Treadmill
IRJET- Variable Frequency Drive Used in TreadmillIRJET- Variable Frequency Drive Used in Treadmill
IRJET- Variable Frequency Drive Used in Treadmill
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 

More from slmnsvn

Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system slmnsvn
 
Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system slmnsvn
 
Smart home
Smart homeSmart home
Smart homeslmnsvn
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detectorslmnsvn
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detectorslmnsvn
 
Rfid attendace system
Rfid attendace systemRfid attendace system
Rfid attendace systemslmnsvn
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicleslmnsvn
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicleslmnsvn
 
Power factor correction
Power factor correctionPower factor correction
Power factor correctionslmnsvn
 
Power factor correction
Power factor correctionPower factor correction
Power factor correctionslmnsvn
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallahslmnsvn
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallahslmnsvn
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkslmnsvn
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkslmnsvn
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2slmnsvn
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2slmnsvn
 
Optimum performance for aqraba electrical network
Optimum performance for aqraba electrical networkOptimum performance for aqraba electrical network
Optimum performance for aqraba electrical networkslmnsvn
 
Multi tone test
Multi tone testMulti tone test
Multi tone testslmnsvn
 
Multi tone test
Multi tone testMulti tone test
Multi tone testslmnsvn
 
Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...slmnsvn
 

More from slmnsvn (20)

Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system
 
Analysis optimization and monitoring system
Analysis optimization and monitoring system Analysis optimization and monitoring system
Analysis optimization and monitoring system
 
Smart home
Smart homeSmart home
Smart home
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detector
 
Smart fuel theft detector
Smart fuel theft detectorSmart fuel theft detector
Smart fuel theft detector
 
Rfid attendace system
Rfid attendace systemRfid attendace system
Rfid attendace system
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicle
 
Quad pod transformable vehicle
Quad pod transformable vehicleQuad pod transformable vehicle
Quad pod transformable vehicle
 
Power factor correction
Power factor correctionPower factor correction
Power factor correction
 
Power factor correction
Power factor correctionPower factor correction
Power factor correction
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallah
 
Optimum performances of ramallah
Optimum performances of ramallahOptimum performances of ramallah
Optimum performances of ramallah
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate network
 
Optimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate networkOptimum performance of tulkarim governorate network
Optimum performance of tulkarim governorate network
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2
 
Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2Optimum performance for aqraba electrical network 2
Optimum performance for aqraba electrical network 2
 
Optimum performance for aqraba electrical network
Optimum performance for aqraba electrical networkOptimum performance for aqraba electrical network
Optimum performance for aqraba electrical network
 
Multi tone test
Multi tone testMulti tone test
Multi tone test
 
Multi tone test
Multi tone testMulti tone test
Multi tone test
 
Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...Mini scada system for monitoring pv and wind installation in meteorology stat...
Mini scada system for monitoring pv and wind installation in meteorology stat...
 

Recently uploaded

Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 

Recently uploaded (20)

Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 

Single phase-induction-motor(eee499.blogspot.com)

  • 1. Graduation Project Supervisor: Dr. Samer Mayaleh An-Najah NationalUniversity Faculty of Engineering Electrical Engineering Department Prepared by: Nihaya Dmeede 10405165 Farah Damen 10406679
  • 2. Page2 TABLE OF CONTENT Abstract________________________________________________________________________3 Chapter -1- Theoretical Part 1.1 Why Single phase AC motor? ______________________________________________6 1.2 Single phase AC motor type __________________________________________________7 1.3 Applications on single phase AC motor_______________________________________10 1.4 Speed Control___________________________________________________________11 1.5 Direction Control__________________________________________________________12 Chapter -2- Practical Part 2.1 Design Description ________________________________________________________14 2.2 System Description ________________________________________________________15 2.3 Full circuit Preview ________________________________________________________16 2.4 Hardware_________________________________________________________________17 2.5 Software _________________________________________________________________30 Chapter -3- Problems & Constraints _________________________________________________________38 Chapter -4- Cost _________________________________________________________________________42 Chapter -5- Conclusion_____________________________________________________________________43 Chapter -6- Recommendations Cost _________________________________________________________44 Chapter -7- Appendix ______________________________________________________________________45
  • 3. Page3 ABSTRACT Single Phase Induction Motor Adjustable Speed-Direction Control Using Microcontroller In this project, a single phase induction motor (SPIM) adjustable speed drive control is implemented with hardware setup and software program in PIC-C code. SPIM is used because it is widelyused in our daily life. The main feature used in microcontroller is their peripherals to realize pulse width modulation. This Digital control brings low cost, small size and flexibility to change the control algorithm without changes in hardware.
  • 5. Page5 THEORETICAL PART CHAPTER (1) INTRODUCTION INTRODUCTION WHY SINGLE PHASE AC MOTORS ?? SINGLE- PHASE AC MOTOR TYPES SPEED CONTROL DIRECTION CONTROL APPLICATION ON SINGLE- PHASE AC MOTOR
  • 6. Page6 (1.1) WHY SINGLE PHASE AC MOTORS??  They are useful -- serving as the prime power sources for a seemingly limitless array of small-horsepower applications in industry and in the home.  Where three-phase power is unavailable or impractical, its single-phase motors to the rescue.  Single phase AC electrical supply is what is typically supplied in homes, three phase electrical power is commonly only available in a factory setting.  Single-phase motors -- correctly sized and rated -- can last a lifetime with little maintenance. 1ϕ AC Power supply Lifetime & Maintenece small- horsepower applications
  • 7. Page7 (1.2) SINGLE PHASE AC MOTOR TYPES SPLIT-PHASE CAPACITOR START/INDUCTION RUN PERMANENT SPLIT CAPACITOR CAPACITOR START/CAPACITOR RUN SHADED-POLE
  • 8. Page8 THE MOTOR WE USED IS: PERMANENT SPLIT CAPACITOR A permanent split capacitor (PSC) motor, Figure shown, has neither a starting switch, nor a capacitor strictly for starting. Instead, it has a run- type capacitor permanently connected in series with the start (Aux.) winding. This makes the main winding an auxiliary winding once the motor reaches running speed. Because the run capacitor must be designed for continuous use, it cannot provide the starting boost of a starting capacitor. Typical starting torque of PSC motors is low, from 30 to 150% of rated load, so these motors are not for hard-to-start applications. However, unlike split-phase motors, PSC motors have low starting currents, usually less than 200% of rated load current, making them excellent for applications with high cycle rates. Breakdown torque varies depending on the design type and application, though it is typically somewhat lower than with a cap start motors. PSC motors have several advantages. They need no starting mechanism and so can be reversed easily. Designs can be easily altered for use with speed controllers. They can also be designed for optimum efficiency and high power factor at rated load. And they're considered to be the most reliable of the single phase motors, mostly because no starting switch is needed. Permanent split capacitor motors have a wide variety of applications depending on the design. These include fans, blowers with low starting torque needs, and intermittent cycling uses such as adjusting mechanisms, gate operators and garage door openers, many of which also need instant reversing.
  • 9. Page9 MEASURED MOTOR SPECIFICATIONS: NO LOAD PARAMETERS:  InL=0.38A  W= 1436 rpm LOADED MOTOR PARAMETERS:  Pout=86w (Measured)  𝜂 = 85% (Estimated)  𝜂 = 𝑃𝑜𝑢𝑡 𝑃𝑖𝑛 ∗ 100%  Pin= V*I =220*I  P.f ≈ 1  IfL= 𝑃𝑜𝑢𝑡 𝜂∗𝑉∗𝑝.𝑓 = 86 0.85∗220∗1 = 0.45A Imian=400mA, Iaux=670mA Turns Ratio (α) = 𝑉𝑎𝑢𝑥 𝑉𝑚𝑎𝑖𝑛 = 𝐼𝑚𝑎𝑖𝑛 𝐼𝑎𝑢𝑥 =3.33 θ=2tan 𝛼=146.57º TORQUE MEASUREMENT: We measured the torque by loading the motor with some weights connected to the shaft using a cord.  The cord length (l)= 60cm  Force (F)= 130N  T=F*L(m)= 130*0.6= 78 N.m  T≅ (Full load Torque)
  • 10. Page10 (1.3) APPLICATIONS ON SPI MOTORS The scope of motor control technology must be very wide to accommodate the wide variety of motor applications in various fields. A. DOMESTIC APPLICATIONS B. OFFICE EQUIPMENT, MEDICAL EQUIPMENT… ETC. C. COMMERCIAL APPLICATIONS D. INDUSTRIAL APPLICATIONS E. VEHICLE APPLICATIONS F. POWER TOOLS G. HOBBY EQUIPMENT PSC MOTORS APPLICATIONS With this motor, designs can be easily altered for use with speed controllers. It can also be designed for optimum efficiency and high power factor at rated load. Include fans, blowers with low starting torque needs, and intermittent cycling uses such as adjusting mechanisms, gate operators and garage door openers, many of which also need instant reversing.
  • 11. Page11 (1.4)SPEED CONTROL In general, ac drives work (controlling ac motor speed) by varying the frequency of the current supplying the motor. Although frequency can be varied many ways, and in relation to other variables such as voltage, the most common methods in use today are "volts per hertz," open-loop vector, and closed-loop vector. How these techniques differ determines where each drive type works best. VOLTS PER HERTZ Volts per hertz (V/Hz) technology is the most economical and easiest to apply of the three speed-control methods. Here, the drive controls shaft speed by varying the voltage and frequency of the signal powering the motor. Now, the rotor of an ac induction motor is magnetically coupled to the stator through an induced magnetic field. The speed at which the magnetic field rotates around the stator is known as synchronous speed and is determined by: n = 120 f/N where n is synchronous motor speed, 120 is an electrical constant, f is the applied frequency, and N is the number of motor poles. The equation illustrates one of the basic principles of speed control: Reducing applied frequency to an ac induction motor causes the magnetic field to turn at a proportionally slower rate, thereby reducing rotor speed. This is only part of the story, however. Induction motors are designed to operate from line voltage at line frequency. But the whole purpose of V/Hz drives is that they don't hold systems to power line shapes. What they do instead is maintain an optimal voltage-to- frequency ratio, so that the motors their power will produce their rated torque over the widest possible speed range. -Air gap flux level becomes greater than normal -The saturation in flux resultting can cause an excessive magnetizing current. Decreasing the developed tourqe
  • 12. Page12 (1.5)DIRECTION CONTROL HISTORICALLY BIDIRECTIONAL TECHNIQUES: PRESENT BIDIRECTIONAL TECHNIQUES: USING AN H-BRIDGE INVERTER The first approach is relatively easy as far as the power circuit and control circuit are concerned. On the input side, a voltage doubler is used and on the output side an H-bridge, or 2-phase inverter, is used as shown in Figure bellow. One end of the main and start windings are connected to each half bridge and the other ends are connected together to the neutral point of the AC power supply, which also serves as the center point for the voltage doubler. Unfortunately, all of these components increase the cost of the system for basic ON and OFF control in two directions. Historically Bidirectional Gear mecha -nisms Switches External relays
  • 13. Page13 If the voltage applied to the main winding lags the start winding by 90 degrees, the motor runs in one (i.e., forward) direction. To reverse the direction of rotation, the voltage supplied to the main winding should lead the voltage supplied to the start winding. USING A 3-PHASE INVERTER The input section is replaced with a standard diode bridge rectifier. The output section has a 3-phase inverter bridge. The main in Figure bellow. difference from the previous scheme is the way the motor windings are connected to the inverter. One end of the main winding and start windings are connected to one half bridge each. The other ends are tied together and connected to the third half bridge, as shown With this drive topology, control becomes more efficient; however, the control algorithm becomes more complex. The voltages V a, V b and V c should be controlled to achieve the phase difference between the effective voltages across the main and start windings to have a 90 degree phase shift to each other. Now, H-bridge inverter method of controlling a PSC type motor has following disadvantages:  The main and start windings have different electrical characteristics. Thus, the current flowing through each switch is unbalanced. This can lead to the premature breakdown of switching devices in the inverter.  The common point of the windings is directly connected to the neutral power supply. This may increase the switching signals creeping into the main power supply, and may increase the noise emitted onto the line. In turn, this may limit the EMI level of the product, violating certain design goals and regulations.  The effective dc voltage handled is relatively high due to the input-voltage doubler circuit.  Lastly, the cost of the voltage doubler circuit itself is high due to two large power capacitors. Advantages of using the three-phase control method:  The main advantage of using the three-phase control method is that the same drive- hardware topology can be used to control a three-phase induction motor. In this scenario, the microcontroller should be reprogrammed to output sine voltages with
  • 14. Page14 120-degree phase shift to each other, which drives a three-phase induction motor. This reduces the development time.  Power saving. Microcontroller Resources Requirement (For reversing direction) Resource Bidirectional H-bridge Bidirectional with three-phase bridge Notes Program memory 2.0 Kbytes 2.5 Kbytes -- Data memory ~25 Bytes ~25 bytes -- PWM channels 2 channels 3 channels Complementary with dead time Timer 1 1 8- or 16-bit Digital I/Os 3 to 4 3 to 4 For user interfaces like switches and displays Complexity of control algorithm Medium High -- Bidirectional with H-bridge Bidirectional with three-phase bridge Input converter section High - Due to voltage doubler circuit Low - Single phase diode bridge rectifier Output inverter section Medium - Two half bridges. The power switches rated higher voltage High - three-phase inverter. Using Integrated Power Modules (IPM) is better choice than discrete components Motor Low - Starting capacitor is removed from the motor Low - Starting capacitor is removed from the motor Development time Mid-range Long Overall cost Medium Medium - Efficient control for the given cost
  • 15. Page15 PRACTICAL PART CHAPTER (2) (2.1)DESIGN DESCRIPTION Design Hardware Software
  • 16. Page16 (2.2)SYSTEM DESCRIPTION OVERALL BLOCK DIAGRAM ALGORITHMIC BLOCK DIAGRAM
  • 18. Page18 (2.4) HARDWARE Bridge Rectifier Optocoupler DC Chopper PIC Microcontroller Basic cct Keypad & LCD Connection Dead Band time Generator 3-Phase Bridge Driver IGBT 3-Phase Inverter
  • 19. Page19 BRIDGE RECTIFIER SINGLE PHASE FULL-WAVE BRIDGE RECTIFIER The full bridge rectifier (KBPC 35-10) has been used to convert the ac supply to a dc voltage Vdc. The output of the rectifier is the input to the dc chopper which controls the voltage level. KBPC 35-10: a Single phase silicon bridge rectifier. Maximum recurrent peak reverse voltage 1000 V. Maximum average forward rectified current 35 A. in 4-pin KBPC package. The output dc voltage: Vdc =206 v.
  • 20. Page20 OPTOCOUPLER The Optocoupler used to isolate between high voltage of the chopper and low voltage of the microcontroller, There are manysituations where signals and data need to be transferred from one subsystem to another within a piece of electronics equipment, or from one piece of equipment to another, without makinga direct ohmic electrical connection. Often this is because the source and destination are (or maybe at times) at verydifferent voltage levels, like a microprocessor which is operatingfrom 5V DC but being used to control a triac which is switching240V AC. In such situations the link between the two must be an isolated one, to protect the microprocessor from overvoltage damage. We used Optocoupler for isolatingbetween the chopper MOSFET gate and the PWM output from the PIC microcontroller. Also we were attendingto use it in the driver cct of the IGBT, but a problem occurred which is discussed in the Problems chapter.
  • 21. Page21 DC CHOPPER A dc chopper is a dc-to-dc voltage converter A DC chopper uses three main components to create variable speed capability A DC chopper circuit is pictured below The MOSFET allows current from the source to pass through it, but when it allows current to pass through it is governed by the pulse wave modulator (PWM). The PWM creates pulses, and the high section of these pulses turns on the MOSFET. The longer the MOSFET is turned on, the faster the motor spins. Thus, by varying the high section, commonly referred to as the duty cycle, it is possible to vary the speed of the motor. MOSFET The MOSFET conducts for the high portion of the gating signal, and does not conduct for the low portion of the gating signal. The higher the duty cycle of these input waves, the longer the MOSFET acts as a closed switch. We attached a large heat sink to the MOSFET to prevent overheating and breakdown due to large currents.
  • 22. Page22 CIRCUITRY SAFETY FEATURES The MOSFET is exposed to high currents and a lot of stress, which raises the concern of safety, and preserving the life of the MOSFET. The MOSFET in our design is protected by a snubber circuit it’s to protect against from the switching stresses of high voltages and currents and to lower the power loss. THE SNUBBER CIRCUIT Much of the power lost when using transistors is due to switching. Snubber circuits reduce power losses in transistors during switching and protect them from the switching stresses of high voltages and currents. Switching contributes to a large amount of the power lost when using transistors. Therefore, to conserve energy in our circuit it was a good idea to implement a snubber circuit into our design. One purpose of the snubber circuit is to alter the voltage and current waveforms produced during switching to an advantage.
  • 24. Page24 KEYPAD & LCD CONNECTION LCD DISPLAY: This display shows speed in addition to the direction of rotation. The display receives its input from the main control unit(PIC 16F877). KEYPAD: The keypad is used to enter the desired speed of the motor, we used the extra push buttons on the keypad for the direction. The output of the keypad goes directly to the control PIC, where it is processed accordingly. (*) key press indicates Reverse Direction of rotation. (#) key press indicates Forward Direction of rotation.
  • 25. Page25 DEAD BAND TIME GENERATOR SIMPLE DEADBAND GENERATOR TARGETS PUSH-PULL DRIVERS This simple cct introduces any desired amount of deadband time between alternating output control pulses. This cct is used In order to avoid cross conduction (two on IGBTs in the same arm) during the transition periods of our IGBT transistors, since cross conduction may results in high current surges being drawn from the power supply. The simple circuit shown can be used to introduce any desired amount of deadband time between Vo1 and Vo2 control pulses. The circuit employs a Schmitt-trigger inverter IC, the 74HC14. With the diodes, different time delays can be obtained for the rising and falling edges of the drive waveform. The deadband is determined by the RC time constant. The waveforms shown are self-explanatory. 𝜏 = 𝑅 ∗ 𝐶 Our deadband time is 5µsec.
  • 26. Page26 GATE DRIVER IR Gate Driver ICs Driving a MOSFET or IGBT in the high side position of a half-bridge topology or 3 phase inverter leg offers the additional challenge that the gate voltage is referenced to the source rather than to ground. The source voltage is a floating point at up to the maximum bus voltage, or voltage rating of the MOSFET or IGBT, 600V and up for motor drive, lighting or SMPS applications. IR gate driver uses a patented level shifter technology for high voltage application and offers the only 1200V rating in the industry. These ICs simplify circuit designs by integrating extensive functionality. They use a low cost bootstrap supply, while opto-coupler-based circuits typically require an auxiliary power supply. IR Gate Driver ICs offer optional single input or dual input programmable deadtime control for low side and high side drivers as well as for 3 phase drivers to provide design flexibility and allows to minimize cross-conduction. Unique 3-phase drivers allow driving a 3 phase inverter using a single IC. IR Gate Driver ICs enable rugged driver designs IR Gate Driver ICs are specifically designed with motor drive applications in mind. The newest soft-turn-on limits voltage and current spike and reduce EMI. In addition, they have up to 50V/ns dV/dt immunity and are tolerant to negative voltage transient. The under- voltage lock-out available for most drivers prevents shoot-through currents and device failures during power-up and power-down without any additional circuitry. The output drivers feature a high pulse current buffer stage designed for minimum driver cross- conduction. Noise immunity is important for the high-side position which has a floating voltage and is susceptible to high noise levels, particularly in motor drive applications. Noise immunity ensures that the MOSFET or IGBT doesn't turn on accidentally. Noise immunity is obtained by using Schmitt-triggered input with pull-down.
  • 27. Page27 IR Gate Driver ICs enable fast switching speeds IR Gate Drive ICs have ten times better delay matching performance than opto-coupler- based solutions. Delay matching between the low-side and high-side driver is typically within ± 50ns (and as low as ± 10ns for some specialty products), allowing complete dead- time control for better speed range and torque control in motor drive applications. Fast switching also reduces switching power losses and allows leveraging the full benefits of the fastest IGBTs available on the market today for better torque control over a wider speed range. The IR21363 is a high voltage, high speed power MOSFET and IGBT driver with three independent high and low side referenced output channels. Over current fault conditions are cleared automatically after a delay programmed externally via an RC network connected to the RCIN input. Our waveforms are as shown: IR input: IR output:
  • 28. Page28 BOOTSTRAP CAPACITOR Comprising a bootstrap diode and bootstrap capacitor (see the figure, below). The bootstrap diode may be either integrated within the gate driver IC or external to it. Because the bootstrap capacitor value must be much higher than the MOSFET gate capacitance, it is always external to the IC. When the lower MOSFET is enabled, the bootstrap capacitor charges up to VDD via the bootstrap diode. Thus, the high-side gate driver “floats” at the gate voltage of the high-side MOSFET. For reliable operation, the high side driver must be able to withstand the operating voltage of the high-side MOSFET. Typical maximum voltage ratings for high-voltage gate drivers can range from 80 to 100 V. Bootstrap diode power loss consists of the forward diode loss while charging the bootstrap capacitor and reverse bias power loss during reverse recovery. These events occur once per cycle, so this diode loss is also proportional to the switching frequency. BOOTSTRAP CAPACITOR SELECTION: CBOOT must be correctly selected to ensure proper operation of the device. If too large, time is wasted charging the capacitor, with the result being a limit on the maximum duty cycle and PWM frequency. If the capacitor is too small, the voltage drop can be too large at the time the charge is transferred from the CBOOT to the IGBT gate.
  • 29. Page29 AC INVERTER An AC inverter is used to convert DC voltage to AC voltage. In this model the frequency is fixed and variable output voltage is obtained by varying the pulse width of the chopper switch. INVERTER STRUCTURE One end of the main winding and start windings are connected to one half bridge each. The other ends are tied together and connected to the third half bridge. With this drive topology, control becomes more efficient; however, the control algorithm becomes more complex. The voltages Va, Vb and Vc should be controlled to achieve the phase difference between the effective voltages across the main and start windings to have a 90 degree phase shift to each other. |Va| = |Vb| = |Vc| = |V1| The effective voltage across the main and start winding is given as: 𝑉𝑚𝑎𝑖𝑛 = Va − Vc 𝑉𝑎𝑢𝑥 = Vb − Vc The voltages are shown in the phasor diagram in
  • 30. Page30 As seen in the phasor diagram, the voltages across phase A and phase B are out of phase. Figure below shows the phase voltages Va ,Vb and Vc, and the other figure shows the effective voltages across the main winding (VMAIN) and the start winding (VSTART). Also shows that the effective phase difference between the voltages is 90 degrees and the effective voltage ratio is α.
  • 31. Page31 1. IGBT SWITCH Power switches used for the inverter are type 2MBI50L-120 IGBTs, manufactured by Collmer Semiconductor. They come two IGBTs in a single unit with an anti parallel diode as shown in Figure bellow. The insulated gate bipolar transistor (IGBT) is an attempt to unite the best features of the bipolar junction transistor and the MOSFET technologies. IGBT device has good forward blocking but very limited reverse blocking ability. It can operate at higher current densities than either the power BJT or MOSFET allowing a smaller chip size. The IGBT is a three terminal device. The power terminals are called the emitter (E) and collector (C), using the BJT terminology, while the control terminal is called the gate (G), using the MOSFET terminology. The main advantages of the insulated gate bipolar transistor (IGBT) are:  Good power handling capabilities.  Low forward conduction voltage drop of 2 V to 3 V, which is higher than for a BJT but lower than for a MOSFET of similar rating.  This voltage increases with temperature making the device easy to operate in parallel without danger of thermal instability.  High speed switching capability.  Relatively simple voltage controlled gate driver.  Low gate current.
  • 32. Page32 (2.5)SOFTWARE DESIGN After constructing the basic cct of the PIC microcontroller 16F877, the following ports are used: Port-B: For keypad. Port-D: For LCD. Port-C: RC1 for CCP2 (PWM1), RC2 for CCP1 (PWM2). Port-A: RA0, chopper MOSFET’s gate square wave signal. PWM (PULSE WIDTH MODULATION) SIGNALS GENERATION: In order to achieve 90º phase shift between main & aux windings, we concluded that the input PWM waveforms must shape in a way or another as the sinusoidal waveforms that the motor must have on its windings. Also, the PWM firing signal must alter its duty cycle rapidly and it must have a nearly high frequency (around 7 KHz was used). We need 3 signals to be generated: Two PWM signals from the PIC, one is shifted from the other by 90º. Now the third signal is exactly the opposite of the base (not shifted) signal. So, we needed two 16 byte signed integer counters to be incremented like this: From 0 to 32768 & then from -32768 to 0
  • 33. Page33 The absolute value function in the PIC is used to make use of the negative value of the counter and to have a continued shape as shown.  Now how we knew that the motor will take the signal as a semi sinusoidal one with a frequency of nearly 50Hz?? The firing signal was entered in to an R-C (low pass) filter, the output signal which has the nearly 5oHZ frequency obtained by adjusting the counter incremental value (counter1 += 300), as shown below: The triangular waveform is the wave expected to have on the terminals of the motor. Above of it is the PWM1 signal. PWM2 signal is the same but with 90º phase shift (±0X4000, according to the direction of rotation) as shown below: (+): forward, (-): reverse.
  • 34. Page34 SO THE PIC C CODE OPERATES THE FOLLOWING: When the user give the PIC an order to start generating PWM signals (in both forward & reverse direction), an signed int16 counter begin an infinite loop (see Fig. Counter values), with an incremental value of 300 –to adjust the output frequency-. Then the absolute value of the counter is to be taken in order to remain in the positive upper side. Then the new value is shifted by 15 (divided by 215 ) to prevent the extreme value of the counter from reaching its unwanted maximum value. This value represents the duty cycle of PWM signal. As explained it is obvious that the duty cycle of both PWMs is variable as we want. The other PWM signal is only shifted by 90º -Vc-(delayed by 90º from Va) and the same procedure is done. DIRECTION CONTROL When the user want to change the direction of rotation by pressing the reverse key, the program enter the loop of stopping the motor temporarily for a delay time period of 15ms then it enters the loop of generating a PWM signal (Vc) that is shifted also by 90º but (advanced from Va) so the direction will be reversed. SPEED CONTROL The speed was controlled by varying the duty cycle of a square wave generated signal entered to the gate of the chopper MOSFET. Generally in PWM basic concept, when the duty cycle is varied, accordingly the mean (average) value of the DC output voltage is varied directly proportional according to the following relation: 𝑉𝑑𝑐 = 𝐷 ∗ 𝑉𝑠 , where D is the duty cycle So, when the user types the wanted speed on the keypad that speed will be displayed on the LCD, that speed represent the voltage level that by default represents the duty cycle of the wave signal. The output voltage level goes directly to the terminals of the AC inverter and so affects the voltage that goes to the motor.
  • 35. Page35 FLOW CHART Start Any key pressed Initialize Port-C PWM1 PWM2 Setup Timer1,Timer2 for PWM2 & 1 setup_ccp1 setup_ccp2 Initialize (clear) LCD lcd_init Initialize Counter1 & counter2 YES NO
  • 36. Page36 key (#) pressed Forward, X=0 printf (lcd_putc,"Forward") delay_us(1) counter1+= 300 PWM1 counter2 = abs(counter1) counter2 =(counter2 >>15)+64 duty_main = counter2 set_pwm1_duty(duty_main) PWM2 counter3 = counter1 +0x4000 counter4 = abs(counter3) counter4=(counter4>>15)+64 duty_aux = counter4 set_pwm2_duty(duty_aux) Another key pressed Key=="#" keep forward Key == "*" Move to Reversed X==0 X==1 Motor stop output_low(pin_c1) output_low(pin_c2) Delay for 15ms 2 2 4 2 3 YES NO YES NO
  • 37. Page37 4 Reverse printf(lcd_putc,"Reverse") Counter1=0 delay_us(1) PWM1 counter1+= 300 counter2 = abs(counter1) counter2=(counter2>>15)+64 duty_main= counter2 set_pwm1_duty(duty_main) PWM2 counter3 = counter1 - 0x4000 counter4 = abs(counter3) counter4=(counter4>>15)+64 duty_aux = counter4 set_pwm2_duty(duty_aux) key==# Motor stop output_low(pin_c1) output_low(pin_c2) Delay for 15ms 4 3 YES NO
  • 38. Page38 CHAPTER (3) PROBLEMS & CONSTRAINTS PROBLEM #1 DC-CHOPPER: In our project we used the DC-Chopper to alter the DC level that represents the input of the AC inverter in order to control the speed of the motor. That is supposed to be done using PWM at the gate of the MOSFET, so while implementing the circuit there was a problem in loading the chopper, why?? Because in order to see the correct output of it, we must attach it with correct load, that is in our case the AC inverter and in that time the inverter was not ready to operate. Another problem appeared in VGS threshold voltage of the MOSFET used, since the PIC gave us a voltage level only between 0 & 5. SOLUTION: An Optocoupler used to solve the problem of the peak-to-peak voltage entered to the gate of the MOSFET by adjusting the collector voltage of the right side of the Optocoupler. While processing the project stages, SO many tough problems faced us. So, in this section each problem or constraint is illustrated deeply. Also we explained how we solved each one.
  • 39. Page39 PROBLEM #2 DEAD BAND TIME: While trying to implement the firing signals of the 3-phase inverter IGBTs –and with the constraint of not switching on two IGBTs in the same arm at the same time- a need of a few μ seconds appears to be inserted in the firing signals. Most of the proposals we checked provided a solution using a feature in the PIC itself, unfortunately our PIC didn’t have that feature and it was hard to program it from scratch. SOLUTION: In order to design the dead band thing, we took the decision of building the hardware circuit you have seen in this report having the control on the dead band time according to the input signal frequency. PROBLEM #3 IGBT GATE DRIVER: After taking the choice of using the IGBT type of transistors in the AC inverter implementation, a need for a driver circuit appears in order to switch the IGBT gate on & off. We preferred to use an already implemented 3-phase bridge driver IC (IR21363) because of its stability characteristics that is excellent both for high & low sides. Having this IC in our hands took 2 weeks. During this period we thought of designing an alternative driving cct by ourselves.
  • 40. Page40 This cct was designed at the begining. This cct achieved the condition of splitting the ground of the low & high sides, BUT AS USUAL: A PROBLEM OCCURRED!! Because the output of the Optocoupler is grounded to the hide side ground –not attached directly as shown below to the IGBTs terminals-, the voltage applied (VGS) was not enough to trigger the gate. But since the output of the Optocoupler is from the emitter, we cannot attach it as above. So the driver was our only choice. ALSO, IR Gate Drive ICs have ten times better delay matching performance than opto-coupler- based solutions. Delay matching between the low-side and high-side driver is typically within ± 50ns, allowing complete dead-time control for better speed range and torque control in motor drive applications. Fast switching also reduces switching power losses and allows leveraging the full benefits of the fastest IGBTs available on the market today for better torque control over a wider speed range.
  • 41. Page41 PROBLEM #4 INVERTER GATES SWITCHING: So many software topologies were applied in order to trigger the IGBT gates, such as: Also: But we approved that they are false, because they didn’t achieve the condition of 90º phase shift between the main & start windings. So we thought of generating a signal that is approximately introduces the sinusoidal one as shown in the software chapter.
  • 42. Page42 CHAPTER (4) THE COST Elements # Of Needed Elements Cost (NIS) Microprocessor 1 40 PIC Basic cct 1 30 Single phase AC motor 1 120 LCD 1 40 keypad 1 35 MOSFET 1 10 IGBT 6 120 Uncontrolled full wave rectifier 1 30 Optocoupler 1 7 Resistors & Capacitors -- 100 IR21363 Driver 1 80 Schmitt & inverters 5 20 Overall Cost=632 NIS
  • 43. Page43 CHAPTER (5) CONCLUSION First this project controls single phase induction motors in both direction & speed. This was done by means of Hardware that is associated with the appropriate Software in order to do the job. It was discovered during the project that there are several problems with implementing motor control techniques; hardware circuits & software, most notably is:  Selecting frequency stability range for every stage in the project (i.e. Chopper, inverter, and microcontroller stages). Every part needs to have the correct frequency to operate as required. Using IGBT switches in driving was more reliable and enjoyable from using BJTs, since driving circuits for the last one is almost disappeared in presence of other rugged switches. Also we concluded practical work differs a lot from theoretical one, although they cannot be separated from each other. This work here can be also applied to 3-phase AC motors, not only single phase, since 3- phase inverter is used. And most important, no matter what happened to our mental state while working in this project, WE LEARNT A LOT ABOUT EVERY THING, Especially: “HOW TO BE PATIENT” LAST THING PLEASE: "DON'T LET THIS CONTROL PROJECT SIT IN A BIG FOLDER AND NOT BE ACTED UPON!"
  • 44. Page44 CHAPTER (6) RECOMMENDATIONS After a lot of stress and fatigue in implementing this project, we recommend the following, hoping for everyone a good life and health with existence of “MOTORS”: First of all we DON’T recommend anyone, anywhere, for any purpose to experiment with the work of this project again. The reason is that one may need a whole year – may be two- just to understand the theoretical aspects that is embedded in this kind of subjects. Another year for doing the practical Part including hardware and software, while maintaining health care above everything. Don’t ever, never, let any exposed wires or any exposed charged capacitors in your circuits. You will definatly regret doing this. Make sure that grounds in your circuit (high side and low side grounds) are completely separated from each other, IT IS A MATTER OF LIFE AND DEATH. Always DOUBLE CHECK on your work before turning on any supply, because an important & expensive part in your circuit might be ON FIRE! Don’t be disappointed, LIFE IS HARD! & ASK Dr. Samer about that 
  • 45. Page45 CHAPTER (7) APPENDIX SOFTWARE PROGRAM ON PIC C #include "E:Software1.h" #include<lcd.c> char key(){ output_low(PIN_B0); output_high(PIN_B6); output_high(PIN_B5); if (!input(PIN_B4)){ restart_wdt(); return '1'; } if (!input(PIN_B3)){ restart_wdt(); return '4'; } if (!input(PIN_B2)){ restart_wdt(); return '7'; } if (!input(PIN_B1)){ restart_wdt(); return '*'; } output_low(PIN_B6); output_high(PIN_B0); output_high(PIN_B5); if (!input(PIN_B4)){ restart_wdt(); return '2'; } if (!input(PIN_B3)){ restart_wdt(); return '5'; } if (!input(PIN_B2)){ restart_wdt(); return '8'; } if (!input(PIN_B1)){ restart_wdt(); return '0'; } output_low(PIN_B5); output_high(PIN_B6); output_high(PIN_B0);
  • 46. Page46 if (!input(PIN_B4)){ restart_wdt(); return '3'; } if (!input(PIN_B3)){ restart_wdt(); return '6'; } if (!input(PIN_B2)){ restart_wdt(); return '9'; } if (!input(PIN_B1)){ restart_wdt(); return '#'; } else{ restart_wdt(); return 'p'; } } void main() { signed int16 counter1=0; signed int16 counter2=0; signed int16 counter3=0; signed int16 counter4=0; long duty_main; long duty_aux; char t='p'; int i,flag=0,flag2=0; lcd_init(); setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL); setup_wdt(WDT_2304MS); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DIV_BY_1,127,1); setup_ccp1(CCP_PWM); setup_ccp2(CCP_PWM); restart_wdt(); while (true) { set_pwm1_duty(0); set_pwm2_duty(0); t=key(); restart_wdt(); while (t=='#')
  • 47. Page47 { y: if(flag2==0) { printf(lcd_putc,"forward"); for(i=1;i<=15;i++) { output_low(pin_c1); output_low(pin_c2); delay_ms(1000); restart_wdt(); } flag2=1; counter1=0; } //signal1// delay_us(1); counter1=counter1+600; counter2 = abs(counter1); counter2 =(counter2 >>7)+(counter2 >>8); counter2 =counter2+64; duty_main = counter2; set_pwm1_duty(duty_main); //signal2// counter3 = counter1 +0x4000; counter4 = abs(counter3); counter4 =(counter4 >>7)+(counter4 >>8); counter4 =counter4+64; duty_aux = counter4; set_pwm2_duty(duty_aux); restart_wdt(); flag=0; t=key(); if(t=='p') t='#'; while(t=='*') { if(flag==0) { printf(lcd_putc,"Reversed"); set_pwm1_duty(0); set_pwm2_duty(0); for(i=1;i<=15;i++) { delay_ms(1000); restart_wdt(); } flag=1; counter1=0; } flag2=0; delay_us(1);
  • 48. Page48 counter1=counter1+600; counter2 = abs(counter1); counter2 =(counter2 >>7)+(counter2 >>8); counter2 =counter2+64; duty_main = counter2; set_pwm1_duty(duty_main); //signal2// counter3 = counter1 -0x4000; counter4 = abs(counter3); counter4 =(counter4 >>7)+(counter4 >>8); counter4 =counter4+64; duty_aux = counter4; set_pwm2_duty(duty_aux); restart_wdt(); t=key(); if (t=='p') t='*'; if(t=='#') { restart_wdt(); goto y; } } } } }