0% found this document useful (0 votes)
74 views27 pages

Draft - Mfusi INTERIM REPORT Final

This report describes an electrical engineering project divided into four parts: power supply and GUI, stepper motor control, speed measurement, and light dimming. Skusele Nkonzo discusses the power supply design and GUI to control it. Trevor Mkhize covers stepper motor control using a driver circuit. Sihle Mfusi evaluates speed measurement using an IR sensor. Isaac Mongali explains light dimming through phase angle control with a microcontroller and triac circuit. The group simulated their designs in Proteus, Multisim and with programming languages to test and discuss the results.

Uploaded by

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

Draft - Mfusi INTERIM REPORT Final

This report describes an electrical engineering project divided into four parts: power supply and GUI, stepper motor control, speed measurement, and light dimming. Skusele Nkonzo discusses the power supply design and GUI to control it. Trevor Mkhize covers stepper motor control using a driver circuit. Sihle Mfusi evaluates speed measurement using an IR sensor. Isaac Mongali explains light dimming through phase angle control with a microcontroller and triac circuit. The group simulated their designs in Proteus, Multisim and with programming languages to test and discuss the results.

Uploaded by

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

School of Electrical, Electronic and Computer Engineering

Electrical Design 4 Group 10 Interim Report

Group Names
1. Trevor Mkhize 215013055 – Motor Control
2. Sihle Mfusi 217018441 – Speed Measurement
3. Isaac Mongali 217007942 – Light Dimming
4. Skusele Nkonzo 217017873- Power Supply and GUI
Abstract

This report contains a project approach which is sub-divided into four parts. Every sub-topic is handled by
individual group member out of four members. The report has schematic and simulation snipped shots
(screenshots) for the based design to be conducted. Each section out of four has its own schematic and
simulation screenshots followed by a brief description of what is happening based on the results found during
simulation. The proposed solutions were simulated using proteus software, multisim, java as well as C
programming, the simulation results are shown and are discussed in greater depth. It has an additional
information than phase 1 report of group 10 which was submitted early July 2019. The light diming circuit uses
the implementation of microcontroller-based firing angle control, using ATmega-16 MCU and associated
hardware circuitry is discussed here, like the zero crossing and triac circuit. The system’s power supply will be
connected to any 230V ac electrical source and with the help of the transformer the output voltage of the power
supply should be 5V so that micro components will be sufficiently energized. It is shown how a full, half steps
sequences are implemented for controlling a stepper motor. Serial communication is incorporated via a computer
that will make use of HyperTerminal. The computer will be used to control the speed and direction to which the
motor will run at. At a point the user can also stop the running of a motor.

Table of Contents
Abstract.......................................................................................................................................................3
1. Introduction.........................................................................................................................................6
2. Power supply and GUI design (Skusele Nkonzo 217017873).............................................................7
I. Transformer.....................................................................................................................................7
II. Rectification....................................................................................................................................8
III. Filtering.......................................................................................................................................8
IV. Voltage Regulation......................................................................................................................9
V. Graphical User Interface (GUI).....................................................................................................10
VI. Serial Communication (Relationship between microcontroller and PC)....................................11
3. Motor Control Circuit (Trevor Mkhize 215013055)..........................................................................12
I. Specification and Considerations...................................................................................................12
II. Functional Specifications...............................................................................................................12
III. Some of the Non-Functional Specification................................................................................12
IV. Flow diagram of how motor functions.......................................................................................13
V. Explanation of the Above Flow Diagram......................................................................................13
VI. The Actual Driving of the Stepper Motor..................................................................................13
VII. The Driver Circuit......................................................................................................................14
4. Speed Measuring Circuit (Sihle Mfusi 217018441)...........................................................................17
I. IR sensor module...........................................................................................................................17
II. IR Transmitter and Receiver..........................................................................................................18
III. Op-Amp LM358........................................................................................................................19
IV. Stepper Motor Driver Circuit.....................................................................................................19
V. Advantages of a stepper motor driver............................................................................................20
VI. The Results from the Simulation................................................................................................21
5. Light dimming Circuit (Isaac Mongali 217007942)..........................................................................22
I. Principle of Phase Angle Control...................................................................................................22
II. Zero Crossing Detector Circuit......................................................................................................23
III. Microcontroller..........................................................................................................................24
a. Schematic Diagram of Selected Solution.......................................................................................24
IV. Delay Calculations.....................................................................................................................25
V. Firing Angle Calculation...............................................................................................................25
VI. Triac and Opto-Coupler.............................................................................................................26
6. Conclusion.........................................................................................................................................27
References.................................................................................................................................................28

