virtial reality tank
TRANSCRIPT
![Page 1: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/1.jpg)
ZRS CTU in Prague, CZ - 2009
Virtual Model DesignVirtual Model DesignVirtual Model Design
(in Matlab)(in Matlab)(in Matlab)
Jirka Roubal
〈http://support.dce.felk.cvut.cz/pub/roubalj/〉
Department of Control Engineering, Faculty of Electrical Engineering
Czech Technical University in Prague
〈www.cvut.cz〉
2009
J. Roubal, CTU in Prague –1/19–
![Page 2: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/2.jpg)
ZRS CTU in Prague, CZ - 2009 Contents and References
Contents
1. Simulink Model in Matlab
2. Mask of the Subsystem
3. VR Model
4. Examples
References
ROUBAL, J. (2009), Jirkovy stranky [online]. [cit. 2009-01-16],
〈http://support.dce.felk.cvut.cz/pub/roubalj/〉.
ROUBAL, J., HUSEK, P. & SPOL. (200x), Zaklady regulacnı techniky v prıkladech, Pracovnı
verze. 〈http://support.dce.felk.cvut.cz/pub/roubalj/〉.
THE MATHWORKS (2008), The Mathworks [online]. [cit. 2008-07-20],
〈http://www.mathworks.com/〉.
J. Roubal, CTU in Prague –2/19–
![Page 3: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/3.jpg)
Figure 1: Water tank system
Consider a model of the water tank, which con-
sists of a rotary-pump, a tank, inflow and outflow
pipes and an output valve. The tank is filled with
the fluid by the rotary-pump. The fluid can drain
away from the tank through the output valve.
The system input is the voltage of the motor of
the rotary-pump u [V] and the system output is
the level of the fluid in the tank h [m].
The minimum and maximum of the input voltage
are umin = 0 V, umax = 10 V. The height of
the tank is 0.3 m.
ZRS CTU in Prague, CZ - 2009 Simulink Model in Matlab
1 Simulink Model in Matlab
1.1 Example of Water Tank System
J. Roubal, CTU in Prague –3/19–
![Page 4: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/4.jpg)
ZRS CTU in Prague, CZ - 2009 Simulink Model in Matlab
The model of the system can be written as (ROUBAL, J., HUSEK, P. & SPOL. 200x)
h(t) = −ko
√
h(t) + bu(t) (1)
and the simulink scheme (THE MATHWORKS 2008) of model (1) is in Figure 2.
Figure 2: Simulink model of the water tank
In the blocks in Figure 2 are filled variables Umin, Umax, b, ko and ho as an initial
condition of the integrator block 1/s.
J. Roubal, CTU in Prague –4/19–
![Page 5: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/5.jpg)
ZRS CTU in Prague, CZ - 2009 Mask of the Subsystem
2 Mask of the Subsystem
Now, we select the model components (in Figure 2) and click on Create subsystem. If
we doubleclick on the blue block in Figure 3, the model of the system (shown in Figure 2) will
be opened.
Figure 3: Subsystem of the Simulink model
If we click by right button of the mouse on the subsystem (blue block shown in Figure 3), we
can Mask Subsystem ... and draw some picture on the block, see Figure 5, set some
parameters of the model, see Figure 6, or write help, see Figure 7.
J. Roubal, CTU in Prague –5/19–
![Page 6: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/6.jpg)
ZRS CTU in Prague, CZ - 2009 Mask of the Subsystem
Note, it is appropriate to set in the Scope enough Limit data points to last
and Save data to workspace - the data can be used in Matlab workspace to plot
the graphs.
(a) Scope (b) Scope settings
Figure 4: Scope settings
J. Roubal, CTU in Prague –6/19–
![Page 7: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/7.jpg)
ZRS CTU in Prague, CZ - 2009 Mask of the Subsystem
Figure 5: Mask of the subsystem: picture on the subsystem
J. Roubal, CTU in Prague –7/19–
![Page 8: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/8.jpg)
ZRS CTU in Prague, CZ - 2009 Mask of the Subsystem
Figure 6: Mask of the subsystem: parameters of the subsystem
J. Roubal, CTU in Prague –8/19–
![Page 9: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/9.jpg)
ZRS CTU in Prague, CZ - 2009 Mask of the Subsystem
Figure 7: Mask of the subsystem: help of the subsystem
J. Roubal, CTU in Prague –9/19–
![Page 10: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/10.jpg)
ZRS CTU in Prague, CZ - 2009 Mask of the Subsystem
Then, the model in the Simulink looks like in Figure 8(a) and if we doubleclick on the model, we
can set the model parameters in the dialog window, see Figure 8(b).
(a) Subsystem (b) Dialog window of the masked subsystem
Figure 8: Subsystem with the mask in Simulink model and dialog window of the masked subsystem
J. Roubal, CTU in Prague –10/19–
![Page 11: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/11.jpg)
ZRS CTU in Prague, CZ - 2009 VR Model
3 VR Model
Now, we add from the VR Toolbox library blocks VR Signal Expander and VR Sink
and set the VR Signal Expander as in Figure 10(a) and in the dialog window shown in Fi-
gure 10(b), we click on New button. The VRML editor will open, see Figure 11, where we put
some objects and change the name of the object (default name is Transform) and save
the WRL file. Then, in dialog window, shown in Figure 12, click on scale in the water
branch. Then we can connect the output of the VR expander to the input of VR Sink, see Fi-
gure 13.
Figure 9: Simulink model of the system with Virtual Reality toolbox blocks
J. Roubal, CTU in Prague –11/19–
![Page 12: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/12.jpg)
ZRS CTU in Prague, CZ - 2009 VR Model
(a) VR Signal Expander (b) VR Sink
Figure 10: VR Signal Expander and VR Sink block dialog windows
J. Roubal, CTU in Prague –12/19–
![Page 13: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/13.jpg)
ZRS CTU in Prague, CZ - 2009 VR Model
Figure 11: VRML Editor
J. Roubal, CTU in Prague –13/19–
![Page 14: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/14.jpg)
ZRS CTU in Prague, CZ - 2009 VR Model
Figure 12: Dialog windows of the WRL file
J. Roubal, CTU in Prague –14/19–
![Page 15: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/15.jpg)
ZRS CTU in Prague, CZ - 2009 VR Model
Figure 13: Simulink model of the system with Virtual Reality
The Simulink model with the Virtual Reality of the Water Tank can be found in (ROUBAL, J.
2009).
J. Roubal, CTU in Prague –15/19–
![Page 16: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/16.jpg)
ZRS CTU in Prague, CZ - 2009 Other Examples
4 Other Examples
Several models with virtual realities were prepared within the students bachelor thesis and are
described in (ROUBAL, J. et al. 200x).
Figure 14: Coupled tanks system with Virtual Reality
J. Roubal, CTU in Prague –16/19–
![Page 17: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/17.jpg)
ZRS CTU in Prague, CZ - 2009 Other Examples
Figure 15: Mass on spring system with Virtual Reality
Figure 16: Double mass on springs system with Virtual Reality
J. Roubal, CTU in Prague –17/19–
![Page 18: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/18.jpg)
ZRS CTU in Prague, CZ - 2009 Other Examples
Figure 17: Inverted pendulum system with Virtual Reality
Figure 18: Ball on plate system with Virtual Reality
J. Roubal, CTU in Prague –18/19–
![Page 19: Virtial Reality Tank](https://reader031.vdocuments.us/reader031/viewer/2022030315/577cce2b1a28ab9e788d813d/html5/thumbnails/19.jpg)
ZRS CTU in Prague, CZ - 2009 Questions ...
Questions ...
• Prepare a Simulink model with the Virtual Reality within your semestral work.
J. Roubal, CTU in Prague –19/19–