Convert Simulink input signal into physical signal
Utilities
The Simulink-PS Converter block converts the input Simulink® signal into a physical signal. Use this block to connect Simulink sources or other Simulink blocks to the inputs of a Physical Network diagram.
To convey signal conversion while taking up minimal canvas space, the block icon changes dynamically based on whether it is connected to other blocks.
When Block Is... | Block Icon |
---|---|
Unconnected |
|
Connected to other blocks |
|
The block icon also changes based on the value of the Input filtering order parameter, to indicate whether filtering is being applied to the input signal.
Input Filtering Order | Unconnected Block Icon | Connected Block Icon |
---|---|---|
|
|
|
|
|
|
You specify the desired unit as the Input signal unit parameter. The parameter value controls the unit of the physical signal at the output port of the block, which serves as the input signal for the Simscape™ physical network.
Note
You can also specify a physical unit on the Simulink signal connected to the input port of the block. In this case, the software checks that the two units match (for more information, see Working with Simulink Units). The Simulink signal units do not propagate into the physical network.
If you leave the block unitless, with the Input signal
unit parameter set to 1
, then the physical
signal unit is inferred from the destination block. The default destination
block units are meter-kilogram-second or MKS (SI). If you specify
different units, commensurate with the expected default units of the
destination block input, then the unit manager attaches these units
to the input Simulink signal value and performs the necessary
unit conversion when providing the signal to the destination block.
In the diagram below, the Ideal Torque Source block
expects a torque signal, in N*m, on its S port. The Constant source
block provides the value for this input signal. If you left the Simulink-PS
Converter block unitless, the Ideal Torque Source block
would generate torque of 1000 N*m. The parameters of other blocks
in this example are chosen so that the output value of the Ideal
Torque Sensor block is equal to the torque generated by the Ideal
Torque Source block, and therefore the Display block
would show the value of 1000. If you change the Input signal
unit parameter value in the Simulink-PS Converter block
to N*cm
, the unit manager performs the conversion
and the Ideal Torque Source block generates torque
of 10 N*m; the torque value in the Display block changes
to 10, as shown in the diagram.
When the input signal is related to thermodynamic variables and contains units of temperature, you must decide whether affine conversion needs to be applied. For more information, see When to Apply Affine Conversion. Usually, if the input signal represents a relative temperature, that is, a change in temperature, you need to apply linear conversion, ΔTnew = L * ΔTold (the default method). However, if the input signal represents an absolute temperature, you need to apply affine conversion, Tnew = L * Told + O.
For example, in the Simulink-PS Converter block shown in the following diagram,
if you type degC
in the Input signal unit field and
select the Apply affine conversion check box, the temperature generated by
the Ideal Temperature Source block is equal to 293.15 K. However, if you leave the
Apply affine conversion check box clear, the output of the Ideal
Temperature Source block is 20 K.
Note
Untyped inputs do not support affine units. If you specify affine units in a Simulink-PS Converter block and then connect it directly to an untyped input port, the signal value is converted to the corresponding fundamental unit and further mathematical operations are performed with that value.
Units to be assigned to the physical signal. These units must be commensurate with the
expected default units of the destination block input. You can select a unit from the
drop-down list, or type the desired unit name, such as rpm
, or a valid
expression, such as rad/s
. For more information and a list of unit
abbreviations, see How to Specify Units in Block Dialogs and
Unit Definitions. The default value is 1
, which means that the
units of the physical signal at the block output match the expected default units of the
destination block input.
This check box is applicable only for units that can be converted either with or without an affine offset, such as thermal units. For more information, see Thermal Unit Conversions.
This parameter lets you decide whether to filter input and thus provide time derivatives of the input signal, or provide the time derivatives through additional input ports on the Simulink-PS Converter block:
Provide signals
— Select whether you want to
provide just the input signal, or also provide time derivatives of the input
signal as additional input signals, by using the Provided
signals parameter. The default input handling options are
Provide signals
and Input
only
. If you use an explicit solver, it is recommended that you
provide input derivatives by selecting one of the other options. For more
information, see Filtering Input Signals and Providing Time Derivatives.
Filter input, derivatives calculated
—
Filter the input through a low-pass filter, which also provides input
derivatives. In this case, the input signal is modified (through filtering)
before being converted to a physical signal. The first-order filter
provides one derivative, while the second-order filter provides the
first and second derivatives. If you use this option, set the appropriate Input
filtering time constant parameter value, as described below.
Zero derivatives (piecewise constant)
—
If your input signal is piecewise constant (such as step), this option
lets you explicitly set the input derivatives to zero.
This parameter is applicable only if the Filtering
and derivatives parameter is set to Provide
signals
. It lets you provide time derivatives of the
input signal as additional input signals:
Input only
— Provide
just the input signal. This is the default. If you select this option,
the block has one Simulink input port and one physical signal
output port.
Input and first derivative
—
If you select this option, an additional Simulink input port
appears on the Simulink-PS Converter block, to let
you connect the signal providing input derivative.
Input and first two derivatives
—
If you select this option, two additional Simulink input ports
appear on the Simulink-PS Converter block, to let you
connect the signals providing input derivatives.
This parameter is applicable only if the Filtering
and derivatives parameter is set to Filter
input, derivatives calculated
. It lets you specify the
number of time derivatives computed for the input signal by selecting
the filter order:
First-order filtering
—
Provides only the first derivative.
Second-order filtering
—
Provides the first and second derivatives.
This parameter is applicable only if the Filtering
and derivatives parameter is set to Filter
input, derivatives calculated
. It specifies the filter
time constant, which controls the filtering of the input signal. The
filtered input follows the true input but is smoothed, with a lag
on the order of the time constant chosen. You should set the time
constant to a value no larger than the smallest time interval of interest
in the system. The trade-off in choosing a very small time constant
is that the filtered input signal will be closer to the true input
signal, at the cost of increasing the stiffness of the system and
slowing down the simulation. The default value is .001
s.
The block has one, two, or three Simulink input ports (depending on the Provided signals parameter value), located on its left side, and a physical signal output port, located on its right side (in the block default orientation).