Visual ModelQ Reference Manual

Version 6.2.0, August 27, 2004

Table of Contents

Instruments Tab

Oscilloscope

Dynamic Signal Analyzer

Variable

Live Scope

Two-Channel Live Scope

Waveform Generator

Data Logger

 

Constants

Simple Constant

Live Constant

Inverse Live Constant

Scale-by Simple Constant

Scale-by Live Constant

Scale-by Inverse Live Constant

String Live Constant

Push Button

Live Switch

 

Misc Tab

Solver

Time

Stop

Extender

Extender Output

Anchor

Note

 

Math Tab

Add

Add (3 input)

Subtract

Multiply

Multiply (3 input)

Divide

Scale-by

Inverse Scale-by

Square Root

Square Root of Sum of Squares

1/x

1/x with Magnitude Limit

Absolute Value

Minus x

Modulo

Quantize

Linear Interp

Linear Interp (Odd)

Linear Interp (Even)

 

Trans Tab

Sine

Cos

Tan

arc Sin

arc Cos

arc Tan

arc Tan(y, x)

Coordinate Transform

Exp

Log

Log10

Y^x

Y^N

 

Meters Tab

RMS Meter

DC Meter

Peak Meter

Harmonic Meter

Timer

Counter

Inspector

Triggered Inspector

Lamp

Bar Meter

Dial Meter

Banner

Windows Message

 

Logic Tab

And

Nand

Or

Nor

Xor

NXor

Buffer

Not

Timed Buffer

JK Flip Flop

 

Compare Tab

Equal To

Not Equal To

Less Than

Less Than or Equal To

Greater Than

Greater Than or Equal To

Minimum

Maximum

 

Waveforms Tab

Cosine Wave

Sine Wave

Square Wave

Pulse Wave

Triangle Wave

Sawtooth Wave

 

Analog Tab

Integrator

Clamped Integrator

Switch (2-position mux)

Switch (4-position mux)

Comparator

Hysteresis

Clamp

Random Number Generator

Ramp Limit

Reversal Shift

Deadband

Deadband Comp

Asynchronous Hold

 

Analog Filters Tab

Analog PI

Analog PI+

Analog PID

1-Pole Low-Pass Filter

Lead-Lag Filter

2-Pole Low-Pass Filter

2-Pole Low-Pass Filter (A)

Bi-Quad Filter

 

F(s) Tab

1st order s-domain filter

2nd order s-domain filter

3rd order s-domain filter

4th order s-domain filter

5th order s-domain filter

6th order s-domain filter

 

Digital Tab

Digital Controller

Sample and Hold

Sample Delay

Calculation Delay

Difference

Inverse Trapezoidal

Sum/TSample

Clamped Sum/TSample

Digital Dither

 

Digital Filters Tab

Digital PI Control Law

Digital PI+ Control Law

Digital PID Control Law

Digital PID Control Law (2)

Digital 1-Pole Low-Pass Filter

Digital Lead-Lag Filter

Digital 2-Pole Low-Pass Filter

Digital 2-Pole Low-Pass Filter (A)

Digital 2-Pole Notch Filter

Digital Bi-Quad Filter

Moving Average Filter

 

F(z) Tab

1st order z-domain filter

2nd order z-domain filter

3rd order z-domain filter

4th order z-domain filter

5th order z-domain filter

6th order z-domain filter

 

Custom Tab

Custom Module

Custom Module Input

Custom Module Output

Custom Documentation

 

Program Tab 

Program (2x2)

Program (4x4)

Program (8x8)

Digital Program (2x2)

Digital Program (4x4)

Digital Program (8x8)

 

Motion Tab

 

Motor Feedback

Two-Body Compliant Load

DQ to ABC

DQ to ABC (Clamped)

ABC to DQ

ABC to Magnitude and Theta

DQ Motor

AVD Motion Profile

VD Motion Profile

AD Motion Profile

Triangular Motion Profile

Harmonic Error Term

 

Revision History

 

Overview

Node types

Input

Can be wired to any input or output node. There is no explicit limit to the number of inputs that can be connected together. If multiple input nodes are wired together, but without an output node, a warning is displayed and those wires are ignored.

To change the value of an unwired input node, place cursor over node and double-click. Alternatively, the value can be changed by placing cursor anywhere in block, right clicking to display a pop-up menu, and selecting "Properties."

The value of a wired input node cannot be changed, but it can be viewed with same procedures as above.

Output

Can be wired to any input node. Two output nodes cannot be wired together.

The value of an output node cannot be changed. To view the value of an output node, place cursor over node and double-click. Alternatively, the value can be viewed by placing cursor anywhere in block, right clicking to display a pop-up menu, and selecting "Properties."

No-connection

Set values that are fixed at the time the model is compiled. To change, stop model and place cursor over node and double-click. Alternatively, the value can be changed by placing cursor anywhere in block, right clicking to display a pop-up menu, and selecting "Properties." Changing the value of a No-connection node will force a recompile to continue model execution.

Documentation

Store information about the use of the block for reference.

 

Node Types

double

 Most Visual ModelQ nodes are of type double.

Boolean

Some Visual ModelQ nodes are Boolean. When viewing or changing values, these nodes show as "True" or "False." For the case where these nodes are input nodes, and so can be wired to non-Boolean nodes, any value less than 0.5 is translated as False while all other values are translated as True.

String

Some Visual ModelQ nodes are strings. When viewing or changing values, these nodes show as one of a list of strings. When these nodes are transmitted on wires (wires carry only double) the value of the node is translated as the integer value of the string’s placement in the string list. Actually, Boolean is a string variable where the string list consists of "True" and "False."

Documentation

Documentation nodes accept strings with no specific length limit.

 

Instruments Tab

Oscilloscope            

Graphic

Function

Provide 8-channel oscilloscope display.

Tab

Instruments

Special behavior.

After compile, oscilloscope display window is hidden. Double click on the Oscilloscope block to view the display window. All default settings can be changed using controls in the display. However, recompilation will restore the default values.

Requirements

At least one oscilloscope is required in every model. There is no explicit limit on the number of oscilloscopes one model can have.

 

Node List

 

 

1

Time/Div
Select default Time/Division.

2

Trigger Source
Select variable to be used for default trigger channel

3

Trigger Level
Select default trigger level.

4

Positive Trig?
Select default trigger slope (positive or negative).

5

Trigger Position
Select default trigger position in percent of screen size.

6

Trigger Mode
Select default trigger position from Auto, Normal, and Cont. With Normal, scope triggers only after trigger channel meets trigger criterion. With Auto, trigger will automatically trigger after two screens full of data pass without a trigger. With Cont (continuous), the scope runs continuously.

7

AC Trigger
Select default value of AC Trigger. If true, Trigger Source is passed through a high-pass filter to remove DC component. Approximately 3 screens of data must pass for the filter to settle out (Boolean).

8

Roll?
Select default value of Roll. If true, display rolls across screen.

9

Single Shot
Select default value of Single Shot. If true, model stops executing after screen fills. Restart execution by clicking the Run button.

10

x vs y?
Select default value of x-vs-y. If true, display shows all channels versus the variable specified in H-Channel.

11

H-Channel
Select default horizontal channel. See x vs y (node 10).

12

Documentation node

See also: Live Scope, Two-Channel Live Scope

 

Dynamic Signal Analyzer (DSA)                

Graphic

Function

Provide Frequency-Response Function (FRF) or Bode plot of system. Provides temporary excitation signal.

Tab

Instruments

Special behavior.

After compile, DSA display window is hidden. Double click on the DSA block to view the display window. All default settings can be changed using controls in the display. However, recompilation will restore the default values.

Requirements

If a DSA is present, at least two variables must be present in model. There is no specific limit on the number of DSAs than can be present.

 

Node List

 

 

1

Switched Input
Input signal, which is normally passed through DSA to Output. However, when DSA excitation is active, switched input is disconnected from Output.

2

Unswitched Input
Input signal, which is passed through DSA to Output, whether or not DSA excitation signal is active. Should only be used for DC signals, or DSA analysis will be corrupted.

3

Excitation
Output of DSA. If DSA excitation is inactive, equal to sum of Switched Input and Unswitched Input. I If DSA excitation is active, equal to sum of Switched Input and Excitation.

4

DSA Inactive
True (1) when DSA excitation is inactive; False (0) when active. Can be used to disable any waveform generators that are not connected to the switched input (these generators are effectively disconnected automatically so there is no need to disable them) (Boolean).

5

Excitation Amplitude
Amplitude of excitation output. If excitation amplitude is too small, signal-to-noise ration will be too large, corrupting the DSA output; if it is too large, it will drive system into saturation, also corrupting the DSA output. If DSA output is noisy in appearance, experiment with this value.

6

Input Channel
Select default Input channel for DSA.

7

Output Channel
Select default Output channel for DSA.

8

TSample
Select default value of sample time for DSA. Normally should be equal to sample time of digital controller, if one is used.

9

Start Zero Time
Select default value of start zero time. Start zero time gives the system time to settle out after DSA becomes active. System must be fully settled before excitation starts, or DSA output will be corrupted. If DSA output is noisy in appearance, experiment with this value.

10

End Zero Time
Select default value of end zero time. End zero time gives the system time to settle out after DSA becomes inactive. System must be fully settled before data-gathering concludes, or DSA output will be corrupted. If DSA output is noisy in appearance, experiment with this value.

11

Order
Select default DSA order. When DSA collects data, 2^Order points are stored for each channel. Larger order allows the DSA to measure lower frequencies. Larger order also allows longer End Zero Time values.

12

Auto Frequency
Default value of Auto Frequency span. If true, frequency span is automatically set at compile time based on Order and TSample. If false, Minimum Frequency (node 13) and Maximum Frequency (node 14) are used to set frequency span.

13

Minimum Frequency
Default minimum of frequency span if Auto Frequency (node 12) is false; ignored otherwise.

14

Maximum Frequency
Default maximum of frequency span if Auto Frequency (node 12) is false; ignored otherwise.

15

Gain Scale
Default gain scale of DSA output.

16

Gain Offset
Default gain offset of DSA output.

17

Phase Scale
Default phase scale of DSA output.

18

Phase Offset
Default phase offset of DSA output.

19

Button Setup
Set up as many as 10 buttons, which automatically load input and output channels when clicked. Simplifies ability to view many FRFs (Bode plots).

20

Documentation node

See also: Variable, Live Scope, Two-Channel Live Scope, Oscilloscope

 

