0% found this document useful (0 votes)
99 views

Microcontroller Based Speed and Current PDF

This document describes a microcontroller-based speed and current control system for a permanent magnet DC (PMDC) motor. The system uses a thermocouple temperature sensor to measure environmental temperature and provide feedback to control the motor's reference speed. It implements sensorless speed and current feedback circuits using a differential amplifier and low-pass filter. A PIC16F876A microcontroller reads the analog signals, implements PID control, and generates a pulse width modulation signal to control the motor speed according to the temperature feedback. Simulation and experimental results validated the system's stability and performance.

Uploaded by

adrian febianto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views

Microcontroller Based Speed and Current PDF

This document describes a microcontroller-based speed and current control system for a permanent magnet DC (PMDC) motor. The system uses a thermocouple temperature sensor to measure environmental temperature and provide feedback to control the motor's reference speed. It implements sensorless speed and current feedback circuits using a differential amplifier and low-pass filter. A PIC16F876A microcontroller reads the analog signals, implements PID control, and generates a pulse width modulation signal to control the motor speed according to the temperature feedback. Simulation and experimental results validated the system's stability and performance.

Uploaded by

adrian febianto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Microcontroller Based Speed and Current Control of

PMDC Motor Drive

Prof.Dr. Saad Saad Eskander Dr.Hamdy Mohammed Nour Eng. Amr Mahmoud Mohammed
Electrical Power & Machines Dept. Senior. Researcher of Agric.Eng. B.Sc. Electrical engineer
Faculty of Engineering Res. Institute. (AEnRI). ARC. Mansoura University, 2006
Mansoura University

Abstract: This paper is written with the objective of illustrating how the speed of a permanent magnet direct current
(PMDC) motor can be controlled by using microcontroller. As a result of the great progress in microprocessor from its
flexibility and higher speed to close and open the power electronic switches. This great progress leads to decrease of
using the analogue circuits. It further explains the methodology used in obtaining the sensorless speed and current
feedback, software implementation of the PID controller. Having obtained a 1kW DC motor (considered to be a suitable
prototype for a typical industrial application) was to implement a complete automatic and manual speed control system
for a PMDC motor. A laboratory model of DC motor drive was successfully implemented using MCU PIC16F876A and
tested. Simulation and experimental results have been presented to verify the stability and tracking performance of the
proposed drive.

Keywords: Microcontroller unit (MCU), Pulse Width Modulation (PWM), Speed and current feedback
circuitry, MATLAB/SIMULINK .

I. INTRODUCTION
Everyone recognizes the vital role played by cutting, and huge control sites like Boilers are some
DC motor drive control in the development of of very good examples of the controls [2].
industrial systems. The dc machine was the first
practical device to convert electrical power into II. AIM AND OBJECTIVES OF THE RESEARCH
mechanical power, and vice versa. Inherently
straightforward operating characteristics, flexible The aim of our research was to implement a
performance, torque, flux controlled independently complete automatic speed control system for a
and efficiency encouraged the use of dc motor PMDC motor. Having obtained a 1kW DC motor
drives in many types of industrial drive application (considered to be a suitable prototype for a typical
[1]. industrial application) from the Solar Cell Lab, the
research was carried out with the following
In the world of controls, the use of objectives :
Microcontrollers is ever increasing. Industrial
process control is one of the very important areas 1. Controlling the Speed of Permanent Magnet
where we can use the Microcontrollers extensively. Direct Current Motor According to the
The flexibility offered by the system to implement Environmental Temperature Changing( Automatic
various control techniques and also the flexibility Reference Speed "additional setpoint" ).
offered by the system in terms of changing the
control techniques is also great. Microcontroller 2. Implementation of Sensorless Speed and Current
controllers are suitable for linear and non-linear Feedback circuitry.
system. Many industrial processes like speed
control, temperature control, lighting control, metal
3. Software Implementation of the closed loop is Constructed from iron and Cu-Ni metals, the
controller using MCU. (Including PID controller) temperature range of this thermocouple is -180oC to
+750 oC , the sensitivity of type J thermocouple is
4. Implementation of the Chopper Drive. 54 µV/oC Type J thermocouple is generally
recommended for new designs [4]. The
5. Implementation of a PWM Signal Generator [3]. experimental results of the output voltage of
thermocouple against the environmental
III. DESCRIPTION OF DC MOTOR DRIVE temperature are shown in table (1).
CONTROL SYSTEM
TABLE 1 EXPERIMENTAL RESULTS OF THERMOCOUPLE OUTPUT
VOLTAGE AGAINST TEMPERATURE.
Fig.1 illustrates the overall schematic diagram
of proposed DC motor drive control system.

