17
Praktikum Mess- und Regeltechnik Anleitung zum Versuch Seesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid- 19 Verordnung 2 gehören, müssen sich vor ihrer Anmeldung beim Praktikumsleiter Fabio Widmer ([email protected]) melden, um allfällig nötige Massnahmen zu besprechen. Kranke Studierende oder Studierende mit Symptomen müssen zu Hause bleiben und können nicht an den Praktika teilnehmen. • Alle Studierende sollen nach Möglichkeit nicht mit den öf- fentlichen Verkehrsmitteln anreisen. • Die Praktika werden entsprechend der Leitlinien der SGU durchgeführt a . Die in diesem Dokument festgehaltenen Hygiene- und Distanzregeln sind jederzeit einzuhalten. a https://ethz.ch/content/dam/ethz/associates/services/coronavirus/20200515_ Leitlinien_f%C3%BCr_Praktika_Coronazeiten_SGU.pdf Authors Michele Vivaldelli Florian Zurbriggen Gehlen Manuel Simon Wieser June 5, 2020

Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

Praktikum Mess- und Regeltechnik

Anleitung zum Versuch

Seesaw

Wichtige Informationen in Zusammenhang mit COVID-19:

• Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor ihrer Anmeldung beimPraktikumsleiter Fabio Widmer ([email protected]) melden, umallfällig nötige Massnahmen zu besprechen.

• Kranke Studierende oder Studierende mit Symptomen müssenzu Hause bleiben und können nicht an den Praktika teilnehmen.

• Alle Studierende sollen nach Möglichkeit nicht mit den öf-fentlichen Verkehrsmitteln anreisen.

• Die Praktika werden entsprechend der Leitlinien der SGUdurchgeführt a. Die in diesem Dokument festgehaltenenHygiene- und Distanzregeln sind jederzeit einzuhalten.

ahttps://ethz.ch/content/dam/ethz/associates/services/coronavirus/20200515_Leitlinien_f%C3%BCr_Praktika_Coronazeiten_SGU.pdf

AuthorsMichele VivaldelliFlorian Zurbriggen

Gehlen ManuelSimon Wieser

June 5, 2020

Page 2: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor
Page 3: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

Contents1 Introduction 2

2 Home Works 42.1 Model Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Homework: Coulomb Friction . . . . . . . . . . . . . . . . . . . . . . . . . . 5Homework: Equilibrium States . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.2 Linera Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6Homework: Carts Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3 Position Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Homework:PID Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Homework: SISO Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 Lab Experience 93.1 SISO Controller application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Task: Position Controller Test . . . . . . . . . . . . . . . . . . . . . . . . . . 9Question: Steady State Error . . . . . . . . . . . . . . . . . . . . . . . . . . 10Question: Solutions to the Steady State Error . . . . . . . . . . . . . . . . . 11Question: Test on the hardware . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.2 LQR Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Task: LQR simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Question: Derivative Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Task: LQR application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Question: Encoder Initialisation . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3 Observer - LQG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Task: Observer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Question: Cart 1 effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.4 Full State Space - LQG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Task: LQG full state space . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.5 Integral Action - LQGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Task: LQGI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Question: SISO Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1

Page 4: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

1 Introduction

Figure 1: Seesaw hardware

The aim of the present laboratory experience is to make the students gain familiarity withvarious control techniques by applying them to the system depicted in Figure 1.

The system is known as Seesaw and it is constituted by a body (the seesaw itself) free torotate with respect to its central kingpin and two carts, which can be moved on its top thanksto electric motors. The sensors in use are three encoders, two of which are used to determinethe position of the carts and the third one measures the angle of the seesaw. Therefore, thesystem is defined by two inputs (the torques to the carts’ drives) and three outputs (positionfirst cart, position second cart and seesaw angle).

The final objective of the lab experience is to stabilize the seesaw around a specific angle,balancing it throughout the movements of one cart and using the second cart as a disturbance.This final result is achieved by going through some intermediate steps, which are detailed inthe following script and are meant to give a deeper insight into the control challenges. Inparticular, Section 2 presents the modeling part of the system and involves the students intosome first tasks, which have to be carried out at home before coming to the laboratory. Sec-tion 3, instead, deals with the tasks the students will have to go through while being in the lab.

2

