Sie sind auf Seite 1von 32

1

Table of Content

OBJECTIVE ................................................................................................................. 3
ABSTRACT .................................................................................................................. 3
METHODOLOGY ....................................................................................................... 4
INTRODUCTION……………………………………………………………………… 5

Chapter 1 - Data Acquisition and Analysis

1.1 - PROJECT SETUP ................................................................................................ 7


Hardware Setup ................................................................................................... 7
Software Setup .................................................................................................... 7
LM393 ( Module) Infrared speed sensor .......................................................... 7-8
1.2 - DC STEP RESPONSE .......................................................................................... 8
Rpm VS. Time plot ............................................................................................ 9
Angular velocity VS. Time plot .......................................................................... 9
1.3 - FILTERING........................................................................................................ 10
Transfer function of low pass filter .................................................................... 10
Step response of a DC motor after filtering ........................................................ 10

Chapter 2 - System Identification

2.1 - PARAMETER ESTIMATION OF DC MOTOR .............................................. 12


Block Diagram ................................................................................................. 12
SIMULINK Model ............................................................................................ 13
Procedure ..................................................................................................... 13-14
2.2 - ESTIMATING TRANSFER FUNCTION USING SYSTEM IDENTIFICATION
TOOLBOX ................................................................................................................. 15
General form ................................................................................................ 15-16
By System Identification Toolbox ..................................................................... 17
LTI view ........................................................................................................... 18

Chapter 3 - Controlling and Stability

3.1 - PID CONTROLLER ..................................................................................... 20-21


PID controller on MATLAB for DC motor response .................................... 21-22
PID Model ........................................................................................................ 22
3.2 - DIFFERENT PLOTS BY VARYING PID ........................................................ 22
Plot before tuning ............................................................................................. 22
Plot after tuning ................................................................................................. 24
3.3 - STABILTY ANALYSIS OF ROUTH CRITERIA ............................................ 25
2

3.4 - ROOT LOCUS POINT FOR STABILITY ANALYSIS ................................... 26


Method.............................................................................................................. 26
Plots by varying gain .................................................................................... 26-27
3.5 - STABILTY ANALYSIS BY BODE POLTS...................................................... 27
Bode plot for motor ........................................................................................... 27

CONCLUSION ........................................................................................................... 28
APPENDICES................................................................................................... 29-30-21
REFERENCES ........................................................................................................... 32
3

OBJECTIVE: DC MOTOR CONTROL BY ARMATURE CONTROL METHOD

ABSTRACT

This project is based on analyzing DC motor speed response through IR speed sensor
under a constant input voltage, estimation of motor electrical and mechanical parameters
through which transfer function is obtained. Experimental results are presented to demonstrate
the application of this approach and its effectiveness. The estimated parameters can be used to
verify the DC motor performance, or can be used to build a model of the motor subsequent
controller design or system optimization. This approach is especially suited to quick field
application.

Keywords: DC motor, IR speed sensor, transfer function, estimated parameters, optimization


4

METHODOLOGY

FILTERING TRANSFER FUNCTION STABILITY ANALYSIS


STEP RESPONSE
OF DC MOTOR PARAMETER
ESTIMATION PID CONTROLLER

INTRODUCTION
Today’s industries are increasingly demanding process automation in all sectors.
Automation results into better quality, increased production in reduced costs. The variable
speed drives, which can control the speed of A.C/D.C motors, are indispensable controlling
elements in automation systems. Depending on the applications, some of them are fixed speed
and some of the variable speed drives.
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. In this
complex engineering problem, armature control method is used for DC motor. The
mathematical modeling is one of the most important and often the most difficult step towards
understanding physically a DC motor, an accurate model is required for developing the motor
equations, transfer function that relates the input and output data. There are few parameters of
the DC motor that are complicated to determine using measurements. Hence we need parameter
estimation techniques. Parameter identification is emerging as a topic of great importance
because for almost every servo control design a mathematical model is needed and parameter
identification is often the only means of obtaining mathematical models of most physical
systems because most systems are usually so complex that, unlike DC motors, there is no easy
way to derive their models based on physical law. Due to some limitation in classical methods,
the recent trend is to use intelligent tool that is “system identification tool” on MATLAB for
DC motor parameters identification.
5