Fig. 1 Overall schematic diagram of proposed DC motor drive control.

A. Control Circuit Description 2) Signal Conditioning Circuit:

1) Thermocouple Temperature Sensor: Fig. 2 shows the relationship between output


voltage of thermocouple temperature sensor against
The choice of a sensor depends on the accuracy, the temperature.
the temperature range, speed of response, thermal
coupling, the environment (chemical, electrical, or
physical), and the cost. thermocouples are best
suited to very low and very high temperature
measurements. The typical measuring range is -270
o
C to +2600 oC .Thermocouples are low cost and
very robust. They can be used in most chemical and
physical environments. External power is not
required to operate them and the typical accuracy is
+/-1 oC. Thermocouples are simple temperature
sensors consisting of two dissimilar metals joined.
The thermoelectric voltage is produced and an
electric current flows in a closed circuit of two
dissimilar metals if the two junctions are held at
different temperatures. The most popular
thermocouple in the Industrial field, which is called
Fig. 2 V – T characteristic of type J thermocouple sensor.
(Type J thermocouple temperature sensor), this type
In addition, the V–T characteristic of the output The maximum input voltage to microcontroller
voltage of the amplification circuit against the is 5Vdc corresponding to 110 oC then the maximum
temperature is shown in Fig. 3, this characteristic output voltage of amplifier circuit should be limited
illustrates that the relationship between the output to this value. So to achieve this The required
voltage of thermocouple and the temperature is voltage gain must be (Av = 1000).
approximately linear.
The tested conditions for the simulation and
experimental work are:

RF=R3= 1 MΩ : R1=R2 = 1 KΩ : CF1 = CF2 = CF =


0.33µF

Sensors reporting such things as temperature


have relatively slow-changing signals. A low-pass
filter would allow the sensor signal to pass while
rejecting higher-frequency electrical noise, as from
motors or relays. following equation determined the
low-pass filter frequency [5]:
Fig. 3 Output voltage after amplifying against environmental temperature.
 1 
f =   (2 )
This relationship also is modeled as;  2π * R F * C F 
V = 0 .0 3 8 * T - 0 .9 2 (1 )
3) PIC Microcontroller System:
Where
Fig.5 illustrates the PIC Microcontroller used
V : Thermocouple output voltage. with the proposed controller which has the type of
16F876A. It has five analogue input pins used to
T : Environmental temperature. read the analogue signal (voltage and current)
corresponding to the thermocouple output signal.
The previous equation is written inside the The other important feature in PIC Microcontroller
program in microcontroller to display the is the hardware Pulse Width Modulation (PWM).
temperature in a liquid crystal display (LCD). This feature is used to generate a PWM output
signal related to the analogue input.
Fig.4 illustrates the differential amplifier circuit
used to amplify thermocouple output voltage to be
suitable for microcontroller input.

Fig. 5 PIC16F876A microcontroller pin configuration.

The system also offers the availability of using


the serial communications between the drive and
Fig. 4 Differential amplifier circuit using LM324. the personal computer to monitoring the analogue
signal such as (temperature, speed and current) [6]. program, must be constructed firstly. Fig.6 shows
the algorithm, which represents the steps used in the the algorithm of the software flow chart diagram.

Fig. 6 Software flow chart for PMDC motor speed controller.

4) Interface Circuit Design: Vout - Vd 5 -1.4


= R5 =
= 360Ω (3)
IF 10mA
The optocoupler circuit shown in the Fig.7 is
(The standard value is 330Ω)
used for interfacing between the PIC
Microcontroller output and the gate of the power
Where
switch.
Vout : output voltage of PIC Microcontroller.

