Activity 12 Lechadores

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

RIZAL TECHNOLOGICAL UNIVERSITY

College of Engineering, Architecture and Technology


Boni Avenue, City of Mandaluyong

SOLVING STEADY-STATE ERRORS USING MATLAB


ACTIVITY TITLE

KEN C. LECHADORES
Name

BS-ECE / CEAT-29-602P
Course/Section
ACTIVITY NO.12
SOLVING STEADY-STATE ERRORS USING MATLAB

PART 1:

Evaluate the static error constants and find the expected error for the standard step,
ramp, and parabolic inputs of the system given below

a. Using manual solution:


b. Using MATLAB

NOTE: Take the screen shot of the result in MATLAB


MATLAB CODE:
numg=500*poly([-2 -5 -6]) deng=poly([0 -8 -10 -12])
lechadores1=tf(numg,deng)
'Check Stability'
lechadores=feedback(lechadores1,1)
poles=pole(lechadores)
'Step Input'
Kp=dcgain(lechadores1) ess=1/(1+Kp)
'Ramp Input' numsg=conv([1 0],numg)
densg=poly([0 -8 -10 -12])
lechadores2=tf(numsg,densg)
lechadores2=minreal(lechadores2)

Kv=dcgain(lechadores2) ess=1/Kv

'Parabolic Input' nums2g=conv([1 0 0],numg)


dens2g=poly([0 -8 -10 -12])
lechadores3=tf(nums2g,dens2g)
lechadores3=minreal(lechadores3)

Ka=dcgain(lechadores3) ess=1/Ka

MATLAB RESULT:
Do the activity below. Take the screen shots of the results using MATLAB.

A unity feedback system has the following forward transfer function:

G(s) =
Using the following method: (a) manual solution; (b) using Matlab solve the following:

a. System type, .
b. Steady-state errors for standard step, ramp and parabolic inputs.

ANSWER:
a. Manual Solution:
b. Using MATLAB:

MATLAB CODE:
numg=100*poly([-8])

deng=poly([-7 -9])

lechadore1=tf(numg,deng)

'Check Stability'

lechadores=feedback(lechadores1,1)

poles=pole(lechadores)

'Step Input'

Kp=dcgain(lechadores1)

ess=1/(1+Kp)

'Ramp Input'
numsg=conv([1 0],numg)

densg=poly([-7 -9])

lechadores2=tf(numsg,densg)
lechadores2=minreal(lechadores2)

Kv=dcgain(lechadores2) ess=1/Kv

'Parabolic Input'
nums2g=conv([1 0 0],numg)

dens2g=poly([-7 -9])

lechadores3=tf(nums2g,dens2g)

lechadores3=minreal(lechadores3)

Ka=dcgain(lechadores3) ess=1/Ka

MATLAB RESULT:
PART 2:

Given the control system shown below, find the value of K so that there is 10% error in
the steady-state.
a. Using Manual Solution:

b. Using MATLAB:

NOTE: Take the screen shot of the result in MATLAB.


MATLAB CODE:
numgdK=[1 5]

dengdK=poly([0 -6 -7 -8])

GdK=tf(numgdK,dengdK)

numgkv=conv([1 0],numgdK)

dengkv=dengdK

lechadores=tf(numgkv,dengkv)

lechadores=minreal(lechadores)

KvdK=dcgain(lechadores)

ess=0.1 K=1/(ess*KvdK)

'Check Stability'

T=feedback(K*GdK,1)

poles=pole(T)

MATLAB RESULT:
Do the activity below. Take the screen shots of the results using MATLAB

A unity feedback system has the following forward transfer function:

Solve for the value of K to yield a 10% error in the steady state using the following:

a. Manual solution

b. Using MATLAB
MATLAB CODE:
numgdK=[1 12]
dengdK=poly([0 -14 -18])
GdK=tf(numgdK,dengdK)
numgkv=conv([1 0],numgdK)
dengkv=dengdK
lechadores=tf(numgkv,dengkv)
lechadores=minreal(lechadores)

KvdK=dcgain(lechadores)

ess=0.1 K=1/(ess*KvdK)
'Check Stability'
T=feedback(K*GdK,1)
poles=pole(T)
MATLAB RESULT:
Conclusion

In this task, inverse Laplace utilizing a MATLAB application is more challenging than

Laplace, particularly in partial fractions. The advantage here is that I had to learn a new set

of codes in order to get the correct answer. Debugging the code took a few hours because

I had to consider variables and tags in this task. Answering Laplace transform of

derivatives in a MATLAB program is a little more difficult than prior assignments, especially

when it comes to declaring variables and arranging the codes. The advantage is that you

learned a new set of codes to obtain the correct result. Also, because there are numerous

ways to use MATLAB, it is acceptable to include additional scripts and commands. As a

result, I used Laplace command and the dsolve command are used to solve the same set

of equations, they produce the same results.

Observation

Finally, MATLAB is a programming environment that is specifically developed for

engineers and scientists to evaluate and design systems and products that transform our

reality. For engineers and scientists, MATLAB is the most user-friendly and productive

computer environment. It includes the MATLAB programming language, which is the only

top programming language dedicated to mathematical and technical computers.

You might also like