List of Figures
Figure 1: Block diagram of the power supply..............................................................................................6
Figure 2: Multism simulation for power supply...........................................................................................6
Figure 3: Displaying results of Primary side and Secondary side of a transformer......................................6
Figure 4: Results of rectified voltage displaying DC voltage only..............................................................7
Figure 5: Results of output voltage after adding filter capacitor..................................................................7
Figure 6: Final DC voltage required after regulation...................................................................................8
Figure 7: Graphical user interface for group 10...........................................................................................9
Figure 8: Block diagram of GUI system....................................................................................................10
Figure 9: Flow diagram of how motor functions.......................................................................................12
Figure 10: illustration of the driver circuit explained.................................................................................13
Figure 11: Full step sequence diagram......................................................................................................14
Figure 12: implementation of half step sequence.......................................................................................15
Figure 13: Block diagram of implementing the speed measuring circuit of a stepper motor.....................16
Figure 14: IR sensor circuit.......................................................................................................................17
Figure 15: The transmitted and reflected incident of light [9]...................................................................18
Figure 16: Motor driver circuit..................................................................................................................18
Figure 17: block diagram of a speed measurement circuit.........................................................................19
Figure 18: Full system functioning............................................................................................................20
Figure19: Measuring the speed of the stepper motor.................................................................................20

List of Tables
1. Introduction

Power supply and GUI, Stepper motor, Speed measuring circuit and Dimming light bulb. A dimmer is a device
that is originally created to control the brightness of the lamp, this is achieved by altering the power delivered to
the lamp, thus the brightness. The brightness of a 60W bulb will be controlled by a GUI, this will be entered by
the user to change the brightness at their own specification, the brightness will range from 0-100%. A
microcontroller will grant automatic features to the circuit, it will then send a signal to the opto-coupler which is
used to electrically connect two isolated circuit and it also prevent high voltage from destroying the circuit this
will then be sent to a TRIAC that will be used as a switch to transmit that specified brightness that the user has
entered. These are the sub-divided sections that we concentrate on. Power supply and GUI are two different parts
that are to be conducted by one member, each and every devices nowadays requires power to operate, power
supply will be in a form of DC supply given an AC voltage which pushes us to use a transformer which converts
one voltage rating to another a step-down transformer is used since we have to convert 230V AC to
approximately 5V supply DC.
Graphical user interface is an interface that is used by a person in order to interact with the system using a
computer. Motor is a machine that is used to convert one energy form to another electrical to mechanically
energy. Motor is specially used for rotating objects in most cases. Stepper motor needs a DC power supply based
on its forename DC motor. Speed of motor is measured in rotation per minute, provided you want to determine a
speed of a motor speed measurement circuit can be used to measure speed of a motor. Speed measurement
circuit will be able to measure the speed of the motor it is measured on velocity feedback concept where a direct
current generator is hooked to the rotating shaft so that the voltage induced across the generator’s terminals is
proportional to the speed of the shaft and a programmable microcontroller chip will be calculating the speed
measured and display it at the GUI. This will interface with motor for starting, stopping and bidirectional
rotation.
A speed measuring unit was used to determine the speed of the motor and ensure the motor was running at the
speed entered by the user. It is then sent to a microcontroller which will process the data according a specific
algorithm and this will allow for the stepper motor to be controlled in a manner which is required by the user
who input the data into the computer. The microcontroller provided can only output a maximum current of
20mAmps and the motor which will be utilized operates with a rated current of 500mAmps and thus it is
necessary to ensure that the current output by the microcontroller be amplified. The driver circuits need to be
protected from these large back currents and this needs to be incorporated into the circuit design. The
microcontroller also needs to be protected from any form of failure which may occur in the driver circuit. The
system that to be conducted must allow each of the four parts have mutual connection. Mutual connection is
whereby each part can communicate with other part using same connection.
2. Power supply and GUI design (Skusele Nkonzo 217017873)

The specifications of the project require a 5V dc supply, which will be able to supply other components of the
design which need a dc voltage for an example dc stepper motor. The AC power supply input voltage is 230 V
and frequency of 50Hz and output 5V dc volts and the current can be controlled by including a resistor at the
load and control the output current. This design consists steps and components for stepping down voltage in the
transformer, full wave bridge rectifier, filter capacitors and a voltage regulator.

Figure 1: Block diagram of the power supply

Figure 2: Multism simulation for power supply