Vd : max forward diode voltage drop.

IF : max forward diode current.

The resistor R6 is used for operating the power


switch through out the saturation region (VGS
>VTH), so as we know that the MOSFET is a
voltage driven (IGSS is very small nA) Consequently
the resistor R6 is designed according to the power
switch data sheet [7].
Fig. 7 Interface circuit.
VDD - VCE 12 - 0.2
R6 = = = 11kΩ (4)
The resistor R5 is used for limiting the output Ic 1mA
current of the PIC so as not to exceed the forward
current IF of the diode (from data sheet). (The standard value is 10kΩ)
B. Power Circuit Description

Fig.8 illustrates the power circuit which DC-DC converter using the power MOSFET
contains The AC grid, bridge rectifier, parallel which is used for controlling the load according to
circuit contains resistor R (discharging resistor) and the programming strategy into the PIC
capacitor C, Microcontroller and RC snubber circuit used to
protect the power switch.

Fig. 8 Power circuit.

1) DC-DC Converter Using Power MOSFET:

The metal oxide semiconductor field effect


transistor (MOSFET) is the most commonly used
active device in very large scale integrated (VLSI)
circuits. It is the fastest power switching device,
with a high switching frequency, and with voltage
power ratings up to 600 V and current rating as
high as 40 A [8].

2) RC Snubber Circuit Protection:

RC type of snubber circuit protection is designed


Fig. 9 (a) Converter with a transistor snubber circuit (b-d) Turn-Off
to protect the power switch against the voltage waveforms with a snubber with increasing values of capacitance.
transient and ringing that occurs when the switch
opens and also eliminate voltage spikes caused by The transistor and snubber-capacitor current
circuit inductance when a switch either mechanical during turn-off are expressed as:
or semiconductor opens. The object of the snubber
is to eliminate the voltage transient and ringing that   t
occurs when the switch opens by providing an IL 1−  for 0 ≤ t < tf
alternate path for the current flowing through the iQ (t) =   t f  (5)

circuit’s intrinsic leakage inductance a typical 0 for t ≥ tf
snubber circuit is shown in Fig. 9(a).
 IL t transistor before the snubber is added is determined
IL − iQ = t for 0 ≤ t < tf
from the
 f

i C (t) =  I L for t f ≤ t < t x (6)


 waveform of Fig.9(c). Turn-off power losses are
 determined from:
 0 for t ≥ tx
1 T
Where tx : is the time at which the capacitor voltage P =
Q ∫ P d t. (1 1 )
reaches its final value. T 0 Q

The capacitor is chosen on the basis of the The resistor is chosen such that the capacitor is
desired voltage at the instant the transistor current discharged before the next time the transistor turns
reaches to zero. The capacitor voltage in Fig.9(d) is off. A time interval of three to five times constant is
expressed as: necessary for the capacitor discharge. Assuming
five times constant for complete discharge, the on
 tI t I t2 time for the transistor is;
 1 ∫ L dt = L for 0 < t < t x
C 0 t 2Ct
 f f
1 t I t
to n
I
VC (t) =  ∫ I dt + V (t ) = L t - t + L f R < (1 2 )
 tf
C L C f C
( )
f 2C
for t < t < t x
f
(7)
5C


V for The capacitor discharges through the resistor and
t > tx
 S
the transistor when the transistor turns on. The
If the switch current reaches zero before the energy stored in the capacitor is;
capacitor fully charges, the capacitor voltage is
determined from the first part of Eq.7. Letting W = 1 C V s 2 (1 3 )
Vc (tf) = Vf , 2

This energy is transferred mostly to the resistor