For the fast dynamic response of the system, many control strategies have been
deployed in various feedback control systems. The vital role of controls in a drive system
include precise and quick tracking for reference speed with minimum overshoot or undershoot
and having little or eliminated steady state error. The conventional (proportional integral-
derivative).PID controllers have become very popular and widely used in industrial control
applications due to their features like simple mathematical modeling, easy to operate, good
robustness, high reliability, stabilization and eliminating steady state error. Root locus
technique is used to illustrate the changes that PID controller tuning inflicts on the control
system performance.
6

DATA ACQUISITION AND ANALYSIS

 PROJECT SETUP
 DC STEP RESPONSE
 FILTERING
7

1.1 - PROJECT SETUP:


This complex engineering problem is based on hardware and software setup.
The components required for this CEP is DC motor, a battery, IR sensor (LM393 module),
jumper wires

Hardware Setup
In the beginning, DC motor is energized through a 9 volts battery and to measure the
speed of DC motor (in rpm), motor disc is placed between the slots of IR sensor (i.e. LM393
module). The ardiuno board is used to read the sensor readings. The sensor output pin is
connected to the digital pin 2 of the arduino board and sensor is supplied with 3.3 volts through
arduino. The sensor and arduino connections are as follows:

Arduino UNO interfacing with IR sensor

Software Setup
The software setup consists of arduino, PLX DAQ and MATLAB. The code of rpm
sensing is implemented on Arduino. When motor starts rotating, the rpm readings are shown on
the serial monitor. These rpm readings are imported to MATLAB through PLX-DAQ. It acts as
interface software between arduino and excel. It download readings from arduino on the excel
sheet which are then transferred to MATLAB for further analysis.

LM393 (Module) Infrared speed sensor


It is a motor speed sensor module which is used to check the rate of an electric motor. It
is used as an encoder in our circuit. The module can be used in association with a
microcontroller for motor speed detection, pulse count, position limit, etc.
The main parts of encoder (LM 393 module) are as follows:
8

LM393 (Module) IR Sensor

For sensing speed, it simply measures the rate at which some event occurs. Usually this
is done by counting the events for a given period of time (integration interval) and then simply
dividing the number of events by the time to get the rate. It works on the principle of
interrupting visual path of its optical sensor which consists of photo transistor and light
emitting diode by some sort of slotted wheel. The speed sensor uses a disc with holes to block
the infrared beam. This encoder disc is placed in the slot of optical sensor to count rotation rate
of a connected wheel. Thus, we will count the number of time the speed sensor goes from Low
to High in a second and then divide that number by 20 (number of holes in the encoder disc) to
get the number of revolution per second.

1.2 - STEP RESPONSE OF DC MOTOR:


Step response of DC motor is analyzed by measuring its rpm and plotting the values in
form of a graph.
To measure rpm, speed sensor uses only 1 pin that goes from Low to High to detect
holes in the encoder disc. Since we will be using Interrupt zero to read the speed sensor, we
need to connect it to Pin 2 (interrupt 0 pin) on the UNO.
We have used interrupt command to calculate how many times the sensor is interrupted
by the encoder disc in 1 sec. So every time the speed sensor pin goes High, interrupt zero will
be called, thus increasing the counter variable by 1. After 1 sec, we will call another interrupt to
display the result and reset everything back to zero to start over again.
We are using the counter value after 1 second elapsed and dividing it by 20 since our
encoder disc has 20 holes. It gives us the number of revolution per second by using a simple
formula.
At the starting condition, the dc motor will go through some transient response as the
speed is not constant in the starting. After some time, motor will attain a constant speed giving
a steady state response. Same results are obtained on MATLAB.
9

Rpm VS. Time plot

The step response of motor (rpm vs. time)

Angular Velocity VS. Time Plot


The rpm readings are converted to angular velocity by multiplying by a factor of (2*pi/60).

The step response of motor (angular velocity vs. time)


It is noticeable that, there are ripples in the plot of step response of DC motor, so we
cannot properly analyzed the transient and steady state of DC motor. Therefore, to reduce these
noises, we use first order low pass filter that passes lower frequency and attenuates higher
frequency components.
10

1.3- FILTERING:

Simulink model of first order low pass filter

