System modelling using Open Modelica Maine Maritime Academy ET401, Automation and Control Fall semester 2018 by Prof Frank Owen, PhD, PE Create a model of a first-order system in Modelica 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)
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
New model First order Second order
Create a first-order model You can name this whatever you want
Drag the FirstOrder out into the workspace First order now get a step input
Hook the two together with your mouse: click and drag away from the output arrow on step1; then let loose the mouse; then click on the input arrow to firstorder1 Set the starttime to 1
Set the steady-state gain to 200 F Set the time constant to 75 seconds
On the buttons across the top, this is Simulation setup Set the simulation stop time to 400 seconds When you press this button, you will get a prompt for a name to save this too. Enter a meaningful name, then the simlation will start.
If all goes well (you did everything right), you will get a success report like this
and an output window like this. To see the step response, you will need to check y here; y is the output from the firstorder block
You can go back and forth between the model and the result (Plotting) using these buttons in the lower right corner of OMEdit
See more about first- and second-order step responses in Chapter 4 of Control Systems Engineering: A Practical Approach
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.
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?
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.
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
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 )
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