Variable                     

Graphic

Function

Non-display data channel for Oscilloscopes and DSAs.

Tab

Instruments

 

Node List

1

Input
Input value in model units

2

Scale
Set default scale of variable on Oscilloscope.

3

Offset
Set default offset of variable on Oscilloscope.

4

Show
Set default of whether variable displays on Oscilloscope. If more than 8 variables default to Show = true, all variables after the either default to not showing (Boolean).

5

AC Couple
Set default AC Coupling of variable on Oscilloscope (Boolean).

6

Mult
Convert model units to user units. This allows the model to execute in SI units with data display convenient units.

7

Documentation node

See also: Live Scope, Two-Channel Live Oscilloscope, DSA

 

Live Scope                                                    

Model graphic

(during model execution)

Select Graphic

Function

Displaying data on model screen; also provide data channel for Oscilloscopes and DSAs.

Tab

Instruments

Special behavior.

The Live Scope creates a variable of the same name as the block name that can be displayed on the Oscilloscope or measured with a DSA.

After compile, double click on the Live Scope block to view the control panel. The control panel simplifies adjustment of standard scope variables such as scale, offset, and trigger settings.

Single-shot operation is supported through the S-Shot checkbox. Single-shot causes the model to stop running after the scope screen fills; if you select “Must click OK” you must acknowledge the S-Shot announcement window; otherwise, the window will go out of view after 10 seconds. Click the Run button to continue model execution.

Supports Hot Connect, which allows temporary connection Input to any node or wire while the model is running, and without forcing a recompile. All scope settings are restored to pre-hot connection values when normal (non-Hot- Connect) operation is restored.

Supports Autoscale, where the scale is set to ±X where X is large enough to show all points of display. 

Supports Fill Screen, where the scale is set to just show the waveform minimum and maximum values.

Supports copying scope display to a bitmap file. You can copy the complete scope display ("Copy Image") or just the plot ("Copy Graph").  If you click the escape key mid sequence, the bitmap is copied to the clipboard where it can be pasted to other applications, for example Microsoft Word documents.

 

 

Live Scope Control Panel

See also: Variable, Two-Channel Live Scope, Oscilloscope

 

Node List

1

Input
Input value in model units

2

Scale
Set scale.

3

Offset
Set offset.

4

AC Couple
Set AC Coupling of variable (Boolean).
.

5

Mult
Convert model units to user units. This allows the model to execute in SI units with data display convenient units.

6

Time/Div
Select Time/Division

7

Show
Set default of whether variable displays on Oscilloscopes. If more than 8 variables default to Show = true, all variables after the either default to not showing (Boolean).

8

Ext
External input (can be used to trigger the scope).

9

Ext Mult
Multiplier for external input

10

Trigger Channel
Select trigger channel, either External Input or Input (Node 1).  Two- and Four-Channel scopes allow any available channel to be used to trigger the scope.

11

Trigger Level
Select trigger level. Note that the trigger level is not scaled by Mult.

12

Positive Trig?
Select trigger slope (positive or negative).

13

Trigger Position
Select trigger position in percent of screen size.

14

Trigger Mode
Select trigger position from Auto, Normal, and Continuous. With Normal, scope triggers only after trigger channel meets trigger criterion. With Auto, trigger will automatically trigger after two screens full of data pass without a trigger.  With Continuous, the scope displays data continuously.  Note:  using Continuous with a small time step can significantly slow model operation.

15

AC Trigger
Select AC Trigger. If true, trigger source (node 1) is passed through a high-pass filter to remove DC component. Approximately 3 screens of data must pass for the filter to settle out (Boolean).

16

Single Shot
Select Single Shot mode, either 0 (off), 1 (on, don’t require user to click OK) or 2 (on, require user to click OK).

17

Height
Select height of Live Scope display in pixels.

18

Width
Select width of Live Scope display in pixels.

19

Documentation node

See also: Variable, Two-Channel Live Scope, Oscilloscope

 

Two-Channel Live Scope                                                   

Model graphic

(during model execution)

Select Graphic

Function

Displaying two channels of data on model screen; also provide one data channel (Channel 1 only) for Oscilloscopes and DSAs.

Tab

Instruments

Special behavior.

The Two-Channel Live Scope creates a variable of the same name as the block name that can be displayed on the Oscilloscope or measured with a DSA. Channel 1 is used for data for the variable.

See Live Scope for more details.

Two-Channel Live Scope Control Panel

See also: Variable, Live Scope

 

Node List

In addition to the Nodes for the Live Scope , the Two-channel Live Scope provides the following five nodes on the right side of the block.

20

Input2
Input value for Channel 2 (red) in model units

21

Scale2
Set scale for Channel 2.

22

Offset2
Set offset for Channel 2.

23

AC Couple2
Set AC Coupling of Channel 2 (Boolean).

24

Mult2
Convert model units to user units for Channel 2. This allows the model to execute in SI units with data display convenient units.

See also: Variable, Live Scope, Oscillocope

 Four-Channel Live Scope                                                  

Model graphic

(during model execution)

Four-Channel Scope with Scales turned off using Control Panel (shown below)

Select Graphic

Function

Displaying four channels of data on model screen; also provide one data channel (Channel 1 only) for Oscilloscopes and DSAs.

Tab

Instruments

Special behavior.

The Four-Channel Live Scope creates a variable of the same name as the block name that can be displayed on the Oscilloscope or measured with a DSA. Channel 1 is used for data for the variable.

See Live Scope for more details.

Four-Channel Live Scope Control Panel

See also: Variable, Live Scope

 

Node List

In addition to the Nodes for the Two-Channel Live Scope, the Four-Channel Live Scope provides the following ten nodes bottom of the block, where Channel 3 parameters are below Channel 1 parameters on the left and Channel 4 parameters are below Channel 2 parameters on the right.

25

Input3
Input value for Channel 2 (black) in model units

26

Scale3
Set scale for Channel 3.

27

Offset3
Set offset for Channel 3.

28

AC Couple3
Set AC Coupling of Channel 3 (Boolean).

29

Mult3
Convert model units to user units for Channel 3. This allows the model to execute in SI units with data display convenient units.

30

Input4
Input value for Channel 4 (green) in model units

31

Scale4
Set scale for Channel 4.

32

Offset4
Set offset for Channel 4.

33

AC Couple4
Set AC Coupling of Channel 4 (Boolean).

34

Mult4
Convert model units to user units for Channel 4. This allows the model to execute in SI units with data display convenient units.

See also: Variable, Live Scope, Two-Channel Live Scope, Oscillocope

 

Waveform Generator

Graphic

Function

Provide constant numerous waveforms with control of frequency, amplitude, offset, and other waveform parameters.

Tab

Instruments

Special behavior

After compile, double click on the Waveform Generator block to view the Waveform Generator control panel. Control panel allows easy adjustment of parameters such as waveform type, frequency, and amplitude while model is running.

 

Node List

1

Output
Output in model units

2

Waveform
Select default waveform from one of:
Sine
Triangle
Sawtooth
Pulse
Bi-polar Pulse
Trapezoid
S-Curve
DC (None)

3

Frequency
Set default frequency of waveform in Hz.

4

Amplitude
Set default peak-to-peak (Sine, Triangle, Sawtooth, Pulse, Bi-polar Pulse) or peak (Trapezoid, S-Curve) amplitude in user units.

5

Offset
Set default center (Sine, Triangle, Sawtooth, Pulse, Bi-polar Pulse) or low level (Trapezoid, S-Curve) of waveform in user units.

6

Phase
Set default phase (time offset) of waveform in degrees.

7

Duty Cycle
Set default duty cycle in percent for Pulse, Bi-polar Pulse, Trapezoid, and S-Curve waveforms.

8

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units.

9

Enable
When false, output is 0. If true, waveform generator operates as normal (Boolean).

10

Documentation node

Data Logger

Graphic

Function

Log 16 channels of data to a file in CSV (comma separated variable) format.

Tab

Instruments

 

Node List

1-16

Channel1-Channel16
Data to be logged.

17

Enable
Store data if Enable = 1

18

Reset
Clear data in file when Reset = 1.

19

File Write Interval
Specifies how many samples of data are collected before data is written.  Defaults to 10. 

20

Ask before overwrite
If set to 1, ask user before overwriting the data file.

21-52

Name1-Name16 and Multipiler1 – Multiplier 16 (in pairs)
Specify name under which channel data will be stored; names are written in the first line of the data file.  Multiplier allows storage of data in user units.  Multipliers are written in second line of data file.

53

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

Data logger saves data on each cycle of controller except the following conditions:
  t = 0
  Enable = 0
  Reset = 1

54

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units.

55

Documentation node

 

Constants Tab

Simple Constant

Model graphic

Select graphic

Function

Provide constant input with on-screen display. Value can be changed at any time by double clicking on the input node (left on icon).

Tab

Constants

 

Node List

1

Input
Input value to constant in user units

2

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units (recommended).

3

Output
Output in model units

4

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Live Constant, Scale-by Constant, Inspector

 

 Live Constant

Model graphic

Select graphic

Function

Provide constant input with on-screen display. Value can be changed at any time by double clicking on the block after compile, which brings an adjustor box into view. Output is scaled from user units by Mult (node 4).

Tab

Constants

Special behavior.

After compile, double click on the Live Constant block to view the adjustor box. Adjustor box simplifies adjustment of constants through use of six logarithmic adjustments. For example, "<<" reduces the value by approximately 50% to an even value of 1, 2, or 5 x 10N.

Value is copied into InitValue (node 1) after clicking "Save value as initial value " button immediately right of value. Value is restored to InitValue after each compile.

Text color in edit box changes to red when keystrokes are entered. This indicates that the value in the model block is not equal to the value in the edit box. Actions that store the value (for example, striking the enter key) load the value and change the text back to the standard color.

Adjustor Box

 

Model block, value and initial value
(above) equal and (below) unequal.

 

Node List

1

InitValue
Initial value of constant in user units.

2

Minimum
Minimum user can set input value to.

3

Maximum
Maximum user can set input value to.

4

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units (recommended).

5

Output
Output in model units.

6

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Simple Constant, Scale-by Constant, String Constant

 

Inverse Live Constant

Model graphic

Select graphic

Function

Provide inverted constant input with on-screen display (if value is zero, output is zero). Value can be changed at any time by double clicking on the block after compile, which brings an adjustor box into view. Output is scaled from user units by Mult (node 4), and then inverted.

