Matrices and Arrays:



SIXTH SEMESTER

LINEAR CONTROL SYSTEMS

COMPUTER SIMULATION LAB/ MACHINE & CONTROL LAB

DEPARTMENT OF ELECTRICAL ENGINEERING

Prepared By: Checked By: Approved By:

Engr. Saqib Riaz Engr. Nasim Khan Dr.Noman Jafri

Lecturer (Lab) Electrical, Senior Lab Engineer Electrical, Dean,

FUUAST-Islamabad F UUAST-I slamabad FUUAST-Islamabad

|Name:___________________________________________ |

|Registration No:__________________________________ |

|Roll No: _________________________________________ |

|Semester: _______________________________________ |

|Batch: __________________________________________ |

|S.No. |Experiment Name |

|1 |Introduction to Matlab (Software) |

|2 |Laplace & Inverse Laplace Transformation also find the Transfer Function & Pole Zero Map of the Transfer Function|

|3 |LTI Models (Software) / Operation on LTI (Software) |

|4 |Characteristics of Control System (Software) |

|5 |Closed Loop Motor Speed Control (Hardware) (DC Servo Motor) |

|6 |Closed Loop Position Controller (Hardware) (DC Servo Motor) |

|7 |Introduction to Robopro Software and To Drive Motor Using Time Delay and Limiting Switch (Hardware) (RoboPro) |

|8 |PID Controller (Software) |

|9 |Simulink Basics (Software) |

|10 |Root Locus and Bode Plot (Software) |

|11 |Introduction To PLC and Motor Control Program (Hardware) |

|12 |Water Level Control System (Hardware) |

|13 |Introduction to Analog Modules AnM-04 |

|14 |Response Analysis first order system using Analog Modules AnM-04 |

|15 |Response Analysis of second order system using Analog Modules AnM-04 |

|16 |Project |

Experiment List Linear Control System

Experiment # 1

|Introduction to Matlab |

Objective:

To learn the basic operation/code in the MATLAB

01: Finding roots of equation and making of equation from roots?

1.01:

>> p= [1 3 0 4]

p = 1 3 0 4

>> r=roots (p)

r =

-3.3553

0.1777 + 1.0773i

0.1777 - 1.0773i

1.02:

>> p=ploy(r)

>> p=poly(r)

p =

1.0000 3.0000 0.0000 4.0000

1.03:

>> r= [1 2]

r =

1 2

>> p=poly(r)

p =

1 -3 2

>> r= [1 1 1 1 1]

r =

1.04:

>> r= [1 1 1 1 1]

r =

1 1 1 1

>> p=poly(r)

p =

1 -5 10 -10 5 -1

02: Multiplication of two polynomials equation?

>> p= [3 2 0 1];

>> q= [1 2];

>> n=con (p , q)

n =

3 8 4 1 2

03: Defining value in a equation?

>> p= [3 2 0 1];

>> q= [1 4];

>>value= polyval (p , 2)

Value =

33

>>value=polyval(n,2)

value =

132

04: Obtaining digits in power form?

>>sqrt(7)

ans =

2.6458

>>sqrt(sym(7))

ans =

7^(1/2)

05: Finding derivative and use of syms command for defining variable?

5.01:

>>sym(3/8)

ans =

3/8

5.02:

>>syms x y

>> f=exp(x*y)

f =

exp(x*y)

>>diff(f)

ans =

y*exp(x*y)

>>diff(f,x)

ans =

y*exp(x*y)

>>diff(f,y)

ans =

x*exp(x*y)

>>diff(f,x,2)

ans =

y^2*exp(x*y)

5.03: Use of pretty command?

>>syms x y z

>> z=2*sin(2*x*y)SS

z =

2*sin(2*x*y)

>>diff(z,x,2)

ans =

-8*sin(2*x*y)*y^2

>>diff(z,y,2)

ans =

-8*sin(2*x*y)*x^2

>>syms x y z t

>> f=2*exp(-t)-2*exp(-2*t)

f =

2*exp(-t)-2*exp(-2*t)

>>pretty(f)

2 exp(-t) - 2 exp(-2 t)

Spring mass system Model:

Write the Mathematical model simulation of spring mass damper system using MATLAB?

Equation of the system is:

Md²y/dt² + bdy/dt +kyº = r(t)

And

Y(t)= y(0)/(√1-ξ²)* e^(-jwnt) * sin(wn√1-ξ²+θ)

Case 1:

y(0)=0.15m,,wn=√2sec; k/m=2; b/m=3; ξ=3/2√2.

Case 2:

y(0)=0.15m,,wn=√2sec; k/m=2; b/m=1; ξ=1/2√2.

>> y0=0.15;

>>wn=sqrt(2);

>> zeta1=3/(2*sqrt(2));

>> zeta2=1/(2*sqrt(2));

>> t=[0:0.1:10];

>> t1=acos(zeta1)*ones(1,length(t));

>> t2=acos(zeta2)*ones(1,length(t));

>> c1=y0/sqrt(1-zeta1^2);

>> c2=y0/sqrt(1-zeta2^2);

>> y1=c1*exp(-zeta1*wn*t).*sin(wn*sqrt(1-zeta1^2)*t+t1);

>> y2=c2*exp(-zeta2*wn*t).*sin(wn*sqrt(1-zeta2^2)*t1+t2);

>>plot(t,y1,'-',t,y2,'--')

>>bu=c2*exp(-zeta2*wn*t);

>>plot(t,y1,'-',t,y2,'--',t,bu,':')

>>bl=-bu;

>> plot(t,y1,'-',t,y2,'--',t,bu,':',t,bl,':')

Exercise:

Q-01: Write a program in MATLAB to solve Spring Mass Damper System for damping factor greater than 1?

Q-02: To plot sin(x) and cos(x) where x=-Pi: pi/20: Pi writes MATLAB code to plot in time domain and frequency domain and also labels, title and limit the axis?

Q-03: Also write MATLAB code to plot above two functions using subplot technique?

Experiment # 2

|Laplace & Inverse Laplace Transformation also find the Transfer Function & Pole Zero Map of the Transfer Function |

Objective:

To know the Laplace, Inverse Laplace, LTI models and delays.

Laplace and inverse Laplace:

L = laplace(F) is the Laplace transform of the scalar symbol F with default independent variable t. The default return is a function of s. The Laplace transform is applied to a function of t and returns a function of s.

f (t) = t4

>>syms t;

>>f=t^4;

>>laplace(f)

F =

24/s^5

F = ilaplace(L) is the inverse Laplace transform of the scalar symbolic object L with default independent variable s. The default return is a function of t. The inverse Laplace transform is applied to a function of s and returns a function of t.

LTI models:

The Control System Toolbox software provides customized data structures, known as LTI model objects, for each type of model: tf, zpk, ss, and frd. These LTI model objects encapsulate the model data. They allow you to manipulate LTI systems as single entities rather than collections of data vectors or matrices.

Depending on the type of model you use, the data for your model can include:

• One or more numerator/denominator pairs for transfer functions

• Zeros and poles for zero-pole-gain models

• Transfer function Models:

A continuous-time transfer function in polynomial form is given by:

Create a transfer function model in polynomial form using:

>>G = tf(num,den)

For example, create the transfer function G(s) = s/(s2 + 2s + 1), using:

>>G = tf([1 0],[1 2 1]);

ZPK Model:

A continuous-time transfer function in factorized (zero-pole-gain) form is given by:

Create transfer functions in factorized (zpk) form using:

>>G = zpk(z, p, k)

For example, the transfer function G(s) = s/(s2 + 2s + 1) in factorized form is given by:

>>G = zpk([0],[-1 -1],[1]);

To create the two-input, one-output MIMO transfer function.

>>g11 = tf([1 -1],[1 1]);

>>g21 = tf([1 2],[1 4 5]);

>>G = [g11; g21];

>>zpk(G)

>> g=tf(num,dnum)

Transfer function:

s + 3

-------------

s^2 + 3 s + 2

>> zpk(g)

Zero/pole/gain:

(s+3)

-----------

(s+2) (s+1)

>> h=zpk([-3],[-1 -2],1)

Zero/pole/gain:

(s+3)

-----------

(s+1) (s+2)

>> h=>> z=[-3];

>> p=[-1 -2];

>> k=[1];

zpk(z,p,k)

Zero/pole/gain:

(s+3)

-----------