Transfer function of first order low pass filter

Step response of motor after filtering

Estimating the parameters of the DC motor through system identification toolbox on MATLAB
and obtaining transfer function will be discussed in the next chapter.
11

SYSTEM IDENTIFICATION

 PARAMETER ESTIMATION
 TRANSFER FUNCTION
12

BRIEF OVERVIEW
DC motors speed and position are easy control and have adjustable range to follow a
speed or position under load. To control the position and speed of a DC motor, an accurate
model of the system is required. The specifications given by manufactures may not be accurate;
also, some motors are produced with coupling gears from manufacturing which add some
inertia and viscous damping coefficient to the original motors, therefore changing the original
values specified by the manufacturer. Several methods have been employed for parameter
identifications of a DC motor.
System identification is the best means of obtaining mathematical models of most
physical systems, because most systems are so complex, that there is no simple way to derive
their models based on physical laws. System identification methods can be applied for DC
motor model identification which will give more concise estimate of the DC motor model than
mathematical modeling.

2.1- PARAMETER ESTIMATION OF DC MOTOR:

System Identification refers to identifying a completely or partially unknown system


and Parameter Estimation is its foundation. Parameter Estimation or estimation theory is a
separate discipline of statistics and it refers to calculating or estimating the coefficients of a
model. The estimator takes the measured data as input and produces an estimate of the
parameters of the model. There are a number of techniques that are used for the purpose. Some
of them are iterative while others find out the coefficients on the basis of direct calculations.
We have used the most basic algorithm here which is least square method that needs the input
and the output of a model in order to estimate its coefficients.

BLOCK DIAGRAM

Once the input and output sequence is fed to the estimator, the accuracy of the results
depends upon the efficiency of the algorithm that is implemented inside the estimator block.
This procedure is diagrammatically shown in this figure.

Dc motors equivalent circuit is shown below:


13

There are 5 parameters to be estimated, which are:


• R = armature resistance
• L = inductance
• J = moment of inertia
• B = friction coefficient
• K = back emf constant

SIMULINK MODEL

Above Simulink model is a combination of electrical and mechanical blocks to account for the
electro-mechanical domains involved in a DC motor. To model the friction coefficient, a
damper block is used, while the moment of inertia is modeled using an inertia block. The back
emf constant is specified in the rotational electro-mechanical converter.

PROCEDURE
We first run the simulation with arbitrary R, L, K, B and J values. The model takes a shape
similar to measured data; however, the magnitudes are far off.
14

Next, we use the parameter estimation app, which is under Simulink Design Optimization
toolbox. This is where we plug in experimental input-output data, specify parameter constraints
and start the estimation process. With the data, Simulink runs optimization processes against
DC motor model to determine the parameter values.
The estimation converges after 30 minutes. Simulated response and measured response are
shown below:
15

RESULTS:

2.2- ESTIMATING TRANSFER FUNCTION USING SYSTEM


IDENTIFICATION TOOLBOX:
System identification tool box treats the system as a black-box. A set of experiments
that is able to capture system dynamics as much as possible is run to generate input-output data
of system characteristics. From these data-sets, a transfer function is obtained to match
experimental behavior as closely as possible.

GENERAL FORM
Firstly, we have to determine a generalize transfer function of dc motor.

The equivalent circuit of dc motor

The development of torque of dc motor is proportional to the magnitude of flux due to field
current If and armature current Ia. For any given motor, these two quantities are adjustable.
For armature control mode,

The torque developed by the motor is proportional to the armature current; thus

𝑇𝑚 (S) = kt × Ia (S)
16

Where 𝑇𝑚 is the torque developed by the motor, and Kt is a constant of proportionality, called
the motor torque constant.
Rearranging

𝑇𝑚 (S)
Ia (S) =
kt

When the motor is rotated back EMF is produced by

d
Vb(t) = kb θ (t)
dt m

Taking the Laplace transform, we get

Vb(S) = kb S θm (S)

By KVL

RIs (S) + La SIa (S) + Vb(S) = Ea (S)

To find the transfer function, substituting values from above

(𝑅𝑎 + 𝐿𝑎 𝑆)𝑇𝑚 (𝑠)