Tab

Constants

Special behavior.

After compile, double click on the Live Constant block to view the adjustor box. Adjustor box simplifies adjustment of constants through use of six logarithmic adjustments. For example, "<<" reduces the value by approximately 50% to an even value of 1, 2, or 5 x 10N.

Value is copied into InitValue (node 1) after clicking "Save value as initial value " button immediately right of value. Value is restored to InitValue after each compile.

After model is compiled, model block is painted white when the value is equal to the initial value and silver when not equal.

Text color in edit box changes to red when keystrokes are entered. This indicates that the value in the model block is not equal to the value in the edit box. Actions that store the value (for example, striking the enter key) load the value and change the text back to the standard color.

Adjustor Box

 

Model block, value and initial value
(above) equal and (below) unequal.

Requirements

None

 

Node List

1

InitValue
Initial value of constant in user units.

2

Minimum
Minimum user can set input value to.

3

Maximum
Maximum user can set input value to.

4

Mult
Convert constant from user units to model units and then invert (1/x). This allows convenient data entry while allowing the model to execute in SI units (recommended).

5

Output
Output in model units

6

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Live Constant, Scale-by Inverse Live Constant

 

Scale-by Simple Constant

Model graphic

Select graphic

Function

Provide constant input with on-screen display. Value can be changed at any time by double clicking on the scale node (top left).

Tab

Constants

 

Node List

1

Input
Input value to be scaled

2

Scale
Scale to be applied to input.

3

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units (recommended).

4

Output
Output in model units

5

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Simple Constant, Scale-by Live Constant

 

 Scale-by Live Constant

Model graphic

Select graphic

Tab

Constants

Function

Provide scaling constant with on-screen display. Value can be changed at any time by double clicking on the block after compile, which brings an adjustor box into view. Output is scaled from user units by Mult (node 5).

Special behavior.

After compile, double click on the Live Constant block to view the adjustor box. Adjustor box simplifies adjustment of constants through use of six logarithmic adjustments. For example, "<<" reduces the value by approximately 50% to an even value of 1, 2, or 5 x 10N.

Value is copied into InitValue (node 2) after clicking "Save value as initial value " button immediately right of value. Value is restored to InitValue after each compile.

After model is compiled, model block is painted white when the value is equal to the initial value and silver when not equal.

Text color in edit box changes to red when keystrokes are entered. This indicates that the value in the model block is not equal to the value in the edit box. Actions that store the value (for example, striking the enter key) load the value and change the text back to the standard color.

Adjustor Box

 

Model block, value and initial value
(above) equal and (below) unequal.

Requirements

None

 

Node List

1

Input
Input value, which is scaled by the inverse of the constant (1/x) and then scaled by Mult to convert from user units to model units.

2

InitValue
Initial value of constant in user units

3

Minimum
Minimum user can set input value to.

4

Maximum
Maximum user can set input value to.

5

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units (recommended).

6

Output
Output in model units

7

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Live Constant, Scale-by Inverse Live Constant

 

 Scale-by Inverse Live Constant

Model graphic

Select graphic

Tab

Constants

Function

Provide scaling inverse constant with on-screen display (if value is zero, output is zero). Value can be changed at any time by double clicking on the block after compile, which brings an adjustor box into view. Output is scaled from user units to model units by Mult (node 5) and then inverted.

Special behavior.

After compile, double click on the Live Constant block to view the adjustor box. Adjustor box simplifies adjustment of constants through use of six logarithmic adjustments. For example, "<<" reduces the value by approximately 50% to an even value of 1, 2, or 5 x 10N.

Value is copied into InitValue (node 2) after clicking "Save value as initial value " button immediately right of value. Value is restored to InitValue after each compile.

After model is compiled, model block is painted white when the value is equal to the initial value and silver when not equal.

Text color in edit box changes to red when keystrokes are entered. This indicates that the value in the model block is not equal to the value in the edit box. Actions that store the value (for example, striking the enter key) load the value and change the text back to the standard color.

Adjustor Box

 

Model block, value and initial value
(above) equal and (below) unequal.

Requirements

None

 

Node List

1

Input
Input value, which is scaled by the inverse of the constant (1/x) and then scaled by Mult to convert from user units to model units.

2

InitValue
Initial value of constant in user units

3

Minimum
Minimum user can set input value to.

4

Maximum
Maximum user can set input value to.

5

Mult
Convert user units to model units. This allows convenient data entry while allowing the model to execute in SI units (recommended).

6

Output
Output in model units

7

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Inverse Live Constant, Scale-by Live Constant

 

 String Live Constant

Model graphic

Select graphic

Tab

Constants

Function

Provide selection from user-defined list of strings. String can be changed at any time by double clicking on the block after compile, which brings a string adjustor box into view.

Special behavior.

After compile, double click on the Live Constant block to view the string adjustor box. Adjustor provides list box to allow string selection.

Value is copied into InitValue (node 2) after clicking "Save value as initial value" button right of "OK" button. String is restored to InitValue (node 2) after each compile.

After model is compiled, model block is painted white when the value is equal to the initial value and silver when not equal.

String Adjustor Box

 

Model block, value and initial value
(above) equal and (below) unequal.

Requirements

None

 

Node List

1

Strings
String list from which one string can be chosen.

Hint: for boolean output, make string list False, True. This will output 0 when False is selected and 1 for True.

2

InitValue
Initial

3

Output
Output of zero-based index of string. For example, if first string of list is selected, output will be 0; if second string is selected, output will be 1.

4

Documentation node
Contents of documentation node are displayed for the user when the help button on the Adjustor box is clicked.

See also: Live Constant, Scale-by Constant

                       

Push Button

Graphic

(Note these graphics represent the Push Button in its two states)

Tab

Meter

Function

Provides push-button function on model diagram. Double-click on button to change value from true to false (or false to true).

Special behavior

Color of button changes to indicate output: Green for true output and red for false output.

 

Node List

1

Initial Value
Value Output takes on after each compile.

2

Output
Output value of button (Boolean).

3

Documentation node

 

Live Switch

Graphic

(Note these graphics represent the Live Switch in its two states)

Tab

Constants

Function

Provides analog switch that can be reconfigured while model runs. Double-click on button to change switch state from OFF to ON (or ON to OFF). To extend a Live Switch to control multiple signal paths, connect the State, the Boolean output state, to a 2-position mux as shown below:


Example: expanding a Live Switch with two analog switches

Special behavior

Schematic of switch, which is plotted on block, changes according to switch state; also, color changes (between red and green) and state is displayed.

See also

Push Button, Switch (2-position mux)

 

Node List

1

Initial Value
Value State takes on after each compile.

2

Input1
When relay is OFF, connections are crossed: Input1 is connected to Output2, and Input2 is connected to Output1. When relay is ON, connections pass through: Input1 is connected to Output1, and Input2 is connected to Output2.

3

Input2
See Input1.

4

State
Current state of relay (Boolean).

5

Output1
See Input1.

6

Output2
See Input1.

7

Documentation node

 

 

Misc Tab

Solver

Graphic

Tab

Misc

Function

Define time step for differential equation solver. Solver is limited to 500 state variables (for example, integrators and single-pole s-domain filters take require one state variable, two-pole s-domain filters require two).

Requirements

Each model must contain one and only one Solver.

 

Node List

1

h
Sample time of differential equation solver. Setting this larger makes the model run faster, but also causes inaccuracy and numerical instability. For analog models, select h no more than 1/10th the fastest dynamics in the system. For digital systems, it can often be set as high as equal to the sample rate. When one or more digital controllers are used in a model, the sample time of each controller should be an integer multiple of h.

2

Time Increment
Use Time Increment to limit execution time. When simulation time exceeds the sum of 1) Time Increment and 2) the simulation time when the user last pressed the Run button, simulation stops. If Time Increment changes during execution, the run-time timer is reset so that execution stops when simulation time exceeds the sum of 1) Time Increment and 2) the simulation time when Time Increment changed.

If Time Increment is less than or equal to 0, Time Increment is ignored. Time Increment defaults to 0.

Note: to stop at a specific point in time, use the Time, Greater-than, and Stop blocks. The following example stops execution at 2 seconds;

How to stop execution at a specific time.

3

Documentation node

 

Time

Graphic

Tab

Misc

Function

Provides access to model time.

 

Node List

1

Time

2

Documentation node

  

Stop

Graphic

Tab

Misc

Function

Stop model execution.

Special behavior

Stop forces down the Stop button on control panel. For example, this model section stops execution after 0.5 seconds of simulation time.  The enable pushbutton allows the user to disable the stop.

See also

Stop() function in Program blocks.

 

Node List

1

Stop
If this input is true (> 0.5)

2

Enable
If true (> 0.5) enable stop function.  Otherwise, disable stop function.

3

Documentation node

                       

Extender, Extender Output

Graphics

Tab

Misc

Function

Allows extension of wires to other pages, or to other parts of the same page that are not convenient to connect with wires.

Input (left graphic) and Output (right graphic) extenders are identical; the two types are provided as a convenience for users who want to document clearly which extenders originate signals (outputs) and which accept them (inputs). Visual ModelQ does not attempt to validate this function.

Special Behavior

Extenders with the same name are treated as connected wires. The presence of Extenders to increase or decrease model execution time.

Extenders can be reversed (i.e., Extenders can be converted to and from Extender Outputs) while remaining on screen and wired in the model. This can be done by placing the mouse over the Extender (or Extender Output) and right clicking; choose "Reverse Extender" from the pop-up menu.

Requirements

Extenders that have no mates generate a warning. The assumption is that there should be at least one mate for every extender.

 

Node List

1

Connect
Connection point to extender.

 

Anchor

Graphic

Tab

Misc

Function

Provides extra points in wire path to allow complex wiring routes.

 

Node List

1

Anchor
Anchor point.

Note

Graphic

Tab

Misc

Function

Provide block to write notes and other documentation.

 

Node List

1

Documentation

 

Math Tab

Add, Subtract, Multiply, Divide

Graphic

Tab

Math

Function

Algebraic Math (2 input)

 

Node List

1

Input1
Operand

2

Input2
Operand

3

Output
Result of operation

Add (3 input), Multiply (3 input)

Graphic

Tab

Math

Function

Algebraic Math (3 input)

 

Node List

1

Input1
Operand

2

Input2
Operand

3

Input3
Operand

4

Output
Result of operation

Scale-by Inverse Scale-by

Graphic

