Вы находитесь на странице: 1из 39

Ex. No.

8(a) Study of Encoder


Date:

Aim:

To study the encoder function using IC 74147.

Study:

An encoder is a device used to change a signal (such as a bit stream) or data into a code.
The code may serve any of a number of purposes such as compressing information for
transmission or storage, encrypting or adding redundancies to the input code, or translating from
one code to another. This is usually done by means of a programmed algorithm, especially if any
part is digital, while most analog encoding is done with analog circuitry.

SINGLE BIT 4 TO 2 ENCODER

A single bit 4 to 2 encoder takes in 4 bits and outputs 2 bits. It is assumed that there are only 4
types of input signals these are : 0001, 0010, 0100, 1000.

I3 I2 I1 I0 O1 O0
0 0 0 1 0 0
0 0 1 0 0 1
0 1 0 0 1 0
1 0 0 0 1 1
4 to 2 encoder
PRIORITY ENCODER

A priority encoder prioritizes more significant bits in the data stream, and once it finds a high
signal will ignore all other bits. An example of a single bit 4 to 2 encoder is shown.

I3 I2 I1 I0 O1 O0
0 0 0 d 0 0
0 0 1 d 0 1
0 1 d d 1 0
1 d d d 1 1
4 to 2 priority encoder

Result:

Thus the Encoder is studied using IC 74147


Ex. No.8(b) Study of Decoder
Date:

Aim:

To study the decoder function using IC 74147.

Study:

DECODER

A decoder is a device which does the reverse of an encoder, undoing the encoding so that
the original information can be retrieved. The same method used to encode is usually just
reversed in order to decode.

In digital electronics this would mean that a decoder is a multiple-input, multiple-output


logic circuit that converts coded inputs into coded outputs, where the input and output codes are
different. e.g. n-to-2n, BCD decoders.

Enable inputs must be on for the decoder to function, otherwise its outputs assume a
single "disabled" output code word. Decoding is necessary in applications such as data
multiplexing, 7 segment display and memory address decoding.

The simplest decoder circuit would be an AND gate because the output of an AND gate is
"High" (1) only when all its inputs are "High".

Example: A 2-to-4 Line Single Bit Decoder

A slightly more complex decoder would be the n-to-2n type binary decoders. These type of
decoders are combinational circuits that convert binary information from 'n' coded inputs to a
maximum of 2n unique outputs. We say a maximum of 2n outputs because in case the 'n' bit coded
information has unused bit combinations, the decoder may have less than 2n outputs. We can
have 2-to-4 decoder, 3-to-8 decoder or 4-to-16 decoder. We can form a 3-to-8 decoder from two
2-to-4 decoders (with enable signals).

A 2-to-4 line decoder/demultiplexer is shown below.

As a decoder, this circuit takes an n-bit binary number and produces an output on one of
2n output lines. It is therefore commonly defined by the number of addressing input lines and
the number of data output lines. Typical decoder/demultiplexer ICs might contain two 2-to-4
line circuits, a 3-to-8 line circuit, or a 4-to-16 line circuit. One exception to the binary nature
of this circuit is the 4-to-10 line decoder/demultiplexer, which is intended to convert a BCD
(Binary Coded Decimal) input to an output in the 0-9 range.

If you use this circuit as a demultiplexer, you may want to add data latches at the
outputs to retain each signal while the others are being transmitted.

Result:

Thus the Decoder is studied using IC 74147


STABILITY ANALYSIS ROOTLOCUS TECHNIQUES
EX:8(a)
DATE:
AIM:
To plot the root locus for a given transfer function of the system using MATLAB.
SOFTWARE REQUIRED:
 Matlab Software

THEORY:
The root locus technique in control system was first introduced in the year 1948 by Evans. Any
physical system is represented by a transfer function in the form of