(s+1) (s+2)

>> pole(g)

ans =

-2

-1

>> zero(g)

ans =

-3

>> zpk(g)

Zero/pole/gain:

(s+3)

-----------

(s+2) (s+1)

>> h=zpk(g)

Zero/pole/gain:

(s+3)

-----------

(s+2) (s+1)

>> tf(h)

Transfer function:

s + 3

-------------

s^2 + 3 s + 2

>> [n,d]=tfdata(g)

n =

[1x3 double]

d =

[1x3 double]

>> [n,d]=tfdata(g,'v')

n =

0 1 3

d =

1 3 2

>> [z,p,k]=zpkdata(g,'v')

z =

-3

p =

-2

-1

k =

1

>> h=zpk(g)

Zero/pole/gain:

(s+3)

-----------

(s+2) (s+1)

>> f=tf(h)

Transfer function:

s + 3

-------------

s^2 + 3 s + 2

>> sys=tf(1,[1 3],'inputname','voltage','outputname','current','note','basic electronic circuit')

Transfer function from input "voltage" to output "current":

1

-----

s + 3

>> sys

Transfer function from input "voltage" to output "current":

1

-----

s + 3

>> set(sys,'iodelay',0.3)

>> sys

Transfer function from input "voltage" to output "current":

1

exp(-0.3*s) * -----

s + 3

>> set(sys)

num: Ny-by-Nu cell of row vectors (Nu = no. of inputs)

den: Ny-by-Nu cell of row vectors (Ny = no. of outputs)

Variable: [ 's' | 'p' | 'z' | 'z^-1' | 'q' ]

Ts: Scalar (sample time in seconds)

ioDelay: Ny-by-Nu array (I/O delays)

InputDelay: Nu-by-1 vector

OutputDelay: Ny-by-1 vector

InputName: Nu-by-1 cell array of strings

OutputName: Ny-by-1 cell array of strings

InputGroup: M-by-2 cell array for M input groups

OutputGroup: P-by-2 cell array for P output groups

Notes: Array or cell array of strings

UserData: Arbitrary

Type "ltiprops tf" for more details.

>> get(sys)

num: {[0 1]}

den: {[1 3]}

Variable: 's'

Ts: 0

ioDelay: 0.3

InputDelay: 0

OutputDelay: 0

InputName: {'voltage'}

OutputName: {'current'}

InputGroup: [1x1 struct]

OutputGroup: [1x1 struct]

Notes: {'basic electronic circuit'}

UserData: []

>> sys=tf([1 3],[1 3 2],'inputname','voltage','outputname','current','note','basic electronic circuit')

Transfer function from input "voltage" to output "current":

s + 3

-------------

s^2 + 3 s + 2

>> [z,p,k]=tf2zpk(num,dnum)

z =

0

-3

p =

-2

-1

k =

1

>> [n,d]=zp2tf(z,p,k)

n =

1 3 0

d =

1 3 2

Data Retrieval:

The output arguments num and den assigned to tfdata and z, p, k assigned to zpkdata are cell arrays. These cell arrays have as many rows as outputs, as many columns as inputs. The data can be retrieved from any of the LTI model.

>>h=tf([1 3],[1 2 5]);

>>g=zpk(h);

>>[num,den]=tfdata(sys);

>>[num,den]=tfdata(sys,’v’)

>>[z,p,k,Ts]=zpkdata(sys,’v’)

LTI Model Properties:

The various piece of information that can be attached to the TF or ZPK objects.

>>sys=tf(1,[1 1]);

>>set(sys,’inputname’,’Energy’,’outputname’,’Temperat ure’,’notes’,’A Simple Heater Model’)

>>get(sys,’notes’)

>>get(sys)

Model Conversion:

Model conversion from one tf model to zpk model or zpk model to tf model can be done from following commands.

>> sys = tf(num, den) ;

>>sys = zpk(sys)

Delay:

Delay can be introduced on input or output side of the transfer function as

H(s)=( e-0.25s )(10/s2+3s+10)

>>num=[0 10];

>>den=[1 3 10];

>>y=tf(num,den,’inputdelay’,0.25);

N0#01

Laplace Transform

1.01:

>>syms t

>> f=t

f =t

>> F=laplace(f)

F =1/s^2

1.02:

>> f=t^4

f = t^4

>> F=laplace(f)

F =24/s^5

1.03:

>> f=exp(-5*t);

>> F=laplace(f)

F =1/(s+5)

1.04:

>> f=2*exp(-5*t);

>> F=laplace(f)

F =2/(s+5)

1.05:

>> f=2*exp(2*t);

>> F=laplace(f)

F =2/(s-2)

1.06:

>> f=2*exp(-2*t)-2*exp(-t)

f =2*exp(-2*t)-2*exp(-t)

>> F=laplace(f)

F =2/(s+2)-2/(1+s)

1.07:

>>syms t e w

>> f=sin(w*t)

f =sin(w*t)

>> F=laplace(f)

F =w/(s^2+w^2)

1.08:

>> f=2*sin(2*w*t)

f =2*sin(2*w*t)

>> F=laplace(f)

F =4*w/(s^2+4*w^2)

1.09:

>> f=cos(w/2*t)

f =cos(1/2*w*t)

>> F=laplace(f)

F =s/(s^2+1/4*w^2)

N0#02

Inverse Laplace Transform

2.01:

>> F=1/(s+a)

F =1/(s+a)

>> f=ilaplace(F)

f =exp(-a*t)

2.02:

>> F=1/(s+2)-3/(s+5)+5/(s-3)

F =1/(s+2)-3/(s+5)+5/(s-3)

>> f=ilaplace(F)

f =exp(-2*t)-3*exp(-5*t)+5*exp(3*t)

2.03:

F =24/s^5

>> f=ilaplace(F)

f =t^4

2.04:

>> F=24/s^4

F =24/s^4

>> f=ilaplace(F)

f =4*t^3

2.05:

>> F=4*w/(s^2+4*w^2)

F =4*w/(s^2+4*w^2)

>> f=ilaplace(F)

f =w*(exp(2*(-w^2)^(1/2)*t)-exp(-2*(-w^2)^(1/2)*t))/(-w^2)^(1/2)

>> F=w/2/(s^2+w^2/4)

F =1/2*w/(s^2+1/4*w^2)

>> f=ilaplace(F)

f =w*(1/2*exp(1/2*(-w^2)^(1/2)*t)-1/2*exp(-1/2*(-w^2)^(1/2)*t))/(-w^2)^(1/2)

>> F=s/(s^2+w^2)

F =s/(s^2+w^2)

>> f=ilaplace(F)

f =cos(w*t)

N0#03

Transfer function and stability of system

3.01:

>>syms s

>>num=[6 0 1]

num = 6 0 1

>>den=[1 3 3 1]

den =1 3 3 1

>> TF=tf(num,den)

Transfer function:

6 s^2 + 1

---------------------

s^3 + 3 s^2 + 3 s + 1

Another Same command to find transfer function:

>>printsys(num,den)

num/den =

6 s^2 + 1

---------------------

s^3 + 3 s^2 + 3 s + 1

poles and zero:

>>roots(num)

ans =

0 + 0.4082i

0 - 0.4082i

>>roots(den)

ans =

-1.0000

-1.0000 + 0.0000i

-1.0000 - 0.0000i

Poles and zeros plotting :

>>pzmap(num,den)

3.02:

>>syms s

>>num=[1 1 0]

num = 1 1 0

>>den=[2 1]

den = 2 1

>> TF=tf(num,den)

Transfer function:

s^2 + s

-------

2 s + 1

>>roots(num)

ans = 0 -1

>>roots(den)

ans = -0.5000>>pzmap(num,den)

3.03:

>>syms s

>>num=[1 6 8 ]

num = 1 6 8

>>den=[1 8 23 35 28 3]

den = 1 8 23 35 28

>> TF=tf(num,den)

Transfer function:

s^2 + 6 s + 8

----------------------------------------

s^5 + 8 s^4 + 23 s^3 + 35 s^2 + 28 s + 3

>>roots(num)

ans = -4 -2

>>roots(den)

ans =

-4.0341

-2.0787

-0.8810 + 1.4427i

-0.8810 - 1.4427i

-0.1252

>>pzmap(num,den)

Exercise:

Q-01: Write code for Laplace and inverse Laplace transform?

f(t) = e–at