Tab

Math

Function

Multiply the input by a scale factor or one over a scale factor

 

Node List

1

Input
Input to scale

2

Scale by
Operand

3

Output
Input scaled by Scale by (or one over Scale by)

4

Documentation

 

Square Root, One Over x, Absolute Value, Minus x

Graphic

Tab

Math

Function

Various math functions

 

Node List

1

Input
Operand

2

Output
Result of operation
Note:  1/x is not evaluated at time 0 to avoid divide by zero.

3

Documentation

 

Sqrt of Sum of Squares

Graphic

Tab

Math

Function

Square root of sum of squares

 

Node List

1

x
(Input)

2

y
(Input)

3

z
(Input)

4

Output
sqrt(x^2 + y^2 + z^2)

5

Documentation

 

1/x with Magnitude Limit

Graphic

Tab

Math

Function

1/x with Magnitude Limit

 

Node List

1

Input
Input signal

2

Epsilon
Minimum magnitude to be inverted

3

Output
1/(Input + Epsilon) if Input >= 0,
1/(Input - Epsilon) if Input < 0.

4

Documentation

 

Modulo

Graphic

Tab

Math

Function

Modulo

 

Node List

1

Input
Input signal

2

Modulo

3

Mult
Multiplier for modulo. Effective modulo is Modulo x Mult.

4

Output

5

Type
0 = Positive (result between 0 and Modulo)
1 = Bipolar (result between +/-Modulo/2)

6

Documentation

 

  Quantize

Graphic

Tab

Math

Function

Quantize

 

Node List

1

Input
Input signal

2

Type
Type of quantization. Select from "None" (0), "Round" (1), and "Truncate" (2).

3

Resolution
Resolution of quantization.

4

Output

5

Documentation

Linear Interp, Linear Interp (Odd), Linear Interp (Even)

Graphic

Tab

Math

Function

Linear Interp, Linear Interp (Odd), Linear Interp (Even)

 

Node List

1

Input
Input (x point)

2

x Vector (CSV)
Vector of x points separated by commas.  If left blank, assumed to be 0, 1, 2, … and will be filled to equal the number of points in y Vector (see below).

Only enter negative x points in Linear Interp, not in Linear Interp (Odd) or Linear Interp (Even).  For Linear Interp (Odd), y(-x) = -y(x).  For Linear Interp (Even), y(-x) = y(x).

3

y Vector (CSV)
Vector of x points separated by commas. 

4

Output
Output (interpolated y point)

5

Number of Points
Number of points used, normally the lesser of the number of x Vector and y Vector points, but equal to the number of y Vector points if x Vector is empty.

6

Documentation

 

Trans Tab

Sine, Cosine, Tangent

Graphic

Tab

Trans

Function

Sine, Cosine, and Tangent

 

Node List

1

Input
Theta (radians)

2

Output
Result of operation

 

arc Sine, arc Cosine, arc Tangent

Graphic

Tab

Trans

Function

arc Sin, arc Cosine, and arc Tangent

 

Node List

1

Input

2

Output
Theta
For arc Sine, -P/2 < Theta < P/2
For arc Cosine, -P/2 < Theta < P
For arc Tangent, -P/2 < Theta < P/2

 

arc Tangent(y, x)

Graphic

Tab

Trans

Function

arc Tangent(y, x), or ATAN2(y, x)

 

Node List

1

Input1
y

2

Input2
x

3

Output
Theta, -P < Theta < P

4

Documentation

 

Coordinate Transform

Graphic

Tab

Trans

Function

Rotational Coordinate Transformation

 

Node List

1

x
Input (before rotation)

2

y
Input (before rotation)

3

Theta
Angle of rotation (radians).
Example:  if Theta = P/2 (90 degrees), (x = 1, y = 0) is translated to (x = 0, y = 1).

4

x'
Output (after rotation)

5

y'
Output (after rotation)

6

Documentation

 

Exponential

Graphic

Tab

Trans

Function

Provide exponential function.

 

Node List

1

Input

2

Output

3

Documentation node

 

Log

Graphic

Tab

Trans

Function

Provide natural logarithm.

 

Node List

1

Input

2

Output

3

Documentation node

 

Log10

Graphic

Tab

Trans

Function

Provide base-10 logarithm.

 

Node List

1

Input

2

Output

3

Documentation node

 

 Y^x

Graphic

Tab

Trans

Function

Y^x, raise any positive floating-point number to any floating-point power.

See also Y^N, for raising negative numbers to integer powers.

 

Node List

1

Y

2

x

3

Output

4

Documentation node

 

 Y^N

Graphic

Tab

Trans

Function

Y^N, raise any floating-point number to any integer power.

See also Y^x, for raising positive number to non-integer powers.

 

Node List

1

Y

2

N (if N is not an integer, it will be rounded to the nearest integer value).

3

Output

4

Documentation node

 

Meter Tab

RMS Meter

Graphic

Tab

Meter

Function

Measure RMS of waveform. Display value on model diagram.

 

Node List

1

Input
Signal to measure.

2

Filter
Frequency of low-pass filter applied signal. The filter should be low enough to eliminate ripple in the output, and high enough to allow rapid settling. The default value is 1 Hz.

3

Mult
Convert model units to user units for Channel 1. This allows the model to execute in SI units with data display convenient units.

4

TSample
Sample rate of meter. Should be at least 20 times the setting of Filter.

5

Output
Measured output of meter. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

6

Documentation node

 

 DC Meter

Graphic

Tab

Meter

Function

Measure DC (average) of waveform. Display value on model diagram.

 

Node List

1

Input
Signal to measure.

2

Filter
Frequency of low-pass filter applied signal. The filter should be low enough to eliminate ripple in the output, and high enough to allow rapid settling. The default value is 1 Hz.

3

TSample
Sample rate of meter. Should be at least 20 times the setting of Filter.

4

Mult
Convert model units to user units for Channel 1. This allows the model to execute in SI units with data display convenient units.

5

Output
Measured output of meter. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

6

Documentation node

  

Peak Meter

Graphic

Tab

Meter

Function

Measure peaks of waveform. Holds peak for 1/Filter frequency, then value declines to input like a filter with a bandwidth of Filter Hz.  Display value on model diagram.

 

Node List

1

Input
Signal to measure.

2

Filter
Frequency of low-pass filter applied signal. The filter should be low enough to eliminate ripple in the output, and high enough to allow rapid settling. The default value is 1 Hz.

3

TSample
Sample rate of meter. Should be at least 20 times the setting of Filter.

4

Mult
Convert model units to user units for Channel 1. This allows the model to execute in SI units with data display convenient units.

5

Output+
Positive peak. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

6

Output-
Negative peak. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

7

Documentation node

  

Example of Peak meter

The following model fragment shows one use of a peak meter.  The meter Frequency is set to 10.  Here a triangle wave with a  frequency of 5 Hz is fed to a peak meter; this signal is shown in the attached four-channel scope in blue.  The positive peak is shown in black; notice that it holds the peak 0.1 seconds (1/Frequency) and then declines like a 10 Hz filter to the triangle wave.  The negative peak, shown in green, is similar.  Note that the positive and negative peaks occasionally coincide with the input so that the input triangle wave is obscured.  Note also that if the triangle wave frequency had been 10 Hz (equal to Frequency) or higher, the peaks would have been DC waves because of the guaranteed hold time of 1/Frequency seconds.

 

 Harmonic Meter

Graphic

Tab

Meter

Function

Measure individual harmonics of an input; displays the magnitude of the harmonic on the block.

 

Node List

1

Input
Signal to measure.

2