We can find poles and zeros from G(s). The location of poles and zeros are crucial keeping view
stability, relative stability, transient response and error analysis. When the system put to service
stray inductance and capacitance get into the system, thus changes the location of poles and
zeros. In root locus technique in control system we will evaluate the position of the roots, their
locus of movement and associated information. These information will be used to comment upon
the system performance.
1. Characteristic Equation Related to Root Locus Technique : 1 + G(s)H(s) = 0 is
known as characteristic equation. Now on differentiating the characteristic equation and on
equating dk/ds equals to zero, we can get break away points.
2. Break away Points : Suppose two root loci which start from pole and moves in opposite
direction collide with each other such that after collision they start moving in different
directions in the symmetrical way. Or the break away points at which multiple roots of the
characteristic equation 1 + G(s)H(s)= 0 occur. The value of K is maximum at the points where
the branches of root loci break away. Break away points may be real, imaginary or complex.
3. Break in Point : Condition of break in to be there on the plot is written below : Root
locus must be present between two adjacent zeros on the real axis.
4. Centre of Gravity : It is also known centroid and is defined as the point on the plot from
where all the asymptotes start. Mathematically, it is calculated by the difference of summation
of poles and zeros in the transfer function when divided by the difference of total number of
poles and total number of zeros. Centre of gravity is always real and it is denoted by σ A.

Where,
N is number of poles and M is number of zeros.
5. Asymptotes of Root Loci : Asymptote originates from the center of gravity or centroid
and goes to infinity at definite some angle. Asymptotes provide direction to the root locus
when they depart break away points.
6. Angle of Asymptotes : Asymptotes makes some angle with the real axis and this angle

can be calculated from the given formula,


7. Where,p=0,1,2......(N-M-1)N is the total number of poles
M is the total number of zeros.
8. Angle of Arrival or Departure : We calculate angle of departure when there exists
complex poles in the system. Angle of departure can be calculated as 180-{(sum of angles to a
complex pole from the other poles)-(sum of angle to a complex pole from the zeros)}.
9. Intersection of Root Locus with the Imaginary Axis : In order to find out the point of
intersection root locus with imaginary axis, we have to use Routh Hurwitz criterion. First, we
find the auxiliary equation then the corresponding value of K will give the value of the point
of intersection.
10. Gain Margin : We define gain margin as a by which the design value of the gain factor
can be multiplied before the system becomes unstable. Mathematically it is given by the

formula
11. Phase Margin : Phase margin can be calculated from the given formula:

12. Symmetry of Root Locus : Root locus is symmetric about the x axis or the real axis.
How to determine the value of K at any point on the root loci? Now there are two ways of
determining the value of K, each way is described below.
1. Magnitude Criteria : At any points on the root locus we can apply magnitude criteria as,

Using this formula we can calculate the value of K at any desired point.
2. Using Root Locus Plot : The value of K at any s on the root locus is given by

PROGRAM:
Draw the root locus for the given transfer function

h = tf([2 5 1],[1 2 3]) indicates the transfer function


rlocus(h)
Displays the root locus for the transfer function

\
To display the root locus for the transfer function
h=tf(50,[1 9 30 40])

Transfer function:
50
-----------------------
s^3 + 9 s^2 + 30 s + 40

>> rlocus(h)
Result:
STABILITY ANALYSIS BODE PLOT TECHNIQUES
EX:8(B)
DATE:

AIM:
To plot the bode graph for a given transfer function of the system using MATLAB.

SOFTWARE REQUIRED:
 Matlab Software

THEORY:
The Bode plot is a frequency response plot of the siusoidal transfer function of a system.
A plot consists of two graphs. One is a plot of the magnitude of a sinusoidal transfer function
versus log w.The other is a plot of the phase angle of a sinusoidal transfer function versus log w.
The Bode plot can be drawn for both open loop and closed loop system.Usually the bode plot is
drawn for open loop system.The standard representation of the logarithmic magnitude of open
loop transfer function of G(jw) is 20 log G(jw) where the base of the logarithm is 10. The unit
used in this representation of the magnitude is the decibel, usually abbrevated as db. The curves
are drawn on semilog paper, using the log scale(abcissa) for frequency and the linear scale
(ordinate) for either magnitude (in decibels) or phase angle (in degrees). The main advantage of
the bode plot is that multiplication of magnitudes can be converted into addition.
Example:

