Computer simulations are powerful tools in the designer’s toolbox, giving an estimate of what the device will actually do once realized. Two such tools, Simulink and SPICE are commonly used to design, simulate, and verify models in the mechanical and electronic domains, respectively. Challenges can arise, however, when attempting to simulate behaviors of hybrid systems that possies both electronic and mechancial subsystems. For example, in microelectromechanical systems (MEMS) designs, variable capacitors are frequent methods for sensing and actuating. While straightforward to model in Simulink, MEMS are not intuitive to model in SPICE, where the control electronics are simulated. On the other hand, SIMULINK is a less mature tool than SPICE for simulating electronic behaviors — SPICE already posseses large libraries of electronic device models. Thus, current MEMS designers lack a straightforward method to simulate and verify variable capacitors in a transient electronic circuit in SPICE, since the entire mechanical system must be converted from Simulink and verified. This paper presents a technique for embedding NGSPICE, an open-source SPICE implementation, inside a Simulink model via a S-function block, enabling a full system model for transient responses to be realized. A Level 2 M-file S-function block implements the calling and parsing of the associated electronic subsystem circuit file. The required modifications for the circuit file to the Simulink model are described. Validation testing using a low-pass filter type circuits with constant and variable capacitance are presented. Some examples are presented and discussed.

This content is only available via PDF.
You do not currently have access to this content.