Combining MTK standard library StateSpace with other Blocks

I’m currently trying to integrate a linear state-space model inside a ModelingToolkit model.
For this purpose I used the ODESystem specialization provided by ControlSystemsMTK, which itself uses the StateSpace block provided by MTK-SL.

However, once the ODESystem is formed, its “interfaces” are RealInputs / RealOutputs, which feel a bit abstract to me.

Are there any examples around showing how to combine such systems with e.g. Flange, MechanicalPort, Pin or else, to give them proper “physical” interfaces and make connections with other blocks easier ?

The StateSpace block has inputs and outputs in the “signal domain”, that is, a generic domain not tied to any physical domain. To use these signals in a physical doman, one uses interface components like sensors (physical → signal), and special input components (signal → physical), such as Voltage, Torque, Force etc. These input components take a signal input and outputs the corresponding physical quantity.

Here’s an example, where the interface components are SpeedSensor, Voltage, and Torque

1 Like

Thanks ! I figured theses sensor blocks would be of use, I’ll try ASAP !