IL t 2 I t
V = f = L f (8) during the on time of the transistor. The power
f 2Ct 2C absorbed by the resistor is energy divided by time,
f
with time equal to the switching period:
Solving for C,
1
P = CVs2f (1 4 )
IL t R 2
C= f (9) Where f : is the switching frequency.
2V
f
The tested conditions for the experimental work
The capacitor is sometimes selected such that the are:
switch voltage reaches the final value at the same
time that the current reaches zero, in which case : Cs = 0.1µF/ 600V ; Rs =30Ω/10W ; Vs=100V ; f
=10KHz ; Ia =10A ; C=220µF,400V(DC Link
IL t
f Capacitor)
C= (10)
2V s
Fig.10 shows the relationship between
The power absorbed by the transistor is reduced transistor, snubber, and total losses. The use of the
by the snubber circuit. The power absorbed by the snubber can reduce the total switching losses, but
perhaps more important, the snubber reduces the
losses in the transistor and reduces the cooling Ea = Ka.ωm (16)
requirements for the device. The transistor is more
prone to failure and is harder to cool than the Where
resistor, so the snubber makes the design more
reliable. Fig. 11 illustrates the practical waveforms Vt : The terminal voltage
with and without using sunbber circuit protection
[9]. Ra : Armature winding resistance

Ia : Armature current

Ea : Back EMF

La : Armature winding inductance

Ka: is a constant equal (P.Z/2π.a)

Fig. 10 Transistor, snubber, and total turn-off losses as a function of snubber The speed control of the dc motor is achieved by
capacitance. the following equation ;

Vt - Ia R a
ωm = (1 7 )

From equation (17) the three most common


speed control methods are field control, armature
voltage control, and armature resistance control
[11].

4) Sensorless Speed and Current Measurement:


Fig. 11 Transient voltage with and without using snubber circuit.

Fig.13 illustrates the electronic circuit used to


3) Modeling of DC Machine:
measure the speed and the current by a sensorless
way using the operational amplifier LM324. in
The equivalent circuit of the PMDC Eq.16 the speed of the DC motor is directly
machine can be shown in Fig.(12), the equivalent proportional to the back E.M.F(Ea), so to estimate
circuit consists of the armature circuit and the field the real time speed without using a speed measuring
is permanent magnet [9]. device the back E.M.F must be estimated.

Fig. 12 Equivalent circuit of PMDC motor.

Vt = Ra.ia + La (dia/dt) + Ea (15) Fig. 13 Electronic circuit of sensorless speed and current measurement.
The circuit also offer the availability to measure C. Simulation and Experimental Results
the armature current (Ia) by using a series resistor
with the armature resistance. This method is very 1) DC Motor with its Control System:
low cost and verify a good performance in different
applications. The LCD display is used to read the The DC-DC converter controlled DC motor can
duty cycles and RPM of the motor resulting from be represented in MATLAB/SIMULINK as shown
the control action. in Fig.15.

5) Software PID Speed and Current Controller


Using Microcontroller:

The PID algorithm remains the most popular


approach for industrial process control despite
continual advances in control theory. This is not
only due to the simple structure, which is
conceptually easy to understand and implemented
in practice. Also this algorithm provides adequate
performance in the vast majority of application.
Fig.14 shown the control system consists of two
controllers which are the software PID speed and Fig. 15 SIMULINK model for the DC chopper controlled DC machine.

current controller , this system can be used to obtain


the required speed. 2) DC Motor:

The block diagram of the DC machine can be


represented in SIMULINK file as shown in Fig.16.

Fig. 14 Block diagram of a software PID speed and current controller.

6) Over Current Detection: Fig. 16 SIMULINK model for the DC machine.

A circuit was design to set a pin in the Many cases have been studied to get the best
microcontroller port to high state, in case of an over response of the controllers. They can be discussed as
current in the motor. Program detects the state of follow;
this pin regularly. If an over current occurs,
program, having picked up this signal, uses it to The PI speed and current controllers gains are
either reduce the armature voltage or stop the motor Kps=700, Kis=20 and Kpc=20, Kic=1000
[12]. respectively. The results for this case are shown in
Fig.17.
represent the PWM output of PIC Microcontroller
after the interface circuit, motor no load input
voltage, motor input voltage when it loaded at the
specified temperature and the output result of PI
speed controllers at (Kps=50, Kis=5 and Kps=50,
Kis=0) respectively.

Fig. 17 Simulation results for speed controller Kps=700,Kps=3

Practically the speed sensorless has some noise;