Q-02: Find the poles & zeros of the following transfer function in the MATLAB?

H(s) = (n1*n2)/(d1*d2*d3)

Where

n1=s+1; n2=s+2;

d1=s+2i; d2=s-2i; d3=s+3;

And also draw pole zero map;

Experiment # 3

|LTI Models/Operation on LTI models |

Objective:

To know operation on LTI models.

Operation on LTI models:

The operations that can be performed on the LTI models are

• Addition of LTI Models.

• Subtraction of LTI Models.

• Multiplication of LTI Models.

• Feedback and Other Interconnection Functions.

• Continuous/Discrete Conversions of LTI Models.

ADDING LTI MODELS:

Adding LTI models is equivalent to connecting them in parallel. Specifically the LTI model

sys = sys1 + sys2

Represents the parallel interconnection shown below.

Where sys1 = 1/(s +2) and sys2 = 2/(s+3)

>>num1=[1 0];

>>den1=[1 2];

>>num2=[0 2];

>>den2=[1 3];

>>sys1=tf(num1,den1);

>>sys2=tf(num2,den2);

Transfer function:

s

-----

s + 2

>> sys2=tf(n2,d2)

Transfer function:

2

-----

s + 3

>> sys=sys1*sys2

Transfer function:

2 s

-------------

s^2 + 4 s + 3

>>sys=sys1+sys2

>> sys = sys1 - sys2

SUBTRACTION OF LTI MODELS:

The subtraction of two LTI models

is depicted by the following block diagram.

MULTIPLCATION OF LTI MODELS:

Multiplication of two LTI models connects them in series. Specifically,

sys = sys1*sys2

returns an LTI model for the series interconnection shown below;

FEEDBACK in LTI Models:

The closed-loop model sys has u as input vector and y as output vector. The LTI models sys1 and sys2 must be both continuous or both discrete with identical.

>>sys = feedback(sys1,sys2)

To apply positive feedback, use the syntax

sys = feedback(sys1,sys2,+1)

>>G = tf([2 5 1],[1 2 3])

>>H = zpk(-2,-10,5)

>>feedback(G,H)

Write the matlab code for Lti models given below

>> n1=[1 0];

>> d1=[1 1];

>> n2=[0 2];

>> d2=[1 3];

>> sys1=tf(n1,d1)

Transfer function:

s

-----

s + 1

>> sys2=tf(n2,d2)

Transfer function:

2

-----

s + 3

>> sys=sys1*sys2

Transfer function:

2 s

-------------

s^2 + 4 s + 3

>> feedback(sys1,sys2)

Transfer function:

s^2 + 3 s

-------------

s^2 + 6 s + 3

>> feedback(sys1,sys2,+1)

Transfer function:

s^2 + 3 s

-------------

s^2 + 2 s + 3

>> feedback(sys1,1)

Transfer function:

s

-------

2 s + 1

>> feedback(1,sys1)

Transfer function:

s + 1

-------

2 s + 1

>> sys=[sys1;sys2]

Transfer function from input to output...

s

#1: -----

s + 1

2

#2: -----

s + 3

>> append(sys1,sys2)

Transfer function from input 1 to output...

s

#1: -----

s + 1

#2: 0

Transfer function from input 2 to output...

#1: 0

2

#2: -----

s + 3

Model interconnection Function:

>>Sys=[sys1,sys2] Horizontal Concatenation

>>Sys=[sys1;sys2] Vertical concatenation

>>Sys=append (sys1,sys2) block diagonal append

Continous/Discreate Conversion Of LTI Models:

The syntax

>>sysd = c2d(sysc,Ts);

Where Ts is the sampling period in seconds

>>sysc=d2c(sysd);

Resampling of Discrete- Time Models:

You can resample a discrete-time TF

>>sys2=d2d(sys1,Ts)

>>H = tf([1 0.4],[1 -0.7]);

>>H1=c2dis(H,0.1)

>>H2=d2d(H1,0.25);

Discretization of system with delays:

P = 10 (e-0.25)/ S2+3s+10

This transfer function can be defined as;

>>Num=10;

>>den=[1 3 10];

>>h=tf(num,den,’input delay’,0.25)

>>hd=c2d(h,0.1)

>> x=0:0.1:2*pi;

>> y=sin(x);

>> z=plot(x,y)

z =

152.0016

>> c2d(sys1,0.1)

Transfer function:

z - 1

----------

z - 0.9048

Sampling time: 0.1

>> n1=[1 0.4]

n1 =

1.0000 0.4000

>> d2=[1 0.6]

d2 =

1.0000 0.6000

>> sys=tf(n1,d1)

Transfer function:

s + 0.4

-------

s + 1

>> c2d(sys,0.1)

Transfer function:

z - 0.9619

----------

z - 0.9048

Sampling time: 0.1

>> sys=sys1*sys2

Transfer function:

2 s

-------------

s^2 + 4 s + 3

>> sys=series(sys1,sys2)

Transfer function:

2 s

-------------

s^2 + 4 s + 3

>> sys=sys1+sys2

Transfer function:

s^2 + 5 s + 2

-------------

s^2 + 4 s + 3

>> sys1/sys2

Transfer function:

s^2 + 3 s

---------

2 s + 2

>> sys1*inv(sys2) ////////// right division

Transfer function:

s^2 + 3 s

---------

2 s + 2

>> inv(sys1)*sys2 /////////////// left division

Transfer function:

2 s + 2

---------

s^2 + 3 s

>> feedback(sys1,sys2)

Transfer function:

s^2 + 3 s

-------------

s^2 + 6 s + 3

>> g=sys1/1+sys1*sys2

Transfer function:

s^3 + 6 s^2 + 5 s

---------------------

s^3 + 5 s^2 + 7 s + 3

>> zero(g)

ans =

0

-5

-1

>> pole(g)

ans =

-3.0000

-1.0000 + 0.0000i

-1.0000 - 0.0000i

>> sys1

Transfer function:

s

-----

s + 1

>> SYS11=tf(n1,d1,0.1)

Transfer function:

z + 0.4

-------

z + 1

Sampling time: 0.1

>> SYS11=c2d(sys1,0.1)

Transfer function:

z - 1

----------

z - 0.9048

Sampling time: 0.1

>> help c2d

C2D Conversion of continuous-time models to discrete time.

SYSD = C2D(SYSC,Ts,METHOD) converts the continuous-time LTI

model SYSC to a discrete-time model SYSD with sample time Ts.

The string METHOD selects the discretization method among the

following:

'zoh' Zero-order hold on the inputs

'foh' Linear interpolation of inputs (triangle appx.)

'imp' Impulse-invariant discretization

'tustin' Bilinear (Tustin) approximation

'prewarp' Tustin approximation with frequency prewarping.

The critical frequency Wc (in rad/sec) is specified

as fourth input by

SYSD = C2D(SYSC,Ts,'prewarp',Wc)

'matched' Matched pole-zero method (for SISO systems only).

The default is 'zoh' when METHOD is omitted.

For state-space models,

[SYSD,G] = C2D(SYSC,Ts,METHOD)

also returns a matrix G that maps continuous initial conditions

into discrete initial conditions. Specifically, if x0,u0 are

initial states and inputs for SYSC, then equivalent initial

conditions for SYSD are given by

xd[0] = G * [x0;u0], ud[0] = u0 .

See also d2c, d2d, ltimodels.

Overloaded functions or methods (ones with the same name in other directories)

help zpk/c2d.m

help tf/c2d.m

help ss/c2d.m

help lti/c2d.m

help frd/c2d.m

Reference page in Help browser

doc c2d

Electric Traction Motor

Q: Write Mat lab code for the following Electric Traction Motor Block Diagram…

G3 G1 G2

- -

G4

>> num1=[10];

>> den1=[1 1];

>> num2=[1];

>> den2=[2 0.5];

>> num3=[540];

>> den3=[1];

>> num4=[0.1];

>> den4=[1];

>> [a,b]=series(num1,den1,num2,den2);

>> [c,d]=feedback(a,b,num4,den4,-1);

>> [e,f]=series(c,d,num3,den3);

>> [g,h]=cloop(e,f,-1);

>>printsys(g,h)

num/den =

5400

----------------------

2 s^2 + 2.5 s + 5401.5

>> t=[0:0.005:3];

>> [y,x,t]=step(g,h,t);

>>plot(t,y)

>>grid on