Page 5: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

The overall experience involves:

• System analysis and understanding;

• SISO controllers loop shaping;

• LQR controller;

• Observer design;

• Integral action for steady state error;

• Critical comparison of the different control solutions.

The assistant will explain to each group how to handle the system and what initializationprocedure has to be followed in order to use it. Moreover, the system is equipped with somesafety measures. In particular:

• Sensors will recognize when the carts are close to their boundaries and will set theirtorque to zero, to avoid the carts from hitting the walls at high speed;

• There is a red safety button in front of the experiment. Pressing it immediately stopsall the inputs to the carts. It should be used when the system does not respond asexpected. Always keep a hand on it when using the real system in order to be readyto stop the experiment if something goes wrong;

• It is always possible to stop the experiment from the Simulink interface, when thebehavior of the system is not as desired.

3

Page 6: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

2 Home Works2.1 Model Derivation

Figure 2: System Modelling

Figure 2 presents the main quantities and forces acting on the system. In order to mathe-matically describe the mechanical system, it has been chosen to use the Force and TorqueBalance approach, which eases the complexity of the resulting model while approximatingthe real behavior in an acceptable way.

In order to build up the model, the following assumptions are made:

• The motor forces are considered linear and dependent on the current given to theelectric drive and the velocity of the cart itself:FMi = CuiIi − Cxixi i ∈ (1, 2)

• The dynamic friction forces are considered as a damping effect that is proportional tothe velocity of each cart:FFi = µixi i ∈ (1, 2)

• The dynamic friction torque is considered proportional to the angular velocity:CF = µsθ

4

Page 7: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

The following table presents the parameters used in the model, including their meaning andvalue.

Parameter Description Value Unitm1 Mass of Cart 1 0.696 kgm2 Mass of Cart 2 0.690 kgMs Mass of the Seesaw in its Center of Gravity 4.872 kgJs Inertia of the Seesaw in its Center of Gravity 0.8 kg·m2

hs Height of the Center of Gravity of the Seesaw 0.077 mh Height of the Seesaw 0.12 mr1 Dynamic friction coefficient for Cart 1 (Cx1 + µ1) 2.32 N·s/mr2 Dynamic friction coefficient for Cart 2 (Cx2 + µ2) 3 N·s/mCu1 Motor Cart 1 Constant 3.944 N/ACu2 Motor Cart 2 Constant 5.7 N/Aµs Dynamic friction coefficient of the Seesaw 0.4 N·m·s/radFc Coulomb Force ?? ??

The overall system has three degrees of freedom, namely the position of the first cart (x1),the position of the second cart (x2) and the seesaw angle (θ). Therefore, three equations ofmotion need to be formulated. Based on the Force and Torque balance method, the followingequations are obtained:

m1x1 = Cu1I1 − Cx1x1 − µ1x1 +m1g sin(θ)− sign(x1)Fc (1)m2x2 = Cu2I2 − Cx2x2 − µ2x2 +m2g sin(θ)− sign(x2)Fc (2)Jsθ = Msg sin(θ)hs − µsθ − h(Cu1I1 − Cx1x1 − µ1x1 − sign(x1)Fc) + · · ·

−h(Cu2I2 − Cx2x2 − µ2x2 − sign(x2)Fc) +m1g(h sin(θ) + x1 cos(θ)) + · · ·+m2g(h sin(θ) + x2 cos(θ)) (3)

The first and second equation result from the balance of forces acting on the carts, while thethird equation is the balance of torques around the seesaw kingpin.

Homework 1: Coulomb Friction: In the parameter table, everything is known exceptfrom the Coulomb Force Fc. Knowing that the current needed to moveCart 1 is at least 0.2 A, find the value of Fc.

Homework 2: Equilibrium Sates: Calculate the equilibrium states of the system fromthe given model. Explain why there are infinite equilibrium positionsand why they are all unstable.

5

Page 8: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

2.2 Linera ModelLinearizing the system in the ~x = ~0 equilibrium yields to the following linear state-spacerepresentation:

{~x = A~x+ B~u

~y = C~x+ D~u

where:~x =

[x1 x2 θ x1 x2 θ

]′, ~u =

[I1I2

], ~y = I~x

A =

0 0 0 1 0 00 0 0 0 1 00 0 0 0 0 10 0 g − r1

m10 0

0 0 g 0 − r2m2

0gm1Js

gm2Js

Msghs+m1gh+m2ghJs

hr1Js

hr2Js

−µs

Js

B =

0 00 00 0Cu1m1

00 Cu2

m2

−Cu1hJs

−Cu2hJs

(4)

The eigenvalues of matrix A are:

3.5216; −1.3054 + 2.708i; −1.3054− 2.708i; 0; −5.2775; −3.8145

Therefore, as expected, the system has an unstable pole for s = 3.5216.

Since the system will be controlled with a state-space controller (LQR), it is important tonormalize it. For the given system it is not possible to normalize the system around theposition in which it has been linearized, since in this specific equilibrium all states are zero.Therefore, a normalization with the maximum value of each variable is used in the following:

x1max = 0.47 [m]x2max = 0.47 [m]θmax = 15 [deg] = 0.2618 [rad]x1max = 5 [m/s]x2max = 5 [m/s]θmax = 30 [deg/s] = 0.5236 [rad/s]I1max = 4.8 [A]I2max = 4.8 [A]

6

Page 9: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

Homework 3: Carts Input: Up to this point, the model has been derived, linearizedand normalized. Before proceeding to the next part, it is useful tounderstand why the two motor currents are considered as the inputsto the system. In fact, we are assuming that the torques (directlyproportional to the currents) can be chosen at every time step. Underwhich conditions is this assumption valid?

2.3 Position ControllerThe first controller that has to be derived for this system is a position controller for Cart1. It will be used to move the cart when the seesaw is fixed in its horizontal position. Thisis a good exercise to apply loop-shaping techniques for SISO controllers. During the labexperience, the resulting controller will be used to introduce disturbances and hence test therobustness of LQR controllers (which will use the other cart to stabilize the seesaw).

Figure 3: Horizontal Position

When the seesaw is fixed in the horizontal position as shown in Figure 3, the transfer functionbetween the current and the position of Cart 1 is:

X1(s)I1(s) = 1

s· Ki

1 + s · TiKi = 1.7 Ti = 0.3 (5)

The non-normalized system is used here. The normalization will be introduced later-on, whendealing with state-space controllers.

Homework 4: PID Tuning: Why is the classical Ziegler and Nichols tuning procedurenot possible for this plant? Discuss this by looking at the Nyquist plotof the plant transfer function.

7

Page 10: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

Homework 5: SISO Controller:

• Download the simulation files from the website ’Prelab.zip’, unzipthem in a folder and set that folder as ’Current Folder’ in Matlab;

• Create the Transfer Function of Cart 1 (5) in the workspace andname it P

• Open the sisotool GUI with the command sisotool(P).By default, Bode plots, Root Locus and Step Response areshown. With the tab ’New Plot’ it is possible to choose vari-ous additional plots, such as Nyquist plot etc. See the Matlabdocumentation for more information about the usage of sisotool.

• Click right in one of the plots and choose ’Edit compensator...’.This allows you to modify the controller, adding zeros and poles.Try to find a suitable controller that guarantees:– ωc ∼ 10 [rad/sec] cross-over frequency;– φm ∼ 60 [deg] phase margin;

• In order to simulate the behavior of a controller, go to the window’Control System Designer - ...’ with the plots and click on the tab’Export’. Click on ’C’ to select it and only afterwards click on thebutton ’Export’. Make sure that the new variable called ’C’ hasbeen created in the workspace.

• Launch the simulation running the m-file called ’RunSimula-tion.m’. You probably recognize - depending on the controllerstructure - that there is a steady-state error between the cartposition and the required position, although the linearized planthas an integrator.

– What is the reason for this behavior?

• Write down the controller and bring it to the lab.It will be tested on the real system during the lab.

8

Page 11: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

3 Lab Experience3.1 SISO Controller applicationThe first task of the laboratory experience is to test the position controller you designed athome on the real hardware. In order to do this, the seesaw has to be fixed in the horizontalposition as shown in Figure 4.

Ask for the help of the assistant when trying to interface Simulink to the real hardware forthe first time. An initialization procedure has to be followed in order to make the systemwork properly. The procedure is also explained in the task below.

Note that ’Cart 1’ is the one on the back, while ’Cart 2’ is the one next to the emergencybutton.

Figure 4: Seesaw fixed in the horizontal position

Task: Position Controller Test

• Enter into the folder ’3_1_PositionController’ in Matlab;

• Store the transfer function of the controller you derived at home with sisotool in theworkspace. The name of this transfer function has to be ’C’;

• Open the Simulink interface file named ’PositionController.mdl’ ;

• At this point, it is possible to start the experiment on the real hardware. Ask for thehelp of the assistant if this is the first time you go through the procedure.

• Make sure that the model is compiled. You can compile the model using the shortcutCtrl + B.

• Before connecting Simulink to the plant, make sure the cart is in the initializationposition shown in Figure 5(a).

9

Page 12: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

(a) Initialisation (b) Initial Position

Figure 5: Horizontal Position - Initialisation procedure

• During the first 10 seconds the controller is switched off and you have to manuallybring the cart in the center position shown in Figure 5(b). Bearing this in mind:

1. click on the ’Connect to Target’ (1) button in Simulink;

2. start the experiment using the ’Start Real-time code’ (2) button;

3. move the cart in the center position after the simulation started.

• After 10 seconds, the cart will start following a pre-defined reference path. When it isback at the center position, the simulation is stopped automatically.

• Plots of the measurements taken from the real hardware will be displayed on screen.Compare these outputs with the simulation outputs obtained at home.

• The Simulink file integrates the absolute value of the error (actual position vs requiredposition) and shows the final value in the black display at the top right of the screen.Pay attention to this value since it is our benchmark parameter to compare this con-troller with the following ones. A good value for this first controller should be around 52.

Question: Steady State Error

Exactly as in the simulations at home, you should notice a steady-state error in the measure-ments which are plotted at the end of each test on the real hardware.

Assume that the real hardware presents a friction, which can be modelled as a CoulombFriction (Figure 6). What problem does this kind of friction present when using LinearControl Theory?

Figure 6: Coulomb Friction

10

Page 13: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

Question: Solutions to the Steady State Error

Which possible solutions do you think will reduce or eliminate this steady-state error?Could your solutions introduce additional problems or side-effects?Discuss pros and cons of each solution with the assistant.

Task: Test on the hardware

Once a solution has been discussed and agreed with the assistant, implement it in the ’Posi-tionController.mdl’ file and test it on the real hardware. A good solution should be able toobtain an error between 30 and 35.

3.2 LQR ControllerAt this point, let the seesaw free to rotate by unfixing the vertical constrains. Fromnow on, the control task will be to balance the rotation of the seesaw using only Cart 2.Cart 1 will be used to introduce disturbances to test the robustness of the designed controller.

Since the controller will act on the seesaw rotation only throughout Cart 2, it is possible tosimplify the system by assuming that Cart 1 is always kept at the center position, i.e. thedisturbance is assumed to have zero mean. This assumption leads to the reduced model:

Ar =

0 0 1 00 0 0 10 g − r2

m20

gm2Js

Msghs+m1gh+m2ghJs

hr2Js

−µs

Js

Br =

00Cu2m2

−hCu2Js

(6)

The state vector is composed only by ~xr = [x2, θ, x2, θ] and the input is ur = [I2]. In orderto accomplish the following task, a LQR controller needs to be designed. Being a state spacecontroller, a LQR needs to know the whole state vector at every time step. Since it is onlypossible to measure the positions (x2 and θ) with the encoders, it is necessary to find a wayto obtain the velocity states.

In a first attempt, the velocities can easily be obtained by differentiating the position signals.The following task wants to show that this solution is not working effectively and it canintroduce problems into the control structure.

Task: LQR simulation

• Open the folder ’3_2_LQR’ in Matlab. Before applying the controller to the realhardware, it will be tested on simulations;

• If the previous controller for Cart 1 is not loaded in the workspace, recreate its transferfunction and call it ’C’;

• Open the m-file ’simulation_ControllerDesign.m’. Choose weights for the LQR con-troller, bearing the control objective and the meaning of each state in mind. Moreover,considering the problems related to the usage of pure derivative actions on the positionsignals, keep the crossover frequency below 20 rad/s. If you want to test the effect ofa faster controller, call your assistant before running the experiment on the hardwareand be prepared to press the emergency button;

• Run the ’simulation_ControllerDesign.m’ file. Results of the simulation will appearon screen and help to assess the performance of the designed controller.

11

Page 14: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

Question: Derivative ActionsIn the simulation the velocities are obtained as derivatives of the positions but this does notseem to be a problem for the controller. Which is the reason why derivative actions willcause problems when applied to real encoders outputs? What do you think will happen whentesting this same controller on the real hardware?Task: LQR application

• Make sure that the controller gain is present in the workspace under the name of K_lqr.If not, run again the file ’simulation_ControllerDesign.m’ in the folder ’LQR’ ;

• Open the Simulink file ’LQR.mdl’, which is the interface between Matlab and the realhardware;

• Before applying the controller, a start-up procedure needs to be followed. Ask for thehelp of the assistant if this is the first time you go through these steps.

• Start-up Procedure1. Bring the system into the initialisation position, shown in Figure 7(a);2. Press the Simulink button ’Connect to Target’. This will initialize all the encoders

measures;3. Press the Simulink button ’Start Real-time code’. This will start the controller

connected to the real hardware;4. For the first 10 seconds, the controller is still switched off. During this time,

manually bring and keep the system in the center position, shown in Figure 7(b);5. At exactly 10 seconds, the LQR controller will start its action. At this point,

leave the seesaw free to rotate and assess the controller performance on the realhardware.

(a) Initialisation Position (b) Center Position

Figure 7: Seesaw Balance - Initialisation procedure

• If the controller is not working properly, either press the red emergency button in frontof the seesaw or stop the Simulink file with the usual ’Stop’ button;

• If the controller works properly, try to introduce some disturbances manually by chang-ing the seesaw angle.

• Press the ’Stop’ button when the test is finished. Plots of the measurements fromthe real hardware will be presented on screen. You should have noticed the differencebetween the performance expected based on the simulation and the performance of thecontroller applied to the real hardware.

Question: Encoder InitialisationThe start-up procedure described above is essential to have the system working in the properway and it has to be followed in all the future tests on the real hardware. Why is this procedureso important for the encoders? Explain the reason why it is not possible to measure absolutedisplacements with these sensors.

12

Page 15: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

3.3 Observer - LQGFrom the previous test on the real hardware, it should be clear that numerically derivingposition signals is not always a good solution for obtaining velocity signals. The followingtask wants to show how an observer, based on the system presented in (6), can be used toobtain the same information while giving better control results.

Task: Observer

• Open the folder ’3_3_LQG_Observer’ ;

• Open the file ’simulation_LQG_Design.m’. Choose the weights for the LQR controllerand for the Observer following the LTR procedure. No limits on the LQR crossoverfrequency are now present;

• Run the ’simulation_LQG_Design.m’ m-file to obtain simulation results and LTRcomparison.

• Once LQR and Observer are considered acceptable, make sure the controller gain K_lqgand the observer matrices Aobs, Bobs, Cobs and Dobs are present in the workspace. Ifnot, run the ’simulation_LQG_Design.m’ file again;

• Open the Simulink interface file ’LQG.mdl’ ;

• Start-up Procedure: follow the start-up procedure explained in the previous task orcall the assistant if help is needed;

• Press the red emergency button if the controller does not respond in a good way;

• If the controller works, try to introduce some disturbances manually changing theseesaw angle.

• If the controller is able to stabilize the seesaw angle, try to move Cart 1 away fromthe center position. The Simulink interface loads the Cart 1 controller which has beenderived with sisotool (’C’ controller) in order to use it as position controller for thiscart.

• Press the Simulink ’Stop’ button to stop the test and to obtain measurements plots onscreen;

• Using the resulting plots, notice the difference between the velocities obtained with thederivative actions and those obtained with the observer.

Question: Cart 1 effect

Is the control structure still able to stabilize the seesaw angle, when moving Cart 1 awayfrom the center position? If not, which could be possible explanations?

13

Page 16: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

3.4 Full State Space - LQGUp to this point, the reduced model with 4 states has been used to derive both: LQRcontrollers and Observer. It has been shown in the previous task that this representation isnot sufficient to make the controller robust towards disturbances introduced with Cart 1.In order to improve the controller performance, in this task the full state space representationpresented in (4) will be used for controller and observer derivation. This means that now 6states are available to the LQR controller and the observer has two more inputs: the currentflowing into Cart 1 (I1) and this cart’s position (x1).

As before, the objective of the controller is to balance the seesaw around the 0 positionmoving Cart 2. The aim of the task is to underline that:

• Giving to the observer the knowledge about Cart 1 quantities results in better recon-struction of the internal state space;

• Giving the knowledge of Cart 1 to the LQR controller results in better control perfor-mance.

Task: LQG full state space

• Open the folder ’3_4_LQG_Full’ in Matlab;

• Open the file ’simulation_LQG_Full_Design.m’. Choose the weights for the LQRcontroller and for the Observer following the LTR procedure.Remember that now both LQR and Observer work on the full state vector with 6 statespresented in (4);

• Run the ’simulation_LQG_Full_Design.m’ m-file to obtain simulation results;

• Once LQR and Observer are considered acceptable, make sure the controller gain K_lqgand the observer matrices Aobs, Bobs, Cobs and Dobs are present in the workspace. Ifnot, run again the ’simulation_LQG_Full_Design.m’ file;

• Open the Simulink interface file ’LQG_Full.mdl’ ;

• Start-up Procedure: follow the start-up procedure explained in task 3.2 or call theassistant if help is needed;

• Press the red emergency button if the controller does not respond in a good way;

• If the controller works, try to introduce some disturbances manually changing theseesaw angle.

• If the controller is able to stabilize the seesaw angle, try to move Cart 1 away fromthe center position. The Simulink interface always loads the ’C’ controller for movingCart 1.

• Press the Simulink ’Stop’ button to stop the test and to obtain measurements plots onscreen;

• Is the controller now able to stabilize the seesaw even if Cart 1 is moved away from thecenter position?

14

Page 17: Seesaw - ETH ZSeesaw Wichtige Informationen in Zusammenhang mit COVID-19: • Studierende, die zur Risikogruppe gemäss Anhang 6 der Covid-19 Verordnung 2 gehören, müssen sich vor

3.5 Integral Action - LQGIFrom the tests on the real hardware it is possible to notice that, introducing disturbanceson the seesaw angle or moving Cart 1, the controller can stabilize the seesaw angle but notexactly in the zero position. This means that an integral action is missing both in the plantand in the controller and therefore it has to be added.

This last task requires the implementation of an integral action on the seesaw angle and teststhe controller performances also when an angle different from 0o is asked.

Task: LQGI

• Open the folder ’3_5_LQGI_Full’ in Matlab;

• Open the file ’simulation_LQGI_Full_Design.m’. Choose the weights for the LQRcontroller and the Observer following the LTR procedure.Bear in mind that now the controller works with 7 states, the 6 from the full statespace model (4) plus the one of the integrator on θ. Also the observer is built on thefull state space representation (4);

• Run the ’simulation_LQGI_Design.m’ m-file to obtain simulation results;

• Once LQR and Observer are considered acceptable, make sure the controller gains,K_lqg and K_i, and the observer matrices Aobs, Bobs, Cobs and Dobs are present inthe workspace. If not, run again the ’simulation_LQG_Full_Design.m’ file;

• Open the Simulink interface file ’LQGI_Full.mdl’ ;

• Start-up Procedure: follow the start-up procedure explained in task 3.2 or call theassistant if help is needed;

• Press the red emergency button if the controller does not respond in a good way;

• If the controller works, try to introduce some disturbances manually changing theseesaw angle.With the introduction of the integrator, now the control system should be able to bringthe seesaw always to the 0o angle position.

• Change the reference angle in the Simulink interface from 0o to ±5o.Test if the controller is able to stabilize the seesaw around this new set-point evenintroducing disturbances on its angle (manually).

• Check if the controller stabilizes the seesaw angle even when Cart 1 is moving awayfrom the 0 position.

Question: SISO Controller (optional)

The given control problem can be described as a Single-Input (the Cart 2 current) Single-Output (the seesaw angle) system. Why is it not asked to derive a standard SISO controllerbut directly a LQR one?

Suggestion: obtain the transfer function between the current and the angle from the state-space representation (4). What do you notice which makes the SISO synthesis complex?

15