system modelling using open modelica - cal polyfowen/et401/firstorderstepresponse.pdfthe resulting...

18
Create a model of a first-order system in Modelica… System modelling using Open Modelica Maine Maritime Academy – ET401, Automation and Control Fall semester 2018 by Prof Frank Owen, PhD, PE …then subject it to a step input… …to get a first-order step response (this will be used later to tune a PID controller for this system)

Upload: others

Post on 13-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Create a model of a first-order system in Modelica…

System modelling using Open ModelicaMaine Maritime Academy – ET401, Automation and Control

Fall semester 2018

by Prof Frank Owen, PhD, PE

…then subject it to a step input…

…to get a first-order step response

(this will be used later to tune a PID controller for this system)

Page 2: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

First you need to download and install the open-source modelling package OMEdit (Open-source Modelica GUI), available for both the Windows and iOS environments

Page 3: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

First order

Second order

New model

Page 4: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Create a first-order model

You can name thiswhatever you want

Page 5: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

First order

Drag the FirstOrder out into the workspace…

…now get a step input

Page 6: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Set thestartTime to 1

Hook the two together withyour mouse: click and dragaway from the output arrowon step1; then let loose the

mouse; then click on theinput arrow to firstOrder1

Page 7: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Set the steady-stategain to 200 °F

Set the time constantto 75 seconds

Page 8: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

On the buttonsacross the top, this is„ Simulation setup“

Set the simulationstop time to 400

seconds

When you press this button, you will get a prompt for a name to save thistoo. Enter a meaningful name, then

the simlation will start.

Page 9: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

If all goes well (you did

everything right), you will get a

success report like this…

Page 10: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

…and an output window like this.

To see the step response, you will need to check y

here; y is the output fromthe firstOrder block

Page 11: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

You can go back and forthbetween the model and theresult (Plotting) using these

buttons in the lower right cornerof OMEdit

Page 12: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

See more about first- and second-order step responses in Chapter 4 of Control Systems Engineering: A Practical Approach

Page 13: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Two identical DC motors, mechanically coupled together. Step input of 5 VDC applied to one motor, voltage out of second motor captured on an oscilloscope.

Page 14: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

The resulting step response is very noisy. It could be filtered, but the first-order nature of the response is evident, even with the noise.

This is the extracted data from the noise

curve at right.

Can you get the transfer function for this motor/generator set?

Page 15: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Homework problem 1

Create a simulation where the time constant is 8 seconds and the gain is -5

Show the time constant graphically on the graph Use electronic cut-and-paste into Word

Use the Word call-outs to point this out

Show the gain using the Word call-outs

How long does it take the system to reach its new equilibrium after the step? Show this on your diagram.

Page 16: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Homework problem 2

Create a simulation of a second-order, underdamped system with: A natural frequency of 1 Hz

A steady-state gain of 8

A 20% overshoot

A step response with a size of 2, triggered at t = 1 sec

Show in Word with call-outs: The 20%OS

The (approximate) period of 1 second

The peak time

Page 17: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Homework problem 3

Create a simulation of a PID controller with KP = 10

KI = 1

KD = 2

A step response with a size of 2, triggered at t = 1 sec

Show the response to a unit step input, triggered at 1 sec, running for 11 sec with: The effect of KP

The effect of KI

The effect of KD (the “derivative kick”)

Page 18: System modelling using Open Modelica - Cal Polyfowen/et401/FirstOrderStepResponse.pdfThe resulting step response is very noisy. It could be filtered, but the first-order nature of

Acknowledgement:

My thanks to the Università degli studi di Bergamo, Laboratorio di Automatica, whose generous support allowed me to find Modelica and then develop my skills in system modelling using that software