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

lOMoARcPSD|13181050

Control 1 ShortExamMatlab

Control y Guiaje (Universitat Politècnica de Catalunya)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)
lOMoARcPSD|13181050

Name:

First Short Exam Version A Control and Guidance (J. Carlos Aguado) April 15, 2020

A simplified model of the transfer function with input the sum of (equal) voltage to the four
rotors and output the vertical thrust (vertical acceleration) of a quadcopter is:
𝑉𝑇(𝑠) 2.105
𝐺(𝑠) = = 2
𝑉(𝑠) 0.4895𝑠 + 1.873𝑠 + 1

Then vertical speed VS (s) and vertical position VP(s)

1) What linear differential equation (model) are we expressing with that transfer function?
(MatLab will not help you to answer this question) (1 point, 3 minutes)

(answer here)

2) Study and justify the stability of the plant and its response to a unit step. Give the poles and
the graph of the step response (1 point, 3 minutes)

(answer here)
G=

2.105
------------------------
0.4895 s^2 + 1.873 s + 1

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)


lOMoARcPSD|13181050

Continuous-time transfer function.

poles =

-3.1849
-0.6414

Tenemos un sistema estable (con


todos su polos con parte real
negativa), sin oscilaciones puesto
que los polos no tienen parte
real, poco preciso y
razonablemente rápido

3) Can we use a proportional controller? What would its optimal value be and why? (1 point, 3
minutes)

(answer here)

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)


lOMoARcPSD|13181050

El root locus nos informa de si es posible usar un controlador proporcional, como se puede
ver, se puede usar sin problemas un controlador proporcional puesto que hay una gran parte
real.
El valor optimo de K sería 0.376 para ser mas rapido y sin osciladores (se podria obtener
un valor más preciso pero tendría oscilaciones. Será la aplicación lo que decidira las
prioridades).

4) Include the transfer function of the corresponding automatic control system, its poles and its
step response for that optimal value (or close to it). Comment its performance. (2 points, 6
minutes)

(answer here)

Ga =

0.7915
----------------------------
0.4895 s^2 + 1.873 s + 1.791

Continuous-time transfer
function.

ans =

-1.9339
-1.8925

Es un sistema rápido, sin


oscilaciones pero con un problema de precesión ya que el valor final es de 0.44 y, aunque
sigue siendo mejor que el anterior, sigue sin tender a 1.

5) Can we use a lead controller? Try to find good values, show them (location of zero and pole,
and proportional global gain) and the corresponding automatic control transfer function, poles
and step response (2 points, 6 minutes)

(answer here)
Definimos un lead controller con un zero a la izquierda del polo del sistema y un polo alejado
en mi caso:

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)


lOMoARcPSD|13181050

C=

s + 3.8
-------
s + 30

Continuous-time transfer function.

Obtenemos un valor de K adecuado: Para mi un buen valor de k es 37.5.


G_lead =

78.94 s + 300
--------------------------------------
0.4895 s^3 + 16.56 s^2 + 136.1 s + 330

Continuous-time transfer function.

poles =

-23.0163 + 0.0000i
-5.4050 + 0.2695i
-5.4050 – 0.2695i

Como se puede ver hemos mejorado la presición del sistema enormemente, así como la
velocidad teniendo unas pequeñas oscilaciones que no son casi perceptibles y un pequeño
overshoot.
6) Can we use a (real, assume N=10) PID controller? Try to find good values, show them
(location of zeros and global proportional gain) and the corresponding automatic control transfer
function, poles and step response. (2 points, 6 minutes)

(answer here)

La forma de PID es la siguiente:


PID(s)=(K*(s-z1)*(s-z2))/(s*(s-p1)) Donde nos dicen que el polo 1 es -10.
Los ceros se pueden escoger en cualquier lugar pero los escogeré en valores próximos a al polo
menos estable para que tengan una fuerte influencia en aquellos polos que podrían ser inestables
atrayendolos. El valor de k se obtendrá a partir de root locus.
PID=((s+1)*(s+0.9))/(s*(s+10))

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)


lOMoARcPSD|13181050

PID =

s^2 + 1.9 s + 0.9


-----------------
s^2 + 10 s

Continuous-time transfer function.

Ampliado

Obtenemos que un valor optimo de k podría ser 22 y con el obtenemos:


G_PID =

46.31 s^2 + 87.99 s + 41.68


----------------------------------------------------
0.4895 s^4 + 6.768 s^3 + 66.04 s^2 + 97.99 s + 41.68

Continuous-time transfer function.

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)


lOMoARcPSD|13181050

poles =

-6.0733 + 8.7679i
-6.0733 - 8.7679i
-0.8399 + 0.2075i
-0.8399 - 0.2075i

Obtenemos un sistema razonablemente


rápido y con algunas oscilaciones però con
una precisión muy buena. No tenemos
overshoot.

7) What is your final choice and why? (quote both advantages and drawbacks) (1 points, 3
minutes)

(answer here)
El lead controller me da mayor velocidad, con menos oscilaciones pero es cierto que la
precisión es mejor en el PID.
Dependiendo de la aplicación sería mejor uno o otro pero en mi caso elegiré el PID porque
le doy más peso a la presición.

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)


lOMoARcPSD|13181050

%Iniciar la funcion
s=tf('s')
G=tf([2.105],[0.4895 1.873 1])
pole(G)
step (G)
%Podemos usar proportional controller?
rlocus(G)
%sisotool(G) %valor optimo
%Lo necesario para ese valor
Ga=feedback(0.376*G,1)
pole(Ga)
step(Ga)
%Añadimos un lead controller
C=tf([1 3.8],[1 30])
rlocus(C*G)
%sisotool(C*G)
G_lead=feedback(37.5*C*G,1)
pole(G_lead)
step(G_lead)

%Implementar un PID
s=tf('s')
PID=((s+1)*(s+0.9))/(s*(s+10))
rlocus(PID*G)
%sisotool(PID*G)
G_PID=feedback(22*PID*G,1)
step(G_PID)
pole(G_PID)

Downloaded by Daniel Acosta Quiroz (daniel.acosta@estudiantat.upc.edu)

You might also like