>>xlabel('Time in second')

>>Ylabel('wheel velocity')

Exercise:

Q-1-a: Write code for addition, subtraction, right division, left division and multiplication of two systems? Sys1 is (f (t) = t4) and sys2 is t0.5?

Q-1-b: Give feedback to sys2 of sys1 and feedback to sys1 of sys2?

Q-02: Write MATLAB code for the following system Using multi-loop Reduction Method….

+ + - + Y(s)

-

+

Where:

G1 = 1/s2+s; G2 = 1/s+1; G3 = s2+1/s2+4s+4: G4 = s+1/s+6:

H1 = s+1/s+2; H2 = 2: H3 = 1

Experiment # 4

|Characteristics of Control System |

Speed Tachometer system

Open loop disturbance step response

>>ra=1; km=10 ;j=2;

f=.5; kb=.1;ka=54;

kt=1; n1=[1];

d1=[j f];

>> n2=[(kb*km)/ra];

>> d2=[1];

>> [num den]=feedback(n1,d1,n2,d2)

num = 0 1

den = 2.0000 1.5000

>>num=-num

num =0 -1

>>printsys(num,den)

num/den = -1

---------

2 s + 1.5

>> t=0:1:10;

>> [y,x,t]=step(num,den);

>>plot(t,y)

>>title('open loop disturbance step response')

>>xlabel 'sec'

>>ylabel 'speed'

>>grid on

Close loop disturbance step response

>> n1=[1]; >> d1=[j f]; >> n2=[(ka*kt)];

>> d2=[1]; >> n3=[kb]; >> d3=[1];

>> n4=[km/ra]; >> d4=[1];

>> [a b]=parallel(n2,d2,n3,d3)

a = 54.1000

b = 1

>> [c d]=series(a,b,n4,d4)

c = 541 d =1

>> [num den]=feedback(n1,d1,c,d)

num = 0 1

den = 2.0000 541.5000

>>num=-num

num = 0 -1

>>printsys(num,den)

num/den = -1

-----------

2 s + 541.5

>> t=0:1:10;

>> [y,x,t]=step(num,den);

>>plot(t,y)

>>title('close loop disturbance step response')

>>xlabel 'time'

>>ylabel 'speed'); s>> grid on

Experiment # 5

|Closed Loop Motor Speed Control |

Objective:

To know the closed loop Motor speed control Technique.

Components:

DC Servo Trainer (ED-4400-B)

U-158 Potentiometer

U-151 Dual Attenuator

U-152 Summing Amplifier

U-153 Pre-Amplifier (20 db)

U-154 Motor Driver Amplifier (10 watts)

U-155 Tacho Am Unit

U-156 DC Power Supply

U-157 Potentiometer (Ref) (1KOhm to 10 KOhm)

U-158 Potentiometer (Motor Coupling) (1KOhm to 10 KOhm)

U-159 Techometer (FS 4000 RPM)

U-161 Servo Motor

U-162 Function Generator

U-163 Magnet Brake

Theory:

When a motor is used as a source of mechanical force, the motor is required to provide constant speed regardless of the change in load. A closed loop speed control system is a self-regulating system in which the measured speed of the motor is compared to the preset value to produce an error output. The detected error voltage is then amplified and fed back to the control circuit to compensate the difference between the actual and preset speed. The self correcting process continues until the detected error voltage becomes zero. At this point the actual speed of the motor is equal to the preset speed. The conceptual difference between an open loop and closed loop system is graphically as

Procedure:

1. Referring to figure arrange the required modules and connect them together.

2. Set the selector switch of summing amplifier U-152 to ‘a’.

3. Set AAT-2 of the U-151 to ‘10’ to prevent Tacho output from entering the system. Set AAT-1 to ‘5’.

4. Turn the power of U-156 on.

5. Adjust U-157 to obtain about one half of the maximum speed. This is same as setting for 2500 RPM on U-159 meter.

6. Attach an electronic brake U-163 with the brake’s setting increased by one notch at a time; record the RPM reading at each setting.

7. Measure the error voltage at each brake setting. (There is no feedback at this point. Therefore, the error voltage will vary only when the preset speed is changed to a different value).

8. Set ATT-2 of U-151 to ‘5’. Adjust U-157 to obtain the same speed as in step 5 (around 2500 RPM).

9. Measure the Tacho output and error voltage at different brake points.

10. Compute the results between steps 3-7 and step 8-9. Notice that the loop was closed for steps 8-9.

Results:

Experiment # 6

|Closed Loop Position Controller |

Objective:

To control the speed of close loop position controller.

Components:

DC Servo Trainer (ED-4400-B)

U-158 Potentiometer

U-151 Dual Attenuator

U-152 Summing Amplifier

U-153 Pre-Amplifier (20 db)

U-154 Motor Driver Amplifier (10 watts)

U-155 Tacho Am Unit

U-156 DC Power Supply

U-157 Potentiometer (Ref) (1KOhm to 10 KOhm)

U-158 Potentiometer (Motor Coupling) (1KOhm to 10 KOhm)

U-159 Techometer (FS 4000 RPM)

U-161 Servo Motor

U-162 Function Generator

U-163 Magnet Brake

Theory:

In a close loop position controller system, the positional information from an output potentiometer (Po) which is mechanically coupled to a motor is fed back to a control amplifier. Then the reference position input from the input potentiometer (Pi) is combined with the feedback signal at the input of the amplifier which drives the motor in proportion to the difference between two signals. When two positions are identical, the output of the amplifier becomes zero.

U-152 is an error signal generator, U-153 is an error signal amplifier and U-154 is the driver for the motor. As Pi is turned away from Po, the difference between two potentiometer voltages becomes an error signal which appears at the output of U-152. The error signal is further amplified by U-153 and U-154.

Procedure:

1. Referring to figure arrange the required modules and connect them together.

2. Set the selector switch of summing amplifier U-152 to ‘a’ and AAT-2 of the U- 151 to ‘10’. Turn the power of U-156 on. Set U-157 dial to 180 degree.

3. Turn the power of U-156 on.

4. Adjust U-153 to make the output of U-154 zero. Once the adjustment is done, do not alter U-153 setting.

5. Set U-151 to ‘9’. Within 20 degree from the original 180 degree setting, turn U-157 either clockwise or anti-clockwise, and see if U-158 follows the movement. U-158 motion should lag U-157. In case U-158 leads U-157.

6. Turn clockwise from 0 degree position by 10 degree increment up to 150 degrees. Measure the angle of U-158 at each position of U-157. Repeat the measurements with U-157 turned counterclockwise. Calculate the error voltage at U-151 center verses angle difference between U-157 and U-158 at each position.

7. Increase the system gain by setting U-151 to 7, 5, 3, 1. At each U-151 setting, repeat step 6. Observe the change in error voltage as a function of the system gain.

8. Plot the results of step 6 and 7. Plot the relationships between system gain and error voltage.

Experiment # 7

|Robotic ARM |

Objective:

To understand the working of robotic arm and to know the robopro how to control the robotic arm.

Theory:

There is power input jack on the back side of this module .There are also two female plugs to apply power and one plug for proper earthling of module.

To connect this module to computer there are two options:

1. USB

2. RS232

Which ever you like, you can chose. If you choose the USB port to connect the module with computer then you have to set the USB option from the tool bar.

If you want to use RS-232 connections then same procedure is to be followed just keep in mind to select accurate port from COM 1 to COM 4.

When you will select the connection option from toolbar then make surety select the option from module.There are two switches on the module.

1. One is for port selection.

2. One is for program module selection.

From port selector switch select the port which you are going to use. The green led will glow and will indicate the selected port. The other switch is for program mode. This switch is used for selection of ram. This option is used when you are going to download some program direct in the robot.

There are four DC motors being used in this module. Each motor has eight speed steps and two directions.

Motor M1:

This motor is used to rotate whole structure. The whole structure can be rotated in 3600.

Motor M2:

This motor is used for to and fro movement of the robotic arm If this motor is driven in clock-wise direction then the arm will move outward and if it is driven in counter clock-wise direction then the arm will move inwards.

Motor M3:

This motor is used for up and down movement of robotic arm. If this motor is driven in clock-wise direction, then arm will move in downward direction and if it is driven in counter clock-wise direction then the arm will move upward.

Motor M4:

This motor is used to open or close the jaw for job piece. If this motor is driven clock-wise, then it will close the jaw and if it is driven in counter clock-wise direction then it will open the jaw.

Basics of Robopro:

Basic algorithm is used to control robotic arm as shown

1. [pic] use to start the program

2. [pic]to rotate motor in clockwise direction

3. [pic] to rotate motor in anti-clockwise direction

4. [pic]to stop a motor

5. [pic]to give time delay

6. [pic]to take decision

7. [pic] to end the program

Exercise:

Write a programe to pick a job from one place and move the arm using all motors and place the job exactly 1800 opposite?

Experiment # 8

|Proportional, Integral and Derivative Controller |

Objective:

To observe the effect of different controller on Rise time, Overshoot, Settling time and Steady State error.

Procedure:

The transfer function of PID controller looks like the following

Kp+Ki/s+Kd*s

Where Kp is the proportional gain, Kd is the derivative gain and Ki is the integral gain. The effect on the closed-loop response of adding to the controller term Kp, Ki and Kd is listed below

|Cl Response |Rise Time |Overshoot |Settling Time |S-S Error |

|Kp |Decreases |Increases |No Change |Decreases |

|Ki |Decreases |Increases |Increases |Eliminates |

|Kd |No Change |Decreases |Decreases |No Change |

Open Loop Step Response:

Lets take a second order plant like

1/s^2+10s+20

Lets first view the open loop step response

>>num=1;

>>den=[1 10 20];

>>g=tf(num,den)

>>step(g)

num=[1];

denum=[1 10 20];

step(num,denum)

The DC gain of the plant is 0.05=1/20, so 0.05 is the finalvalue of the output for a unit step input. This corresponds to a steady state error of 0.95, quite large indeed. Furthermore, the rise time is about one second and settling time is about 1.5 second. Most likely, the response will not be adequate. Therefore, we need to add some control.

Proportional Control:

As Kp will help to reduce the steady-state error and decreases the rise time5. Lets first add a proportional controller into the system.

>>num=1;

>>den=[1 10 20];

>>Kp=10;

>>[numcl,denncl]=cloop(Kp*num,den,-1);

>>t=0:0.01:2;

>>step(numcl,dencl,t)

num=[1];

kp=10; %Change gain and see response

denum=[1 10 20];

[numcl,denumcl]=cloop(kp*num,denum,-1);

t=0:0.01:2;

step(numcl,denumcl,t)

Now the rise time has been reduced and the steady state error is smaller, if we use greater Kp, the rise time and steady state error will become even smaller. Change the Kp=200. This time we see that the rise time is now about 0.1 second and the steady state error is much smaller but the overshoot has been very large now.

PD Control:

The rise time is now probably satisfactory (rise time is about 0.1 second).Now let’s add a derivative controller to the system to see if the overshoot can be reduced. Add another variable, Kd, to them-file, set it equal to 10 and return them-file:

>>KP=500;

>>Kd=10;

>>Numc=[Kd Kp];

>>[numCL,denCL]=cloop(conv(num,den),den);

>>step(numCL,denCL,t)

num=[1];

kp=50; %Change gain and see response

denum=[1 10 20];

[numcl,denumcl]=cloop(kp*num,denum,-1);

t=0:0.01:2;

step(numcl,denumcl,t)

The overshoot is much less then before. it is now only twenty percent instead of almost forty-five percent. We can now try improve that even more. Try increasing Kd to 100, you will see the overshoot eliminated completely.

We now have a system with a fast rise time and no overshoot. Unfortunately, there is still about a 5 percent steady-state error. It would seem that a PD controller is not satisfactory for this system. Let’s try a PI controller instead.

PI Control:

As we have seen, proportional control will reduce the steady-state error, but at the cost of larger overshoot. Furthermore, proportional gain will never completely eliminate the steady-state error .For that we need to try integral control. Let’s implement a PI controller and start with a small ki.

>>Kp=500;

>>Ki=1;

>>Kd=0;

>>Numc[Kd Kp Ki];

>>Denc=[1 0];

>>[numCL,denCL]=cloop(conv(num,numc),conv(den,denc));

>>step(numCL,denCL)

Try Ki=10,

>>Kp=500;

>>Ki=10;

>>.Kd=0;

>>Numc[Kd Kp Ki];

>>Denc=[1 0];

>>[numCL,denCL]=cloop(conv(num,numc),conv(den,denc));

>>step(numCL,denCL)

>>axis([0 100 0 1.5])

num=[1];

kp=500; %Change gain and see response

denum=[1 10 20];

[numcl,denumcl]=cloop(kp*num,denum,-1);

t=0:0.01:2;

step(numcl,denumcl,t)

From the two controllers above, we see that if we want a fast response, small overshot, and no steady-state error, neither a PI nor a PD controller will suffice. Let’s implement both controllers and design a PID controller to see if combining the two controllers will yield the desired response. Recalling that, our PD controller gave us a pretty good response except for a little steady-state error.

>>Kp=500;

>>Ki=1;

>>Kd=100;

>>Numc=[Kd Kp Ki];

>>Denc[1 0];

>>[numCL,denCL]=cloop(conv(num,numc),conv(den,denc)):

>>step(numCL,denCL)

num=[1];

kp=100; %Change gain and see response

denum=[1 10 20];

[numcl,denumcl]=cloop(kp*num,denum,-1);

t=0:0.01:2;

step(numcl,denumcl,t)

[pic]

To design a PID controller, the general rule is to add proportional control to get the desired rise time, add derivative control to get desire overshoot, and then add integral control (if needed).To eliminate the steady-state error.

Proportional-Derivative controller

num=[1];

denum=[1 10 20];

kp=100; %You can set rise time

kd=10;

num1=[kd kp];

[numcl,denumcl]=cloop(conv(num1,num),denum);

t=0:0.01:2;

step(numcl,denumcl,t)

num=[1];

denum=[1 10 20];

kp=100; %You can set rise time

kd=100;

num1=[kd kp];

[numcl,denumcl]=cloop(conv(num1,num),denum);

t=0:0.01:2;

step(numcl,denumcl,t)

num=[1];

denum=[1 10 20];

kp=500; %You can set rise time

kd=100;

num1=[kd kp];

[numcl,denumcl]=cloop(conv(num1,num),denum);

t=0:0.01:2;

step(numcl,denumcl,t)

p-i controller

num=[1];

denum=[1 10 20];

kp=500;

ki=10;

num1=[kp ki];

denum1=[1 0];

[numcl,denumcl]=cloop(conv(num1,num),conv(denum1,denum));

t=0:0.01:2;

step(numcl,denumcl,t)

p-i-d controller

num=[1];

denum=[1 10 20];

kp=500;

kd=100;

ki=10;

num1=[kd kp ki];

denum1=[1 0];

[numcl,denumcl]=cloop(conv(num1,num),conv(denum1,denum));

t=0:0.01:2;

step(numcl,denumcl,t)

Exercise:

Q # 1: G(s) = F(s) / X(s) = 1 / (ms^2 + bs + k)

Calculate the waveforms for different values of m, b and k, when ramp input is applied.

Case-1: Eliminate spring (k=0) where m = 1 and b = 1

Case-2: Eliminate damping (b=0) where m = 1 and k = 5

Case-3: Eliminate mass (m=0) where b = 1 and k = 5

Observe the waveforms for different values of m, b and k, when step input is applied.

Case-1: Eliminate spring (k=0) where m = 1 and b = 1

Case-2: Eliminate damping (b=0) where m = 1 and k = 5

Case-3: Eliminate mass (m=0) where b = 1 and k = 5

Experiment # 9

|Simulink Basics |

Objective:

To know about the simulink basics and know how to create a model.

Procedure:

Simulink is a graphical extension to MATLAB for modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams. Many elements of block diagrams are available, such as transfer functions, summing junctions etc. Simulink is integrated with MATLAB and data can be easily transferred between the programs.

The simple model consists of three blocks: Step, transfer function, and scope. The step is a source block from which a step input signal originates. This signal is transferred through the line in the direction indicated by the arrow to the transfer function linear block. The transfer function modifies the input signal gives a new signal on the line to the scope. The scope is a sink block used to display a signal much like an oscilloscope.

Close loop step response:

The close loop response of the system can be modeled as

From the result you have seen that rise time is high, s-s error is greater and settling time is greater. Lets comes toward the proportional control to decrease the rise time and s-s error.