For this example, the design requirements are:


 Rise time of less than 0.5 seconds
 Steady-state error of less than 5%
 Overshoot of less than 10%
 Gain margin greater than 20 dB
 Phase margin greater than 40 degrees
Open Control System Designer
At the MATLAB® command line, create a transfer function model of the plant, and open Control System
Designer in the Bode Editor configuration.
G = tf(1.5,[1 14 40.02]);
controlSystemDesigner('bode',G);
The app opens and imports G as the plant model for the default control architecture, Configuration 1.
In the app, the following response plots open:
 Open-loop Bode Editor for the LoopTransfer_C response. This response is the open-loop
transfer function GC, where C is the compensator and G is the plant.
 Step Response for the IOTransfer_r2y response. This response is the input-output transfer
function for the overall closed-loop system.
Tip

To open the open-loop Bode Editor when Control System Designer is already open, on
the Control System tab, in the Tuning Methods drop-down list, select Bode Editor. In the
Select Response to Edit dialog box, select an existing response to plot, or create a New
Open-Loop Response.
To view the open-loop frequency response and closed-loop step response simultaneously, on
the Views tab, click Left/Right.

The app displays the Bode Editor and Step Response plots side-by-side.
Adjust Bandwidth
Since the design requires a rise time less than 0.5 seconds, set the open-loop DC crossover frequency to
about 3 rad/s. To a first-order approximation, this crossover frequency corresponds to a time constant of
0.33 seconds.
To make the crossover easier to see, turn on the plot grid. Right-click the Bode Editor plot area, and
select Grid. The app adds a grid to the Bode response plots.
To adjust the crossover frequency increase the compensator gain. In the Bode Editor plot, in
the Magnitude response plot, drag the response upward. Doing so increases the gain of the
compensator.
As you drag the magnitude plot, the app computes the compensator gain and updates the response plots.
Drag the magnitude response upward until the crossover frequency is about 3 rad/s.
View Step Response Characteristics
To add the rise time to the Step Response plot, right-click the plot area, and
select Characteristics > Rise Time.
To view the rise time, move the cursor over the rise time indicator.
The rise time is around 0.23 seconds, which satisfies the design requirements.
Similarly, to add the peak response to the Step Response plot, right-click the plot area, and
select Characteristics > Peak Response.
The peak overshoot is around 3.5%.
Add Integrator To Compensator
To meet the 5% steady-state error requirement, eliminate steady-state error from the closed-loop step
response by adding an integrator to your compensator. In the Bode Editor right-click in the plot area, and
select Add Pole/Zero > Integrator.
Adding an integrator produces zero steady-state error. However, changing the compensator dynamics
also changes the crossover frequency, increasing the rise time. To reduce the rise time, increase the
crossover frequency to around 3 rad/s.
Adjust Compensator Gain
To return the crossover frequency to around 3 rad/s, increase the compensator gain further. Right-click
the Bode Editor plot area, and select Edit Compensator.
In the Compensator Editor dialog box, in the Compensator section, specify a gain of 99, and
press Enter.
The response plots update automatically.
The rise time is around 0.4 seconds, which satisfies the design requirements. However, the peak
overshoot is around 32%. A compensator consisting of a gain and an integrator is not sufficient to meet
the design requirements. Therefore, the compensator requires additional dynamics.
Add Lead Network to Compensator
In the Bode Editor, review the gain margin and phase margin for the current compensator design. The
design requires a gain margin greater than 20 dB and phase margin greater than 40 degrees. The current
design does not meet either of these requirements.
To increase the stability margins, add a lead network to the compensator.
In the Bode Editor, right-click and select Add Pole/Zero > Lead.
To specify the location of the lead network pole, click on the magnitude response. The app adds a real
pole (red X) and real zero (red O) to the compensator and to the Bode Editor plot.
In the Bode Editor, drag the pole and zero to change their locations. As you drag them, the app updates
the pole/zero values and updates the response plots.
To decrease the magnitude of a pole or zero, drag it towards the left. Since the pole and zero are on the
negative real axis, dragging them to the left moves them closer to the origin in the complex plane.