Reference
Signal that sets the base frequency (frequency of harmonic #1). Can be time scaled to the frequency of interest or another model parameter such as position when attempting to determine position.

3

Harmonic
The harmonic to be measured, equal to the reference signal multiplied by Harmonic.

4

Hold
Disable the meter and hold the most recent measurement (Boolean).

5

Number Cycles
Then number of cycles for each measurement. More cycles requires a longer measurement time, but reduces the effects of noise. Typical range is 1 to 5.

6

Mult
Convert model units to user units for Channel 1. This allows the model to execute in SI units with data display convenient units.

7

TSample
Sample rate of meter. Should be at least 20 times the harmonic being measured.

8

Magnitude
Magnitude of the harmonic.

9

Angle
The angle of the harmonic in radians. A cosine signal has 0° ; a sine signal has –90° .

10

Documentation node

 

Example of Harmonic meter

The following example shows the measurement of a one-Hertz square-wave. Time drives the square wave at on Hz (the scale of 6.2832 converts the Square wave output to 1 Hz as the unscaled output is in radians. The 1 Hz signal is also the reference signal. The harmonic is 3, as shown by the simple constant at bottom center. The magnitude is 0.424 (approximately 4/p) and the phase is zero degrees (the phase of this square wave is equal to a cosine wave).

 

 Timer

Graphic

Tab

Meter

Function

Measure time between events.

 

Node List

1

Begin
A positive transition starts timer counting (Boolean).

2

/Stop
A negative transition stop timer counting. Note that to time the duration of the positive portion of a pulse, connect the pulse to both Begin and /Stop (Boolean).

3

Mult
Convert timed output from seconds to user units. For example, set Mult to 1000 to output milliseconds.

4

Output
Measured output of meter. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

5

Documentation node

  

Counter

Graphic

Tab

Meter

Function

Count events. Displays value of counter on block during simulation.

 

Node List

1

Up
A positive transition cause count up of one (Boolean)

2

Down
A positive transition cause count down of one (Boolean).

3

Mult
Convert model units to user units for counter output.

4

Clear
A positive transition causes the counter output to be set to zero.

5

Set
A positive transition causes the counter output to be set to the value stored in Set Value Node (Boolean).

6

Set Value
See Set Node.

7

Minimum Value
Minimum value counter can take on.

8

Maximum Value
Maximum value counter can take on.

9

Roll?
Specifies if counter rolls (Boolean). If false, counter is clamped to values in Minimum Value and Maximum Value nodes. If true, when counter counts above Maximum Value, value is set to Minimum Value; similarly, when counter counts below Minimum Value, value is set to Maximum Value.

10

Counter
Value of counter scaled by Mult node.

11

Positive Roll
If Roll? is true, each positive rollover clocks a single-cycle pulse ouptut (Boolean). Can be used to chain counters for multiple digit counters.

12

Negative Roll
If Roll? is true, each negative rollover clocks a single-cycle pulse ouptut (Boolean). Can be used to chain counters for multiple digit counters.

13

Documentation node

 

Example of Counter:

Multiple counters can be chained for multiple digit counters:

Note that Roll? Node on less significant digit must be true; also, Minimum Value must be 0 and Maximum Value must be 9 on the less significant digit for a base-10 counter.

 Inspector

Graphic

Tab

Meter

Function

Measure the instantaneous value of waveform. Display value on model diagram.

 

Node List

1

Input
Signal to measure.

2

Mult
Convert timed output from seconds to user units.

3

Output
Measured output of meter. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

4

Documentation node

 

Triggered Inspector

Graphic

Tab

Meter

Function

Measure and hold the instantaneous value of waveform upon a trigger signal. Display value on model diagram. Pass trigger through to be used with other blocks

Special behavior

The following example shows how to use the trigger to capture the output of "Signal" using "Trigger" to trigger the capture. A stop is issued immediately after the value is captured.

 

Node List

1

Input
Signal to measure.

2

Mult
Convert timed output from SI units to user units.

3

Trigger Input
Transition from false to true causes trigger event.

4

Output
Measured output of meter. Can be used as signal elsewhere in the model such as displaying on a Live Scope.

5

Trigger Output
Pass logical trigger input for use with other blocks.

6

Documentation node

 

Lamp

Graphic

Tab

Meter

Function

Display red is input is logical false and green if true.

 

Node List

1

Input
Signal to drive lamp display.

2

Documentation node

 

Bar Meter

Graphic

Tab

Meter

Function

Display input as a bar and as text.

 

Node List

1

Input
Signal to drive bar display.

2

Mult
Convert input from SI units to user units.

3

Minimum
Specified value for low side of bar.

4

Maximum
Specified value for high side of bar

5

Orientation
Select Horizontal or Vertical

6

Justification
For Horizontal bars, select from Left, Center, or Right; for Vertical bars, select from Bottom, Center, or Top. With Center justification, the average of the Maximum and Minimum forms the center, and display is shown on either side of center in one of two colors. The other choices for justification are single color displays with the bar being blank when the output is equal to or below Minimum and sold when it is equal to or above Maximum.

7

Width
The width of the bar meter in pixels. Cannot be set to less than 100 pixels.

8

Height
The height of the bar meter in pixels. Cannot be set to less than 40 pixels.

9

Primary Color
Color of display for single color justification; color of high values for center-justified bars.

10

Secondary Color
Color of low values of center-justified bars.

10

Documentation node

 

Dial Meter

Graphic

Tab

Meter

Function

Display input as a dial meter and as text.

 

Node List

1

Input
Signal to drive dial needle and display.

2

Mult
Convert input from SI units to user units.

3

Minimum
Specified value for low side of dial.

4

Maximum
Specified value for high side of dial

5

Label Font
Font size of the dial labels.

6

Display Font
Font size of the display.

7

Number Labels
Number of labels around the dial face; must be between 2 and 20.

8

Number Ticks
The number of ticks (small divisions of labels); must be between 1 and 20. Note: 1 tick indicates no small divisions.

9

Width
Width of the dial; height is approximately equal to the width. Must be between 150 and 400 pixels.

10

Needle Color
Color of dial needle.

11

Label Color
Color of labels on dial face.

12

Gauge Color
Color of dial face.

13

Documentation node

  

 Banner

Graphic

Tab

Meter

Function

Display one of a number of user-specified messages on model diagram.

 

Node List

1

Input
Signal to select which message to display. For example, if three messages are defined, the first message will be displayed when the input is 0 or lower (actually, any value <= 0.5), the second when the input is 1 (any value > 0.5 and <= 1.5), and the third when the value is 2 or higher (any value > 1.5).

2

Messages
List of user-specified messages.

3

Trigger Output
Pass logical trigger input for use with other blocks.

4

Documentation node

   

Windows Message

Graphic

Tab

Meter

Function

Display a message after a trigger event. Message is displayed in a Windows "modal" box, which pauses model execution.

Special behavior

Display of message halts program execution. To clear message and continue execution, click "OK." To clear message and halt model execution, click "Cancel." If the model triggers the message so rapidly (for example, every 1/4 second) that the model almost immmediately triggers a new message as soon as the "OK" button is clicked, it may be required to click "Cancel" to stop model execution.

 

Node List

1

Trigger Input
Transition from false to true causes message to be displayed.

2

Message
Message to be displayed.

3

Width
The width of the banner in pixels. Cannot be set to less than 40 pixels.

4

Height
The height of the banner in pixels. Cannot be set to less than 20 pixels.

5

Documentation node

   

Logic Tab

 And, Nand, Or, Nor, Xor, Nxor

Graphic

Tab

Logic

Function

Perform various logic functions.

 

Node List

1

Input1
First input to logic gate (Boolean).

2

Input2
Second input to logic gate (Boolean).

3

Output
Output of logic gate (Boolean).

4

Documentation node

Buffer , Not,

Graphic

Tab

Logic

Function

Perform various logic functions.

 

Node List

1

Input
Input to logic gate (Boolean).

2

Output
Output of logic gate (Boolean).

3

Documentation node

 

Timed Buffer

Graphic

Tab

Logic

Function

Delay a digital signal a specified period of time.

 

Node List

1

Input
Input to logic gate (Boolean).

2

Delay
Delay time for digital signal. Note that if input signal transitions again during the delay time, the output signal does not transition. For example, a 10 Hz signal fed into to 0.5 sec delay will generate a DC output.

3

Output
Output of logic gate (Boolean).

4

Documentation node

J-K Flip Flop

Graphic

Tab

Logic

Function

J-K Flip-Flop

 

Node List

1

J
On positive edge of Controller clock, if J = 1 and K = 0, set Q = 1 and \Q = 0.  \Set and \Clear supercede J.  If both J and K are the same value, there is no change in output.

2

K
On positive edge of Controller clock, if K = 1 and J = 0 set Q = 0 and \Q = 1.  \Set and \Clear supercede K.  If both J and K are the same value, there is no change in output.

3

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

4

\Clear
If \Clear = 0, set Q = 0 and \Q = 1.  If \Clear = 1, there is no change in output.  If \Clear = 0 and \Set = 0, there is no change in output.  If \Clear = 0, J and K are ignored.

5

\Set
If \Set = 0, set Q = 1 and \Q = 0.  If \Set = 1, there is no change in output.  If \Clear = 0 and \Set = 0, there is no change in output.  If \Set = 0, J and K are ignored.

6

Q
Primary output.  Initial value = 0.

7

\Q
Logical inverse of Q

8

Documentation node

 

Compare Tab 

Equal To, Not Equal To, Greater Than, Greater Than or Equal To

Less Than, Less Than or Equal To

Graphic

Tab

Compare

Function

Perform various compare functions.

 

Node List

1

Input1
Positive input to compare functions (Boolean).

2

Input2
Negative input to compare functions (Boolean).

3

Output
Output of compare functions (Boolean).

4

Documentation node

 

Minimum, Maximum

Graphic

Tab

Compare

Function

Minimum and Maximum.

 

Node List

1

Input1

2

Input2

3

Output
Minimum or Maximum of Input1 and Input2

4

Documentation node

 

Waveforms Tab 

Cosine Wave, Sine Wave, Square Wave, Triangle Wave, Sawtooth Wave

Graphic

Tab

Waveforms

Function

Provide various waveforms. Note that the square and triangle waves have the same phase as a cosine wave. The vertical edge of the sawtooth occurs at zero time.

Note that the input is assumed to be in radians so that each wave has a period of 2 p. When using the Time block, scale the time to increase the frequency. For example, the following model scales the input by 2p to give a frequency of 1 Hz:

 

Node List

1

Input
Input position to the waveform in radians.

2

Output
Output signal scaled to ± 1

3

Documentation node

 

Pulse Wave

Graphic

Tab

Waveform

Function

Provide Pulse (PWM) waveform. Similar to Square Wave (see above) except Duty Cycle Node sets duty cycle in percentage..

Note that the input is assumed to be in radians so that the wave has a period of 2 p. When using the Time block, scale the time to increase the frequency. For example, the following model scales the input by 2p to give a frequency of 1 Hz:

 

Node List

1

Input
Input position to the waveform in radians.

2

Duty Cycle
Duty cycle in percent. Clamped to be between 0 and 100.

3

Output
Output signal scaled to ± 1

4

Documentation node

 

 

Analog Tab

Integrator

Graphic

Tab

Analog

Function

Provide integration

 

Node List

1

Input
Signal to be integrated

2

Gain
Rate of Integration (normally set to 1)

3

Reset Value
Value the integrator is set to when the Reset node is true.

4

Reset
When true, set output to Reset Value

5

Initial Value
Value to which the output is set upon each compile

6

Output

7

Documentation node

 

Clamped Integrator

Graphic

Tab

Analog

Function

Provide integration with maximum and minimum limits

 

Node List

1

Input
Signal to be integrated

2

Gain
Rate of Integration (normally set to 1)

3

Maximum
Maximum value the integrator can take on.

4

Minimum
Minimum value the integrator can take on.

5

Initial Value
Value to which the output is set upon each compile

6

Output

7

Documentation node

 

Switch (2-position mux)

Graphic

Tab

Analog

Function

Model a two-input, two-output analog switch

 

Node List

1

Control
If Control > 0.5, Input0 connects to Output0, and Input1 connects to Output1. If Control <= 0.5, the outputs are switched: Input0 connects to Output1, and Input1 connects to Output0.

2

Input0

3

Input1

4

Output0

5

Output1

6

Documentation node

 

Switch (4-position mux)

Graphic

Tab

Analog

Function

Model a four-input, one-output analog switch

 

Node List

1

Control
If Control <= 0.5, Input0 connects to Output.
If 0.5 < Control <= 1.5, Input1 connects to Output.
If 1.5 < Control <= 2.5, Input2 connects to Output.
If 2.5 < Control, Input3 connects to Output.

2

Input0

3

Input1

4

Input2

5

Input3

6

Documentation node

 

Comparator

Graphic

Tab

Analog

Function

Model an analog comparator (equivalent to Greater-Than or Equal-To)

 

Node List

1

Input1
Positive input

2

Input2
Negative input

3

Output
If Input1 >= Input2, Output = 1; otherwise, Output = 0.

4

Documentation node

 

Hysteresis

Graphic

Tab

Analog

Function

Model a hysteresis circuit

 

Node List

1

Input

2

Low Limit
When input value falls below Low Limit, the output turns off.

3

High Limit

When input value rises above High Limit, the output turns on.

4

Initial State (Bool)
State of Output immediately after compiling.

5

Output (Bool)
Logical output of hysteresis process. If input falls below Low Limit or rises above High Limit, the Output changes state accordingly; if input remains between these limits, Output retains its value.

6

Documentation node

 

Clamp

Graphic

Tab

Analog

Function

Model an analog comparator (equivalent to Greater-Than or Equal-To)

 

Node List

1

Input
Positive input

2

Minimum
Clamp level

3

Maximum
Clamp level

4

Clamped
Boolean output, on when output is clamped

5

Output
Input, bounded by Minimum and Maximum.

6

Documentation node

 

Ramp Limit

Graphic

Tab

Analog

Function

Ramp limit

 

Node List

1

Input

2

Positive Rate
Maximum positive ramp rate.

3

Negative Rate
Maximum negative ramp rate

4

Output
Input
with maximum ramp rate limited according to Negative Rate and Positive Rate.

5

Documentation node

 

Reversal Shift

Graphic

Tab

Analog

Function

Provide gain that shifts with the sign of the input

See also

Program blocks to implement more complex gain-variation.

 

Node List

1

Input

2

Positive Gain
Gain from input to output when input > 0.

3

Negative Rate
Gain from input to output when input < 0.

4

Output
Input
scaled according to either Positive Gain or Negative Gain.

5

Documentation node

 

Deadband

Graphic

Tab

Analog

Function

Deadband

See also

Program blocks to implement more complex deadband functions.

 

Node List

1

Input

2

Positive Band
Positive side of deadband. Must be > 0.

3

Negative Band
Negative side of deadband. Must be < 0.

4

Output
if Input < Positive Band, Output = Input – Positive Band;
if Input > Negative Band, Output = Input – Negative Band;
Otherwise, Output = 0.

5

Documentation node

 

Deadband Comp

Graphic

Tab

Analog

Function

Deadband compensation algorithm

See also

Program blocks to implement more complex deadband compensation.

 

Node List

1

Input

2

Positive Band
Positive side of deadband. Must be > 0.

3

Negative Band
Negative side of deadband. Must be < 0.

4

Output
if Input > 0, Output = Input + Positive Band;
if Input < 0, Output = Input + Negative Band.

5

Documentation node

 

Asynchronous Hold

Graphic

Tab

Analog

Function

Asynchronous Hold

 

Node List

1

Input

2

Hold
If 1, Hold Output to constant value.  Level triggered (not edge triggered).

3

Output
If Hold <= 0.5, Output = Input
Otherwise, hold Output constant..

4

Documentation node

 

Random Number Generator

Graphic

Tab

Analog

Function

Random number generator.

 

Node List

1

Amplitude
Peak-to-peak span of random number output.

2

Offset
Offset of output center. For example, if Amplitude = 1 and Offset = 0, output of generator will span between –0.5 and +0.5.

3

Output

4

Documentation node

 

Analog Filters Tab

Analog PI

Graphic

Tab

Analog Filters

Function

Provide an analog proportional-integral control law with wind-up control. Output = KP x (KI/s + 1), subject to wind-up control.

 

Node List

1

Input
Error signal input

2

KP
Proportional gain.

3

KI
Integral gain

4

Saturation
Saturation of PI control output (assumed to be same for positive and negative values).

5

Wind-up
Wind-up level; normally set to 2.

6

Output

7

Documentation node

 

Analog PI+

Graphic

Tab

Analog Filters

Function

Provide an analog proportional-integral-plus (PI+) control law with wind-up control.

 

Node List

1

Command
Command signal input

2

KP
Proportional gain.

3

KI
Integral gain

4

KFR
Feed-forward (PI+) Gain

5

Saturation
Saturation of PI control output (assumed to be same for positive and negative values).

6

Wind-up
Wind-up level; normally set to 2.

7

Output

8

Error Monitor
Output of error signal, which, for example, is usually connected to error signal for DSA in order to provide an open-loop Bode plot.

9

Feedback
Feedback signal input

9

Documentation node

 

Analog PID

Graphic

Tab

Analog Filters

Function

Provide an analog proportional-integral control law with wind-up control. Output = KP x (KI/s + 1 + KDs), subject to wind-up control.

 

Node List

1

Input
Error signal input

2

KP
Proportional gain.

3

KI
Integral gain

4

KD

Derivative gain

5

Low-pass Frequency

Break (-3dB) frequency of low-pass filter applied to derivative term.

6

Saturation
Saturation of PI control output (assumed to be same for positive and negative values).

7

Wind-up
Wind-up level; normally set to 2.

8

Output

9

Documentation node

  

1-Pole Low-Pass Filter

Graphic

Tab

Analog Filters

Function

Provide a single-pole low-pass filter in the form of
(w)/(s + w) where w = 2 * PI * frequency and s is the Laplace operator.

 

Node List

1

Input

2

Frequency
Filter –3dB (break) frequency in Hertz.

3

Output

4

Documentation node

 

Lead-Lag Filter

Graphic

Tab

Analog Filters

Function

Provide a lead-lag filter in the form of
(s+wN)/(s + wD) where wN = 2 * PI * Numerator frequency (the "zero"), wD = 2 * PI * Denominator frequency (the "pole") and s is the Laplace operator.
Note: filter is scaled for unity gain at DC.

 

Node List

1

Input

2

Numerator Frequency
Numerator frequency ("zero") in Hertz.

3

Denominator Frequency
Denominator frequency ("pole") in Hertz.

4

Output

5

Documentation node

  

2-Pole Low-Pass Filter

Graphic

Tab

Analog Filters

Function

Provide a two-pole low-pass filter in the form of
(w^2)/(s^2 + 2 * zeta * w * s + w^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Frequency
Filter natural frequency in Hertz.

3

Damping
Filter damping (zeta) where zeta = 1 implies critically damped.

4

Output

5

Documentation node

 

2-Pole Low-Pass Filter (A)

Graphic

Tab

Analog Filters

Function

Provide a two-pole low-pass filter in the form of
(2 * zeta * w * s + w^2)/(s^2 + 2 * zeta * w * s + w^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Frequency
Filter natural frequency in Hertz.

3

Damping
Filter damping (zeta) where zeta = 1 implies critically damped.

4

Output

5

Documentation node

 

Bi-Quad Filter

Graphic

Tab

Analog Filters

Function

Provide a two-pole low-pass filter in the form of
(s^2 + 2 * zetaN * wN * s + wN^2)/(s^2 + 2 * zetaD * wD * s + wD^2) x (wD^2 / wN^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Numerator Frequency
Numerator filter natural frequency in Hertz (wN)

3

Numerator Damping
Numerator filter damping (zetaN) where zeta = 1 implies critically damped.

4

Denominator Frequency
Denominator filter natural frequency in Hertz (wD)

5

Denominator Damping
Denominator filter damping (zetaD) where zeta = 1 implies critically damped.

6

Output

7

Documentation node

  

F(s) Tab

1st – 6th order s-domain filters

Graphics

Tab

F(s)

Function

Provide 1st-6th order filters set by z-domain coefficients. Transfer function is C(z)/R(z) = (A(N)s^N + … + A(0))/s^N + B(N-1)s^(N-1)… + B(0))

 

Node List

1

Input Node

2

Output Node

Top side, left set (2-7 nodes)

Numerator coefficients, from left to right, with A(N) – A(0).

Top side, right set (1-6 nodes)

Denominator coefficients, from left to right, with B(N-1) through B0. B(N) is assumed = 1.

Bottom

Documentation node

  

Digital Tab

 Digital Controller

Graphic

Tab

Digital

Function

Provide regular sampling for digital blocks

Special behavior

Each digital controller must be named uniquely. Controllers are automatically given unique (Controller1, Controller2, …) names upon placement in model. At least one digital controller must be present in any model that has one or more digital (yellow) blocks.

 

Node List

1

Sample Time
Sample time of the digital controller in seconds. Sample Time of each controller should be an integer multiple of the Solver block node h.

2

Sample Frequency
Output a 50% duty cycle square wave at the frequency of 1/(Sample Time)

3

Documentation node

 

Sample and Hold

Graphic

Tab

Digital

Function

Sample and hold

Notes

Most digital blocks have the sample/hold function built in so that analog signals can be fed directly into digital blocks.

 

Node List

1

Input
Unsampled signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Output
Sampled signal

4

Documentation node

 

Sample Delay

Graphic

Tab

Digital

Function

Delay a signal one sample time.

 

Node List

1

Input
Undelayed signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Output
Delayed signal

4

Documentation node

 

Calculation Delay

Graphic

Tab

Digital

Function

Delay a signal a fraction of one sample time to simulate delay to execute digital calculation algorithms

 

Node List

1

Input
Undelayed signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Delay
Amount of delay as a percentage of one sample time.

4

Output
Delayed signal

5

Documentation node

 

Difference

Graphic

Tab

Digital

Function

Calculate simple difference (difference of two most recent samples) divided by sample time; this is a common approximation to a derivative.

 

Node List

1

Input
Input signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Output
Differentiated signal

4

Documentation node

 

Inverse Trapezoidal

Graphic

Tab

Digital

Function

Calculate difference based on the inverse trapezoidal method. This method can provide the derivative with less phase lag than simple differences, but has a penalty of increasing noise sensitivity.

 

Node List

1

Input
Input signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

a
Inverse trapezoidal parameter, which ranges from 0 to 1. When a = 0, this is equivalent to simple differences. As a increases towards 1, the output signal has less phase lag than simple differences, but has greater noise sensitivity. Normally, a should be less than 0.8.

3

Output
Differentiated signal

4

Documentation node

 

Sum/TSample

Graphic

Tab

Digital

Function

Calculate the sum of the input samples divided by the sample time. This is a common approximation to analog integration.

 

Node List

1

Input
Input signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Initial Value
Value of the output after each compile..

4

Output
Integrated signal

5

Documentation node

 

Clamped Sum/TSample

Graphic

Tab

Digital

Function

Calculate the sum of the input samples divided by the sample time; clamp output between Minimum and Maximum. This is a common approximation to clamped analog integration.

 

Node List

1

Input
Input signal.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Initial Value
Value of the output after each compile..

4

Minimum
Minimum value the integrator can take on.

5

Maximum
Maximum value the integrator can take on.

6

Output
Integrated signal

7

Documentation node

 

Digital Random Number Generator

Graphic

Tab

Digital

Function

Digital random number generator.

 

Node List

1

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

2

Amplitude
Peak-to-peak span of random number output.

3

Offset
Offset of output center. For example, if Amplitude = 1 and Offset = 0, output of generator will span between –0.5 and +0.5.

4

Output

5

Documentation node

 

Digital Dither

Graphic

Tab

Digital

Function

Generate dither, the periodic square waves used to break up limit cycles in digital control loops.

 

Node List

1

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

2

Amplitude
Peak-to-peak span of random number output.

3

Cycles
Sample time period between each transition of the output signal.

4

Output
Dither output, a 50% duty cycle square wave.

5

Documentation node

 

Digital Filters Tab

Digital PI

Graphic

Tab

Digital Filters

Function

Provide a digital proportional-integral control law with wind-up control. Output = KP x (KI/s + 1), subject to wind-up control.

 

Node List

1

Input
Error signal input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

KP
Proportional gain.

4

KI
Integral gain

5

Saturation
Saturation of PI control output (assumed to be same for positive and negative values).

6

Wind-up
Wind-up level; normally set to 2.

7

Output

8

Error Monitor
Output of error signal, which, for example, is usually connected to error signal for DSA in order to provide an open-loop Bode plot.

8

Documentation node

 

Digital PI+ Control Law

Graphic

Tab

Digital Filters

Function

Provide a digital proportional-integral-plus (PI+) control law with wind-up control.

 

Node List

1

Command
Command signal input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

KP
Proportional gain.

4

KI
Integral gain

5

KFR
Feed-forward (PI+) Gain

6

Saturation
Saturation of PI control output (assumed to be same for positive and negative values).

7

Wind-up
Wind-up level; normally set to 2.

8

Output

9

Error Monitor
Equal to CommandFeedback, which is often connected to a variable to be used as a DSA signal. This error signal is often used to get the Bode plot of the open loop transfer function.

10

Feedback
Feedback signal input

11

Documentation node

 

Digital PID Control Law

Graphic

Tab

Digital Filters

Function

Provide a digital proportional-integral control law with wind-up control. Output = KP x (KI/s + 1 + KD x s), subject to wind-up control. Commonly used for single-integrating plants.

 

Node List

1

Input
Error signal input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

KP
Proportional gain.

4

KI
Integral gain

5

KD
Derivative gain

6

Saturation
Saturation of PID control output (assumed to be same for positive and negative values).

7

Wind-up
Wind-up level; normally set to 2.

8

Output

9

Documentation node

 

Digital PID Control Law (2) 

Graphic

Tab

Digital Filters

Function

Provide a digital proportional-integral control law with wind-up control. Output = KI/s + KP + KD x s, subject to integral saturation. Commonly used for double-integrating plants such for position loops (without velocity loops).

 

Node List

1

Input
Error signal input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

KP
Proportional gain.

4

KI
Integral gain

5

KD
Derivative gain

6

Saturation
Saturation of PID control output (assumed to be same for positive and negative values).

7

Integral Saturation
Saturation of Integral term.

8

Zero Integrator
Boolean input that, if true, forces integral term of PID control law to zero. Often used to reduce overshoot of PID control law during large swings of command input; for example, in a position controller, Zero Integrator may be set to true when position profile is non zero. Note that all Visual ModelQ position profile generators (in Motion Tab) provide an output, called In Motion, for this purpose.

9

Clegg Integrator
Boolean input that causes integral to be zeroed anytime position error changes sign. Some times used to reduce overshoot of PID control law.

10

Output

11

Documentation node

 

Digital 1-Pole Low-Pass Filter

Graphic

Tab

Digital Filters

Function

Provide the digital equivalent to a single-pole low-pass filter in the form of
(w)/(s + w) where w = 2 * PI * frequency and s is the Laplace operator.

 

Node List

1

Input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Frequency
Filter –3dB (break) frequency in Hertz.

4

Output

5

Documentation node

 

Digital Lead-Lag Filter

Graphic

Tab

Digital Filters

Function

Provide a z-Domain equivalent to the s-Domain lead-lag filter in the form of
(s+wN)/(s + wD) where wN = 2 * PI * Numerator frequency (the "zero"), wD = 2 * PI * Denominator frequency (the "pole") and s is the Laplace operator.
Note: filter is scaled for unity gain at DC.

 

Node List

1

Input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Numerator Frequency
Numerator frequency ("zero") in Hertz.

4

Denominator Frequency
Denominator frequency ("pole") in Hertz.

5

Output

6

Documentation node

 

Digital 2-Pole Low-Pass Filter

Graphic

Tab

Digital Filters

Function

Provide the digital equivalent of a two-pole low-pass filter in the form of
(w^2)/(s^2 + 2 * zeta * w * s + w^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Frequency
Filter natural frequency in Hertz.

4

Damping
Filter damping (zeta) where zeta = 1 implies critically damped.

5

Output

5

Documentation node

 

2-Pole Low-Pass Filter (A)

Graphic

Tab

Digital Filters

Function

Provide the digital equivalent of a two-pole low-pass filter in the form of
(2 * zeta * w * s + w^2)/(s^2 + 2 * zeta * w * s + w^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Frequency
Filter natural frequency in Hertz.

4

Damping
Filter damping (zeta) where zeta = 1 implies critically damped.

5

Output

6

Documentation node

 

Digital 2-Pole Notch Filter

Graphic

Tab

Digital Filters

Function

Provide the digital equivalent of a notch filter in the form of
(s^2 + w^2)/(s^2 + 2 * zeta * w * s + w^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Frequency
Filter natural frequency in Hertz.

4

Damping
Filter damping (zeta) where zeta = 1 implies critically damped.

5

Output

5

Documentation node

 

Digital Bi-Quad Filter

Graphic

Tab

Digital Filters

Function

Provide the digital equivalent of a two-pole low-pass filter in the form of
(s^2 + 2 * zetaN * wN * s + wN^2)/(s^2 + 2 * zetaD * wD * s + wD^2) x (wD^2 / wN^2) where w = 2 * PI * Frequency and s is the Laplace operator.

 

Node List

1

Input

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Numerator Frequency
Numerator filter natural frequency in Hertz (wN)

4

Numerator Damping
Numerator filter damping (zetaN) where zeta = 1 implies critically damped.

5

Denominator Frequency
Denominator filter natural frequency in Hertz (wD)

6

Denominator Damping
Denominator filter damping (zetaD) where zeta = 1 implies critically damped.

7

Output

8

Documentation node

                       

Moving Average Filter

Graphic

Tab

Digital Filters

Function

Provide a moving average (box car) filter. For example, a fourth-order moving average filter produces:

Out(i) = [Input(i) + Input(i-1) + Input(i-2) + Input(i-3)]/4

 

Node List

1

Input
Inputs are saved by filter to be averaged for output. At time t=0, all inputs are filled with the value 0.0.

2

Controller
Select a digital controller. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

3

Maximum Order
Set maximum order of the filter. Changing this value forces the model to recompile.

4

Order
Set the order of the filter. This value can be changed at any time. Value is automatically clamped to be between 1 and Maximum Order.

5

Output

6

Documentation node

 

 F(z) Tab

1st – 6th order z-domain filters

Graphics

Tab

F(z)

Function

Provide 1st-6th order filters set by z-domain coefficients. Transfer function is C(z)/R(z) = (A(N)z^N + … + A(0))/(B(N)z^N + … + B(0))

 

Node List

1

Input Node

2

Output Node

Top side, left set (2-7 nodes)

Numerator coefficients, from left to right, with A(N) – A(0).

Top side, right set (2-7 nodes)

Denominator coefficients, from left to right, with B(N) through B(0).

Bottom

Documentation node

  

Custom Tab

Custom Module

Note: This block is currently in beta release.

Graphic

Tab

Custom

Function

Allow user to build custom modules. Custom modules are disabled in default screen.

How to build a custom module.

  1. Click File, New Custom Module. Screen will turn off white and custom module block buttons (in Custom Tab) will become enabled. In addition, some blocks, including most instruments and constants, will be disabled, since these blocks are not allowed in custom modules.
  2. Insert one Custom Module Input for each input node desired in the custom module.
  3. Insert one Custom Module Output for each input node desired in the custom module.
  4. Add ordinary blocks between input and output modules as needed.
  5. Add one documentation node (recommended) so user can document the use of the custom module.
  6. Save File.
  7. Return to standard model. Insert custom module by clicking on Custom Module block and then placing on screen. A dialog box will appear, allowing the user to select the desired module.

 

Node List

 

Node list is set by the user when building custom modules.

 

Custom Module Input

Note: This block is currently in beta release.

Graphic

Tab

Custom

Function

Connect inputs from the model that calls the module.

Notes

After the custom module is built and saved, it is placed in the calling model. (see Custom Module, above). When viewed from the calling model, one input node will be created for each Custom Module Input block. The input nodes will be named according to the user strings of the Custom Module Input block; for example, if the block picture above were used in a custom module, the node would appear as an "Input1" as viewed from the calling model.

 

Node List

1

Edge
Position where node will appear on the custom module block, when viewed from the calling model. Choose from Left, Right, Top, and Bottom.

2

Position
Position from top or left of Edge. Larger Position implies the node will appear further from top or left. Do not allow two nodes to have the same position on the same edge as only one will be viewable.

3

Initial Value
Value of input node if the node is not wired in the calling program.

4

Input
Value of input node as transferred from the calling model.

5

Documentation node

 

Custom Module Output

Note: This block is currently in beta release.

Graphic

Tab

Custom

Function

Connect outputs to the model that calls the module.

Notes

After the custom module is built and saved, it is placed in the calling model. (see Custom Module, above). When viewed from the calling model, one output node will be created for each Custom Module Output block. The output nodes will be named according to the user strings of Custom Module Output block; for example, if the block picture above were used in a custom module, the node would appear as an "Output1" as viewed from the calling model.

 

Node List

1

Edge
Position where node will appear on the custom module block, when viewed from the calling model. Choose from Left, Right, Top, and Bottom.

2

Position
Position from top or left of Edge. Larger Position implies the node will appear further from top or left. Do not allow two nodes to have the same position on the same edge as only one will be viewable.

3

Output
Value of output node as transferred to the calling model.

4

Documentation node

 

Custom Documentation

Note: This block is currently in beta release.

Graphic

Tab

Custom

Function

Provides documentation nodes on custom module to the model that calls the module.

Notes

After the custom module is built and saved, it is placed in the calling model. (see Custom Module, above). When viewed from the calling model, one documentation node will be created for each Custom Documentation block. The output nodes will be named according to the user strings of Custom Documentation block; for example, if the block picture above were used in a custom module, the node would appear as an "Documentation" as viewed from the calling model.

 

Node List

1

Edge
Position where node will appear on the custom module block, when viewed from the calling model. Choose from Left, Right, Top, and Bottom.

2

Position
Position from top or left of Edge. Larger Position implies the node will appear further from top or left. Do not allow two nodes to have the same position on the same edge as only one will be viewable.

3

Documentation node

 

Program Tab

2x2 Program, 4x4 Program, 8x8 Program

Graphics

Tab

Program

Function

Supports text-based programming language that is executed at the same rate as the analog model components. Program length is limited to 5000 characters for each program block.

The following example sets Output1 to the square root of Input1.

See Visual ModelQ User’s Manual for detail on language.

 

Node List

Left

Input1, Input2, …
Input lines that can be used in the text-based programming.

Right

Output1, Output2, …
Output lines that can be used in the text-based programming.

Top

Program
Stores text-based program.

Bottom

Documentation node

 

2x2 Digital Program, 4x4 Digital Program, 8x8 Digital Program

Graphics

Tab

Program

Function

Supports text-based programming language that is executed at a rate equal to a digital controller. Program length is limited to 5000 characters for each program block.

The following example sets Output1 to the square root of Input1.

See Visual ModelQ User’s Manual for detail on language.

 

Node List

Left

Input1, Input2, …
Input lines that can be used in the text-based programming.

Left

(Bottom)

Controller (bottom left)
Select a digital controller. The program in this block will execute one each time the digital controller samples. Note that if only one digital controller is used in the model, Visual ModelQ automatically selects that controller for this node.

Right

Output1, Output2, …
Output lines that can be used in the text-based programming.

Top

Program
Stores text-based program.

Bottom

Documentation node

  

Motion Tab

Motor Feedback

Graphic

Tab

Motion

Function

Quantizes output of motor feedback

 

Node List

1

InputPosition
Position of motor.in radians

2

Resolution
Resolution in either lines/revolution or counts/revolution.

3

ResolutionType
Specify type of resolution, either lines/revolution or counts/revolution. This follows the convention from optical encoders where one line is equivalent to four counts.

4

Enable
If true, block quantizes output; if false, OutputPosition = InputPosition (without quantization).

5

OutputPosition
Quantized motor position

17

Documentation node

 

Two-Body Compliant Load

Graphic

Tab

Motion

Function

Provides model for motor and load with compliant coupling.

 

Node List

1

tAppl
Applied torque, usually from velocity or position loop, in Nm.

2

tMDist
Disturbance torque applied to motor, in Nm.

3

TLDist
Disturbance torque applied to load, in Nm.

4

Vmax
Maximum velocity of motor; model clamps velocity to +/- this value. Measured in rad/s.

5

Jm
Motor inertia, in kg-m^2.

6

Jl
Load inertia, in kg-m^2, reflected through transmission. For example, for a 5:1 gear box, Jl would be 1/25 of the actual load inertia.

7

Ks
Overall spring constant of the compliant load, in Nm/rad.

8

Kcv
Cross-coupled viscous damping, the damping constant between motor and load, in Nm-sec/rad. This source damping has the greatest effect on the resonant behavior seen in compliantly-coupled systems.

9

Kmv
Motor viscous damping, the damping constant between motor and ground, in Nm-sec/rad

10

Klv
Load viscous damping, the damping constant between load and ground, in Nm-sec/rad

11

Am
Acceleration of the motor, in rad/s^2.

12

Vm
Velocity of the motor, in rad/s.

13

Pm
Position of the motor, in rad.

14

Al
Acceleration of the load, in rad/s^2.

15

Vl
Velocity of the load, in rad/s.

16

Pl
Position of the load, in rad.

17

Documentation node

 

DQ to ABC

Graphic

Tab

Motion

Function

Convert from stationary to three-phase rotating reference frame.

Sample use

The following fragment shows how to connect voltages from a phase-based current controller to DQ motor voltages, and then convert the DQ currents output by the motor to phase currents using the DQ-to-ABC block.

 

 Node List

1

Direct
Direct axis in the stationary reference frame.

 

2

Quadrature
Quadrature axis in the stationary reference frame.

 

3

Theta
Angle of rotational reference frame in radians.

 

4

PhaseA
Phase A in the rotating reference frame:
PhaseA = Quadrature * sin(Theta)
+ Direct * cos(Theta).

 

5

PhaseB
Phase B in the rotating reference frame.
PhaseB = Quadrature * sin(Theta – 2PI/3)
+ Direct * cos(Theta – 2PI/3).

 

6

PhaseC
Phase B in the rotating reference frame.
PhaseC = Quadrature * sin(Theta – 4PI/3)
+ Direct * cos(Theta – 4PI/3).

 

7

Documentation node

 

DQ to ABC (Clamped)

Graphic

Tab

Motion

Function

Convert from stationary to three-phase rotating reference frame, clamping the output. Intended for voltage conversion where the clamp is the bus voltage

 Node List

1

Direct
Direct axis in the stationary reference frame.

 

2

Quadrature
Quadrature axis in the stationary reference frame.

 

3

Theta
Angle of rotational reference frame in radians.

 

4

Clamp

Bipolar limit on output; applied after Phases A-C are calculated. In a simple voltage converter, this is commonly set to VBUS/2.

 

5

PhaseA
Phase A in the rotating reference frame:
PhaseA = Quadrature * sin(Theta)
+ Direct * cos(Theta).

 

6

PhaseB
Phase B in the rotating reference frame.
PhaseB = Quadrature * sin(Theta – 2PI/3)
+ Direct * cos(Theta – 2PI/3).

 

7

PhaseC
Phase B in the rotating reference frame.
PhaseC = Quadrature * sin(Theta – 4PI/3)
+ Direct * cos(Theta – 4PI/3).

 

8

Documentation node

 

 

ABC to DQ

Graphic

Tab

Motion

Function

Convert from 3-phase rotating to stationary reference frame.

Sample use

The following fragment shows how to connect voltages from a phase-based current controller to DQ motor voltages, and then convert the DQ currents output by the motor to phase currents using the DQ-to-ABC block.

 Node List

1

PhaseA
Phase A in the rotating reference frame:

 

2

PhaseB
Phase B in the rotating reference frame; lags PhaseA by 2PI/3 radians (120 degrees).

 

3

PhaseC
Phase C in the rotating reference frame; lags PhaseA by 4PI/3 radians (240 degrees).

 

4

Theta
Angle of rotational reference frame in radians.

 

5

Direct
Direct axis in the stationary reference frame.
PhaseD = (2.0/3.0) *
( PhaseA * cos (Theta) +
PhaseB * cos (Theta – 2PI/3) +
PhaseC * cos (Theta – 4PI/3)).

 

6

Quadrature
Quadrature axis in the stationary reference frame.
PhaseQ = (2.0/3.0) *
( PhaseA * sin (Theta) +
PhaseB * sin (Theta – 2PI/3) +
PhaseC * sin (Theta – 4PI/3)).

 

7

Documentation node

 

 

 

ABC to Magnitude and Theta  

Graphic

Tab

Motion

Function

Convert from 3-phase rotating to stationary reference frame including deducing angle.  For example, if you know IA, IB, and IC, use this block to determine the magnitude, angle, and offset of the three phases.

 

 Node List

1

PhaseA
Phase A in the rotating reference frame:

 

2

PhaseB
Phase B in the rotating reference frame; lags PhaseA by 2PI/3 radians (120 degrees).

 

3

PhaseC
Phase C in the rotating reference frame; lags PhaseA by 4PI/3 radians (240 degrees).

 

4

Magnitude
Magnitude of three-phase current vector

 

5

Theta
Angle of three-phase current vector in radians.

 

6

Offset
Offset current for cases where PhaseA + PhaseB + PhaseC <> 0.

 

7

Documentation node

 

 

DQ Motor

Graphic

Tab

Motion

Function

Provide DQ current and torque given DQ voltages.

Sample use

The following fragment shows how to connect voltages from a phase-based current controller to DQ motor voltages using an ABC-to-DQ block, and then convert the DQ currents output by the motor to phase currents using the DQ-to-ABC block.

 

 Node List

1

VQ
Quadrature axis voltage in the stationary reference frame.

 

2

VD
Direct axis voltage in the stationary reference frame.

 

3

KT
Torque constant of the motor in Nm/Amp

 

4

LQ
Quadrature axis inductance in the stationary reference frame per phase in henries.

 

5

LD
Direct axis inductance in the stationary reference frame per phase in henries.

 

6

R
Phase resistance in ohms.

 

7

Pole Pairs

 

8

Velocity
Motor velocity in rad/sec.

 

9

Documentation node

 

 

 

AVD Motion Profile

Graphic

Tab

Motion

Function

Provides general profile where A-V-D (acceleration, velocity, and distance) can be specified independently.

 

Node List

1

Move
Boolean move command. Starts move after each positive trigger. If edge occurs during profile, next profile will execute immediately following.

2

Continuous
Continuously commands profile moves..

3

Pf
Value to reset position command to after each compile, in rad. Typically wired to position feedback.

4

PDistance
Distance of move profile, in rad.

5

VTraverse
Maximum traverse speed of move profile, in rad/s..

6

AMax
Average acceleration of first segment of move, in rad/s^2..

7

DMax
Average deceleration of last segment of move, in rad/s^2.

8

SCurve
Select amount of s-curve in profile. If SCurve = 0, create trapezoidal move; if SCurve = 1, the entire acceleration and deceleration are polynomial (4th order) s-curves. If SCurve is between 0 and 1, it defines the percentage of the accel/decel that is polynomal (e.g., SCurve = 0.8 implies 80% of the accel/decel is polynomial and the remainder is straight-line).

9

TDwell
Dwell time, in seconds added to end of profile until completion of move.

10

Pc
Position command, in rad, from profile generator; usually connected as command of position loop.

11

Vc
Velocity command, in rad/s, from profile generator; usually connected to velocity feed-forward command.

12

Ac
Acceleration command from profile generator; usually connected to acceleration feed-forward after being multiplied by system inertia and divided by motor torque constant (Kt).

13<