SEARCH3
SEARCH3
Authors
Mohammed
Zahraa
Reduan
Athraa
Supervisor
Dr Samir M. Falih
I
II
Dedication:
III
Abstract
المحتويات
Dedication:................................................................................................................................................10
Abstract.....................................................................................................................................................11
CONTENTS.................................................................................................................................................13
1.Introduction............................................................................................................................................16
1.1components of a typical DC motor.......................................................................................................17
1.2 Types of DC motors.............................................................................................................................21
1.3 Applications of DC Motor....................................................................................................................22
1.4 DC motor Advantages and Disadvantages...........................................................................................23
1.5 Speed Control of DC motor.................................................................................................................24
1.5.1 Flux Control Method........................................................................................................................24
1.5.2 Armature Control Method................................................................................................................25
1.5.3 Voltage Control Method...................................................................................................................26
1.6 Axial-Flux:............................................................................................................................................28
1.6.2 Generalities about Axial-Flux Permanent- Magnet Motor...............................................................29
2.1 Introduction.........................................................................................................................................31
2.2 Scope of the research..........................................................................................................................36
3.5 Open Loop System:.............................................................................................................................45
3.6 Close Loop System:..............................................................................................................................45
1. Proportional controller................................................................................................................47
2.Proportional Integral controller..................................................................................................48
3.Proportional integral derivative controller.................................................................................50
4.1 Desigine matlab...................................................................................................................................53
Fig.12.........................................................................................................................................................53
4.1.1Components:.....................................................................................................................................53
4.1.2Explain:..............................................................................................................................................53
4.2Development:.......................................................................................................................................54
Building the model with Simulink..............................................................................................................55
Building the model with Simscape.......................................................................................................60
4.3Hard ware.............................................................................................................................................66
4.5 Linking method:...................................................................................................................................71
4.5.1Open-loop..........................................................................................................................................71
4.5.2 code open loop system..............................................................................................................71
4.6 Close loop system................................................................................................................................73
4.6.1 code close loop.................................................................................................................................74
IV
CONTENTS
V
VI
CHAPTER ONE
Introduction
1.Introduction
Direct Current (DC) motor is a motor that turns energy from a direct
current and turns this into mechanical energy. The first DC motor was
developed around the 1830’s-1840s. They were commercially
unsuccessful, because these motors were battery powered and batteries
were still very expensive and the quality was low. When the electrical
grid was created and the rechargeable batteries were invented in the late
1800s this all changed. The first commercially viable DC motors
entered the market. DC motors have been improved continuously, but
other types of motors, like the BLDC motor, have been developed in the
meantime too. As a result, the use of brushed Direct Current motors in
several applications is limited today. When it comes to starting and
regulating speed, brushed DC motors have a good performance. The
torque density is relatively high for these motors. A Direct Current
motor runs smoothly and the range of speed regulation is wide. The
overload capability is strong and the electromagnetic interference is
small. A disadvantage of the DC motor is the structure. There is a
sliding contact between the commutator and the brush. This causes
sparks and mechanical wear. Direct Current motors have relatively
short life expectancy because of this and the motor has high
maintenance cost. It also raises reliability concerns. The DC motor has
a rotating part called the rotor and a stationary part called the stator. The
rotor has windings connected to a commutator, and the stator provides
the external magnetic field. When power is applied, the rotor rotates due
to the interaction between these components, when the rotor aligns with
the stator's field magnets, the brushes move to the next commutator
contacts, changing the current direction in the rotor windings and
causing the rotor to continue rotating.
1.1components of a typical DC motor
The key components of a typical DC motor include a rotor (armature), stator,
commutator, brushes, field windings ,yoke, armature windings ,poles, and a
power source (DC supply). Some of the most popular designs for DC motors are
Permanent magnet, Brushless, Shunt, Series, and Compound wound or stabilized
shunt. The DC motor parts are normally the same within these different designs
and the overall operation is similar. How it operates is that a conductor, carrying
the current is implanted in a magnetic field, and the power applied through the
conductors enables the rotation of the motor. The generation of electromagnetic
fields and its place, whether in the rotor or stator is the reason these designs differ
from each other. As getting acquainted and understanding the diverse types of
direct current motors will aid you to figure out how they are used for different
applications and which one is more suitable for the application, in what follows,
here are functions of some of these types.
A DC motor contains different parts that understanding each one can assist to
know deeply these parts cooperate with each other and in the end how DCs work.
These components are: a stator, a rotor, a yoke, poles, armature windings, field
windings, commutator, and brushes. Many of its parts are the same as parts of AC
motor, but with a little change.
Stator
A stator is one of the DC motor parts that is, as the name suggests, a static unit
containing the field windings. The stator is the DC Motor part that receives the
supply.
Rotor
The dynamic part of a DC motor is the rotor that creates the mechanical rotations
of the unit.
Yoke
Another unit of the DC motor parts is the Yoke. A Yoke is a magnetic frame
made of cast iron or sometimes steel, which works as a protector. This
protective cover keeps the inner parts of the motor safe and sound and also
supports the armature. Yoke also houses the magnetic poles and field windings
of a DC motor to help supporting the field system.
Poles
DC motor has magnetic poles that fit into the inner wall of the Yoke with the
help of screws to tighten them up. Poles have two parts: The Pole Core and the
Pole Shoe. These two parts are fixed together by hydraulic pressure and are
attached to the Yoke. Each part of the Poles has a specific task based on its
design. The core holds the Pole Shoe over the Yoke while the Pole Shoe is
structured to both carry slots for the field winding and spread the produced flux
by the field windings into the air gap between the rotor and stator. It helps to
reduce the loss caused by reluctance.
Field Windings
Made with Copper wire (field coils), the Field Windings circle around the slots
carried by the Pole Shoes. The field windings form an electromagnet capable of
producing field flux. The rotor armature rotates inside the field flux, resulting in
the effective flux cutting.
Armature Windings
Another DC motor parts is armature winding. The armature winding of the DC
motor has two constructions: Lap Winding and Wave Winding. Their difference
is in the number of parallel paths. Armature Winding is attached to the rotor and
alters the magnetic field in the path that it rotates. The result of this procedure is
magnetic losses. Designers try to reduce the magnetic losses by making the
armature core with some low-hysteresis silicon steel lamination. Then, the
laminated steel sheets will be piled up together, creating the cylindrical
structure of the armature core. There are slots designed inside the armature core
with the same material.
DC Motor Commutator
The commutator is a split ring made up of Copper segments, Commutator is
another DC motor part. The operating system of a DCs is based on the interaction
of the two magnetic fields of rotating armature and a fixed stator. As the north pole
of the armature is attracted to the south pole of the stator and south pole of
armature is attracted to the north pole of the stator, a force is produced on the
armature which makes it to turn. the process in which the field in the armature
windings is switched to produce constant torque in one direction is called
Commutation. the commutator is a device connected to the armature enabling this
switching of current. Different segments of its cylindrical structure are insulated
from each other by Mica. The commutator is designed to commute the supply
current to the armature winding from the mains. The commutator passes through
the brushes of the DC motor.
The basic purpose of commutation is to certify that the torque acting on the
armature is always in the same direction. Naturally, the generated voltage in the
armature is alternating, the commutator converts it to the direct current. To control
the direction the electromagnetic fields are pointing to, the commutator turns the
coils on and off. On one side of the coil, the electricity should always flow away,
and on the other side, electricity should always flow towards. This ensures that the
torque is always produced in the same direction.
Brushes
The last item on the DC motor parts list is Brushes that are made of Carbon or
Graphite structures. Brushes with the commutator, are working as a bridge to
connect the static electrical circuit to the rotor. Brushes are in contact with the
commutator and relay the produced current to the commutator from an external
circuit. The current then moves into the armature winding.
1.2 Types of DC motors
There are four main types of DC motors have the numerous potential applications
each type of these motors possesses its strengths and weaknesses:
1. Permanent Magnet Motors
Permanent Magnet Motors (also known as a PMDC motor) apply a
permanent magnet to make a field flux. This type of DC motors creates a
great starting torque with a good speed regulation. With limited torque it
has, permanent magnet type typically is used on low horsepower
applications.
2. Shunt Motors
the field of shunt type is connected in parallel with the armature windings.
As the shunt field can excited separately from the armature windings, this
type of motors provides a great speed regulation. Besides, shunt motors also
offer simplified reversing controls.
3. Series Motors
A series DC motor consists of a field wound with some turns of a wire
which carries the current of armature. Like permanent motors, series motors
create a large amount of starting torque. In comparison with permanent
motors, series type can’t regulate speed. In addition, if series motors run
with no load, they can be damaged. These limitations make series motors
unsuitable for variable speed drive applications.
4. Compound Motors
Like shunt DC motors, compound motors possess a shunt field which is
separately excited. Just like permanent and series motors, compound motors
enjoy good starting torque with some problems in speed regulation in
variable speed drive applications.
1.3 Applications of DC Motor.
Due to the fact that there are 4 main types of DCs, a wide range of different
applications is defined for DC motors. The previous sections considered some of
the various parts and types of DCs. In this section, we are going to introduce
different applications and circumstances where DC motors are used for.Generally,
because of some specific advantages of each type of DC motors, there are various
uses of them. At home, small ones are used in tools, toys and many household
appliances. Some other applications of DCs include conveyors and turntables and
in industries, huge DCs usages consist of braking and reversing applications. We
tried to bring some specific examples as the DCs applications:
1-Pumps
Hydraulic pumps as an essential industrial tool are used in almost all industries
such as construction, mining, manufacturing and steel. DC motors because of their
variable speed control and also excellent starting torque are used to empower these
kinds of pumps. Most of the time lower-cost brushless DCs are used in pumps
which make it far easier to maintain on such a large industrial scope.
2-Toys
Due to the fact that small DC motors are easy to use and considerably rugged, they
are the best choice of manufacturer and hobbyists for children’s toys such as
remote-control cars and trains. Toys that require different range of speed and types
of movements need a motor with a wide variety of voltages. Manufacturers find all
of these specifications in DCs.
3-Electric Cars
Another application for DCs is in electric cars. DC motors because of their energy
efficiency and durability are one of most favorite options for electric vehicles.
Moreover, many hobbyist use DCs because of their great and higher starting torque
particularly series-wound motors, and their variable speeds with voltage input.
4-Robots
For many hobbyist and engineering robots are any electromechanical devices
designed to do one or more specific tasks. To activate things like tracks, arm or
cameras,
1.4 DC motor Advantages and Disadvantages
Different sizes of DC motor parts will create different DC motors, suitable for
different needs. As mentioned before, small ones can be used in toys, tools, and
home appliances and larger ones are used in the elevator and hoists and propulsion
of electric vehicles. Although AC motors decreased the selling of DC motors on
account of simple generation and transmission with fewer losses to long distances,
needing less maintenance and can be operated in explosive atmospheres, DCs still
are utilized in where ACs can’t fulfill the needs. DCs have their own unique
features and importance in industries that make up for lots of other advantages that
AC motors have over them.
DC motors are suitable for low-speed torque, or when having an adjustable speed
and constant is necessary. In other words, with DC motors the speed can be
controlled over a wide range. This means they offer a wide range of speed control
both below and above the rated speed. This feature of DC motors can be got in
shunt types. By armature controlling and field controlling, you can enjoy this
unique advantage of DC motors over AC motors. Moreover, DCs have a very high
and strong starting torque compared to normal operating torque. Therefore, DCs
are used in electric trains and cranes having overwhelming burdens in the
beginning conditions. In addition to the above-mentioned advantages, DC motors
have smaller converters and drives as well as higher motor power density. Not to
mention that they have full torque at zero speed.Being around on the market for
more than 140 years, DC motors are often more affordable than AC motors and
have a simpler and more efficient design. Plus, their maintenance is easy and takes
little to no time. If you redesign your current installation to use an AC motor, it
will cost way more than just simply replacing the DC motor inside the installation.
So, you not only repair your system by installing a new unit inside but save lots of
money.
1.5 Speed Control of DC motor
Often we want to control the speed of a DC motor on demand. This intentional
change of the drive speed is known as speed control of a DC motor.
We can control the speed of DC motor manually or through an automatic control
device. This is different to speed regulation – where the speed can regulate against
the natural change in speed due to a change in the load on the shaft
The speed of a DC motor (N) is equal to
K ( V −I a∗Ra )
N= (1)
∅
Where, K is a constant.
This implies three things:
1. Speed of the motor is directly proportional to supply voltage.
2. The Speed of the motor is inversely proportional to armature voltage drop.
3. The motor speed is inversely proportional to the flux due to the field
findings
Thus, the speed of a DC motor can control in three ways:
By varying the flux, and by varying the current through field winding
By varying the armature voltage, and the armature resistance
Through the supply voltage
Initially, when the variable resistor keeps at its minimum position, the rated current
flows through the field winding due to a rated supply voltage, and as a result, the
speed is kept normal. When the resistance increases gradually, the current through
the field winding decreases. This in turn decreases the flux produced. Thus, the
speed of the motor increases beyond its normal value.
1.5.2 Armature Control Method
The controlling of armature resistance controls the voltage drop across the
armature. With this method, the speed of the DC motor can control. This method
also uses a variable resistor in series with the armature.
In case of a duty-cycle of 0%, the motor will be stopped, so t OFF will be maximal
whilst tON will be zero. The duty cycle is noted by f and can be calculated through
the relation:
t on
f= ∗100 % (2)
t on +t off
The H-bridge is generally used for reversing the polarity of the motor supply
voltage but it may be also used for braking the motor (the motor stops suddenly
because of short-circuiting its terminals) or for allowing the motor to freely rotate
until still.
1.6 Axial-Flux:
2.1 Introduction
DC motors are widely used in industrial applications, robot controllers and home
appliances due to their high reliability, versatility and low cost, where speed and
position control of the motor is required. engine. This paper deals with the
performance evaluation of different types of conventional controllers and
intelligent controllers implemented with the express purpose of controlling the
speed of independently excited DC motors. PID controllers are commonly used for
motor control applications due to their simple structure and intuitively
understandable control algorithms. The controller parameters are usually set using
the Ziegler-Nichols frequency response method . The Ziegler-Nichols frequency
response method is often used to tune the parameters of a PID controller. However,
it is necessary to put the system into oscillation mode to perform the adjustment
process. But it is not always possible to oscillate most technological settings . In
process control, model-based control systems are mainly used to achieve desired
set points and eliminate small external disturbances. The design of internal model
control (IMC) is based on the fact that the control system contains a certain
representation of the process under control, allowing to achieve perfect control.
Therefore, if the control architecture is developed based on an accurate model of
the process, then perfect control is mathematically possible . Fuzzy logic control
(FLC) is one of the most successful applications of fuzzy set theory, introduced by
L.A. Zadeh in 1973 and applied (Mamdani 1974) to attempt to control systems
with difficult structures. modeling. Since then, FLC has become an extremely
active and fruitful research area with many industrial applications reported . Over
the past three decades, FLC has developed as an alternative or complement to
conventional control strategies in various engineering fields. The analysis and
control of complex, non-linear and/or time-varying systems is a difficult task using
conventional methods due to uncertainties. Fuzzy set theory leads to a new control
method called Fuzzy Control, which is capable of handling system uncertainties.
One of the most important advantages of fuzzy control is that it can be successfully
applied to control complex nonlinear systems using operator experience or control
engineering knowledge. without any mathematical modeling of the installation
process .
Direct currents (DC) motors have been used in variable speed drives for a long
time. The versatile characteristics of dc motors can provide high starting torques
which is required for traction drives. Control over a wide speed range, both below
and above the rated speed can be very easily achieved. The methods of speed
control are simpler and less expensive than those of alternating current motors.
There are different techniques available for the speed control of DC motors. The
phase control method is widely adopted, but has certain limitations mainly it
generates harmonics on the power line and it also has got p .f when operated lower
speeds. The second method is PWM technique, which has got better advantages
over the phase control.
In the proposed project, a DC motors circuitry is designed, and developed using
pulse with modulation (PWM).The pulse width modulation can be achieved in
several ways. In the present project, the PWM generation is done using micro-
controller.
speed control means intentional change of drive speed to a value required for
performing the specific work process. this concept of speed control or adjustment
should not be taken to include the natural change in speed which occurs due to
change in the load on the shaft. any given piece of industrial equipment may have
its speed change or adjusted mechanically by means of stepped pulleys, sets of
change gears, variable speed friction clutch mechanism and other mechanical
devices. historically it is proved to be the first step in transition from non-
adjustable speed to adjustable speed drive. the electrical speed control has many
economical as well as engineering advantages over mechanical speed control the
nature of the speed control requirement for an industrial drive depends upon its
type. some drives may require continues variation of speed for the whole of the
range from zero to full speed or over a portion of this range, while the others may
require two or more fixed speeds, there are many speed control methods of dc
motors which can be listed below:
● Armature or Rheostatic control method.
● Flux control method. It is seen that speed of the motor is inversely
proportional to flux.
● Armature control method.
● Voltage Control Method.
● Variable resistance in series with armature.
In the field of DC motor speed and direction control , many researches have been
done and a lots of controlling methods have been implemented in order to achieve
accurate ,robust , smooth and durable speed controlling method , here are some
reviews of some studies which done in same of our study field of research:
A.sahithi Priya et al., work on a micro controller MCS 51 series 89c52 and
motor driver, thermal sensor, comparator, key pad,16X2 dot matrix LCD display
and rotation feedback sensor (optical encoder). The program is written in micro
controller to take the input values from the user, then rotates the motor by placing
50% duty cycle pulse on the motor. The motor is rotated at X RPM speed, can be
detected by using feedback sensor and micro controller. If the speed is above the
specified speed, then the micro controller continuously reduces the duty cycle till
the speed comes to a predetermined level. If the detected speed is less than the pre-
determined speed then the micro controller continuously increases the duty cycle
till the determined level. The micro controller keeps on tracking the determined
speed by varying duty cycle in a closed loop control system .
Md Akram Ahmad et al. work on the speed control of a DC shunt motor using
conventional controllers (PID, IMC) and Fuzzy Logic controller based on Matlab
Simulation program. A mathematical model of the process has been developed
using real plant data and then conventional controllers and Fuzzy logic controller
has been designed. A comparative analysis of performance evaluation of all
controllers has been done. In process control, model based control systems are
mainly used to get the desired set points and reject small external disturbances. The
internal model control (IMC) design is based on the fact that control system
contains some representation of the process to be controlled then a perfect control
can be achieved. So, if the control architecture has been developed based on the
exact model of the process then perfect control is mathematically possible.
Jalu A. Prakosa et al. work on Quadcopter drones typically use brushless direct
current (BLDC) motors as rotors due to their high efficiency and small volume.
BLDC motor speed control is very important in determining the drone's position
and speed. Optical sensors can be used to measure the speed of the BLDC motors
during laboratory tests. Speed calculation, use of pulse width modulation (PWM)
techniques for speed control, and serial interface can be implemented using a
microcontroller. The purpose of this study is to control the speed of a BLDC motor
for ground testing of a drone rotor. Measurements have shown that the relationship
between the PWM-controlled speed reference signal and the actual speed is
nonlinear due to the time constant and fan load. Increasing the PWM duty cycle
increases motor speed. You can use the motor's control characteristics to modify
speed control .
Ali N. hamoodi et al. work on a design and implement an aped control of a direct-
current (DC) series motor. The Arduino UNO kit was used with four resistance
armature control, and the approaches available with the Arduino kit enabled us to
build this connection and measure the speed in a straightforward manner. This
speed was measured using a speed meter (Autonics MP5w). Traditional armature
resistance controls and also Arduino armature resistance controls were used. For
each example, the speed readings were recorded. Finally, it was found that the
Arduino control approach is less complicated than the old method.
Palem Lay Krishna et al. provides different aspects of speed control of DC drive.
Different control schemes of DC motor with proper explanation has been provided.
Multi-pulse converter and firing angle control scheme has been discussed.
Simulation results have been provided for the speed control aspect. It is possible to
measure the speed of the motor with a tachometer or incremental encoder. These
tachometers and incremental encoders produce erroneous results as a result of a
variety of factors. the authors provide a strategy for compensating against
imperfections in incremental encoders. In his paper, a study of several speed
control systems for direct current motors is discussed in detail. This paper
discusses many strategies for controlling the speed of a DC motor, including
various speed control schemes. This study discusses and simulates multi-pulse
converter-based DC motor speed control. The results of the simulation reveal that
the motor can be controlled accurately in terms of speed. The speed of the motor
can be measured with a tachometer or incremental encoder .
The process of identifying problems in the DC motor was carried out, where the
rotation of the DC motor needs to be controlled at speed in accordance with the
function and use of the motor. The factors that are considered in this study are
motor speed control and calculation of controlling values. To get optimal results, a
study was carried out and subsequently the appropriate hardware was made and the
manufacture of software to operate the system from the driver motor and DC
motor. After that, tool testing is carried out to obtain data to be processed and
compared with previous studies. The research flow chart of the automatic feeding
system can be seen in Fig.9.
Fig.9 Research Flowchart
The design of this DC motor angular velocity control system uses an Arduino
UNO microcontroller to regulate a DC motor that has an encoder in it, Arduino
will send a voltage signal to the driver motor to be subsequently discharged to the
DC motor according to the voltage calculation results of the PID controller.
The voltage value in the DC motor is influenced by the PID controller, depending
on the set point value and the value of each Proportional-integral-derivative
controller, the result of the PID controller is the angular velocity of the DC motor.
PID control results in addition to the rotation results on the DC motor, this study
also displays the PID control results through a graph displayed by the serial
monitor.
Fig.11 shows the wiring circuit of this system, all components are connected by
the Arduino UNO with a power supply coming from a 12 Volt adapter. The motor
driver and DC motor are directly connected with the Arduino pins. The pins used
on the Arduino UNO can be seen in Table 1.
No. Arduino Pin Information
1 D5 ENB pin on L298N motor driver
2 D6 IN 3 pin on L298N motor driver
3 D7 IN 4 pin on L298N motor driver
4 GND GND Arduino to GND L298N motor driver
5 D2 To Encoder Chanel B motor DC pin
6 D3 To Encoder Chanel A motor DC pin
7 GND To Encoder GND , LCD GND, Potentiometer GND
8 5V To Encoder VCC, LCD VCC, Potentiometer VCC
9 A1 Analog input from potentiometer
10 A4 SCL of LCD
11 A5 SDA of LCD
Table 1. Arduino Uno Input and Output Pins
[ ( )] ……………………………………(1)
−T S 2
Cv (z ) 1−e Kd S + KpS+ Ki
s
PIDd = =Z
E (z) S S
¿(1−Z −1)Z
[ Kp Ki
]
+ + Kd …………………………….……………………(3)
S S2
¿(1−Z )
Kp
−1
+
[Ki T s Z−1 Kd
+
(1−Z−1) ( 1−Z−1 )2 T s ]
…………………………….................(4)
[ ]
Kd 2
Kp (1−Z−1)+ Ki T s Z−1 + ( 1−Z −1)
Cv(z ) Ts ………………………………………..(5)
=
E (z) (1−Z −1)
Cv(z )
=¿
E (z)
−1 −1 −1 Kd Kd −2 Kd −1
Cv ( z )−Cv ( z ) Z =KpE ( z ) −KpE ( z ) Z + Ki T s E ( z ) Z + E ( z )+ E ( z ) Z −2 E(z)Z
Ts Ts Ts
………………………………………….……….(7)
Equation No.7 will be used in Arduino code in order to evaluate the Control value
(Cv) of the controller , knowing that E stand for error signal ,Ki ,Kp, Kd stand for
integral ,proportional and derivative controller constant respectively .
3.5 Open Loop System:
An open-loop system is a type of control system where the output is not directly
fed back to the input for correction. In an open-loop system, the control action is
determined solely by the input commands, without considering the actual output or
system response. This means that there is no feedback mechanism to adjust the
control action based on the system's performance. An example of an open-loop
system is a washing machine that runs through a predefined cycle without
monitoring the cleanliness of the clothes. Once the cycle is initiated, it proceeds
according to a predetermined sequence of operations regardless of the actual state
of the clothes. Open-loop systems are simpler and less expensive to implement
compared to closed-loop systems, but they are typically less accurate and less
robust in dealing with disturbances or changes in the system[21].
1. Controller: The controller is responsible for processing the error signal, which is
the difference between the desired reference value and the actual output of the
system. It generates a control signal based on this error signal to adjust the system's
behavior.
2. Plant or Process: The plant or process represents the system being controlled. It
could be a mechanical, electrical, or chemical system. The plant receives the
control signal from the controller and produces an output.
3. Feedback Loop: The feedback loop is the mechanism by which the output of the
system is fed back to the controller. This feedback allows the controller to
continuously monitor the system's performance and make necessary adjustments to
maintain or achieve the desired output.
4. Sensors: Sensors are used to measure the output or performance of the system and
provide feedback to the controller. They sense the actual output or state of the
system and transmit this information to the controller for comparison with the
reference value.
5. Actuators: Actuators are devices that receive the control signal from the controller
and exert control over the system to bring its output closer to the desired value.
They could be motors, valves, heaters, or any other devices that can manipulate the
system's behavior. Closed-loop systems are widely used in various applications,
including industrial control systems, automotive control systems, robotics,
aerospace, and more. They offer several advantages over open-loop systems, such
as improved accuracy, stability, and robustness to disturbances and uncertainties.
Additionally, closed-loop systems can adapt to changes in the system or the
environment, making them suitable for dynamic and uncertain environments.
Main disadvantage of proportional control is that we can never drive the error to
zero because that would mean our control effort is zero. Now there is a way to
remove the offset or bring the error to zero. Looking at the normal structure of the
controller if we were to add a bias signal to our controllers output, this can
potentially drive the process enough such that we reach our desired set point. But
the disadvantage of this method is that for every new set point we’re going to have
to manually change the bias. Now although the proportional controller is easy to
implement and can drive the process close to our set point, it can never eliminate
the offset automatically. These issues can be automatically solved by adding
integral controller.
The main advantage of integral control is that it allows us to eliminate the steady
state error completely. Now by tuning the Ki term we can adjust the control effort
of our integral controller. Now in this case for a high Ki value, we can see that we
get a steeper slope and this would make our control signal more aggressive.
Now just like with proportional control, we can’t just arbitrarily choose an integral
constant. The output behaves relatively upon varying the integral constant. If Ki is
too low, we end up with the large rise time and overall a very slow response. This
is bad when it comes to rejecting disturbances or constant changes in the set point.
You can see we reached our set point much sooner with just a small amount of
overshoot. But in an attempt to get a faster response, increasing this gain even
further can lead to larger overshoots and this should be avoided when trying . we
learned that the proportional controller provided us with a fast rise time but with a
steady state offset. The PI controller solves that using the integral control to reduce
the error to zero. But when neither the controller can solve is the large overshoots
and ringing. In order to reduce or dampen this response, we will need to add a
differential controller and they will quickly respond fast enough to keep the output
from overshooting or undershooting the set point.
We have seen that P controller eliminates the stay state error through the interval
term. But we also made it clear that neither the p term or I term can contribute to
actively dampening the overshoots. This is where the derivative comes into play.
Let’s look at how this new term handles the error signal the job of the derivative
term is to take the rate of change of the error as its control signal. The proportional
term decreases the rise time the interval term eliminates a steady state error and the
derivative term reduces the overshoots and ringing.
Increasing the proportional gain (Kp) has the effect of proportionally increasing the
control signal for the same level of error. The fact that the controller will "push"
harder for a given level of error tends to cause the closed-loop system to react more
quickly, but also to overshoot more. Another effect of increasing Kp is that it
tends to reduce, but not eliminate, the steady-state error. The addition of a
derivative term to the controller (Kd) adds the ability of the controller to
"anticipate" error. With simple proportional control, if Kp is fixed, the only way
that the control will increase is if the error increases. With derivative control, the
control signal can become large if the error begins sloping upward, even while the
magnitude of the error is still relatively small. This anticipation tends to add
damping to the system, thereby decreasing overshoot. The addition of a derivative
term, however, has no effect on the steady-state error. The addition of an integral
term to the controller (Ki) tends to help reduce steady-state error. If there is a
persistent, steady error, the integrator builds and builds, thereby increasing the
control signal and driving the error down. A drawback of the integral term,
however, is that it can make the system more sluggish (and oscillatory) since when
the error signal changes sign, it may take a while for the integrator to "unwind."
The general effects of each controller parameter (Kp, Kd, Ki) on a closed-loop
system are summarized in the table below. Note, these guidelines hold in many
cases, but not all. If you truly want to know the effect of tuning the individual
gains, you will have to do more analysis, or will have to perform testing on the
actual system.
Fig.12
4.1.1Components:
1. Dc machine
2. Step
3. Display
4. Dc voltage source
5. Powergui
6. Connecting wires
4.1.2Explain:
At the beginning, we made a design on the Matlab program with a simple circuit that contains
the components mentioned above in order to see the process and principle of the motor
working on a voltage of 100V, knowing that the method of recommendation is as in the image
shown above
4.2Development:
Here we have started to develop the design of the matlab and develop it
A common actuator in control systems is the DC motor. It directly provides rotary motion and,
coupled with wheels or drums and cables, can provide translational motion. The electric circuit of
the armature and the free-body diagram of the rotor are shown in the following figure:
Fig .22
For this example, we will assume that the input of the system is the voltage
source ( ) applied to the motor's armature, while the output is the rotational
speed of the shaft . The rotor and shaft are assumed to be rigid. We further
assume a viscous friction model, that is, the friction torque is proportional to shaft
angular velocity.
The physical parameters for our example are:
(J) moment of inertia of the rotor 0.01 kg.m^2
(b) motor viscous friction constant 0.1 N.m.s
(3)
(4)
To build the simulation model, open Simulink and open a new model window.
Then follow the steps listed below.
Insert an Integrator block from the Simulink/Continuous library and draw lines
to and from its input and output terminals.
Label the input line "d2/dt2(theta)" and the output line "d/dt(theta)" as shown
below. To add such a label, double-click in the empty space just below the line.
Insert another Integrator block above the previous one and draw lines to and
from its input and output terminals.
Label the input line "d/dt(i)" and the output line "i".
Fig.23
Next, we will apply Newton's law and Kirchoff's law to the motor system to
generate the following equations:
(5)
(6)
The angular acceleration is equal to 1 / J multiplied by the sum of two terms (one
positive, one negative). Similarly, the derivative of current is equal to
1 / L multiplied by the sum of three terms (one positive, two negative). Continuing
to model these equations in Simulink, follow the steps given below.
Insert two Gain blocks from the Simulink/Math Operations library, one
attached to each of the integrators.
Edit the Gain block corresponding to angular acceleration by double-clicking it
and changing its value to "1/J".
Change the label of this Gain block to "Inertia" by clicking on the word "Gain"
underneath the block.
Similarly, edit the other Gain's value to "1/L" and its label to "Inductance".
Insert two Add blocks from the Simulink/Math Operations library, one
attached by a line to each of the Gain blocks.
Edit the signs of the Add block corresponding to rotation to "+-" since one term
is positive and one is negative.
Edit the signs of the other Add block to "-+-" to represent the signs of the
terms in the electrical equation.
Fig.24
Now, we will add in the torques which are represented in the rotational equation.
First, we will add in the damping torque.
Insert a Gain block below the "Inertia" block. Next right-click on the block and
select Rotate & Flip > Flip Block from the resulting menu to flip the block from
left to right. You can also flip a selected block by holding down Ctrl-I.
Set the Gain value to "b" and rename this block to "Damping".
Tap a line (hold Ctrl while drawing or right-click on the line) off the rotational
Integrator's output and connect it to the input of the "Damping" block.
Draw a line from the "Damping" block output to the negative input of the
rotational Add block.
Fig. 25
Now, we will add in the voltage terms which are represented in the electrical
equation. First, we will add in the voltage drop across the armature resistance.
Insert a Gain block above the "Inductance" block and flip it from left to right.
Set the Gain value to "R" and rename this block to "Resistance".
Tap a line off the current Integrator's output and connect it to the input of the
"Resistance" block.
Draw a line from the "Resistance" block's output to the upper negative input of
the current equation Add block.
In order to save all of these components as a single subsystem block, first select all of
the blocks, then select Create Subsystem from Selection after right-clicking on the
selected portion. Name the subsystem "DC Motor" and then save the model. Your
model should appear as follows
Fig.27
Building the model with Simscape
In this section, we alternatively show how to build the DC Motor model using the
physical modeling blocks of the Simscape extension to Simulink. The blocks in the
Simscape library represent actual physical components; therefore, complex multi-
domain models can be built without the need to build mathematical equations
from physical principles as was done above by applying Newton's laws and
Kirchoff's laws.
Open a new Simulink model and insert the following blocks to represent the
electrical and mechanical elements of the DC motor.
Resistor, Inductor and Rotational Electromechanical Converter blocks from the
Simscape/Foundation Library/Electrical/Electrical Elements library
Rotational Damper and Inertia blocks from the Simscape/Foundation
Library/Mechanical/Rotational Elements library
Four Connection Port blocks from the Simscape/Utilities library
Double-click on the Connection Port blocks to make the location of ports 1 and 2
from the Left and the location of ports 3 and 4 from the Right.
Connect and label the components as shown in the following figure. You can
rotate a block in a similar manner to the way you flipped blocks, that is, by right-
clicking on the block then selecting Flip Block from the Rotate & Flip menu.
Fig.28
Complete the design of the DC motor Simscape model by assigning values to the
physical parameters of each of the blocks to match our assumed values. To assign
the necessary values, double-click on the Resistor, Inductor, Inertia, Rotational
Damper, and Rotational Electromechanical Converter blocks and enter the
following parameters and associated units:
Resistance = R [Ohm]
Inductance = L [H]
Inertia = J [kg*m^2]
The Rotational Damper block serves to model the viscous friction of the motor.
This type of friction model was chosen because it is linear. In most cases real
friction is more complicated than this. If you wish to employ a more complicated
friction model, for instance to add Coulomb friction to the model, then you may
use the Rotational Friction block from the Simscape/Foundation
Library/Mechanical/Rotational Elements library.
Also note that in the above you generated a DC Motor model from the individual
mechanical and electrical aspects of the motor. The Simscape library also includes
a DC Motor block under the Simscape/Electronics/Actuators & Drivers/Rotational
Actuators library.
The physical parameters must now be set. Enter the following commands at the
MATLAB prompt.
J = 0.01;
b = 0.1;
K = 0.01;
R = 1;
L = 0.5;
These values are the same ones listed in the physical setup section.
You can then save these components in a single subsystem. Select all of the blocks
and then select Create Subsystem from Selection after right-clicking on the
selected portion. You can also change the subsystem block color by right-clicking
on the block and choosing Format > Background Color from the resulting menu.
This subsystem block can then be used to simulate the DC motor
Fig.29
Fig.30
You can save these components in a single subsystem with one input and three
outputs. Select all of the blocks and then select Create Subsystem from
Selection after right-clicking on the selected portion. Also label the subsystem and
signals as shown in the following figure.
Fig.31
Arduino is known for its ease of use and learning, making it ideal for beginners,
hobbyists, and professionals alike. It provides an open-source and free
development environment for programming using the Arduino language based on
Wiring, which is based on C/C++.
2-
The L298N is a popular dual H-bridge motor driver
integrated circuit (IC) commonly used to control DC
motors and stepper motors. It is designed to drive
inductive loads, such as motors, with high efficiency
and low heat dissipation.
3. Built-in Diodes: The IC has built-in flyback diodes (also known as freewheeling
diodes) to protect the circuit from back electromotive force (EMF) generated by
the motors when they are turned off.
4. Direction and Speed Control: The L298N allows for both direction and speed
control of motors through PWM (Pulse Width Modulation) signals.
Fig.33
1. Potentiometer: Also known as a pot, it consists of a rotating body controlled by
hand and containing a conductive track and a wiper that moves along it. Rotating
the body changes the distance between the track and the wiper, thus altering the
resistance value.
2. Pressure-Sensitive Variable Resistor: It changes resistance value when pressure
is applied. It's used in applications such as touchscreens and pressure sensors.
4-
DC motors come in various types and sizes, such as brushed DC motors, brushless
DC motors (BLDC), and coreless DC motors, each suited to different applications
based on factors like torque requirements, speed, and efficiency.
5- Connecting wires
4.5 Linking method:
4.5.1Open-loop
1. We prepare the Arduino with a power source
2. We connect l298n(drive)
We connect enable to one of the pins on the Arduino that supports PWM and which
contains an analog signal
We connect enable to one of the pins on the Arduino that supports PWM and which
contains an analogue signal
Then we connect the drive to the DC motor by connecting one of the poles to the positive
out pin and the other to the negative.
We equip the drive with a power source. Let us assume that it is a 12 volt battery. We take
a wire from the negative and put it in the GND pin of the Arduino.
3. We connect the screen to the Arduino to display the values of the variables
4. We connect the joystick to control the change in resistance to change the speed of the DC motor
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
void loop()
{
// قراءة قيمة محورX من الجوستيك
int joystickValue = analogRead(joystickXPin);
Serial.println(joystickValue);
// )تحديد اتجاه الحركة (قد يختلف تبًعا لتوصيالت المحرك
if (joystickValue <= 500) {
// الحركة لألمام
int motorSpeed = map(joystickValue, 500, 0, 0, 255);
digitalWrite(in1Pin, HIGH);
digitalWrite(in2Pin, LOW);
analogWrite(enablePin, motorSpeed);
lcd.setCursor(0,0);
lcd.print("mot_Spd=");
lcd.setCursor(8,0);
lcd.print(int (motorSpeed*3.92156863));
lcd.setCursor(13,0);
lcd.print("RPM");
lcd.setCursor(0,1);
lcd.print("direction=");
lcd.setCursor(11,1);
lcd.print("C.W");
} else {
// إيقاف المحرك
digitalWrite(in1Pin, LOW);
digitalWrite(in2Pin, LOW);
analogWrite(enablePin, LOW);
lcd.setCursor(0,1);
lcd.print("direction=");
lcd.setCursor(11,1);
lcd.print("STOP");
}
}
4. Output: The result or signal that exits the system after processing.
5. Feedback: The signal that returns from the output to the controller, providing
information about the system's performance and allowing necessary
adjustments.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
int POT_sp=1;
float sp;
int PWM_output=6;
float pv;
int pinA=3;
volatile int counter=0;
unsigned long previousMillis=0;
long interval =100;
int IN1=4;
int IN2=5;
float cv;
float cv1;
float error;
float error1;
float error2;
float kp=1;
float ki=5;
float kd=0.001;
float Tm=0.1;
void setup() {
pinMode(pinA,INPUT);
pinMode(PWM_output,OUTPUT);
pinMode(POT_sp,INPUT);
Serial.begin(115200);
attachInterrupt(1,interruption,RISING);
pinMode(IN1,OUTPUT);
pinMode(IN2,OUTPUT);
///lcd////
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("SP = ");
lcd.setCursor(0,1);
lcd.print("PV = ");
lcd.setCursor(12,0);
lcd.print("RPM");
lcd.setCursor(12,1);
lcd.print("RPM");
}
void loop() {
unsigned long currentMillis=millis();
if ((currentMillis - previousMillis)>=interval)
{previousMillis=currentMillis;
pv=10*counter*(60.0/550.0);
counter=0;
}
sp=analogRead(POT_sp)*(200.0/1023);
error=sp-pv;
cv=cv1+(kp+kd/Tm)*error+(-kp+ki*Tm-2*kd/Tm)*error1+(kd/Tm)*error2;
cv1=cv;
error2=error1;
error1=error;
if (cv>500.0){
cv=500.0;
}
if (cv<30.0){
cv=30.0;
}
analogWrite(PWM_output,cv *(255.0/550.0));
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
Serial.print("SP: ");
Serial.print(sp);
Serial.print(" ");
Serial.print("PV: ");
Serial.println(pv);
lcd.setCursor(4,0);
lcd.print(sp);
lcd.setCursor(4,1);
lcd.print(pv);
delay(100);
}
void interruption(){
counter++;}
Here we fixed the values of Kd and Ki as (0.001 and 5 ) respectively and tuning
the value of Kp in order to see its effect on the response knowing that the Blue
curve represent the set point while the Red one represent the process value (actual
value ).
Fig38. response of the controller with Kp =5.
After that , the values of Kp and Ki as (1 and 5 ) respectively and tuning the value
of Kd in order to see its effect on the response .
Fig40. response of the controller with Kd =1.
Finally, the values of Kp and Kd as (1 and 0.001 ) respectively and tuning the
value of Ki in order to see its effect on the response .