Tip

As you drag a pole or zero, the app displays the new value in the status bar, on the right
side.

As an initial estimate, drag the zero to a location around -7 and the pole to a location around -11.
The phase margin meets the design requirements; however, the gain margin is still too low.
Edit Lead Network Pole and Zero
To improve the controller performance, tune the lead network parameters.
In the Compensator Editor dialog box, in the Dynamics section, click the Lead row.
In the Edit Selected Dynamics section, in the Real Zero text box, specify a location of -4.3, and
press Enter. This value is near the slowest (left-most) pole of the DC motor plant.
In the Real Pole text box, specify a value of -28, and press Enter.
When you modify a lead network parameters, the Compensator and response plots update
automatically.
In the app, in the Bode Editor, the gain margin of 20.5 just meets the design requirement.
To add robustness to the system, in the Compensator Editor dialog box, decrease the compensator gain
to 84.5, and press Enter. The gain margin increases to21.8, and the response plots update.
In Control System Designer, in the response plots, compare the system performance to the design
requirements. The system performance characteristics are:
 Rise time is 0.445 seconds.
 Steady-state error is zero.
 Overshoot is 3.39%.
 Gain margin is 21.8 dB.
 Phase margin is 65.6 degrees.
The system response meets all of the design requirements.
EX:9
DATE:
LEAD,LAG,LEAD-LAG COMPENSATOR FOR AIRCRAFT
DYNAMICS
AIM:
To Design lead, lag, lead-lag compensator for aircraft dynamics
SOFTWARE REQUIRED:
Matlab software 7.0 and above
THEORY:
Lead compensation

We specifically need to shift the root locus more to the left in the complex plane to get it inside
our desired region. One way to do this is to employ a lead compensatorThe transfer function of a
typical lead compensator is the following, where the zero is smaller than the pole, that is, it is
closer to the imaginary axis in the complex plane.

(3)

Before we begin designing the lead compensator, we need to configure the SISO Design Tool to
have a compensator parameterization corresponding to the one shown above. This can be
accomplished by clicking on the Edit menu at the top of the Control and Estimation Tools
Manager window. Then choose SISO Tool Preferences, and from the Options tab of the
resulting window, select a Zero/pole/gain parameterization as shown below.
We will choose to place the zero of our lead compensator on the real axis on the semicircle
defined by our rise time requirement, z = -0.9. This will ensure that as the gain K is increased, the
branch of the root locus that approaches that open-loop zero won't exit the desired region.
Furthermore, we will place the pole farther to the left than the zero, as required by the definition
of a lead compensator. To begin with, let p = -3.

Within the SISO Design Tool you can add the lead compensator from under the Compensator
Editor tab of the Control and Estimation Tools Manager window. Specifically, right-click in
the Dynamics section of the window and select Add Pole/Zero > Lead. Then enter the Real
Zero and Real Pole locations as shown in the following figure.
In order to see the effect of moving the pole of the lead compensator, you can enter different
numerical values under the Compensator Editor tab. Any changes in the compensator here will
be reflected in the root locus plot. Alternatively, you can tune the compensator graphically
directly from the root locus plot. Specifically, if you click on the open-loop pole at -3 (marked by
a red x) you can then slide the pole along the real axis and observe how the root locus plot
changes. Specifically, you should see that as you move the pole to the left, the root locus gets
pulled farther to the left (and further into our desired region). Placing the pole at -30 will
generate the figure shown below.
Right-clicking on the root locus plot and choosing Properties from the resulting
menu, we can change the limits of the graph in order to zoom in on the region of
the root locus nearer to the origin as shown below.
From examination of the two above plots, three of the branches of the root locus clearly pass
through the desired region. The fourth branch on the real axis closer to the origin is not in the
desired region. Even though the closed-loop pole associated with that branch is slower than the
other closed-loop poles, its effect will be canceled somewhat by the closed-loop zero at -0.1541.
The larger the value of the loop gain K employed, the closer this closed-loop pole will be to the
closed-loop zero and the less effect it will have. The locations of the closed-loop poles for the
current value of the loop gain (in the above figures K = 33.3) are indicated by the pink boxes on
the root locus. The closed-loop pole located farthest to the left will have minimal effect on the
transient response of the system since it is significantly faster than the other closed-loop poles.
In order to see the explicit effect of the zeroes and higher-order poles, we will need to examine
the closed-loop step response. This can be done within the SISO Tool, specifically, from under
the Analysis Plots tab of the Control and Estimation Tools Manager. Once you have clicked
on this tab, choose Step from the drop-down menu under Plot 1 of the Analysis Plots section of
the window and select Closed loop r to y from under the Contents of Plots section of the
window as shown below.

