Page 854 - Mechatronics with Experiments
P. 854
840 MECHATRONICS
2
Speed
1 + M 1 1
– s s
Force –
Mass Integrator Integrator 1 1
Position
K
Damping
C
Spring
®
FIGURE A.12: Simulink model of a mass-spring-damper system.
In order to delete a line, select the line with the mouse, and hit “Delete” key or use
the Edit → Delete menu item.
To remove a connection without deleting it, select it, pick the edge of the connection,
and move it.
To make a straight line into a non-straight line, select the line, pick a point on the
line, and drag it while holding the “Shift” key.
®
Grouping of Blocks: Simulink supports block hierarchy. A block can be made of smaller
sub-blocks. The hierarchy can be many layers deep. An existing group of blocks can be
grouped into a single “sub-system block.” In order to group a set of blocks into a “sub-
system block,” select them with the mouse in a rectangular select box (left click to define
the corner of the bounding rectangle, then drag the move to include the blocks desired in
the sub-system, and release the move), then right click to bring up the context-sensitive
menu, then select from menu
Edit → Create SubSystem
The set of blocks will now be replaced by a sub-system block. The new block will
show the input ports and output ports of the grouped set and hide the details. In order to
look into the details of the sub-system block (lower level hierarchy details), double click
on the sub-system block. It will open a new window with the details of the block (Figures
A.12 and A.13).
®
Grouping of blocks is a very useful tool in designing Simulink models with clear
graphical and logical organization. Good programming practice dictates that the systems
should be divided into sub-systems, and then those sub-systems should be divided into
Position 1
Pos 1
1 Force
FIGURE A.13: The mass-spring-damper
Force Speed 2 system is grouped into a sub-system block
Vell showing the input and output ports, hiding
Mass-spring-damper system the internal details of it.