Proportional Control:

The proportional gain can be used as in the model

Proportional controller

Output graph

For gain 10

Output graph

For gain 50

Output graph

For gain 100

Output graph

Gain 150

Output graph

Gain 200

Output graph

Gain 500

Output graph

Now rise time is smaller but overshoot is produced so to decrease the overshoot we use derivative compensator.

PD Control:

The proportional and derivative compensator can be used as can be used as

[pic]

[pic]

After controlling rise time overshoot and settling time now come towords the integral control to eliminate the steady state error.

PI Control:

The proportional and integral compensator can be used as

Now combine the three compensators to see the whole result.

PID Control:

[pic]

[pic]

Exercise:

Q # 1: G(s) = F(s) / X(s) = 1 / (ms^2 + bs + k)

Calculate the waveforms for different values of m, b and k, when ramp input is applied.

Case-1: Eliminate spring (k=0) where m = 1 and b = 1

Case-2: Eliminate damping (b=0) where m = 1 and k = 5

Case-3: Eliminate mass (m=0) where b = 1 and k = 5

Observe the waveforms for different values of m, b and k, when step input is applied.

Case-1: Eliminate spring (k=0) where m = 1 and b = 1

Case-2: Eliminate damping (b=0) where m = 1 and k = 5

Case-3: Eliminate mass (m=0) where b = 1 and k = 5

Experiment # 10

|Root Locus Analysis and Bode Plot |

Objective:

To explore the root-locus analysis of a control system.

Procedure:

A CLOSED-LOOP control system using a proportional controller and unity feedback is shown below

• For Open loop integral controller

>>Kp=30;

>>num=[Kp*1];

>>den=[1 5 6 0];

>>sys=tf(num,den)

• For closed loop integral controller

>>Kp=30;

>>num=[Kp*1];

>>den=[1 5 6 0];

>>sys=tf(num,den)

>>y=feedback(sys,1)

• Plot the root-locus using MATLAB commands rlocus and sketch the root-locus.

>>Kp=30;

>>num=[Kp*1];

>>den=[1 5 6 0];

>>sys=tf(num,den)

>>y=feedback(sys,1)

>>rlocus(y)

In the system shown above, using integral controller K/s and determined the open loop and close loop TF?

• For Open loop integral controller

>>Kp=200;

>>Kd=0;

>>Ki=20;

>>Numc=[Kd Kp Ki];

>>Denc=[1 0];

>>num=[1];

>>den=[1 5 6 0];

>>Sys=tf(conv(num,Numc),conv(den,Denc))

• For closed loop integral controller

>>Kp=200;

>>Kd=0;

>>Ki=20;

>>Numc=[Kd Kp Ki];

>>Denc=[1 0];

>>num=[1];

>>den=[1 5 6 0];

>>Sys=tf(conv(num,Numc),conv(den,Denc))

>>y=feedback(sys,1)

• Plot the root-locus using MATLAB commands rlocus and sketch the root-locus.

>>Kp=200;

>>Kd=0;

>>Ki=20;

>>Numc=[Kd Kp Ki];

>>Denc=[1 0];

>>num=[1];

>>den=[1 5 6 0];

>>Sys=tf(conv(num,Numc),conv(den,Denc))

>>y=feedback(sys,1)

>>rlocus(sys)

In the system shown above, using integral controller K/s , proportional controller and derivative controller determined the open loop and close loop TF?

• For Open loop integral controller

>>Kp=200;

>>Kd=100;

>>Ki=20;

>>Numc=[Kd Kp Ki];

>>Denc=[1 0];

>>num=[1];

>>den=[1 5 6 0];

>>Sys=tf(conv(num,Numc),conv(den,Denc))

• For closed loop integral controller

>>Kp=200;

>>Kd=100;

>>Ki=20;

>>Numc=[Kd Kp Ki];

>>Denc=[1 0];

>>num=[1];

>>den=[1 5 6 0];

>>Sys=tf(conv(num,Numc),conv(den,Denc))

>>y=feedback(sys,1)

• Plot the root-locus using MATLAB commands rlocus and sketch the root-locus.

>>Kp=200;

>>Kd=100;

>>Ki=20;

>>Numc=[Kd Kp Ki];

>>Denc=[1 0];

>>num=[1];

>>den=[1 5 6 0];

>>Sys=tf(conv(num,Numc),conv(den,Denc))

>>y=feedback(sys,1)

>>rlocus(sys)

COMMENTS

____________________________________________________

____________________________________________________

____________________________________________________

____________________________________________________

____________________________________________________

Exercise:

Q # 1: G(s) = F(s) / X(s) = 1 / (ms^2 + bs + k)

Calculate the waveforms for different values of m, b and k, when ramp input is applied.

Case-1: Eliminate spring (k=0) where m = 1 and b = 1

Case-2: Eliminate damping (b=0) where m = 1 and k = 5

Case-3: Eliminate mass (m=0) where b = 1 and k = 5

Observe the waveforms for different values of m, b and k, when step input is applied.

Case-1: Eliminate spring (k=0) where m = 1 and b = 1

Case-2: Eliminate damping (b=0) where m = 1 and k = 5

Case-3: Eliminate mass (m=0) where b = 1 and k = 5

Experiment # 11

|Introduction To PLC and Motor Control Program |

Objective:

To know about the Plc’s basics and to understand

1) Understand motor’s starting principle using PLC.

2) Learn about I/O MAP of PLC.

3) Understand the structure and principle of PLC SIMULATOR

Basics:

A programmable logic controller (PLC) or programmable controller is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or lighting fixtures. PLCs are used in many industries and machines. Unlike general-purpose computers, the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. Programs to control machine operation are typically stored in battery-backed or non-volatile memory. A PLC is an example of a real time system since output results must be produced in response to input conditions within a bounded time, otherwise unintended operation will result

The main difference from other computers is that PLCs are armored for severe conditions (such as dust, moisture, heat, cold) and have the facility for extensive input/output (I/O) arrangements. These connect the PLC to sensors and actuators. PLCs read limit switches, analog process variables (such as temperature and pressure), and the positions of complex positioning systems. Some use machine vision. On the actuator side, PLCs operate electric motors, pneumatic or hydraulic cylinders, magnetic relays, solenoids, or analog outputs. The input/output arrangements may be built into a simple PLC, or the PLC may have external I/O modules attached to a computer network that plugs into the PLC. PLCs are well-adapted to a range of automation tasks. These are typically industrial processes in manufacturing where the cost of developing and maintaining the automation system is high relative to the total cost of the automation, and where changes to the system would be expected during its operational life. PLCs contain input and output devices compatible with industrial pilot devices and controls; little electrical design is required, and the design problem centers on expressing the desired sequence of operations. PLC applications are typically highly customized systems so the cost of a packaged PLC is low compared to the cost of a specific custom-built controller design. On the other hand, in the case of mass-produced goods, customized control systems are economic due to the lower cost of the components, which can be optimally chosen instead of a "generic" solution, and where the non-recurring engineering charges are spread over thousands or millions of units.

A microcontroller-based design would be appropriate where hundreds or thousands of units will be produced and so the development cost (design of power supplies, input/output hardware and necessary testing and certification) can be spread over many sales, and where the end-user would not need to alter the control. Automotive applications are an example; millions of units are built each year, and very few end-users alter the programming of these controllers. However, some specialty vehicles such as transit busses economically use PLCs instead of custom-designed controls, because the volumes are low and the development cost would be uneconomic.

Very complex process control, such as used in the chemical industry, may require algorithms and performance beyond the capability of even high-performance PLCs. Very high-speed or precision controls may also require customized solutions; for example, aircraft flight controls.

Programmable controllers are widely used in motion control, positioning control and torque control.

Some manufacturers produce motion control units to be integrated with PLC so that G-code (involving a CNC machine) can be used to instruct machine movements.

Procedure:

1) Build motor’s start circuit by using two input switches (start, stop). (Output consists of output coil for electronic contact maker, operation lamp, and stop lamp.) Initially stop lamp must glow.

2) If start input switch is turned on, motor gets started, and then operation lamp turns on whereas stop lamp turns off.

3) If one turns on stop lamp during operation, motor stops, and lamp turns on, and operation lamp turns off.

4) PLC I/O MAP is configured below.

|Section |

| |

|Inputs |

| |

|Outputs |

|Indirect Variable Name |Comments |