I. Transformer

Figure 3: Displaying results of Primary side and Secondary side of a transformer


Steps down ac voltage used from multism as a ratio of 10:1, Real design will be a 6V or 12V transformer as the
LM7805 CT requires 6V-12V voltage as its input is greater 5V.

II. Rectification

Figure 4: Results of rectified voltage displaying DC voltage only.

A Full wave rectifier is used in this design, full wave rectifier is a circuit arrangement which makes use of both
half cycles of input alternating current (AC) and converts them to direct current (DC). The residual ac ripples
(before filtering) is very low in the output of a bridge rectifier. The same ripple percentage is very high in half
wave rectifier. A simple filter is enough to get a constant dc voltage from bridge rectifier [1]. Diodes are used
which allow current to move in one direction only. Because of the alternating nature of the input AC sine wave,
the process of rectification alone produces a DC current that, though unidirectional, consists of pulses of current.

III. Filtering

Figure 5: Results of output voltage after adding filter capacitor

The output of a rectifier is thus smoothened as the signal contains a larger ripple component which is unstable, a
smoothing capacitor stabilizes the DC voltage to be constant. In this design the dc power supply desired must
have a constant output voltage. A constant output voltage from the DC power supply is very important as it
directly affects the reliability of the electronic device connected to the power supply [1].

IV. Voltage Regulation

Figure 6: Final DC voltage required after regulation

A voltage regulator generates a fixed output voltage of a pre-set magnitude that remains constant regardless of
changes to its input voltage or load conditions. The voltage from rectification and smoothing capacitor fluctuates
which can damage some components, the 7805 also ensures that the output voltage is 5V. The LM7805 is a very
important part of this design as it also has thermal overload protection and short circuit protection [2]. The value
of the capacitance connected after the voltage regulator is smaller compared to the value of the capacitor
connected just after rectification. The reason for this is because the peak to peak ripple voltage just after
rectification is larger than the ripple voltage after the voltage regulation. The simulation results showed a voltage
of 5.003V.

V. Graphical User Interface (GUI)

Figure 7: Graphical user interface for group 10.

The Graphical User Interface (GUI) allows the user to interact with the system from the PC. It is the GUI that
ensures that communication is effective between the user and the system’s microcontroller. The user enters data
on the GUI which in turn sends the information to the microcontroller which acts as the “brain” of the system.
The GUI also allows the user to view the feedback from the microcontroller via a display.
It also enables the user to:
1. Send commands to the microcontroller.
2. Start the motor.
3. Stop the motor.
4. Change the speed of the motor.
5. Change the direction of rotation of the motor.
6. Allow the user to manually set the dimming level within an acceptable range. Display the level of dimming
from the slider that will allow a user to adjust the dimming level.
The GUI will have specific buttons for adjusting the functionality of the stepper motor. These consist of start or
stop the motor, change the speed and select the direction of rotation of the stepper motor and the graphical user
interface will be programmed in such a way that a person cannot be able to select both directions at the same
time. To vary the speed of the motor and to manually set the dimming level within an acceptable range the user
will have to adjust the dot on a slider then text box shows you the value which you wish to adjust to. The values
of a threshold dimming level and speed that is measured using speed measurement circuit shall be clear when
you press the clear buttons respectively to which value you want to clear either speed display or threshold value
or both including port setting. The aim of our design is that the system should gradually fluctuate the brightness
level of the 60 W incandescent lamp based on the speed of the stepper motor if the speed of the stepper motor
exceeds the threshold to be set the light bulb should start dimming. Another way of dimming the bulb is to slide
the slider checking the dimness. Data logging capabilities will be recorded to the text area box when button save
last record is pressed the results shall be printed to the text area box using appending for writing values which
will allow several values to be written to.

VI. Serial Communication (Relationship between microcontroller and PC)