this noise is increased by the speed controller
proportional gain which results in an increase in the
Fig. 20 PWM output at T = 30,50 oC .
current distortion and harmonics. Fig.18 and Fig.19
are illustrate simulation result for speed controller
when Kis=0 and for loading and load removal.

Fig. 18 Simulation results for speed controller Kis=zero.

Fig. 21 Motor no load input voltage at different temperature.

Fig. 19 Simulation results for loading and load removal.

3) Experimental Results:

The experimental results are recorded using


digital storage oscilloscope communicated with the
computer. Fig. 20, Fig. 21, Fig. 22 and Fig. 23 are Fig. 22 Motor loaded input voltage.
IV. CONCLUSIONS

This research introduces the full design of all


circuits for controlling the speed of permanent
magnet DC motor. A real-time PID digital
controller has been developed that controls the
speed of a DC motor in a closed loop manner. A
laboratory model of DC motor drive was
successfully implemented using MCU PIC16F876A
and tested. The electrical performance of all circuit
are measured using digital storage oscilloscope
connected to the PC. we could conclude that:
• The motor can be started/stopped and made to
retain a set speed irrespective of the load.
Fig. 23 Experimental results for speed controller Ki= 5 and Ki= zero. • The motor can be run as low as 100rpm and as
high as 1500rpm, also the torque is controlled
through this period.
4) Photograph of Practical Circuits:
• Program interface is user-friendly enabling
flexible and simple operation.
Photographs of the DC motor drive speed
• PID controller enable the motor to reach the
control and the power circuit constructed in the
speed smoothly and within an acceptable period of
laboratory are shown in Figs.24 (a) and (b).
time.
• Since we control the average armature voltage,
speed could be controlled only below the rated
speed.

REFERENCES

[1] Timothy L. Skvarenina, "Power Electronic


Hand Book" Modern Power Electronics,
Evaluation, Technology and Applications, IEEE
Press, New York, Purdue University, West
Lafayette, Indiana, 2002.

[2] Dogan Ibrahim, " Microcontroller Based


Applied Digital Control ", Department of Computer
Engineering, Near East University, Cyprus, John
Wiley & Sons Ltd,, 2006.

[3] Sukumar Kamalasadan, " A PID Controller


for Real-Time DC Motor Speed Control using the
C505C Microcontroller", Division of Engineering
and Computer Technology, University of West
Florida, Pensacola, FL, 32513, 2005.

[4] Dogan Ibrahim, "Microcontroller-Based


Temperature Monitoring And Control. ", Elsevier’s
Fig. 24 Laboratory board (a) Control circuit (b) Power circuit.
Science & Technology Rights Department In West Florid, Department of Electrical and
Oxford, Uk, 2002. Computer Engineering, 2007.

[5] Walt Jung, " Op Amp Applications [9] Finney, Williams And Green, "RCD Snubber
Handbook " Elsevier’s Science & Technology Revisited", IEEE Transactions On Industry
Rights Department in Oxford, UK, 2005. Applications, Vol. 32, No. 1, January 1996, Pp.
155-160.
[6] Dogan Ibrahim, "PIC Basic Projects 30
Projects Using PIC Basic And PIC Basic Pro ", [10] Cyril W. Lander, " Power Electronics.",
Elsevier’s Science & Technology Rights Third Edition, McGraw-Hill Book Co.,(Uk)
Department in Oxford, UK, 2006. Limited,1993.

[7] S. Bernet, “Recent Developments in High [11] Saffet Ayasun, Gu¨ Ltekin Karbeyaz , "DC
Power Converters for Industry and Traction Motor Speed Control Methods Using
Applications, IEEE Transactions on Power MATLAB/Simulink " Department of Electrical and
Electronics, Vol.15, no. 6, pp. 1102-1117, Electronics Engineering, Nigde University, Nigde
November 2000. 51100, Turkey, March 2007.

[8] Muhammad H. Rashid, "Advances in Power [12] Qiwen Yang, Yuncan Xue, and Jiao Huang ,
Electronics and Applications in Renewable Energy" “Simultaneous PID Self-tuning and Control" IEEE
Fellow IET (UK) , Fellow IEEE, University Of Taipei, Taiwan, September 2-4,2004.

You might also like