|START_SWITCH |Push Switch S-2 |

|STOP_SWITCH |Push Switch S-3 |

|MOTOR |MOTOR-1 (-) |

|OPERATION _LAMP |Lamp L-2 |

|STOP_LAMP |Lamp L-1 |

PROGRAM PRACTICE:

1) Execute the GMWIN and open the Project window and the program window.

2) Write a program using PLC I/O MAP

3) Write ladder program as shown below.

EXECUTION OF PROGRAM (USING SIMULATOR):

1) To verify what was mentioned above, one uses a simulator, which is characteristic of

GLOFA t performs an experiment to check whether there is any abnormality in the circuit and its activation.

2) Simulator starts when one clicks the icon on Basic tool bar. When one clicks on this icon, firstly following window opens

If one clicks OK than simulator starts and we can use inputs and outputs of simulator to monitor our program.

3) The above figure shows that when simulator is in RUN mode and start switch is pressed, the output related to operation lamp and motor status are activated which means that program is working properly.

LAB TASK:

1) Implement the above lab in FXGPWIN and also configure the hardware.

2) Also mentioned that in what sequence the hardware is connected.

3) Also implement the above ladder with set and reset command as discussed in class (in GMWIN).

LADDER DIAGRAM:

WORKING DESCRIPTION:

CONCLUSION

TIMERS USING PLC

A driven coil sets internal PLC contacts (NO and NC contacts available). Various timer resolutions are possible, from 1 to 100 msec, but availability and quantity vary from PLC to PLC.

[pic]

Selectable timers taken from the main range of 100 msec timers.

Timers operate by counting clock pulses (1, 10 and 100 msec). The timer output contact is activated when the count data reaches the value set by the constant K. The overall duration or elapsed time, for a timers operation cycle, is calculated by multiplying the present value by the timer resolution, i.e.

A 10 msec timer with a present value of 567 has actually been operating for:

567_ 10 msec

567_ 0.01 sec = 5.67 seconds

Timers can either be set directly by using the constant K to specify the maximum duration or indirectly by using the data stored in a data register (ex. D). For the indirect setting, data registers which are battery backed/ latched are usually used; this ensures no loss of data during power down situations. If however, the voltage of the battery used to perform the battery backed service, reduces excessively, timer malfunctions may occur.

On certain programmable controllers, driving a special auxiliary coil redefines approximately half of the 100 msec timers as 10 msec resolution timers. The following PLC’s and timers are subject to this type of selection.

- FX0, FX0S driving M8028 ON, timers T32 to 55 (24 points) are changed to 10 msec resolution.

- FX0N driving M8028 ON, timers T32 to 62 (31 points) are changed to 10 msec resolution.

PROGRAM FOR OPERATING A BUZZER FOR 1ms

1. Build buzzer’s start/stop circuit by using one input switch, a 1ms timer and a buzzer as an output.

2. Execute the FXGP-WIN and open the Project window and the program window.

3. Write ladder program as shown below.

PROGRAM FOR TURNING A DEVICE ON/OFF AT A CONTROLLED RATE.

In this example, the Output Y0 will be ON for 1 sec and then OFF for 1 sec. It will be used to describe how a PLC ladder can be produced, modified and tested. Then using a Mitsubishi FX2NPLC, the program will be downloaded, run and monitored

The ladder diagram for the circuit and its explanation is given below.

[pic]

1. Line 0

(a) On closing the input switch X0, the timer T0 will be enabled via the normally closed contact of timer T1.

(b) Timer T0 will now start timing out, and after 1 sec, the Timer will operate. This means:

(i) Any T0 normally open contacts -jj-, will close.

(ii) Any T0 normally closed contacts -j / j-, will open.

2. Lines 5 and 9

There are two T0 contacts, which are both normally open, therefore both of them will close, causing the following to occur:

(a) Timer T1 will become enabled and start timing out.

(b) Output Y0 will become energized, i.e. output Y0 will turn ON.

3. Line 5

After timer T1 has been energized for 1 sec, it will also operate and its normally closed contact will open, causing Timer T0 to dropout.

4. With Timer T0 dropping-out, its normally open contact will now re-open causing:

(a) Timer T1 to dropout even though T1 has just timed out.

(b) Output Y0 to become de-energized, i.e. output Y0 will turn OFF.

5. Hence it can be seen that timer T1 is part of a ‘cut-throat’ circuit in that when it does time out, it immediately de-energizes itself.

6. With timer T1 dropping-out, its normally closed contact will close, and for as long as input X0 is closed, the operation will be constantly repeated.

7. Line 9 Hence the output Y0 will be continuously OFF for 1 sec and then ON for 1 sec.

Lab Assignment:

Design a system controlling three motors with conditions:

1. All the three motors should operate for 1 second.

2. When motor 1 is on, the others two should be off i.e. only one motor should operate at a time.

Conclusion:

Experiment # 12

|Control System for Motors With Emergency Backup and Water level control using PLC |

Objective:

Understand motor’s PLC Commands and learn about I/O MAP of PLC.

Control System for motors:

1) Build motor’s start/stop circuit by using four input switches (operation, stop).

2) PLC I/O MAP is configured below.

PROGRAM PRACTICE:

1) Execute the FXGP-WIN and open the Project window and the program window.

2) Write a program using PLC I/O MAP

3) Write ladder program as shown below.

[pic]

Execute the program by converting and then writing to the plc. Follow the steps used in the previous lab.

Multiple Motors control:

1) Build motor’s start/stop circuit by using four input switches (operation, stop).

2) PLC I/O MAP is configured below.

[pic]

PROGRAM PRACTICE:

3) Execute the FXGP-WIN and open the Project window and the program window.

4) Write a program using PLC I/O MAP

5) Write ladder program as shown below.

LADDER DIAGRAM:

WORKING DESCRIPTION:

CONCLUSION:

Water Level Control:

1) Build motor’s start/stop circuit by using four input switches (operation, stop).

2) PLC I/O MAP is configured below.

[pic]

PROGRAM PRACTICE:

3) Execute the FXGP-WIN and open the Project window and the program window.

4) Write a program using PLC I/O MAP

5) Write ladder program as shown below.

LADDER DIAGRAM:

WORKING DESCRIPTION:

CONCLUSION:

Experiment # 13

|Introduction to Analog Modules AnM-04 |

The Analog Modules AnM-04 consists of four computing elements:

1. Auxiliary Amplifier one

2. Summing Amplifier one

3. Integrators two

4. Control Unit (CU) one

5. Potentiometers five

These computing elements provide sufficient computing elements for a second order system.

For larger systems linkage facilities are provided that facilitate enabling the control of a group of modules to be coordinated.

Equipment:

1. Analog Modules AnM-04 1

2. 4mm plug leads, 100mm long 12

3. 4mm plug leads, 150mm long 2

4. 4mm plug leads, 300mm long 1

5. 4mm plug leads, 450mm long 3

Description:

1. Auxiliary Amplifier

It consists of an Operational Amplifier (Op Amp) and four 10K resistors which can be connected as inputs or outputs for feedback.

2. Summing Amplifier

It consists of an Operational Amplifier (Op Amp) and set of following resistors:

a. 10K six

b. 20K one

c. 50K one

d. 100K two

e. 200K one and

f. 500k one.

The resistors can be connected to Op Amp input or output for feedback.

3. Integrators

The two integrators are identical and each of them consists of:

a. Op Amp one

b. Resistors:

i. 25K one

ii. 100K two

iii. 250K 0ne

iv. 1M one

c. Capacitors:

i. 0.1uF one

ii. 1.0uF one

Connections are provided at Op Amp input for configuring it manually or in repetitive mode.

The capacitors are selected by a three position switch in each integrator circuit.

4. Control Unit (CU)

The Cu provides timing for repetitive operations. It consists of a retriggerable monostable flipflop. The timing is set by two switches for setting ‘compute period’ 10ms and 10s to a value between 10ms and 10s. The range is set by the upper knob. The value within that range is selected by the lower knob. The switches are controlled by a combination of internal and external signals.

5. Potentiometers

The potentiometers are used to reduce the input signal to any value between 0 and 1 by setting the knob. To facilitate reading, the scale around the knob is marked 0 to 100; it may be thought of as ‘percent of input voltage’.

Additional requirements:

1. ±15V, 50mA DC regulated power supply.

2. 2-channel oscilloscope.

