sce4206 exam2013 - solutions · 2018. 6. 11. ·...
Post on 23-Jan-2021
0 Views
Preview:
TRANSCRIPT
Telemark University College
Final Test with Suggested Solutions
Note! Others solutions, answers, etc. may also be valid.
Course: SCE4206 Systems and Control Laboratory
Teacher: Hans-‐Petter Halvorsen
Class: SCE2
Date: 2013.12.04
Time: 09:00-‐12:00
The assignment contains:
Pages: 17 (incl. this page)
Tasks: 5
Attachments:
None
Aids:
Calculator
The test counts 40% of the final grade in the course.
There are 5 equally weighed tasks (A-‐E), select only 3 of these tasks.
Note! If you miss assumptions for solving some of the problems, you must define proper assumptions yourself.
You have approximately 60 minutes on each task. Short answers are required.
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
2
Lab A (20p): SCADA System
Task A.1 (5p)
Solution:
Different parts:
+ Explanations….
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
3
Task A.2 (10p)
Solution:
Example:
+ Explanations…
Task A.3 (5p)
Solution:
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
4
Lab B (20p): DAQ and Process Control in C#
Task B.1 (2p)
Solution:
Windows Forms:
The “old way” of programming Windows applications with GUI in Visual Studio/.NET.
WPF:
The “new way” of programming Windows applications with GUI in Visual Studio/.NET.
In addition to “graphically” create your GUI you can programatically design your GUI using socalled XAML (Extensible Application Markup Language).
Task B.2 (9p)
Solution:
PID Class Example: class PidController {
public double r; //Reference Value public double Kp; //Proportional Gain for PID Controler public double Ti; //Integral Time for PID Controler public double Ts; //Sampling Time private double z; //Internal variable public double PiController(double y) { double e; // Error between Reference and Measurement double u; // Controller Output //PID Algoritm e = r - y; u = Kp * e + (Kp / Ti) * z; z = z + Ts * e; return u; } }
We then initialize the PidController Class: PidController pidControl = new PidController
{ Ts=0.1, r=5, Kp=0.8, Ti=15 };
Finally we use the controller: private void ControlSystem()
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
5
{
//Write Control Value if (switchController.Value == true) //Use Manual Control { controllerOutput = sliderControl.Value; } else // Use PID Control { controllerOutput = pidControl.PiController(levelMeasurement); //Scaling controllerOutput = controllerOutput / 4; //0-20cm -> 0-5V //Set boundaries if (controllerOutput < 0) controllerOutput = 0; if (controllerOutput > 5) controllerOutput = 5;
} myDaqData.WriteDaqData(controllerOutput); //Write to DAQ }
Task B.3 (9p)
Solution:
DAQ Class Example: public class DaqData { public double ReadDaqData() { ... } public void WriteDaqData(double analogDataOut) { ... } }
The ReadDaqData() method handles the logic for reading from the DAQ device: public double ReadDaqData() { Task analogInTask = new Task(); AIChannel myAIChannel; myAIChannel = analogInTask.AIChannels.CreateVoltageChannel( "dev1/ai0", "myAIChannel", AITerminalConfiguration.Differential, 0, 5, AIVoltageUnits.Volts ); AnalogSingleChannelReader reader = new AnalogSingleChannelReader(analogInTask.Stream);
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
6
double analogDataIn = reader.ReadSingleSample(); return analogDataIn; }
The WriteDaqData() method handles the logic for writing to the DAQ device: public void WriteDaqData(double analogDataOut) { Task analogOutTask = new Task(); AOChannel myAOChannel; myAOChannel = analogOutTask.AOChannels.CreateVoltageChannel( "dev1/ao0", "myAOChannel", 0, 5, AOVoltageUnits.Volts ); AnalogSingleChannelWriter writer = new AnalogSingleChannelWriter(analogOutTask.Stream); writer.WriteSingleSample(true, analogDataOut); }
Using the DAQ Class Example: private void timer1_Tick(object sender, EventArgs e) { DaqData myDaqData = new DaqData(); //Read Data double analogDataIn; analogDataIn = myDaqData.ReadDaqData(); if (analogDataIn < 0) analogDataIn = 0; if (analogDataIn > 5) analogDataIn = 5; //Scaling: analogDataIn = analogDataIn * 4; //0-5V -> 0-20cm tank.Value = analogDataIn; txtLevelValue.Text = analogDataIn.ToString("0.00"); //Write Data double analogDataOut; analogDataOut = sliderControl.Value; myDaqData.WriteDaqData(analogDataOut); }
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
7
Lab C (20p): System Identification and Estimation
Task C.1 (2p)
Solution:
The state-‐space model becomes: 𝑥!𝑥!𝑥!!
=3 0 20 0 50 0 1
!
𝑥!𝑥!𝑥!!
+0 54 00 0!
𝑢!𝑢!!
𝑦!𝑦!!
= 0 0 22 3 0
!
𝑥!𝑥!𝑥!!
+ 0 00 7!
𝑢!𝑢!!
Task C.2 (6p)
Solution:
The Least square method can be written as:
𝑌 = Φ𝜃
Least Square formula:
𝜃!" = (Φ!Φ)!!Φ!Y
We need to sett the equation on the form:
𝑌 = Φ𝜃
The first step is to create a discrete version, using Euler:
𝑇!"#,!!! − 𝑇!"#,!
𝑇!=1𝜃!
−𝑇!"#,! + 𝐾!𝑢! + 𝑇!"#
This gives: 𝑇!"#,!!! − 𝑇!"#,!
𝑇!=1𝜃!
−𝑇!"#,! + 𝐾!𝑢! + 𝑇!"#
And we finally get:
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
8
𝑇!"#,!!! − 𝑇!"#,!𝑇!!
= −𝑇!"#,! 𝑢! 1!
1𝜃!𝐾!𝜃!𝑇!"#𝜃!!
𝑌 is a vector, Φ is a matrix, 𝜃 is a vector with the unknowns we want to find.
We find the uknowns by solving:
𝜃!" = (Φ!Φ)!!Φ!Y
Task C.3 (12p)
Solution:
We get:
𝑥! = 0
𝑥! =1𝐴 𝑥! − 𝐾!𝑢
or:
𝑥! = 0
𝑥! =1𝐴 𝑥! −
1𝐴𝐾!𝑢
The state-‐space model becomes:
𝑥!𝑥!
=0 01𝐴 0!
𝑥!𝑥! +
0
−𝐾!𝐴!
𝑢
𝑦 = 0 1!
𝑥!𝑥!
We find the discrete state-‐space model on the following form:
𝑥!!! = 𝐴𝑥! + 𝐵𝑢!
𝑦! = 𝐶𝑥! + 𝐷𝑢!
We use the Euler Forward discretization method:
𝑥 ≈𝑥 𝑘 + 1 − 𝑥(𝑘)
𝑇!
This gives:
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
9
𝑥! 𝑘 + 1 − 𝑥!(𝑘)𝑇!
= 0
𝑥! 𝑘 + 1 − 𝑥!(𝑘)𝑇!
=1𝐴 𝑥!(𝑘)−
1𝐴𝐾!𝑢(𝑘)
Further:
𝑥! 𝑘 + 1 = 𝑥!(𝑘)
𝑥! 𝑘 + 1 =𝑇!𝐴 𝑥! 𝑘 + 𝑥! 𝑘 −
𝑇!𝐾!𝐴 𝑢(𝑘)
𝑦 𝑘 = 𝑥!(𝑘)
This gives the following discrete state-‐space model:
𝑥! 𝑘 + 1𝑥! 𝑘 + 1
=1 0𝑇!𝐴 1!
𝑥!(𝑘)𝑥!(𝑘)
+0
−𝑇!𝐾!𝐴!
𝑢(𝑘)
𝑦(𝑘) = 0 1!
𝑥!(𝑘)𝑥!(𝑘)
Control System:
LabVIEW Example:
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
10
+ Explanations…
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
11
Lab D (20p): DeltaV Process System
Task D.1 (4p)
Solution:
See sketch below:
+++, etc.
Task D.2 (8p)
Solution:
DeltaV is a type of industrial control system (ICS) from Emerson Process Management. Industrial control systems are computer controlled systems that monitor and control industrial processes that exist in the physical world.
DeltaV Overview sketch:
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
12
Software Modules:
• DeltaV Database Administration: Here you have the ability to copy databases or create new databases so that you can program from a blank module. This is especially desirable if we are to use the drive on multiple systems or users to practice configuring the DeltaV. Data is then stored only in the database is active. One can navigate at will between these, and you do not have an application that is preloaded to be changed
• DeltaV Explorer: It is in the "Explorer" to build strategy and hierarchy of programming by creating modules to acquire inputs and outputs.
• DeltaV Control Studio: In "Control Studio" goes the logic controller to DeltaV. Everything that happens between inputs and outputs are configured here. It is based on the "drag-‐and-‐drop" principle. You select blocks and they go to the main window. These can be combined and modified to suit individual needs. The blocks are linked to inputs and outputs. It also sets the range of the components required to connect to the system.
• DeltaV Operate Configure: HMI Configuration. Yo design and link the GUI elements.
• DeltaV Operate Run: When the system is in production this is the module used by the operators.
• DeltaV User Manager: Here you have the possibility to restrict access to different users and set passwords for them. An operator can, for example, only have access to change set points, driving valves, acknowledge alarms and navigate the pictures. However, an administrator may be able to transform images, adjust the controller parameters and make changes to the system. The supply is then adapted username and password.
• DeltaV Process History View
• System Alarm Management
System Alarm Management in DeltaV:
Screen shots for Alarm Management in DeltaV:
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
13
It is in Alarm Management System to configure the properties of the alarms. Adding alrams are done in the Control Studio.
Task D.3 (8p)
Solution:
An Alarm system is part of the Process Control System:
+++, etc.
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
14
Lab E (20p): DAQ System for Measurements and Monitoring
Task E.1 (8p)
Solution:
Data acquisition is the process of sampling signals that measure real world physical conditions and converting the resulting samples into digital numeric values that can be manipulated by a computer. The components of data acquisition systems include:
Sensors that convert physical parameters to electrical signals.
Signal conditioning circuitry to convert sensor signals into a form that can be converted to digital values.
Analog-‐to-‐digital converters, which convert conditioned sensor signals to digital values.
Different DAQ systems used in the lab work:
1. ZigBee
2. Wi-‐Fi DAQ
3. NI CompactRio (cRIO) platform
1. ZigBee
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
15
+ some explanations…
2. Wi-‐Fi DAQ
+ some explanations…
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
16
3. The NI CompactRio (cRIO) platform
+ some explanations…
Task E.2 (8p)
Solution:
See sketch below:
+ some explanations…
Task E.3 (4p)
Solution:
Web Service: A Web service is a method of communication between two electronic devices over World Wide Web. A Web service is a software function provided at a network address over the web or the cloud
SCE4206 Systems and Control Laboratory – Final Test 2013 with Solutions
17
PT-‐100: Pt-‐100 element, temperature sensor based on a resistance that changes with temperature. The resistor is of platinum and is 100 ohms at 0 ° C, hence the name. Pt-‐100 elements are highly accurate, and used in contexts where there is a need for accurate temperature measurements.
Gateway:
A gateway coordinates communication between distributed WSN measurement nodes and the host controller.
Data Dashboard for LabVIEW:
An App availibe for iOS (iPhone, iPad), Android and Windows 8 Modern UI/Windows Store App. This App can receive and present data generated from a Web Service created in LabVIEW.
top related