= 𝐸𝑎 (𝑆)
𝐾𝑏 + 𝐾𝑡 𝑆 𝜃𝑚 (𝑆)

Now we must find Tm(s) in terms of 𝜃𝑚 (𝑆) if we are to separate the input and output
variables and obtain the transfer function, 𝜃𝑚 (𝑠)/𝐸𝑎 (𝑠).

From Above figure:

𝑇𝑚 (𝑆) = (𝐽𝑚 𝑆 2 + 𝐷𝑚 𝑆)𝜃𝑚 (𝑆)

Substituting:

(𝑅𝑎 + 𝐿𝑎 𝑆)(𝐽𝑚 𝑆 2 + 𝐷𝑚 𝑆)𝜃𝑚 (𝑆)


= 𝐸𝑎 (𝑆)
𝐾𝑡 + 𝐾𝑏 𝑆 𝜃𝑚 (𝑆)

If we assume that the armature inductance, 𝐿𝑎 , is small compared to the armature resistance,
𝑅𝑎 , which is usual for a dc motor, above equation ) becomes,
17

𝑅𝑎
((𝐽 𝑆 + 𝐷𝑚 ) + 𝐾𝑏)𝑆𝜃𝑚 𝑆 = 𝐸𝑎 (𝑆)
𝐾𝑡 𝑚

After simplification, the desired transfer function, 𝜃𝑚 (𝑠)/𝐸𝑎 (𝑠), is found to be

In general,

BY SYSTEM IDENTIFICATION TOOLBOX


Input and output to system identification toolbox are as follows

After specifying number of poles and zeroes, system identification toolbox gives the first order
transfer function as follows
18

LTI VIEW
Through LTI viewer, our step response (i.e. transfer function) is shown as:

This is showing that the step response of DC motor is an OVERDAMPED RESPONSE.


19

CONTROLLING AND STABILITY

 DESIGNING PID CONTROLLER


 PLOTS BY VARYING ZETA
 ROUTH CRITERIA
 ROOT LOCUS
 BODE PLOT
20

OVERVIEW

The stability and control of any system is extremely important and is generally a safety
issue in the modeling of the system. The stability of the system relates to its response to the
inputs or disturbances. A system is said to be stable when it remains to a constant state unless
affected by an external action and which returns to a constant state when the external action is
removed. In order to achieve the desired stability, proper controlling of system is necessary.
Therefore controlling and stability are linked to each other and are important to get the desired
response of any system.
DC motors are widely used in many applications and hence their controlling and
stability analysis are important aspects to be learned. In this chapter we will discuss the basic
concepts of controlling and stability of DC motor, will implement those concepts on our DC
motor response and hence will interpret and evaluate the results.

This section will cover the following assigned tasks:


• Designing of PID controller on software as well as on hardware.
• Plots of different responses by varying zeta.
• Roth criteria and stability analysis
• Plotting of root locus
• Bode plots

3.1- PID CONTROLLER:


PID controller is a Close loop system which has feedback control system and it
compares the Process variable (feedback variable) with set Point and generates an error signal
and according to that it adjusts the output of system. This process continues until this error gets
to Zero or process variable value becomes equal to set point.

The PID controller calculation (algorithm) involves three constant parameters called the
proportional (P), integral (I) and derivative (D) values, these values can be interpreted in terms
of time. P depends on the present error, I on the accumulation of past error, and D is a
prediction of future error, based on current rate of change .The weighted sum of these three
actions is used to adjust the process via a control element.
The block diagram of a PID controller is shown as below:
21

Mathematically;
Y(t) = e(t) KP + KI ∫( ) + KD ( )

Equation shows the output of the PID controller.


Where,
e = Error signal
KP = Proportional Constant
KI = Integral Constant
KD = Derivative Constant

These gains or constant are tuned or selected according to our desired response. By
changing the values of these gains, different parameters of the responses of such as rise time,
overshoot, settling time, steady state errors are adjusted and a desired response id achieved.

The table below shows the effect of changing constants on different parameters:

Basically by applying PID controller we want following changes in our response:


• No overshoot
• Small rise time
• Zero steady state error
• Small settling time

PID parameters are set according to our set point and the plant response in order to achieve
above characteristics.

PID CONTROLLER ON MATLAB FOR OUR DC MOTOR RESPONSE