Then by clicking the Show Analysis Plot button a window entitled LTI Viewer for SISO
Design Task displaying the system's closed-loop step response will open. You can also identify
some characteristics of the step response. Specifically, right-click on the figure and under
Characteristics choose Settling Time. Then repeat for Rise Time. Your figure will appear as
shown below.
From the above, we can see that for the current value of gain K the settling time and rise time are
both too large. Let's attempt to modify the loop gain graphically by clicking on one of the pink
boxes on the root locus and dragging the box along the locus in the direction of increasing K. As
you do this, the step response plot will automatically update. The effect of increasing K to a
value of 200 will be that the two slowest closed-loop poles will approach closed-loop zeros
thereby making their effect minimal. The next slowest pole moves to the left in the complex
plane with increasing K which has the effect of reducing both the settle time (increased ) and
the rise time (increased ). A loop gain of K = 200 keeps all of the poles on the real-axis,
leading to no overshoot and the presence of the integrator in the plant guarantees zero steady-
state error. Therefore, this controller meets all of the given requirements as shown in the figure
below.
Lag or phase-lag compensator using frequency response

A first-order phase-lag compensator also can be designed using a frequency response approach.
A lag compensator in frequency response form is given by the following.

(9)

The phase-lag compensator looks similar to phase-lead compensator, except that a is now less
than 1. The main difference is that the lag compensator adds negative phase to the system over
the specified frequency range, while a lead compensator adds positive phase over the specified
frequency. A Bode plot of a phase-lag compensator has the following form.

The two corner frequencies are at 1 / T and 1 / aT. The main effect of the lag compensator is
shown in the magnitude plot. The lag compensator adds gain at low frequencies; the magnitude
of this gain is equal to a. The effect of this gain is to cause the steady-state error of the closed-
loop system to be decreased by a factor of a. Because the gain of the lag compensator is unity at
middle and high frequencies, the transient response and stability are generally not impacted
much.

The side effect of the lag compensator is the negative phase that is added to the system between
the two corner frequencies. Depending on the value a, up to -90 degrees of phase can be added.
Care must be taken that the phase margin of the system with lag compensation is still
satisfactory. This is generally achieved by placing the frequency of maximum phase lag, wm as
calculated below, well below the new gain crossover frequency.

(10)

In MATLAB, a phase-lag compensator C(s) in frequency response form is implemented using


the following code, again assuming that a andT are defined.

s = tf('s');
C_lag = (a*T*s+1)/(a*(T*s+1));

We can again interconnect the compensator with a plant P(s) as follows.

sys_ol = C_lag*P;

Lead-lag compensator using either root locus or frequency response

A lead-lag compensator combines the effects of a lead compensator with those of a lag
compensator. The result is a system with improved transient response, stability, and steady-state
error. To implement a lead-lag compensator, first design the lead compensator to achieve the
desired transient response and stability, and then design a lag compensator to improve the steady-
state response of the lead-compensated system.

RESULT:
Ex. No.10 Augmented Experiment
Date:

Вам также может понравиться