3. Function Generator, 600Ω, 10 ~ 100 Hz.

4. Two DVMs

5. Digital Phase Meter (Optional)

Exercise 1

Summing Amplifier

Fig 1.1

Experimental procedure:

Set up the circuit as shown in fig 1.2.

K is the coefficient, conventionally placed in a circle.

Record the output in the following table:

|S. No. |inputs |output |

| | |Vo |

| |V1 (10K) |V2 (10K) |V1 +V2 | |

|1 |+5 |+4 |+9 | |

|2 |-5 |+8 |+3 | |

|3 |+5 |-5 |0 | |

|4 |-5 |0 |-5 | |

|5 |0 |+5 |+5 | |

|S. No. |inputs |output |

| | |Vo |

| |V1 (10K) |V2 (20K) |V1 + ½ (V2) | |

|1 |+5 |+4 |+7 | |

|2 |+5 |+8 |+9 | |

|3 |-5 |+5 |-2.5 | |

|4 |-5 |0 |-5 | |

|5 |0 |+5 |+2.5 | |

Exercise 2

Integrator

Integration is an important mathematical function and control systems operator.

Fig 1.3

Vo = - ∫[pic]

Experimental procedure:

Set up the circuit as shown in fig 1.4.

Set the three position switch in the down position to connect the 1uF capacitor in circuit.

On the control unit (CU), set the upper switch to ‘hold’ (central) position and to the lower switch to ‘reset’ (right) position.

Using DVM1 (DC voltmeter position), adjust the potentiometer viper to 1V.

Observe the DVM2 (DC voltmeter position) while you move the CU lower switch from ‘reset’ to ‘compute’. The meter should indicate steadily increasing negative voltage as shown in fig 1.5.

Fig 1.5

Observe the time taken from 0V to -10V and record in the following table:

|S. N0. |C |R |Time constant (s) |

| | | |Calculated value |Observed value |

|1 |1.0uF |25K | | |

|2 |1.0uF |100K | | |

|3 |0.1uF |250K | | |

|4 |0.1uF |1M | | |

Record the cause of difference, if any.

Experiment # 14

|Response Analysis of first order system using Analog Modules AnM-04 |

A differential equation describes how quantities vary.

A first order differential equation states that some other variable varies at a rate simply dependant on itself and another variable.

Equation:

[pic]

a and b are constants

suppose for instance that y represents the speed of a shaft whose moment of inertia is J which is driven by a torque and braked by a torque ky (which is proportional to speed then:

[pic]= T- ky[pic]

Which is same as equation (1) if a is set equal to [pic]

[pic]

[pic]

although it will be better to take equation (2) as a base torque.

If the motor starts from rest, there is initially no braking and the motor accelerates. As the motor gets faster the torque builds up, so the acceleration becomes slow xxx see how this is represented in analog form.

In the figure an integrator is shown, whose output is xxx input must therefore be [pic]. The trick is xxx way of producing the signal [pic] and supply that to the integrator as an input

The figure shows how this can be obtained, based on the equation:

T- ky[pic]

It could be said that this equation is solved in the summing amplifier, since this amplifier adjusts its output to make the sum of the terms on the left side of the equation zero. This equation is equivalent to equation (2). The left-hand amplifier simply inverts the ky signal.

Equipment required:

Analog Modules AnM-04

Regulated Power Supply, ±15VDC

DVM

2-Channel Oscilloscope

Fig 2.1

Experimental procedure

• Set up the circuit of above figure as indicated in fig 2.2. The 1uF capacitor of the integrator should be switched in.

• Turn the ‘T’ and ‘K’ potentiometers fully clockwise and the ‘J’ potentiometer fully anticlockwise.

• Reset the integrator using the lower right-hand switch. The voltmeter should read 0V.

• On switching to ‘compute’ the voltage should rise, rapidly at first and then slowly. The variation in speed may not be very obvious. It can be made more so by reducing the setting of the centre potentiometer. This has the same effect as increasing J, the moment of inertia of the motor, slowing the acceleration.

Repetitive operation:

By repeating the computation over and over again the result can be displayed on an oscilloscope.

• This makes it easier to see what is happening. To do this, set the lower right-hand switch to central position. This brings the upper switch in to action.

• Set the two rotary knobs in the ‘Control Unit’ to ‘300ms- 1s’ to ‘max’ respectively.

• Set the upper ‘repetitive operation ‘ switch to ‘reset off’ and observe the voltmeter. It should be doing exactly the same thing as when the lower switch was operated between ‘reset’ and ‘compute’.

• Set the oscilloscope time-base to free run at about 0.2s/div and Y-channel dc coupled, at 2V/div. It should be possible to see the way in which the motor speed rise time each time the ‘reset’ makes it start again from zero. However the speed of operation is too fast for the motor to respond accurately or for the oscilloscope to trace to be seen.

Time scaling:

• The automatic repetitive process is set and it is required to speed it up to make the oscilloscope display more presentable, this can be done as follows:

• Switch the integrator’s capacitor to 0.1 uF

• Set the Control Unit range switch to 30ms – 100ms

• Increase the time-base speed of oscilloscope to 10ms/div.

• The oscilloscope should now show a similar should now be stabilized, rising waveform as before. (The rise time will be larger fraction of the time, but this is not part of the computation and oscilloscope trace should now be stabilized, using external time base control from the synchronizing signal at socket. Control Unit’s ‘compute period’ can be finely adjusted to give a stable display that extends over the whole screen.

• The only time dependant feature of the analog integrator. The time constant can be reduced further by can be selecting 25K input resistor. The Control Unit time. and oscilloscope time base can be adjusted to give a display across the whole screen.

Using the analog:

• Now the three potentiometers can be varied to show the effect of various factors and the circuit behavior.

• Try first the effect of reducing the driving torque.

Exercise:

Draw the graph of first order system?

Experiment # 15

|Response Analysis of second order system using Analog Modules AnM-04 |

A simple model of action of a pendulum is set up in order to study the behavior of second-order systems. The concept of initial conditions and damping are introduced.

Equipment:

1. Analog Module AnM-04

2. Regulated power supply, ±15V DC

3. Voltmeter, 10VDC

4. Oscilloscope

Introduction:

If y is a variable, a first order linear differential equation (LDE) in y involves y and [pic] (if it is an independent variable).

A second order LDE involves y, [pic] and [pic]

The first and second order LDEs are important because although the LDEs can exist up to any order, they can virtually always be solved by linking systems which solve first and second order ones.

Building up the solution to a second order system follows similar lines to those in Lab 1.

A pendulum is simply a mass hanging on a string.

The initial conditions are set as:

1. Pendulum is displaced from the vertical or

2. Pendulum is moving at the time the study of its motion is studied.

The AnM-04 has the provision for setting up whatever initial conditions are required, within its normal working limits.

Fig 3.1

Figure 3.1 shows a mass M hanging from a string of length L. the tension in the string is approximately Mg (g is acceleration due to gravity). When the mass is deflected a small distance x from the vertical line, through the support, so that the string makes a small angle Θ with the vertical. The horizontal component is approximately Mg sinΘ.

V tends to decrease

[pic]

the differential equation for the pendulum becomes:

[pic] or [pic]

The Analog Modules solution to this problem starts with two integrators, so that some input signal will represent [pic] and this will be integrated twice to produce x.

[pic]

Fig 3.2

Experimental procedure:

Set up the circuit as shown in fig 3.3, ignoring the connection shown by the broken line.

1. The o.1uF capacitors should be switched in the integrators.

2. Set the [pic] potentiometer to about 20.

3. Set voltmeter to read 10VDC.

4. Set the oscilloscope Y-channel to 5V/div the time base for free running at 0.2s/div.

5. Settings on AnM-04 Control Unit

• The upper ‘repetitive operation’ switch to central position.

• The lower switch to ‘reset’.

6. Using the voltmeter check that both x and [pic] are zero.

7. Connect the meter to read x and set the lower switch to ‘compute’ and observe x. Nothing should happen since the pendulum is, stationary.

In real life to start the pendulum motion, either it should be pulled to one side (non-zero x) and then released or its mass should be given a velocity (non-zero [pic] ); that is to say some initial condition must be set up.

Exercise:

Draw the graph of second order system ?

-----------------------

10/(s+1)

540

1/(2s+0.5)

0.1

H2

G2

G3

G4

G1

H3

H1

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download