Virtial Reality Tank | Virtual Reality | Technology

# ZRS

CTU in Prague, CZ - 2009

Virtual Virtual Model Model Design Design (in (in Matlab) Matlab)
Jirka Roubal
roubalj@control.felk.cvut.cz 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–

P. J. http://www.dce.mathworks. [cit. Zaklady regulaˇ cn´ ı techniky v pˇ r´ ıkladech. Simulink Model in Matlab 2. Examples References ´ R OUBAL .cvut. http://support. 2009-01-16].com/ . H U S SPOL . J. CZ . Pracovn´ ı verze. T HE M ATHWORKS (2008). CTU in Prague –2/19– . [cit.ZRS CTU in Prague. Jirkovy stranky [online].. VR Model 4. The Mathworks [online].felk.dce. 2008-07-20].cvut. http://support. Roubal.cz/pub/roubalj/ . & R OUBAL . Mask of the Subsystem 3.cz/pub/roubalj/ . (2009).felk.2009 Contents and References Contents 1. J. ˇ EK . ´ (200x).

which consists of a rotary-pump.1 Example of Water Tank System Consider a model of the water tank. a tank. are Figure 1: Water tank system J. The ﬂuid can drain away from the tank through the output valve. umax = 10 V. Roubal. the rotary-pump The minimum and maximum of the input voltage umin = 0 V. CTU in Prague –3/19– .3 m. The tank is ﬁlled with the ﬂuid by the rotary-pump. The height of the tank is 0. inﬂow and outﬂow pipes and an output valve. The system input is the voltage of the motor of u [V] and the system output is the level of the ﬂuid in the tank h [m].2009 Simulink Model in Matlab 1 Simulink Model in Matlab 1. CZ .ZRS CTU in Prague.

Figure 2: Simulink model of the water tank In the blocks in Figure 2 are ﬁlled variables condition of the integrator block 1/s. & The model of the system can be written as (R OUBAL . J. Roubal. J. b.. 200x) (1) ˙ (t) = −ko h h(t) + bu(t) and the simulink scheme (T HE M ATHWORKS 2008) of model (1) is in Figure 2.ZRS CTU in Prague. P. H U S SPOL . CTU in Prague Umin.2009 Simulink Model in Matlab ˇ EK . CZ . Umax. ko and ho as an initial –4/19– .

. or write help. CZ . set some parameters of the model.2009 Mask of the Subsystem 2 Mask of the Subsystem Now. see Figure 5. and draw some picture on the block. see Figure 6. we can Mask Subsystem .ZRS CTU in Prague. we select the model components (in Figure 2) and click on Create subsystem. If we doubleclick on the blue block in Figure 3.. J. 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). Roubal. the model of the system (shown in Figure 2) will be opened. CTU in Prague –5/19– . see Figure 7.

the data can be used in Matlab workspace to plot Note. it is appropriate to set in the the graphs.ZRS CTU in Prague. Roubal.2009 Mask of the Subsystem Scope enough Limit data points to last and Save data to workspace . CZ . (a) Scope (b) Scope settings Figure 4: Scope settings J. CTU in Prague –6/19– .

2009 Mask of the Subsystem Figure 5: Mask of the subsystem: picture on the subsystem J. CZ . CTU in Prague –7/19– .ZRS CTU in Prague. Roubal.

CTU in Prague –8/19– .ZRS CTU in Prague. CZ .2009 Mask of the Subsystem Figure 6: Mask of the subsystem: parameters of the subsystem J. Roubal.

CZ . Roubal.2009 Mask of the Subsystem Figure 7: Mask of the subsystem: help of the subsystem J.ZRS CTU in Prague. CTU in Prague –9/19– .

Roubal.2009 Mask of the Subsystem Then. the model in the Simulink looks like in Figure 8(a) and if we doubleclick on the model. CZ . CTU in Prague –10/19– . (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.ZRS CTU in Prague. we can set the model parameters in the dialog window. see Figure 8(b).

in dialog window. CZ . CTU in Prague –11/19– . Then. we click on Signal Expander and VR Sink and set the VR Signal Expander as in Figure 10(a) and in the dialog window shown in Fi- New button. Then we can connect the output of the VR expander to the input of VR Sink. see Figure 11. shown in Figure 12. Roubal.ZRS CTU in Prague. Figure 9: Simulink model of the system with Virtual Reality toolbox blocks J. click on scale in the water branch. we add from the VR Toolbox library blocks VR gure 10(b).2009 VR Model 3 VR Model Now. see Figure 13. where we put some objects and change the name of the object (default name is Transform) and save the WRL ﬁle. The VRML editor will open.

CZ . Roubal.ZRS CTU in Prague.2009 VR Model (a) VR Signal Expander (b) VR Sink Figure 10: VR Signal Expander and VR Sink block dialog windows J. CTU in Prague –12/19– .

2009 VR Model Figure 11: VRML Editor J.ZRS CTU in Prague. CTU in Prague –13/19– . Roubal. CZ .

CZ . Roubal.2009 VR Model Figure 12: Dialog windows of the WRL ﬁle J. CTU in Prague –14/19– .ZRS CTU in Prague.

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 (R OUBAL . 2009). J. J. CZ .ZRS CTU in Prague. Roubal. CTU in Prague –15/19– .

ZRS CTU in Prague. CZ . 200x). J.2009 Other Examples 4 Other Examples Several models with virtual realities were prepared within the students bachelor thesis and are described in (R OUBAL . et al. Figure 14: Coupled tanks system with Virtual Reality J. Roubal. CTU in Prague –16/19– .

ZRS CTU in Prague.2009 Other Examples Figure 15: Mass on spring system with Virtual Reality Figure 16: Double mass on springs system with Virtual Reality J. Roubal. CZ . CTU in Prague –17/19– .

ZRS CTU in Prague. CTU in Prague –18/19– .2009 Other Examples Figure 17: Inverted pendulum system with Virtual Reality Figure 18: Ball on plate system with Virtual Reality J. CZ . Roubal.

.. CZ . Roubal. J. Questions . CTU in Prague –19/19– .ZRS CTU in Prague. • Prepare a Simulink model with the Virtual Reality within your semestral work.2009 Questions ...

Sign up to vote on this title