In the previous section of System Identification we have imported our real time response of DC
motor to the MATLAB and find its transfer function via system identification toolbox.
The transfer function or response of our DC motor when angular speed is the output is shown
on the next page.
In the shown graph the parameters are as follows:
Overshoot = 6.06 % Settling time= 9.38 seconds
Rise time=3.14 seconds Peak amplitude= 473
22

PID CONTROLLER MODEL

We have implemented the control blocks and make a feedback control system as follows. We
have implemented our tuned PID block to the system. At the input we have set our desired
speed then the tuned PID block is inserted and then our plant (motor) transfer function is added
and a feedback system is implemented. It reduces the error in the loop and gives the desired
response. The Simulink model is shown below:

3.2- DIFFERENT PLOTS BY VARYING PID

PLOT BEFORE TUNNING


23

After changing the values of P, I, PI, PD and PID we have find out some responses which is
given below:

By changing P:

This is showing that the step response of DC motor is an UNDER DAMPED RESPONSE

By changing I:

This is showing that the step response of DC motor is a CRITICALLY DAMPED


RESPONSE

By changing PI:

This is showing that the step response of DC motor is an OVER DAMPED RESPONSE
24

By changing PD:

This is showing that the step response of DC motor is an UNDER DAMPED RESPONSE

By changing PID:

This is showing that the step response of DC motor is an UNDER DAMPED RESPONSE

PLOT AFTER TUNNING


25

By changing the values of P, I, PI, PD and PID accordingly, we are able to reduced the under
damped response significantly after the tuning. It is noticeable that before tuning there were
oscillations which make a response under damped but after then applying the certain values, we
tried to reduced the under damped response as much as it was able.

3.3- STABILITY ANALYSIS BY ROUTH CRITERIA:

In control system theory, the Routh–Hurwitz stability criterion is a mathematical test


that is a necessary and sufficient condition for the stability of a linear time invariant (LTI)
control system. The Routh test is an efficient recursive algorithm to determine whether all the
roots of the characteristic polynomial of a linear system have negative real parts or are in the
right half plane of the complex plane.
The importance of the criterion is that the roots s of the characteristic equation of a
linear system with negative real parts represents solutions 𝒆𝒔𝒕 of the system that are stable
(bounded).
Thus the criterion provides a way to determine if the equations of motion of a linear
system have only stable solutions, without solving the system directly.
The analysis is done by drawing a table known as Routh table and then the stability is analyzed
by seeing the sign changing.
We will implement the Routh criteria on our transfer function in order to analyze its stability.
The transfer function of our closed loop tuned feedback system is:

2645
--------------------------------
𝑠2 + 4.976 s + 7.496

The Routh table is formed as:

𝑠2 1 7.496
𝑠1 4.976 0
𝑠0 7.469 0

There are no sign changing in the first column of the table this means that there are no
poles of the system in the right half plane and hence the system is stable. All the poles that are
2 poles of the system are in left half plane making the system as stable.

3.4 - ROOT LOCUS POINT FOR STABILITY ANALYSIS:

The transient response of a system plays an important role in the design of a control
system. The nature of the transient response is determined by the location of poles of the closed
loop system. Usually, the loop gain of the system is adjustable and the value of this gain
determines the location of poles of the closed loop system. It will be very informative, if one
26

can determine how these poles change their location as the gain is increased. The locus of these
roots as one parameter of the system, usually the gain, is varied over a wide range is known as
the root locus plot of the system.

METHOD
In Root locus technique, the locus of the roots of the characteristic equation is plotted for all
values of the parameter. Once the complete locus is obtained, all the roots for a given value of
the parameter can be determined. The method can be developed assuming that the gain is the
variable parameter and it can be varied from zero to infinity.

PLOTS BY VARYING GAIN


FOR K =1:

FOR K = 10:
27

FOR K =50:

3.5 - STABILTY ANALYSIS BY BODE POLTS:


Bode plot is a graph of frequency response of the system. It is usually a combination of
Bode magnitude plot expressing magnitude in decibels and Bode phase plot expressing the
phase shift. Both quantities are plotted against a horizontal axis proportional to the logarithm of
frequency. The logarithmic scale allows us to use the wide range of frequencies unlike the
linear scale.
Bode plots are widely used in stability analysis of the open loop and closed loop control
systems. The plots are useful as we can directly comment on the stability of system by these
plots without doing the long calculations. The stability is analyzed through the phase margins
and gain margins and their associated conditions.
We will implement the bode plot stability criterion on our system response. Firstly we
will implement it on our motor response and then on our closed loop feedback system. The plot
will be achieved through a simple command in MATLAB i.e. Bode (tf) where tf is our system’s
transfer function. To analyze the stability status we will use the stability margins option in the
MATLAB and hence came to know whether the system is stable or not.

BODE PLOT OF MOTOR


The bode plot of motor by applying transfer function in a system is as follows:
28

It is shown on the plot that the system is stable. Conclusively in this chapter we have applied
different control and stability approaches on our motor response.

CONCULSION
In above complex engineering problem, we analyzed DC motor speed response through
IR speed sensor under a constant input voltage, and found out the transfer function of DC
motor by estimating electrical and mechanical parameters. We implemented our theoretical
knowledge to this practical work and carried out some observations by obtaining the graph of
DC motor. Moreover we got different responses of motor like under damped, over damped,
undamped etc, by changing some parameters. Also we did the same approaches by adding
gears at the shaft of the motor to control different speed levels.
29

APPENDICES

ARDIUNO CODE

int sensorvalue;
int state1 = HIGH;
int state2;
float rps;
float rpm;
long prevMillis = 0;
long interval = 100;
long currentTime;
long prevTime = 1;
long diffTime;
int sensorthreshold = 40;
int i=0;
// this value indicates the limit reading between dark and light,
// it has to be tested as it may change acording to the
// distance the leds are placed.
// to see what number is good, check the sensorvalue variable value
// as printed out in the serial monitor

void setup()
{
Serial.begin(9600);
//pinMode(2,INPUT); // assign pin 13 led as indicator because we cannot
se the IR light
Serial.println("CLEARDATA");
Serial.println("LABEL,Date,Time,seconds,RPM");

// Get true random value from Excel to feed into RandomNumberGenerator from
Arduino (randomSeed())
Serial.println("RPM");
}
void loop()
30

{
sensorvalue = analogRead(0); // read from pin 0
if(sensorvalue < sensorthreshold)
state1 = HIGH;
else
state1 = LOW;
// digitalWrite(2,state1); // as iR light is invisible for us, the led on
pin 13
// indicate the state of the circuit.

if(state2!=state1){ //counts when the state change, thats from (dark to


light) or
//from (light to dark), remember that IR light is invisible to us.
if (state2>state1){
currentTime = micros(); // Get the arduino time in microseconds
diffTime = currentTime - prevTime; // calculate the time diff from the last
meet-up
rps = 1000000/diffTime; // calculate how many rev per second, good to know
rpm = 60000000/diffTime; // calculate how many rev per minute

unsigned long currentMillis = millis();

// print to serial at every interval - defined at the variables declaration


if(currentMillis - prevMillis > interval){ // see if now already an interval
long
prevMillis = currentMillis;
i=i+1;
Serial.print(rps); Serial.print(" rps "); Serial.print(rpm);
Serial.println(" rpm");
Serial.println( (String) "DATA,DATE,TIME," + i + "," + rpm );

delay(100);
}

prevTime = currentTime;
}
31

state2 = state1;
}

/*
//only for testing to determine the sensorthreshold value
delay(500);
Serial.println(sensorvalue);
*/
}
BODE PLOT CODE

% clear everything
close all
clear all
clc

%Example Transfer Function: G(s)= 2645/s2+4.976s+7.496

%Numerator
num = [2645];
%Denominator
den = [1 4.976 7.496];

%Transfer Function
G = tf(num, den)

%Plot Frequency Response


bode(G),
grid
32

REFERENCES

Link: https://medium.com/@islamnegm/quick-start-to-simple-daq-system-using-
plx-daq-excel-arduino-d2457773384b

Link: https://www.mathworks.com/help/sldo/examples/dc-servo-motor-parameter-
estimation.html

Link: https://www.mathworks.com/videos/series/using-bode-plots-95148.html

Das könnte Ihnen auch gefallen