Some SimMechanics™ blocks provide physical signal ports for actuation input or sensing output. These ports accept or output only Simscape™ physical signals. If you wish to connect these ports to Simulink® blocks, you must use the Simscape converter blocks. The table summarizes the converter blocks that Simscape provides. You can find both blocks in the Simscape Utilities library.
|PS-Simulink Converter||Convert Simscape physical signal into Simulink signal|
|Simulink-PS Converter||Convert Simulink signal into Simscape physical signal|
In SimMechanics, most physical signal ports are hidden by default. To expose them, you must select an actuation input or sensing output from the block dialog box. Blocks that provide physical signal ports include certain Forces and Torques blocks as well as Joint blocks. Each port has a unique label that identifies the actuation/sensing parameter. For the ports that a block provides, see the reference page for that block.
To provide an actuation signal based on Simulink blocks, you use the Simulink-PS Converter block:
Specify the desired actuation signal using Simulink blocks.
Connect the Simulink signal to the input port of a Simulink-PS Converter block.
Connect the output port of the Simulink-PS Converter block to the input port of the SimMechanics block that you want to provide the actuation signal to.
In the figure, the connection line that connects to the input port of the Simulink-PS Converter block represents the original Simulink signal. The connection line that connects to the output port of the same block represents the converted physical signal. This is the signal that you must connect to the actuation ports in SimMechanics blocks.
To connect the sensing signal of a SimMechanics block to a Simulink block, you use the PS-Simulink Converter block:
Connect the SimMechanics sensing port to the input port of a PS-Simulink Converter block.
Connect the output port of the PS-Simulink Converter block to the Simulink block of your choice.
The figure shows how you can connect a SimMechanics sensing signal to a Simulink Scope block.