<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://chemeng.up.ac.za/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wian+Smit</id>
		<title>Chemical Engineering @ UP wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://chemeng.up.ac.za/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wian+Smit"/>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php/Special:Contributions/Wian_Smit"/>
		<updated>2026-05-13T17:59:47Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.1</generator>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39325</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39325"/>
				<updated>2019-11-22T04:13:54Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Wian Smit, 2019 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
Available and useful documentation for this rig includes:&lt;br /&gt;
&lt;br /&gt;
* The latest manual (Update in 2019) for configuring and operating the rig can be found [https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf here].&lt;br /&gt;
* The latest diagrams of the rig can be found [https://drive.google.com/drive/u/1/folders/19zE0yqKaH7KwqEUk1z1irLhHWVoYiA6K here].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:''' The rig required very little maintenance. The level sensor wiring was not connected properly, and revision along the complete line revealed a loose connection that was fixed. The flow meter was cleaned to ensure less noise and accuracy when sensing flow. There were two leaks on the piping surrounding the flow meter and pressure gauge. These leaks were repaired.&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
'''Project Documentation:''' All the documentation, experimental data, and software developed during this project, can be found [https://drive.google.com/drive/u/1/folders/1O6G7cUIRA4gNSzfaRTKnwVpskbnz9JYe here].&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39324</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39324"/>
				<updated>2019-11-22T04:06:46Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
Available and useful documentation for this rig includes:&lt;br /&gt;
&lt;br /&gt;
* The latest manual (Update in 2019) for configuring and operating the rig can be found [https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf here].&lt;br /&gt;
* The latest diagrams of the rig can be found [https://drive.google.com/drive/u/1/folders/19zE0yqKaH7KwqEUk1z1irLhHWVoYiA6K here].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:''' The rig required very little maintenance. The level sensor wiring was not connected properly, and revision along the complete line revealed a loose connection that was fixed. The flow meter was cleaned to ensure less noise and accuracy when sensing flow. There were two leaks on the piping surrounding the flow meter and pressure gauge. These leaks were repaired.&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39323</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39323"/>
				<updated>2019-11-22T04:04:38Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
- The latest manual (Update in 2019) for configuring and operating the rig can be found [https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf here].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:''' The rig required very little maintenance. The level sensor wiring was not connected properly, and revision along the complete line revealed a loose connection that was fixed. The flow meter was cleaned to ensure less noise and accuracy when sensing flow. There were two leaks on the piping surrounding the flow meter and pressure gauge. These leaks were repaired.&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39322</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39322"/>
				<updated>2019-11-22T04:03:05Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Wian Smit, 2019 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
The latest manual (Update in 2019) for configuring and operating the rig can be found [https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf here].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:''' The rig required very little maintenance. The level sensor wiring was not connected properly, and revision along the complete line revealed a loose connection that was fixed. The flow meter was cleaned to ensure less noise and accuracy when sensing flow. There were two leaks on the piping surrounding the flow meter and pressure gauge. These leaks were repaired.&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39321</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39321"/>
				<updated>2019-11-22T03:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
The latest manual (Update in 2019) for configuring and operating the rig can be found [https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf here].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39320</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39320"/>
				<updated>2019-11-22T03:58:42Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
The latest manual (Update in 2019) for configuring and operating the rig can be found [https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf / here].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39319</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39319"/>
				<updated>2019-11-22T03:57:45Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
The latest manual (Update in 2019) for configuring and operating the rig can be found [[here]https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf].&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39318</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39318"/>
				<updated>2019-11-22T03:56:20Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
The latest manual for configuring and operating the rig can be found at *[https://drive.google.com/drive/u/1/folders/1qdXLhK4me_BBqJNJQvolAX7O8MUKdBjf]&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=PMC_Lab_Users&amp;diff=39317</id>
		<title>PMC Lab Users</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=PMC_Lab_Users&amp;diff=39317"/>
				<updated>2019-11-22T03:49:18Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Software set-up */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains information that new users to the PM&amp;amp;C labs will find useful. The set up of internet access, computers, etc. are discussed in the sections below. For more information about the rigs and equipment in the lab see [[PMC Lab|this page]].&lt;br /&gt;
&lt;br /&gt;
Information about using the PMC lab printer can be found [[Lab Printer|here]].&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
== New computers ==&lt;br /&gt;
&lt;br /&gt;
New computers have to be registered on the network. Technically, their NIC (Network Interface Card)s have to be registered. Send an email to [mailto:help@it.up.ac.za help@it.up.ac.za] and ask them to register a domain name. You could also phone them on x3051 (search for it on the [http://mx1.up.ac.za/ldap directory service]). If you phone remember to speak slowly and spell any complicated words like &amp;quot;acetone&amp;quot; or &amp;quot;dist&amp;quot; or &amp;quot;temperature&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The information you need to include is:&lt;br /&gt;
* A Name - We use names from [[Norse Mythology]].&lt;br /&gt;
* Your MAC address - Get this by running Start|run|cmd and typing ipconfig /all. This is the value after &amp;quot;Physical Address&amp;quot;. Avoid registering by using the NIC from the previous computer (you will have to stick with the name though).&lt;br /&gt;
* Your subnet - All of main campus is on the 137.215 subnet. The control lab (in fact, most of Eng II) is on the 137.215.117 subnet.&lt;br /&gt;
&lt;br /&gt;
You should be able to check that the help desk did their job by rebooting or by running Start|run|ipconfig/renew (this might take a day to be completed)&lt;br /&gt;
&lt;br /&gt;
The computers from Createk already have Microsoft XP Professional installed. They also have the [[Windows Update]] and [[Anti Virus|Anti-virus]] installed. The following needs to be changed/added (if necessary):&lt;br /&gt;
* The QoS Packet Scheduler Service (Service)&lt;br /&gt;
* Client for Microsoft Networks (Client)&lt;br /&gt;
* File and Printer Sharing for Microsft Networks (Service)&lt;br /&gt;
&lt;br /&gt;
This can be done by changing the properties of Lan connection under Network connections in the Control Panel. Then under the general tab, add the items (as services or clients) if not already there. Then run the network setup wizard (also in the control panel's network connections) using the default settings. You must be a member of the PROSESLAB workgroup. Do not create a setup disk and exit the wizard. You can now access and be accessed from other computers.&lt;br /&gt;
&lt;br /&gt;
== Software set-up ==&lt;br /&gt;
&lt;br /&gt;
Now that you have a new computer you need some software. In the lab you probably need the following:&lt;br /&gt;
&lt;br /&gt;
'''Microsoft Office''' - The university has some license with Microsoft so ask around where you can get an original CD.&lt;br /&gt;
&lt;br /&gt;
'''Acrobat Reader''' - The latest version starts instantly and is available from [ftp://ftp.up.ac.za/mirrors/adobe.com/ ftp.up.ac.za].&lt;br /&gt;
&lt;br /&gt;
'''[[Matlab]] 2007a''' - The latest version is required to run all the communication stuff we need. Remember to register the [[Opto22]] service&lt;br /&gt;
&lt;br /&gt;
'''[[Anti Virus|Anti-virus Software]]''' - A vital necessity&lt;br /&gt;
&lt;br /&gt;
'''[[Windows Update]]''' - A vital necessity&lt;br /&gt;
&lt;br /&gt;
'''Alternative Browser and Email Application''' - A mozilla.org based web browser and email client is strongly recommended. We try not to use Internet Explorer as it is useless and prone to viruses, worms and spyware. Check out the Mozilla web Suite (maybe the seamonkey version) or Firefox (the second most used browser). They are all available from [ftp://ftp.up.ac.za/mirrors/mozilla.org/ ftp.up.ac.za]. Mozilla and Firefox are far quicker, more reliable and more secure than Internet Explorer.  Tabbed browsing is another feature that will make you wonder why people still use Internet Explorer. You can also use Opera (but ensure that at least Firefox is on the rig computers. Thunderbird (also from Mozilla.org) is an excellent mail application. Ensure that automatic updates for the alternative browsers are turned off and rather use the new versions release on the ftp site to save that internet access.&lt;br /&gt;
&lt;br /&gt;
'''Some Media Player''' - Winamp 5 is recommended. In the lab we play music over Heimdall. The music is kept in &amp;lt;tt&amp;gt;C:\music&amp;lt;/tt&amp;gt; (this folder is not generally shared). It is recommended that you install NetAmp to control the volume of Heimdall from you workstation. This is useful if the phone rings etc. NetAmp is already installed on Heimdall as a server using the default port.&amp;lt;br/&amp;gt;&lt;br /&gt;
Downloads:&lt;br /&gt;
*[http://ragnarok.up.ac.za/programdownloads/Media/winamp509_pro.exe Winamp 5]&lt;br /&gt;
*[http://ragnarok.up.ac.za/programdownloads/Media/Netamp.exe NetAmp]&lt;br /&gt;
&lt;br /&gt;
'''VNC''' - This is a stylish program to allow you to access other computers directly. It is usefull if you want to access a rig computer form the comfort of your cubicle or if you need to change the playlist on heimdall while somebody else is using the screen for [[PMC Lab Computers|Ragnarok]]. On a rig computer you need to install the server as well (remember to add the standard password). You will also need to add it as an exception to the Windows XP firewall. On your personnel computer where you probably don't want people to have remote control you merely need to copy the small VNC Viewer program.&amp;lt;br/&amp;gt;&lt;br /&gt;
Downloads:&lt;br /&gt;
* [http://ragnarok.up.ac.za/programdownloads/VNC_WIN32/vncviewer/vncviewer.exe VNC Viewer]&lt;br /&gt;
* [http://ragnarok.up.ac.za/programdownloads/VNC_WIN32/vnc-3.3.6-x86_win32.exe Client and Server]&lt;br /&gt;
&lt;br /&gt;
'''Python''' - There are two versions of Python that may have to be installed. Version 3.7 is recommended as support for version 2.7 will be discontinued in 2020. It is recommended that you install the Anaconda distribution, which contains Spyder as a text editor and Jupyter Notebook as an interactive coding environment.&lt;br /&gt;
&lt;br /&gt;
== Internet access ==&lt;br /&gt;
&lt;br /&gt;
To get internet access a document (which needs to be signed by the head of the department) needs to be completed. This document can be obtained from Zenobia Botha (on floor 5, NWII building) or [http://www.up.ac.za/intranet/it/documentation/docs/INT1035.pdf here]. The completed form may be handed in at room 1-25, NWII building, or sent by email to [mailto:help@it.up.ac.za help@it.up.ac.za]. Applications are processed within three days. Applicants&lt;br /&gt;
must personally visit room 5-6, NWII building, to obtain their username and password – this is a security measure to protect the applicant.&lt;br /&gt;
&lt;br /&gt;
Unless the cost point, staff/student number and signature of the head of the department are provided, the application cannot be processed.&lt;br /&gt;
&lt;br /&gt;
There is a page containing details of [[Campus Proxy Servers]]&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	<entry>
		<id>http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39314</id>
		<title>Level and Flow</title>
		<link rel="alternate" type="text/html" href="http://chemeng.up.ac.za/wiki/index.php?title=Level_and_Flow&amp;diff=39314"/>
				<updated>2019-11-18T08:24:40Z</updated>
		
		<summary type="html">&lt;p&gt;Wian Smit: /* Previous Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Pmc04flow_rig.JPG|400px|right|thumb|The level and flow control rig]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
This rig is an interactive level and flow system consisting of two manipulated variables and two controlled variables (2x2 MIMO system) that can be used to investigate a number of alternative APC configurations. This rig is very robust and easy to operate but does require some maintenance on occasion to ensure that all pipe connections and seals are in a good condition.&lt;br /&gt;
&lt;br /&gt;
== Previous Projects ==&lt;br /&gt;
&lt;br /&gt;
This section describes some of the previous projects that was done on the level and flow rig to give you an idea of what has been done and where you can find the results obtained. Most important data contained in this section is information about what models were used/developed (if you want to reuse models) and what control strategies were employed (if you want to compare your results to something specific).&lt;br /&gt;
&lt;br /&gt;
=== Wian Smit, 2019 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of Python 2.7. The OpenOPC data is stored on a local server (run by KepWare pay to use software), while the OpenOPC Python module accesses the data and imports it to Python. The MPC was implemented successfully, although it is not robust across a wide range of operating conditions. &lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Used scipy.optimize.curve_fit to fit first order plus dead time models to the various step tests performed. While the model fits were accurate, some error in the data generation (or step testing) was made, due to the extreme hysteresis of the orange control valve. This valve was tuned from scratch twice during the project.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear FOPDT transfer function matrix. Reasonable accuracy (for the specific steady state condition).&lt;br /&gt;
&lt;br /&gt;
'''Recommended Changes:''' More tuning of the orange control valve positioner is required. Currently the valve is not producing a wide enough range in the system's control. Implementing fuzzy logic to start and stop the two pumps to force the system into certain steady state conditions will improve the robustness of the MPC. This will require the installation of two additional relays in the control panel (and using two more outputs on the OPTO22 module).&lt;br /&gt;
&lt;br /&gt;
=== Michael Stephens, Edgar Whyte and Neill Herbst, 2016 ===&lt;br /&gt;
'''Rebuild'''&lt;br /&gt;
The rig was completely rebuilt and now contains pluming to easily fill and drain the system water. &lt;br /&gt;
&lt;br /&gt;
'''Instrumentation communication''' The level transmitter, flow transmitter and the control valve receivers were connected, via the Junction Box, to the SNAP modules on the OPTO brain SNAP rack. The wiring is connected to the field instruments using the field rail and connected from the Junction Box to the ''OPTO'' brain using the Trunking on the roof of the lab. The Opto Brain was connected to the LAN and tests were done to ensure the two Opto brains are connected to the Network. The simulink software was updated to deal with the current configuration of the level and flow rig wiring and SNAP modules.&lt;br /&gt;
&lt;br /&gt;
'''Calibrate Instrumentation''' The level transmitter is calibrated using the ''optoEIEI''O software by relating the position of the level to a mA current signal. The flow transmitter was calibrated by using the current signal, in ''mA'', using the ''optoEIEIO'' software and the digital readout which displays the flow rate in ''gpm''. The accuracy of the digital read ou on the flow meter was tested using the level meter and was found to be accurate. The control valves were calibrated by using the adjust screw on both control valves to adjust the position of the stem so that when a 20mA signal is sent to the control valves the orange valve (reverse acting) corresponds to fully open and the green valve (direct acting) corresponds to fully closed.&lt;br /&gt;
&lt;br /&gt;
'''Step testing''' Step tests were conducted on the system by moving the position of the valves. Each step test was completed by moving one of the valves, keeping the other constant, and recording the time response to level and flow using Matlab. It was found that the level takes approximately 100 times longer to respond than the flow response with the level also having much larger time delays. The step tests confirmed the presence of non-linearities in the system.&lt;br /&gt;
&lt;br /&gt;
'''Maintenance''' The following maintenance was completed on the system:&lt;br /&gt;
* Mounted the Junction Box to the wall&lt;br /&gt;
* Built stand for delay unit&lt;br /&gt;
* Repaired flow meter &lt;br /&gt;
* Repaired the gas lines to the control valves&lt;br /&gt;
* Replaced wires on all transmitters and receivers&lt;br /&gt;
* Replaced 04FV011 that now fits on the 20 mm piping&lt;br /&gt;
&lt;br /&gt;
=== Jean-Pierre Cronje, 2015 ===&lt;br /&gt;
&lt;br /&gt;
'''Modeling:''' A first principle approach was used to model the level and flow rig. &amp;lt;br /&amp;gt;&lt;br /&gt;
A system of ordinary differential equations was derived and solved using numerical integration (Euler explicit method). The system's stiff nature necessitated very small integration intervals to ensure numerical stability. The fitting friction factors were adjusted heuristically to ensure that the model matches actual changes in output variables when the input variables are perturbed. These were the only parameters used to &amp;quot;tune&amp;quot; the model.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' Inspecting the open loop step response of the system to determine degree of interaction between the input-output variable pairs, showed that there is some interaction between the orange valve (pneumatic valve in line with the flow measurement) and flow, and significant interaction between the green valve and level. Despite the interactive nature of this system, conventional PI control (velocity form) was used successfully. &amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
'''OPC Interface:''' With the continued drive to migrate to open source software, it was deemed beneficial to make use of the following setup to establish communication between the the OPTO22 Ethernet B3000 Brain and the controller (PC).&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.kepware.com/products/kepserverex/ KEPServerEX V5] with OPTO Driver (Trial) was used as OPC Server to receive OPC communication requests from OPC Clients. The trial limitation restricts communication to a 2 hour time limit, requiring services to be restarted before communication can resume. This limitation was not restrictive, as most of the runs were completed within a 2 hour time frame. KEPServerEX V5 is only available for Windows operating systems, but performs well on a virtual machine (only VirtualBox was tested). Tags were created on the OPC Server corresponding to the points on the specific SNAP module. EU[X] is the address for the engineering value of point [X]. The point numbers can be retrieved from the OPTO Web interface accessed from 137.215.116.239 (OPTO B3000 Ethernet brain's static IP).&amp;lt;br /&amp;gt;	&lt;br /&gt;
*[http://openopc.sourceforge.net OpenOPC 1.2.0 for Python] was used as the OPC Client and the convenient Python interface enabled an easy interface between the Python based controller, historian and trending. It should be noted that OpenOPC is platform independent (works on Windows, Linux and MacOSX), but requires that a OpenOPC Gateway Service is running on a Windows machine elsewhere on the network (or virtual machine) to act as a proxy for all OPC calls. OpenOPC requires [https://pypi.python.org/pypi/Pyro/3.15 Pyro 3.15] to be part of your Python environment.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Maintenance:'''&amp;lt;br /&amp;gt;&lt;br /&gt;
*04FV001 was replaced due to an irreparable spindle leak.&amp;lt;br /&amp;gt;&lt;br /&gt;
*Various compression fittings were replaced due to broken gripper rings.&amp;lt;br /&amp;gt;&lt;br /&gt;
*O-rings were replaced on compression fittings where they were absent.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Norbertin Nkoghe Eyeghe, 2012 ===&lt;br /&gt;
&lt;br /&gt;
'''Rig Modifications:''' The various modifications and updates that were done on the Level &amp;amp; Flow rig were as follows: &amp;lt;br /&amp;gt;&lt;br /&gt;
* The pressure regulator device, supplying pressure to the rig was changed as the previous one was not working. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Level indicator measuring scale(with paper tape) were put up on the level measuring tank. The level scale varies from bottom (0) to top (22). &amp;lt;br /&amp;gt;&lt;br /&gt;
* The flow meter was opened and the inside wire connections were solded, as it was not working in the early stage of the project. &amp;lt;br /&amp;gt; &lt;br /&gt;
* The Flow meter was stuck with super glue so as to keep it still during operation and avoid noise in the process level measurement. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A T-junction fitting was added on the pipe connected to the orange valve so that it could service any other rig if need for that be. The slug flow rig used it as it experienced some issues with its own valve. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Control Strategy:''' The control strategy investigated was that of a linear MPC controller implementation on the rig. The intended objective for this project was to investigate the impact that the rig charateristics of deadtime, interaction and occurence of unmeasured disturbance could have on the rig. That objective had not quite successfully achieved as the controller tuning used seemed not to be adequate for proper closed loop simulation of the rig to be observed.&lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' The matlab interface was updated from those of previous projects. It was created so as to switch from openloop operation to closed loop operation by merely changing the positions of the switches on the Simulink model. It was named: LevelFlow_MPC_2012_final. All communication with the OPTO22 ENET B3000 brain (OPTO1)were working well at the time of the project. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Alternatively, the rig intrumentation can be connected to the OPC server in the aim testing the brain activity by entering the following: &amp;lt;br /&amp;gt;&lt;br /&gt;
*IPAddress:ItemType.Pointnumber. &amp;lt;br /&amp;gt;&lt;br /&gt;
* As an example: connecting all intrumentation wired to the SNAP module on position 0 on the rack1 of OPTO1, one could type. 137.215.116.239:state.0 and observe if the ETD indication of the brain is blinking to say there communication with the brain. The connection to the control valves wired to the SNAP on position1 would be: 137.215.116.239:EU.1 . State is used for digital point and EU for analog point. Refer to the brain user guide/manual on the OPTO link on the ragnarok wikipage for more info.&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:'''The designed controller was, in the end, implemented to the system derived continuous model and simulations were simply run from within MATLAB.&lt;br /&gt;
&lt;br /&gt;
'''Identification of rig model:''' The rig model was derived from the MATLAB System Identification Toolbox. The rig step test data were used to fit a model that was then converted to a continuous transfer function.&lt;br /&gt;
&lt;br /&gt;
=== Shown Breytenbach, 2011 ===&lt;br /&gt;
'''Control Strategy:''' Implement a theoretical controller. The time based controller uses the maximum amount of tank capacity to ensure that the least amount of changes are made to the flow. &lt;br /&gt;
&lt;br /&gt;
'''Matlab interface:''' A new matlab interface was created as the old one did not work on the new version of matlab. This included the following files: &amp;lt;br /&amp;gt; &lt;br /&gt;
* FlowLevel.m - OPTO22 interface file. &amp;lt;br /&amp;gt; &lt;br /&gt;
* waitforreal.m - real time clock for simulink. &amp;lt;br /&amp;gt; &lt;br /&gt;
* Rig_live.mdl - simulink interface that receives inputs between 0 -100% and gives output in 0-100% for the level and gpm or L/min for the flow. &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Controller implementation:''' The controller was implemented successfully and all communications worked correctly. The controller performed as expected during the test.&lt;br /&gt;
&lt;br /&gt;
'''Other notes:''' The system showed high interaction between the two contol loops. System parameters: &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (both valves): 8.4L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Max flow (one valve): 7.3L/min. &amp;lt;br /&amp;gt;&lt;br /&gt;
* Tank capacity: 10.9L &amp;lt;br /&amp;gt;&lt;br /&gt;
* Dimensions: 24cm(diameter) x 24cm  &lt;br /&gt;
&lt;br /&gt;
=== Lizette Verster, 2010 ===&lt;br /&gt;
'''Control Strategy:''' Dynamic Matrix Control using ''Aspen DMCplus'' software. The control objective was to maintain the level and flow rate between specified lower and upper limits while gradually driving the level to a set point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing (open loop). Identified models with ''Aspen DMCplus Model''. The model chosen was a finite impulse response (FIR) model with the time to steady state at 10 minutes.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Convolution models in the time domain. Medium Quality - models relating level to control valve position was very good but not so for the models relating flow rate to control valve position.&lt;br /&gt;
&lt;br /&gt;
=== Francois Pieterse, 2009 ===&lt;br /&gt;
'''Control Strategy:''' Model Predictive Control making use of ranged control algorithm to minimise MV move effort and optimiser to determine economic operating point.&lt;br /&gt;
&lt;br /&gt;
'''Model Identification:''' Manual step testing. Identified models with ''Honeywell Profit Design Studio''.&lt;br /&gt;
&lt;br /&gt;
'''Models:''' Linear. Transfer function Matrix. Low Quality.&lt;br /&gt;
&lt;br /&gt;
== Rig Problems ==&lt;br /&gt;
As with any design, there are a couple of fundamental problems with the design of the level and flow rig. This section is used to document these problems that, should the need to ever rebuild the rig arise, the persons responsible can have a complete list of all the pitfalls of the previous design so that they can attempt to correct them.&lt;br /&gt;
&lt;br /&gt;
- The level probe was not fixed to the tank 04TK001 that resulted in significant noise in the measurements since the probe was free to move and the discharging flow into the tank resulted in significant turbulence around the level probe. To remedy this positioners were mounted to ensure the level probe remains in position. A false bottom was also installed in the tank to minimise saturation of the level measurements.&lt;br /&gt;
&lt;br /&gt;
- The pumps are different. Technically you shouldn't put different sized pumps in parallel although the pumps may have similar charachteristics even though they have different physical sizes.&lt;br /&gt;
&lt;br /&gt;
- The pumps cannot be blocked in or isolated individually. At the time this comment was added the small pump was broken and alot of the head delivered by the big pump was dicipated by recirulating flow through the small pump. The ideal solution is using check valves although this may be unecesarily expensive. Hand valves to block out a pump in the event of failure should be included.&lt;br /&gt;
&lt;br /&gt;
- Upon re-commissioning of the rig after an extended shutdown period it is required to prime the system to achieve flow through the dead time element and into 04TK001. This can be achieved by closing gate valve 04FV001 and filling 04TK003 half with water, stopping the pumps and opening both the control valves fully, 04CV001 and 04CV002. Thereafter the system can be filled with water from the feed pipe into the dead time element. Ensure all other gate valves are in the appropriate position to purge all the air from the system. Upon completion open 04FV001 and start the pumps with a full system.&lt;/div&gt;</summary>
		<author><name>Wian Smit</name></author>	</entry>

	</feed>