Serial interfaces stream their data, one single bit at a time. These interfaces can operate on as little as one wire,
usually never more than four. Full duplex communication system is used in this design so that the computer can
do both the transmission and receiving of data at the same time. Moreover, data will be transmitted one byte at a
time and include the start, stop and parity bits in asynchronous communication. The GUI is configured for serial
port communication and the microcontroller is set to Universal Asynchronous Receiver Transmitter (USART).
Therefore, USART settings for both the microcontroller and the GUI will have to be the same. For this design
the USART settings are:
1. Baud rate = 9600
2. Data bits = 8
3. Parity = None
4. Stop Bits = 1
To connect the PC to the microcontroller we will use the MAX232 chip. The benefit of this is that, it allows an
easy way to connect TTL devices like the microcontroller to the USB port of the PC. This means that for our
design the interfacing between the GUI and the microcontroller will be done through RS232. The RS232 is
mainly used for serial binary and single ended data hence it can work in our design since our data is serial,
binary and single ended (one stop bit). Else we use a CP2102 chip. CP2102 chip from SiLabs is a single chip
USB to UART Bridge IC. It requires minimal external components. CP2102 can be used to migrate legacy serial
port-based devices to USB. Hobbyists can use it as a powerful tool to make all kinds of PC interfaced projects (
https://www.sunrom.com › cp2102-usb-ttl-uart-module ).

Figure 8: Block diagram of GUI system

The summary of the relationship and communication between the interface and the microcontroller, for receiving
and sending data to and from the microcontroller.
3. Motor Control Circuit (Trevor Mkhize 215013055)

Stepper motors are used in many applications which require rotational movement. The performance of stepper
motor is strongly guided by the driver circuit. The basic arrangements in two phase stepper motor are the
unipolar and the bipolar. The stepper motors can be regarded as DC motors that move in discreet steps.
[ CITATION RBB01 \l 7177 ]
Unlike the DC motor that is driven by continuous flow of current, stepper motors are driven by pulses of
electricity. Each pulse moves the shaft of the motor a step further thus, they are known as digital devices.
As the digital pulses increase in frequency, the step motion varies into a more continuous rotation with the speed
of rotation directly proportional to the frequency of the pulses. Stepper motors are used every day in both
industrial and commercial application due to their low cost, high reliability, high torque at low speeds and a
simple, rugged construction that operates in almost any environment. [ CITATION RBB01 \l 7177 ]
This brushless DC motor is controlled by series of electromagnetic coils. The center shaft has a series of magnets
mounted on it, and the coils surrounding the shaft are alternatively given current, creating magnetic fields which
repulse or attracts the magnets on the shaft, causing the motor to rotate one step at a time.

I. Specification and Considerations


The following is a specification of the stepper motor to be provided .

Model Step angle Number of voltage current


phase
PM2515-03 7.5 4 5 0.5

II. Functional Specifications


The group will use Atmega16 to code the intended program, as it will be provided. It serves as a tool for the
purpose of:
 Producing a PWM wave to rotate the motor accordingly
 Alter the speed of the stepper motor
 Change the direction of motor rotation
 Provide an interaction from the input sent through from the user, in this case a graphical user interface
(GUI).

III. Some of the Non-Functional Specification


Upon the tasks, the stepper motor is also expected to:
 Change the brightness level of the light bulb depending on its shaft position.
 Run at the speed selected by the user through GUI.
IV. Flow diagram of how motor functions

Power Supply

Graphic User Microcontroller Driver Circuit Stepper Motor


Interface

Figure 9: Flow diagram of how motor functions

V. Explanation of the Above Flow Diagram


The graphical user interface requires an input from the user to determine the speed and the direction of the motor
or to stop the stepper motor operation. Once the selection has been made the microcontroller uses this
information to produce a pulse width modulation wave with the appropriate duty cycle.
The PWM wave is interpreted by the driver circuit and amplifies the current flowing to the stepper motor to the
required value of 0.5 A. The BJT’s switch between the phases causing the motor to rotate depending on the
direction either (clockwise or counterclockwise) input by the user.

VI. The Actual Driving of the Stepper Motor


There are two types of stepper motors in relation to the functioning and rotation of the shaft, the unipolar (one
directional) and bipolar (two directions). The difference is dependent on the arrangement of electromagnetic
coils. Unipolar stepper motor operates with one winding with a center tap per phase and allows current flow in
half of the windings at one time. The center tap is brought outside the motor along with each winding phase.
[ CITATION Col16 \l 7177 ]
In the bipolar configuration, there is only a single winding per phase. The bipolar stepper motor produces current
flow in two directions. This allows each of the stator to be magnetized from North to South. When choosing the
type of stepper motor there are many factors to take into consideration. The unipolar design allows current to
flow in half winding, while the bipolar allows for bidirectional. Since there is a greater winding current in the
bipolar stepper motor this will produce more torque as compared to the unipolar motor. [ CITATION
Placeholder1 \l 7177 ]
Bipolar stepper motors have more complex circuitry and as a result can be difficult to operate when compared to
unipolar. Unipolar windings are thinner than bipolar and can be thereby incorporate twice the amount of wire in
the same space. Having mentioned that, the unipolar stepper motor is to be used in the design.

VII. The Driver Circuit


The demonstration of the driver circuit in open-loop stepper motor drive. The motor’s windings are connected in
unipolar configuration and are driven using the H-bridge. The purpose of the driver circuit is to amplify the
signal from the microcontroller to comply with the rated current in the specifications. As the microcontroller
produces 20mAh it will not allow for the excitation of the windings in the stepper motor. As a result, the need
for the driver is compulsory.[ CITATION Leg12 \l 7177 ]
It is to find one in close parameters the Darlington transistor driving chip. The transistor is used as a switch,
allowing certain phases to be used while others are not active. Zener diode is used as a protection mechanism for
the circuit and decreases the current decay time. This will later improve the motor efficiency and ensure that a
phase switches of as fast as possible.

Figure 10: illustration of the driver circuit explained

Full Step Sequence


Here two coils are energized at the same time and motor shaft rotates. The order in which coils has to be
energized is given in the table below. The table below shows the full step pattern to be used. In this pattern two
transistors are always on.
Table 1: Full Step pattern

Q1 Q3 Q2 Q4 Hex
1 1 0 0 0C0C
0 1 1 0 0C06
0 0 1 1 0C03
1 0 0 1 0C09
From the table, the sequence that would be output to turn the motor 4 steps in a certain direction would be:

0X0C 0X06 0X03 0X09


It is important to understand that if the 4 numbers are not output when the motor is next energized, you will have
to remember where you left off in that sequence. If the motor completes 4 of these cycles it will have made one
full revolution. Below is a diagram showing how a full step sequence is implemented for a stepper motor of 90º
per step. For this design 7.5º per step stepper motor is used, and for it to complete one full rotation it must take
48 steps.[ CITATION Tig16 \l 7177 ]

Figure 11: Full step sequence diagram

Half Step Sequence


Here motor’s step angle reduces to half the angle than in full mode. So the angular resolution is also increased
i.e., it becomes double the angular resolution than in full mode. Also in half mode sequence the number of steps
gets double as that of the full mode. Half mode is usually preferred over full mode. For half mode the patterns of
energizing the coils are:
Table 2: Half step sequence table

Q1 Q2 Q3 Q4 Hex
1 1 0 0 0X0C
0 1 1 0 0X06
0 0 1 1 0X03
1 0 0 1 0X09
0 0 1 1 0X03
0 0 0 1 0X01
1 0 0 1 0X09
1 0 0 0 0X08

The diagram below shows how a half step sequence is implemented for 90º per step stepper motor. To direct the
motor in clockwise direction the sequence shown in the table is used in that order. For anticlockwise direction
the order is reversed.
Figure 12: implementation of half step sequence
4. Speed Measuring Circuit (Sihle Mfusi 217018441)
The aim of the speed measuring circuit is to be able to accurately measure the speed of the stepper motor and
display the reading on a graphical user interface through integration in revolutions per minute (rpm) or
alternatively on an LCD screen. The speed measuring circuit is to work hand in hand with system of controlling
steeper motor. The speed of the motor will be measured on velocity feedback concept where a direct current
generator is hooked to the rotating shaft so that the voltage induced across the generator’s terminals is
proportional to the speed of the shaft and a programmable microcontroller chip will be calculating the speed
measured and display it at the Graphical User Interface (GUI).

Specification
1. Microcontroller (atmega16)
2. IR sensor module
3. GUI for displaying
4. Stepper Motor Driver Circuit

Figure 133: Block diagram of implementing the speed measuring circuit of a stepper motor

I. IR sensor module
The IR sensor was chosen because of the following advantages:
 Their low power requirements make them suitable for most electronic devices such as laptops,
telephones, PDAs.
 They can detect motion in presence/ absence of light almost with same reliability.
 They do not require contact with object to for detection.
 There is no leakage of data due to beam directionality IR radiation.
 They are not affected by corrosion or oxidation.
 They have very strong noise immunity.
Figure 14: IR sensor circuit

The IR transmitter and receiver are used for emitting and sensing the IR beam. The Op Amp LM358 is used as a
comparator which in turn switches the output level as either logic 1 or logic 0. The Variable resistor RV1 used to
tune the sensitivity of the detector by altering the reference voltage to the comparator and at last LED D3 was
meant as an indicator in case an IR beam is detected or reflected[ CITATION Don17 \l 1033 ].
When the circuit is powered photo transistor emits Infra-red beam. The receiver was connected in a reverse
biased manner along with a resistor R3 in series. When there is no IR beam incident in the photodiode no current
passes through it which in turn leads to no drop in voltage and inverting terminal of the Op Amp is fed with max
voltage that is 5V [ CITATION Cir17 \l 1033 ]. The voltage in the inverting terminal is more than the reference
voltage at the positive terminal of op amp the output stays LOW or logic 0 [ CITATION Don17 \l 1033 ].
When IR beam is reflected by any object which makes the beam to incident on receiver, current passes through it
and in turn a drop of voltage occurs between the terminals. The reference voltage at the positive terminal of Op
amp is more than the negative terminal. The output of Op amp switches to high or Logic 1 state [ CITATION
Coo11 \l 1033 ].

II. IR Transmitter and Receiver


The IR led and photo-diode can be place in two ways which is direct and indirect, in this design the IR
transmitter and receiver will be place indirect. The IR transmitter and receiver are placed parallel (side by side),
facing both in same direction. When an object is kept in front of IR pair, the IR light gets reflected by the object
and gets absorbed by receiver.
An Infrared Sensor works in the following sequence:
 IR source (transmitter) is used to emit radiation of required wavelength.
 This radiation reaches the object and is reflected.
 The reflected radiation is detected by the IR receiver.
 The IR Receiver detected radiation is then further processed based on its intensity. Generally, IR
Receiver output is small, and amplifiers are used to amplify the detected signal.
Figure 15: The transmitted and reflected incident of light[ CITATION Ele19 \l 1033 ]

III. Op-Amp LM358


The LM358 is an operational amplifier and in this circuit it is used as a voltage comparator. The LM358 has two
independent voltage comparators inside it, which can be powered by single pin. The design have only one
comparator, which have inputs at pin 2 and 3 and output at pin 6. Voltage comparator has two inputs, one is
inverting input and second is non-inverting input (pin 2 and 3 in LM358).When voltage at non-inverting input
(+) is higher than the voltage at inverting input (-), then the output of comparator (pin 1) is high and if the
voltage of inverting input (-) is higher than non-inverting end (+), then output is low [ CITATION Sed82 \l
1033 ].

IV. Stepper Motor Driver Circuit

Figure 16: Motor driver circuit


A driver circuit is required to amplify the output current produced by the microcontroller. Stepper motor drivers
convert pulse signals from the controller into motor motion to achieve precise positioning. They vary in
complexity. Modern drivers may be combined with a host of different stepper motor types. Configuring for a
specific motor is usually configurable by the user at the time of installation. But by and large, stepper motor
drivers are relatively simple devices.
Stepper motor drivers can be as simple as a dozen components. The illustration above depicts one such driver
circuit. Configured as they are, the components’ job is to react to the step command pulses coming from the
machine controller and convert them into the proper on-off pattern required to drive the stepper motor. This
pattern is what energizes the phases, in the proper order, to drive the motor one step at a time in one direction or
the other[ CITATION Edg19 \l 1033 ].

V. Advantages of a stepper motor driver


 Easy to interface to low voltage logic circuitry.
 Fewer components are used.
 Less expensive NPN drive transistors.
 Relay power reduces load on voltage regulator.
 It uses more commonly obtained NPN drive transistors.
 It is easier to interface relay.
 It is economic.
 Uses Industry standard technique.

Figure 17: block diagram of a speed measurement circuit


VI. The Results from the Simulation

Figure 18: Full system functioning

Figure19: Measuring the speed of the stepper motor


5. Light dimming Circuit (Isaac Mongali 217007942)

I. Principle of Phase Angle Control


Phase angle control is a method of PWM applied to AC input voltages, usually the mains supply. The AC supply
could be from a transformer or any other AC source, but the mains supply is the most common input – this gives
the phase angle control method its greatest usefulness. It has of course become obvious from the title that the
purpose of phase angle control is to control or limit power to the load[ CITATION Sha12 \l 1033 ].

Figure 14: Phase angle control

The power device used in phase angle controllers is a thyristor – mostly triacs or SCRs. The power flow to the
load is controlled by delaying the firing angle (firing time each half-cycle) to the power device [ CITATION
Sha12 \l 1033 ].
The thyristor is a latching device – when the thyristor is turned on by a gating signal and the current is higher
than the holding current and the latching current, the thyristor stays on, until the current through it becomes
sufficiently low (very close to zero). The thyristor turns off when current through it becomes zero, as happens at
the AC mains zero crossing. This is the natural line commutation. (Another method of turning the thyristor off is
by forced commutation. I will not go into that now.) The assumption here is that the load is resistive and has
little to no inductance[ CITATION Sha12 \l 1033 ].
In phase angle control, a gate pulse is sent to the triac. This is sent at a time between one zero crossing and the
next. Without the gate pulse sent to the triac, right after zero crossing, the triac is off and no current flows
through it. After a certain time, the gating signal is given to the triac and it turns on. The triac then stays on until
the current through it becomes zero (natural line commutation). This is at the next zero crossing. For simplicity’s
sake and as usually should be, assume that the current through the triac (when on) is larger than the latching
current and the holding current. If you did not already know this, the latching current is the current that must
pass through the triac right after it is turned on to ensure that it latches. The holding current is the current level
through the triac below which the triac will turn off. So, the assumption that current through the triac is higher
than the latching current and the holding current means that the triac stays on once it is fired on. It stays on until
the current through it is zero.
This means that the voltage is supplied to the load for a fraction of the cycle, determined by how long the triac is
on. How long the triac is on, is, in turn, determined by the delay time between the zero crossing and the applying
of the triac gating signal[ CITATION Sha12 \l 1033 ].
II. Zero Crossing Detector Circuit
The Zero-crossing circuit detects a zero voltage across the mains voltage as soon as a zero form in the sine wave
is detected. It significant is to achieve a smooth dimming without the lamp flickering, which can happen due to
the fact of the lamp turning ON and OFF when the wave voltage comes across a zero point. This information is
transmitted to a microcontroller in a form of a pulse, the microcontroller needs to know the zero-crossing
detection point of the waveform; it then can calculate the angle offset to send the trigger pulse to the gate of the
1
TRIAC. The AC power oscillates in a 50Hz cycle T = =20 mSec this is the time it takes to complete a full
50
cycle. During this time, the waveform will cross the zero point two times. One at the middle of a cycle and the
second one at full cycle (2* π ), this will be after10 mSec . If we want to dim the lamp 50% the microcontroller
will send a pulse in the middle of each semi-cycle, thus after the pulse is sent after 5mSec after each time the
waveform passes a zero point, the microcontroller will watch the ZCD (zero crossing detection) circuit for a
pulse. When this pulse is sent, the Microcontroller will count 5ms and then will trigger the gate of the TRIAC.

Figure 15: Zero Crossing Circuit

Figure 16: The square wave pulse sent to micro-controller


III. Microcontroller
The Atmega16 will be used; a pulse from the zero-crossing detector circuit will be fed to it through an interrupt
pin to the opto-coupler. The opto-coupler is used for the isolation of the high voltage AC to the low voltage DC
supply at the microcontroller side. The microcontroller is interrupted for every zero crossing, which switches on
the TRIAC required. It will be creating a pulse width modulation (PWM) to control the triac using the delay; the
following equation is used to calculate a delay required to control the light.

a. Schematic Diagram of Selected Solution

Figure 17: Schematic Diagram

Figure 18: Firing angle results


Figure 19: Increased Firing angle result

IV. Delay Calculations


The frequency of the AC mains is f =50 Hz
The period T if given by 𝑇= 1/𝑓=20𝑚𝑠
So, the period of the half cycle is 𝑇=10𝑚𝑠
The following equation was used to calculate the required delays:
Delay=(100 % – brightness percentage)∗10 ∈milliseconds
For 0% dimming, there will be no delay sing full power will have to be delivered.
For 100% dimming, the delay will be 10ms
toff
1−D=
T
D-is the brightness, is given by the frequency of 50Hz,
1
T= =20ms
50
This is for a full cycle but because the zero point in the sinewave happens two times the period used will be
T=10ms.
t off =( 1−D )∗T
This is the amount of time that the triac will be off
t on
Duty cycle= ∗100 ; used to calculate the delay.
T

V. Firing Angle Calculation


Firing angle refers to the phase angle of the ac supply voltage when the gate current is applied, and the TRIAC
turns ON
t off
( 1−D ) = ⇒t off =( 1−D )∗T
T
Where D is the brightness.
T is half frequency.
t off is the off time.
The firing angle is given by the formula below.
t off 0
φ= ∗180
T

Table 3: different firing angles under different brightness level

Brightness t off t on Firing angle duty cycle OCRO


Level
0 10 0 180 0 0
10 9 1 162 10 25.5
20 8 2 144 20 50.2
30 7 3 126 30 76.5
40 6 4 108 40 101.4
50 5 5 90 50 127.5
60 4 6 72 60 152.6
70 3 7 54 70 178.5
80 2 8 36 80 203.8
90 1 9 18 90 229.5
100 0 10 0 100 255

VI. Triac and Opto-Coupler


A triac and an opto-coupler are two substantially important components of the light dimmer circuit. The TRIAC
(Triode for Alternating current) is turned on by a positive or a negative current flow between the gate terminal
and the gate is to be triggered by DC (or unipolar pulses) at zero crossing of the load current.
The main function of the TRIAC is to control and conduct current flow to the lamp in both half-cycles, whereas
the amount of energy that reaches the bulb during each half-cycle depends on how long the control waits before
the TRIAC is triggered, shows that the longer it waits the less energy reaches the bulb and as a result it will
glow, therefore the less time it takes for he controls to wait, will then dim the bulb as more energy will reach the
bulb. The gate terminal must be driven hard and fast to ensure complete gate turn-on and prevent false
triggering, and a gate current of at least 3-times the gate turn on current with a pulse train, taking note that all
currents and voltages are specified using the MT1 terminal as reference.
The microcontroller side of the circuit runs on low direct current (DC) and the diming of the incandescent lamp
runs on alternating current (AC). The two circuits shouldn’t come into contact as the AC can easily damage the
circuit running on (DC), thus the usage of the opto-coupler isolator. The input signal of 5V (DC) will be
transmitted to the opto-coupler via its pin1 and pin2 will be grounded for stability. The opto-coupler is used to
control the movement of current from the AC in the low dc logic circuit, it receives a signal from the AC zero
detection circuit so that it can be able to allow or block current from the AC circuit from passing to the (DC)
circuit without either circuit coming into physical contact, done by emitting diodes within the opto-coupler.

6. Conclusion

In this report types of solutions have been generated on how to approach the design in order to meet the
mentioned specifications of the design. The simulated results allow the group to go through with an
implementation of the design. This document presented the four tasks of this design project and how they
interface with each other. Best chosen solutions for each individual task were presented and stated the reasons as
to why they were chosen. Everything is good with the motor control circuit and light dimming circuit, but the
speed measuring circuit was still having some issues with the code as the circuit simulation was still
misbehaving a bit, but rest assured it will be working accurately. Another challenge facing the group is the
integration of the project which has not been done as the design specifications cannot be put together into one
simulation environment and see how the design performs. The report details further information from the phase
1 proposal. Further investigations and research were conducted to follow up from the previous report. Each
member clearly specifies their modules with appropriate simulation where needed with different simulating
tools. The efficiency of the project rests on the interface with each of the modules. Based on the information
provided in this report the hopes are to build successfully without any errors stopping the progress. In-case of
meeting up with the difficulties during progress it will lead to improvement of the ideas for the above approach.
References

[1] R. Bonanza, "working with stepper motors," robotoid, new york, 2001.

[2] C. J., "How to use stepper motor," Instructables, Cape Town, 2016.

[3] M. M., "Micro Stepping, Full stepping and half Stepping.," Mitsumi Engineers, Miami, 2017.

[4] L. G., "Simply Smart Circuitry," Circuit Specialists, New York, 2012.

[5] T. M., "Stepper Motors," Tigoe.com, Chicago, 2016.

[6] Donald, "IR sensors," 2017.

[7] "Circuit digest," 12 08 2017. [Online]. Available: Circuitdigest.com. [Accessed 20 08 2019].

[8] "Cool gadgets of electronics," Fast Tech, NY, 2011.

[9] "Electrical funda blog," [Online]. Available: https://electricalfundablog.com/infrared-sensor/. [Accessed 12


08 2019].

[10] S. Sedra, Amplifiers, 1982.

[11] "Edge fx kits," [Online]. Available: https://www.edgefxkits.com/blog/relay-driver-circuit-using-uln2003-


ic/. [Accessed 12 08 2019].

[12] S. V. L. a. S. R. Hirekhan, "Microcontroller based Digital Trigger Circuit for," 2012.

[13] R. Ravindran and A. Kumar, A DC Motor Speed Controller using LABVIEW and Visual Basic, vol. 3, no.
1, 2012.

[14] "Automation.com," [Online]. Available: https://www.automation.com/library/articles-white-papers/motor-


drives-control/10-benefits-adjustable-speed-ac-drives-provide-to-industrial-users. [Accessed 16 07 2019].

[15] R. Gupta, Ruchika Lamba and Subhransu Padhee, speed control techniques of dc motor: a comparative
analysis.

You might also like