Académique Documents
Professionnel Documents
Culture Documents
with VisSim
What is VisSim?
VisSim helps you model linear and non-linear dynamic systems - "anything that moves"
Blocks
Blocks are placed on the worksheet from the Blocks drop down menu
Blocks can generally be divided into three categories...
Blocks that produce signals that "travel" through the system
Blocks that consume signals - these are used to display the results
of your simulation
And everything else. These are typically used to transforms signals from one
form to another, create animations, or read in external data. At their simplest
level, they might add two signals together. At their most complex level, they
might be used to numerically integrate a signal over time or represent a transfer
function
Hello World
Let's try the VisSim equivalent of "Hello World". We can't get much simpler than adding two numbers together!
STEP 1
Select const from the Signal Producer menu with a
left-click.
Left -click to
place the block
STEP 2
Place another const block on the worksheet, together with a summingJunction (from the Arithmetic menu) and a display
block (from the Signal Consumer menu)
STEP 3
Left -click at this point and keep the
mouse button held down.
STEP 4
Wire the other blocks together.
STEP 5
Move the mouse pointer over the top
const block
STEP 6
Select Go from the Simulate menu
(or press F5 or click the
button)
Quick Tip...
Eureka!
Hold down the Ctrl key and press the rightmouse button to change the sign of the branch
STEP 1
Assemble the following blocks. The centre portion (between the sinusoid and the plot block) is the derivative operation.
STEP 2
Drag a selection box around the following blocks
STEP 3
Select Create Compound Block from the Edit menu and
make the following changes
3
1
Spring Constant
Constant Damping
Mass
Vertical Displacement
From Newton's Second Law, the equation of motion for the damped harmonic oscillation is
Integral equations are more numerically stable than differential equations. The first step is to isolate the
derivate with the highest degree on the LHS:
Integrating the acceleration gives the velocity. Integrating the velocity gives the position. Within VisSim, this
would look like:
The initial condition (x(0) = 3) is set in the second integrator block (by right-clicking on the block to bring up
the Integrator Properties menu).
To form the whole equation in VisSim we need to
1) Multiply the position by K
2) Multiply the velocity by B
3) Add these two quantities together with a summingJunction
4) Multiply the sum by -1/M with a gain block
5) Wire the output of the gain block to the input of the acceleration block
The completed simulation would look like:
Quick Tip...
In the simulation above we set the initial conditions for the position inside the integrator block. However, initial conditions can also be set within the
represent velocity at time t, with x(0) = 3. In VisSim, the position x(t) is given by
actual simulation environment itself. For example, let
We'll now develop a model of a classical PID Control Loop and optimise the gains so that we minimise risetime and overshoot.
The model will consist of three sections: 1) the control loop, 2) a "cost" function that measures how close we
are to our optimisation goal, and 3) the parameters that we want to vary to minimize the cost function.
3. The Parameters.
We use parameterUnkown blocks to specify what parameters we want to vary to minimise the cost function
Run the simulation and your plot block should look something like this
www.adeptstore.com
Copyright 2004 Adept Scientific plc. All rights reserved. All trademarks recognised. E&OE