You are on page 1of 186

6.

MEMS+ User Guide

www.coventor.com
Version 6.3

Coventor, Inc.
This manual and its accompanying materials are licensed to the user for the period set forth in the applicable license agreement,
subject to termination of the license by Coventor, Inc. at any time. The manual at all times remains the property of Coventor, Inc.,
or third parties from whom Coventor, Inc. has obtained a licensing right. The information contained in this manual including but
not limited to the ideas, concepts and know-how, is proprietary, confidential and trade secret to Coventor, Inc. or such third parties
and the information contained therein shall be maintained as proprietary, confidential, and trade secret to Coventor, Inc. or to such
third parties. The information in this manual shall not be copied or reproduced in any form whatsoever, nor is any information in
this manual to be disclosed to anyone other than an authorized representative of the user’s employer who is contractually obligated
not to disclose same, without express prior written consent of Coventor, Inc. The user of this manual and the computer program(s)
referred to herein retains full control over and is solely responsible for the mechanical design of the user’s equipment, machinery,
systems, and products. COVENTOR, INC. MAKES NO WARRANTIES OF ANY KIND, INCLUDING THE WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE WITH RESPECT TO THE EQUIPMENT, MACHIN-
ERY, SYSTEMS, AND PRODUCTS, DERIVED OR RESULTING HEREUNDER, AND THE USER ASSUMES ALL RISKS
AND LIABILITY FOR RESULTS OBTAINED BY THE MANUFACTURING, USE OR IMPLEMENTATION OF THE COM-
PUTER PROGRAMS(S) DESCRIBED HEREIN, WHETHER USED SINGLY OR IN COMBINATION WITH OTHER
DESIGNS OR PRODUCTS. Coventor shall not be liable for any incidental, indirect, special, consequential, or punitive damages.
Coventor makes no warranty that the equipment, machinery, systems, and products derived or resulting hereunder will not infringe
the claims of domestic or foreign patents and further does not warrant against infringement by reason of the user, thereof in combi-
nation with other designs, products, or materials or in the operation of any process. User shall protect, indemnify and hold harm-
less Coventor of and from any loss, cost, damage (including attorney’s fees) or expense arising from any claim that is any way
associated with the computer programs(s) described in this manual. Data presented in examples do not necessarily reflect actual
test results and should not be used as design criteria.
By acceptance of this manual, the user agrees to the above conditions and further agrees that this manual will not be exported (or
re-exported from a country of installation), directly or indirectly, separately or as part of a system, without user or user’s employer,
at its own cost, first obtaining all licenses from the United States Department of Commerce and any other appropriate agency of
the United States Government as may be required by law.
© Coventor, Inc., 2018.
All rights reserved. No part of this work may be reproduced, stored in a retrieval system, or transmitted, in any form or by any
means, electronic or mechanical, including photocopying and recording, or by any information storage or retrieval system without
prior permission in writing from Coventor, Inc. Information in this document is subject to change without notice.
CoventorWare includes software developed by the University of California, Berkeley and its contributors.
CoventorWare is enhanced with Visualization Software from Tecplot, Inc. of Bellevue, Washington, USA.
CoventorWare and the associated documentation incorporate portions of Abaqus/CAE and its associated documentation under
license from SIMULIA, Inc. Abaqus is a registered trademark of SIMULIA, Inc.
Coventor, CoventorWare, MEMS+, CoSolveEM, CoventorWare ANALYZER, CoventorWare DESIGNER, MemElectro, Damp-
ingMM, MemMech, and WHAT’S NEXT, AND NEXT, AND NEXT are registered trademarks of Coventor, Inc. Cary, NC.
DXF is a trademark of Autodesk, Inc.
FLEXnet is a registered trademark of Globetrotter Software, Inc.
I-deas is a trademark of UGS.
MATLAB(r). (c) 1984 - 2018 The MathWorks, Inc.
Permalloy is a registered trademark of B&D Industrial & Mining Services, Inc.
Tecplot is a registered trademark of Tecplot, Inc.
Cadence, Verilog and Verilog-XL are registered trademarks of Cadence Design Systems, Inc.
Excel and Windows 7 are registered trademarks of Microsoft Corporation.
X Window System is a trademark of Massachusetts Institute of Technology.
MUMPs is a registered trademark of MEMSCAP, Inc.
VdmTools is proprietary and copyrighted software of Visual Kinematics, Inc.
All other trademarks or registered trademarks belong to their respective holders.
Contact us at www.coventor.com
Doc Ver 6.3 Rev A Compatible with MEMS+ version 6.3

ii May 31, 2018 Coventor, Inc.


Table of Contents Version 6.3

Table of Contents

Section 1: Using MEMS+


1.1: Overview.................................................................................................. U1-1
1.1.1: Design Entry in MEMS+........................................................................................... U1-1
1.1.2: Simulation with MEMS+ Device Models .................................................................. U1-2

1.2: MEMS+ Modules ..................................................................................... U1-2

M
1.2.1: Material Database.................................................................................................... U1-3
1.2.2: Process Editor.......................................................................................................... U1-3
1.2.3: Component Library .................................................................................................. U1-3
1.2.4: Innovator .................................................................................................................. U1-3
1.2.5: Simulator.................................................................................................................. U1-3
1.2.6: Scene3D .................................................................................................................. U1-4

1.3: MEMS+ User Interface............................................................................ U1-4


1.3.1: Adding and Editing Items ......................................................................................... U1-7
1.3.2: File Association and Tab Ordering........................................................................... U1-7
1.3.3: Customizing the Interface ........................................................................................ U1-9
Configuring Tab Components.................................................................................. U1-9
1.3.4: MEMS+ Icons......................................................................................................... U1-10
Application Icons ................................................................................................... U1-10
Bottom Row Icons ................................................................................................. U1-11
1.3.5: Session Transcript and Logging ............................................................................ U1-12
Macros and Replaying Parts of a Transcript ......................................................... U1-13

1.4: Parameterizing a Design with Variables............................................. U1-14


1.4.1: Defining Variables with Functions.......................................................................... U1-15
1.4.2: Limiting Variable Values ........................................................................................ U1-17
1.4.3: Exposing Variables ................................................................................................ U1-17

1.5: Licensing............................................................................................... U1-18

1.6: Tips for Design Entry in MEMS+ ......................................................... U1-18

1.7: Simulation Options for MEMS+ ........................................................... U1-20

1.8: MEMS+/C++ API .................................................................................... U1-21

1.9: Exporting MEMS+ Designs to Other Programs ................................. U1-22

Coventor, Inc. May 31, 2018 iii


Table of Contents Version 6.3

Section 2: Using MEMS+ with MATLAB


2.1: Updating a Script from a Previous Version..........................................U2-1
2.1.1: Limitations of codeUpdater ...................................................................................... U2-2
Variable Names ....................................................................................................... U2-2
Use of cov.memsplus.Document ............................................................................. U2-2

2.2: Creating and Editing MEMS+ Documents in MATLAB ........................U2-3


2.2.1: Terminology ............................................................................................................. U2-3
Type and Property Names....................................................................................... U2-3
2.2.2: Updating MEMS+ Files from Within MATLAB.......................................................... U2-4
2.2.3: Creating a New Document ....................................................................................... U2-4
Creating Materials Database and Process Files...................................................... U2-4
Creating a Component Library................................................................................. U2-5
Creating a Schematic .............................................................................................. U2-6
Creating a Model from Layout ................................................................................. U2-7
2.2.4: Opening an Existing Document................................................................................ U2-8
2.2.5: Saving a Document.................................................................................................. U2-9
2.2.6: Exporting MEMS+ Files ......................................................................................... U2-10
To an Archive......................................................................................................... U2-10
To a Process Design Kit ........................................................................................ U2-10
Exporting a Schematic........................................................................................... U2-10
2.2.7: Sending Documents to MEMS+ ............................................................................. U2-10
2.2.8: Deleting Simulation Files........................................................................................ U2-11
2.2.9: Items ...................................................................................................................... U2-11
Accessing Tree Items ............................................................................................ U2-11
Printing the Contents of an Item Tree.................................................................... U2-12
Get Item Info .......................................................................................................... U2-12
Filters ..................................................................................................................... U2-13
Parent and getChildrenNames() ............................................................................ U2-14
Type....................................................................................................................... U2-14
add() ...................................................................................................................... U2-14
2.2.10: Properties............................................................................................................. U2-16
Retrieving and Setting Properties .......................................................................... U2-16
Get Commands...................................................................................................... U2-17
Viewing Errors on Properties ................................................................................. U2-17
2.2.11: Accessing Variables............................................................................................. U2-17
2.2.12: Comparing Documents, Items, and Properties .................................................... U2-19
Comparing Documents .......................................................................................... U2-19

iv May 31, 2018 Coventor, Inc.


Table of Contents Version 6.3

Comparing Properties............................................................................................ U2-21


2.2.13: Updating MEMS+ Documents and Items in MATLAB.......................................... U2-21
2.2.14: Innovator-Specific Commands............................................................................. U2-21
Connectors ............................................................................................................ U2-21

2.3: Simulating a MEMS+ Innovator 3D Schematic .................................. U2-22


2.3.1: Creating and Running an Analysis......................................................................... U2-22
2.3.2: Running Analyses Created in MEMS+................................................................... U2-25
2.3.3: Inputs, Outputs and States .................................................................................... U2-26
2.3.4: Run the Innovator Wizard ...................................................................................... U2-28
2.3.5: Simulation Properties and Methods ....................................................................... U2-28

M
Setting Property Values for Simulation .................................................................. U2-29
Hints for Remembering Properties and Methods .................................................. U2-31
2.3.6: Recursive Runs for Analyses................................................................................. U2-32
2.3.7: Accessing Results.................................................................................................. U2-32
Result Matrices ...................................................................................................... U2-32
Plotting Results...................................................................................................... U2-34
Plotting Harmonic Results ..................................................................................... U2-34
2.3.8: Saving to and Loading from a File ......................................................................... U2-35
Individual Scene3D Files ....................................................................................... U2-35
Full Analysis Session............................................................................................. U2-36
2.3.9: Displaying Individual Component Force Contributions .......................................... U2-37
get.......................................................................................................................... U2-39
sum ........................................................................................................................ U2-39
Transient Analysis ................................................................................................. U2-40
2.3.10: Stopping a Simulation .......................................................................................... U2-41
With a Keyboard Shortcut...................................................................................... U2-41
Specifying a Simulation Stop Event....................................................................... U2-41

2.4: Analysis Types ..................................................................................... U2-42


2.4.1: Small-Signal AC Analysis ...................................................................................... U2-42
2.4.2: Modal Analysis....................................................................................................... U2-43
Sparse vs. Dense Solver ....................................................................................... U2-44
Sparse Modal Advanced Options .......................................................................... U2-44
Using the Index Command .................................................................................... U2-44
Modal Analysis of Solid Mechanical States ........................................................... U2-45
2.4.3: DC Sweep and DC Sweep Variable ...................................................................... U2-46
DCSweepVariable Example .................................................................................. U2-46
2.4.4: Parametric Study ................................................................................................... U2-48
Vary Analysis ......................................................................................................... U2-48

Coventor, Inc. May 31, 2018 v


Table of Contents Version 6.3

for Loop.................................................................................................................. U2-50


2.4.5: Transient Analysis.................................................................................................. U2-52
Specify a DC or AC Solution as the Initial State .................................................... U2-53
Set the Span of Time to Simulate .......................................................................... U2-55
Specify the Inputs, u(t), as a Function of Time ...................................................... U2-55
Anonymous Functions ........................................................................................... U2-55
Coventor-Supplied Function Objects ..................................................................... U2-56
Function Defined in an M-File................................................................................ U2-58
Viewing the Current Settings for an Input .............................................................. U2-59
Changing Default Simulator Settings..................................................................... U2-60
Other ODE Settings ............................................................................................... U2-61
Optionally Specify Signals to Plot While the Simulation Runs............................... U2-61
Running a Simulation then Saving and Viewing the Results ................................. U2-61
Simulation Results ................................................................................................. U2-63
Continuing a Stopped, Interrupted or Saved Simulation........................................ U2-63
2.4.6: Computing Pull-in and Release Hysteresis Curves ............................................... U2-65
DC Sweep.............................................................................................................. U2-65
Pull-in Analysis ...................................................................................................... U2-67
Viewing Settings .................................................................................................... U2-68
Specifying How to Start and End a Pull-in Analysis............................................... U2-68
Controlling Step Sizes ........................................................................................... U2-69
Controlling Solution Accuracy................................................................................ U2-69
Monitoring Simulation Progress............................................................................. U2-69
Slow Transient Analysis to Determine Pull-in and Release................................... U2-70
2.4.7: Nonlinear Frequency Hysteresis (Duffing) ............................................................. U2-75
Computing the Hysteresis Curves ......................................................................... U2-75
Starting a Transient Analysis from a Hysteresis Result......................................... U2-78
Vary Analysis with Frequency Hysteresis.............................................................. U2-80
Modifying Settings ................................................................................................. U2-81
2.4.8: User-Defined Custom Analyses in MATLAB.......................................................... U2-81
2.4.9: Creating a Reduced-Order Model .......................................................................... U2-82
Add Analysis to Reduced-Order Model ................................................................. U2-83

2.5: Utility Functions....................................................................................U2-83

2.6: MATLAB Scripting Examples ..............................................................U2-84

2.7: Help ........................................................................................................U2-85


2.7.1: Help on Classes ..................................................................................................... U2-85
2.7.2: Help on Objects...................................................................................................... U2-85

vi May 31, 2018 Coventor, Inc.


Table of Contents Version 6.3

2.7.3: MATLAB Help ........................................................................................................ U2-86

2.8: List of Available MATLAB Commands ............................................... U2-86


2.8.1: Memsplus............................................................................................................... U2-86
2.8.2: Document............................................................................................................... U2-86
2.8.3: Items ...................................................................................................................... U2-87
2.8.4: Properties............................................................................................................... U2-87
2.8.5: Arrays..................................................................................................................... U2-88
2.8.6: ComponentLibrary ................................................................................................. U2-88
2.8.7: Innovator ................................................................................................................ U2-88
Schematic .............................................................................................................. U2-88

M
Components .......................................................................................................... U2-88
Connectors / Port Connections.............................................................................. U2-89
2.8.8: Simulator................................................................................................................ U2-89
Analyses ................................................................................................................ U2-89
Result .................................................................................................................... U2-90
Datasets ................................................................................................................ U2-90
Force Balance Contributions ................................................................................. U2-90
SystemMatrices ..................................................................................................... U2-91
2.8.9: Utilities ................................................................................................................... U2-91
2.8.10: Access to CoventorWare ..................................................................................... U2-92

2.9: References ............................................................................................ U2-92

Section 3: Using MEMS+ with Simulink


3.1: Importing a MEMS+ Model..................................................................... U3-1
3.1.1: Updating an Imported Model.................................................................................... U3-1
3.1.2: Opening Imported Model in MEMS+........................................................................ U3-1
3.1.3: Modifying the Path to the Model .............................................................................. U3-1

3.2: MEMS+ Model Ports ............................................................................... U3-2

3.3: Running Simulations.............................................................................. U3-5


3.3.1: Compute Initial DC Point.......................................................................................... U3-5
3.3.2: Compute Initial AC Point.......................................................................................... U3-6
3.3.3: Transient Simulations .............................................................................................. U3-7
3.3.4: View Results in Scene3D......................................................................................... U3-8
3.3.5: Simulink Diagnostic Viewer...................................................................................... U3-9

Coventor, Inc. May 31, 2018 vii


Table of Contents Version 6.3

3.4: MEMS+ Model Simulation with Simulink Control Design .................U3-10


3.4.1: Computing the Operating Point (OP) ..................................................................... U3-10
3.4.2: AC and Modal Analysis .......................................................................................... U3-11
Linearization Inputs and Outputs ........................................................................... U3-13
AC Results............................................................................................................. U3-13
Modal Analysis....................................................................................................... U3-15

Section 4: Using MEMS+ with Cadence Virtuoso


4.1: Importing a MEMS+ Model .....................................................................U4-1
4.1.1: Updating an Imported Model.................................................................................... U4-2
4.1.2: Exporting/Importing to Archive ................................................................................. U4-3
Export Library to Archive ......................................................................................... U4-3
Import from an Archive ............................................................................................ U4-3
Importing from an Archive Created in a Previous Release...................................... U4-3
4.1.3: Setting Default Import Options ................................................................................. U4-4
4.1.4: MEMSPLUS_SCHEMATIC_PATH Environment Variable....................................... U4-5
With the Local Option and Without the Absolute Option.......................................... U4-5
Without the Local or Absolute Option ...................................................................... U4-5
With or Without the Local Option and With the Absolute Option ............................. U4-6

4.2: MEMS+ Model in Cadence Virtuoso......................................................U4-6


4.2.1: Properties................................................................................................................. U4-6
UseSimulatorTemperature Setting .......................................................................... U4-7
4.2.2: Ports......................................................................................................................... U4-7
4.2.3: Quantity Functions ................................................................................................... U4-8
4.2.4: MEMS+ Model Signals in Virtuoso Result Viewer ................................................. U4-10

4.3: Naming Simulation Results .................................................................U4-11


4.3.1: Naming Results and Result Locations Using Keywords ........................................ U4-11
4.3.2: Naming Results and AMS Simulations .................................................................. U4-13

4.4: Sampling Simulation Results ..............................................................U4-13

4.5: Plotting Current, Force and Moment Contributions ..........................U4-15

4.6: Optimizing Simulations ........................................................................U4-17


4.6.1: Suggested Scaling Tool ......................................................................................... U4-17
Tips for Using SuggestScaling Tool....................................................................... U4-18
4.6.2: Multiplier Setting..................................................................................................... U4-18
4.6.3: Start an Analysis from an Initial DC Result ............................................................ U4-19

viii May 31, 2018 Coventor, Inc.


Table of Contents Version 6.3

4.7: Adjusting Simulation Settings for Transient Analysis...................... U4-20


4.7.1: Resonant Structures .............................................................................................. U4-20
4.7.2: Non-Resonant Structures ...................................................................................... U4-21

4.8: MEMS+ Layout in Cadence Virtuoso .................................................. U4-22


4.8.1: Properties............................................................................................................... U4-22
4.8.2: Ports....................................................................................................................... U4-22
4.8.3: Geometry Generation ............................................................................................ U4-22
4.8.4: Error Reporting ...................................................................................................... U4-23

M
Section 5: Troubleshooting
5.1: MEMS+..................................................................................................... U5-1
5.1.1: Replaying .py File Locks Application ....................................................................... U5-1
5.1.2: Changes Lost When MEMS+ Loses License........................................................... U5-1
5.1.3: Cannot Change Value of Exposed Variable ............................................................ U5-1

5.2: Innovator ................................................................................................. U5-1


5.2.1: Wizard...................................................................................................................... U5-1
Inappropriate Component Models ........................................................................... U5-1
Incompatible Material Properties ............................................................................. U5-3
5.2.2: Common Design Considerations ............................................................................. U5-4
5.2.3: Mechanical Connectors Restored Incorrectly .......................................................... U5-4

5.3: Common Simulation Problems ............................................................. U5-5


5.3.1: Troubleshooting a DC or DC Sweep Analysis ......................................................... U5-5
DC Analysis ............................................................................................................. U5-5
DC Sweep ............................................................................................................... U5-6
5.3.2: Simulations With Contact......................................................................................... U5-6
5.3.3: Pull-In and Frequency Hysteresis (Arc Length Continuation) .................................. U5-6
5.3.4: Nonlinear AC............................................................................................................ U5-7
5.3.5: Beam Paths Do Not Appear to Simulate Correctly .................................................. U5-8
5.3.6: Stopping a Simulation .............................................................................................. U5-8

5.4: MATLAB Simulations ............................................................................. U5-8


5.4.1: Transient Analysis.................................................................................................... U5-8
Daeic3 Errors........................................................................................................... U5-8
5.4.2: Contact..................................................................................................................... U5-9

5.5: Cadence Simulations ........................................................................... U5-10


5.5.1: Troubleshooting an Operating Point ...................................................................... U5-10
Inaccurate or Wrong Operating Point .................................................................... U5-10

Coventor, Inc. May 31, 2018 ix


Table of Contents Version 6.3

Failing to Obtain an Operating Point...................................................................... U5-11


5.5.2: Frequency Analysis Mismatch ............................................................................... U5-11
Explanation ............................................................................................................ U5-11
5.5.3: Current Measurement through a Source Yields Unexpected Results.................... U5-13
5.5.4: Quantity Functions and Scale Factors not in Sync ................................................ U5-13

5.6: Scene3D.................................................................................................U5-14
5.6.1: New Result File Will Not Load Automatically ......................................................... U5-14
5.6.2: Loading a Result File Crashes Scene3D ............................................................... U5-14

5.7: Poor Graphics Quality ..........................................................................U5-14

Section 6: Appendix
6.1: Keyboard Shortcuts................................................................................U6-1

6.2: Additional Command Line Functionality ..............................................U6-6


6.2.1: ExportSch................................................................................................................. U6-6
Examples ................................................................................................................. U6-7

x May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

Section 1: Using MEMS+

1.1: Overview
MEMS+ is an integrated platform for MEMS and MEMS+IC design, simulation, and product development. MEMS
devices typically comprise a MEMS sensing or actuation device and integrated electronics. But in conventional
MEMS design, there is a disconnect between MEMS and IC design flows, which leads to long development cycles,
high costs, and minimal design reuse. MEMS+ enables MEMS designers to assemble a behavioral model of a MEMS
device in a 3-D graphical user interface and simulate it in MEMS+ Simulator, the Mathworks MATLAB, the Math-
works Simulink, or Cadence Virtuoso. The MEMS designers can easily hand off MEMS+ behavioral models to their
counterparts in system architecture and IC design who require MEMS behavioral models to complete system-level or

M
implementation-level simulations. MEMS+ behavioral models are superior to hand-crafted models because they
accurately capture the MEMS behavior, including multiple degrees of freedom, and they are parameterized with
respect to geometric, process, and environmental variables chosen by the MEMS designer.
MEMS+ allows users to assemble a 3-D model using material properties, a process description, and library compo-
nents. As components are added to a model, they instantly appear on the design canvas, allowing the user to easily
identify potential problems with component dimensions. The final design can be exported as a GDS file or as a 3-D
SAT file, or imported and used in a circuit simulator, such as MATLAB, Simulink, or Cadence Virtuoso. Results
from those simulations can be opened in the MEMS+ Scene3D module for 3-D viewing.

1.1.1: Design Entry in MEMS+


When a MEMS+ designer starts MEMS+, it starts with a blank, 3-D canvas on the Innovator tab. Typically, a
designer will be working with a predefined component library (with its database and process dependencies), which
will provide all foundry relevant data. The material database and process are specified in the Material Database and
Process Editor tabs respectively. Material properties can be defined as values, variables, or algebraic equations. The
process file details the sequence of MEMS fabrication steps; it holds GDS layer names, thicknesses and sidewall
angles. In that process, each deposit is associated to one of the materials from the material database. Variables
defined in the Material Database, Component Library, or Process Editor can be exposed to the MEMS designer,
which will make them available in Innovator for use in component definition.
The Component Library module, which incorporates the information from the material database and process, can be
used to create a custom library of components tailored to a specific usage. With a custom library, a user, such as a

Coventor, Inc. May 31, 2018 U1-1


Section 1: Using MEMS+ Version 6.3

foundry, can restrict schematic creation to a subset of the component types, with default properties values that make
sense for one specific process, and can define locks and constraints as required by their design rules.
In Innovator, MEMS device models are created with a library of parametric component generators for suspensions,
plates, combs, and electrical pads. The MEMS designer picks components from the library to assemble the desired
structure. Each component can be assigned to one or multiple deposits of the corresponding process file, and compo-
nent parameters can be defined as values, variables or algebraic equations. Select components can be enhanced with
piezoelectric models. To individual components, users can also add gaps that include electrode/contact and squeeze-
film damping models, pressure loads, or cavities. Once a design is complete, it ready for simulation in the MEMS+
Simulator module or for export to MATLAB, Simulink, or Cadence.

1.1.2: Simulation with MEMS+ Device Models


MEMS+ includes a Simulator module that allows the user to conduct basic simulations on a MEMS device before
exporting to MATLAB, Simulink, or Cadence for system simulation. Once imported into MATLAB, Simulink or
Cadence, the MEMS device will appear as a device symbol (Simulink or Cadence) or object (MATLAB) that features
all parameters that were exposed in MEMS+ Innovator, as well as all exposed electrical, mechanical and capacitance
ports. The MEMS system designer completes the feedback or post processing circuit using models from a standard
library, and confirms the device performance by running simulations in the MATLAB, Simulink, or Cadence environ-
ment. The system designer can also run MEMS system simulations, do control design, and circuit optimization.
Simulation results from Simulator, MATLAB, Simulink, and Cadence can be loaded into the MEMS+ Scene3D mod-
ule for 3-D viewing and animation. Individual signals can be plotted on a 2-D graph. Scene3D gives the MEMS
designer detailed feedback of what exactly happens to the MEMS device when subject to electrical or mechanical
stimulus.

1.2: MEMS+ Modules


The MEMS+ interface offers access to all its modules through a single console. These modules include the Material
Database, the Process Editor, Component Library, Innovator, Simulator, and Scene3D. This section gives an over-
view of each module.

U1-2 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

1.2.1: Material Database


The first step in creating a design is to enter the material properties associated with the fabrication process in the
Material Database, which stores materials and their properties in a .mmdb file. In the Process Editor, the user associ-
ates the process with the material database file, and the material list stored in that file becomes available in the indi-
vidual steps of the process. In turn, the material properties of the selected materials are taken into account in the
device simulation. The user can create a material database or can select and modify an existing database.
The Material Database module is discussed in detail in the section starting on page R1-1.

1.2.2: Process Editor


The second step in creating a design is to use the Process Editor to create a description of the sequence of steps
involved in the fabrication process. The user creates the sequence by selecting prototype steps from the Item Library.

M
Each step has parameters that must be specified. For example, for deposit steps the user must specify the material to
be deposited and the deposit thickness. For etch steps, the user must specify a mask, which will be used to pattern the
previous deposit.
The process is saved to a file with a .mproc extension. In the Component Library tab, the user associates the process
file with a model so that individual components can be assigned to the process deposit layer(s).
For detailed information on the Process Editor, see the section beginning on page R2-1 of the MEMS+ Reference.

1.2.3: Component Library


The Component Library module allows the user to create a custom library of components tailored to a specific usage.
With the custom library, a user, such as a foundry, can restrict schematic creation to a subset of the component types,
with default properties values that make sense for one specific process, and can define locks and constraints as
required by their design rules. A component library is saved to a file with a mlib extension.
In the MEMS+ interface, the Component Library module is accessed from a tab that is situated between the Process
Editor tab and the Innovator tab because it depends on the material database and process files, and an Innovator sche-
matic is dependent on the specified Component Library.
For detailed information on the Component Library, see the section beginning on page R3-1 of the MEMS+ Refer-
ence.

1.2.4: Innovator
Innovator allows users to assemble their MEMS device using a 3-D library of parametric components. It is effectively
a 3-D schematic editor for MEMS. As components are added, the user sets the dimension and deposit information, as
well as connects the components to other components. Each component has a rich set of parameters that can be incor-
porated in a P-cell implementation. The component then appears on the canvas as the user defined it. Any mistakes in
dimensions or orientation are immediately apparent to the user.
When the model is complete, the user saves the device as a 3-D schematic file (with a .3dsch extension) and can then
export a layout in GDS or a solid model in SAT format or import the MEMS model into MATLAB, Simulink, or
Cadence Virtuoso.
For detailed information on the Innovator module, see the section beginning on page R4-1 of the MEMS+ Reference.

1.2.5: Simulator
Simulator allows the user to conduct basic MEMS device analysis to verify the correctness of a device before export-
ing it to MATLAB, Simulink, or Cadence Virtuoso for system simulation. Simulator can be used to run the following
analyses:
 DC analysis: steady-state equilibrium with mechanical and electrostatic forcing, electrostatic pull-in and lift-
off, and contact

Coventor, Inc. May 31, 2018 U1-3


Section 1: Using MEMS+ Version 6.3

 Mechanical modal analysis: includes electrostatic spring softening effects


 Small signal AC: linear frequency response to mechanical and/or electrostatic forcing with Reynolds gas
damping effects
 Pull-in: computes pull-in and release voltages and the behavior of the device between and beyond those volt-
ages using an independent variable to follow the curve of solutions to force balance rather than compute the
solution to force balance at given voltages.
 Noise: calculates the amplitudes of thermal noise on states and outputs over a specified frequency range
 Nonlinear frequency analysis: computes the harmonic response of the system to inputs at specified fre-
quency
The user can also run a vary analysis, alter operating points, alter variables, and alter sources. Analysis setup is saved
to a file with a .msim extension.
For more information on this module, see the section beginning on page R5-1 of the MEMS+ Reference.

1.2.6: Scene3D
Scene3D allows users to import and visualize results from MATLAB, Simulink, or Cadence Virtuoso. This module is
only accessible when a result file is selected. Users will be able to visualize DC, AC, modal, and transient results with
Scene3D.
When a MEMS+ model is incorporated into a MATLAB script, a Simulink system model or a Cadence Virtuoso
schematic, and then simulated, the simulator produces results files with the same name as the Innovator schematic
used to produce the MEMS+ symbol, and these result files are written to the same directory location as that sche-
matic. Those result files can then be opened in Scene3D.
For more information on this module, see the section beginning on page R6-1 of the MEMS+ Reference.

Result files generated from a MATLAB script, a Simulink model, or a Cadence Virtuoso schematic without a
MEMS+ symbol cannot be viewed in Scene3D.

1.3: MEMS+ User Interface


All the MEMS+ modules (Material Database, Process Editor, Component Library, Innovator, Simulator, and
Scene3D) are organized similarly. Each has its own tab within a MEMS+ window, and within each tab there is a list
of the items that make up the active file or model, a list of variables that are used by those items, and either a 3-D
view or a property editor. When appropriate, the editor has an Item Library listing the items that can be added to the
active file. For instance, Innovator's items are called Components, and Figure 1-1 shows the Components tree along
the left edge of the window. In the center is the 3-D view of the Components and on the right are the Mechanical and
Electrical Connector trees, which are unique to Innovator. The organization of all of these subwindows in Figure 1-1
has been customized, as described in “Customizing the Interface” on page U1-9.

U1-4 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

Figure 1-1 Innovator Tab Organization

List of items
added to model

M
3-D View

In Figure 1-2, the Material List is a tree of items for the Material Database, and the large subwindow in the window in
the middle is the property editor for materials. At the right is the variable list and the Comment Editor.

Coventor, Inc. May 31, 2018 U1-5


Section 1: Using MEMS+ Version 6.3

Figure 1-2 Material Database Tab Organization

The Process Editor's tree of items is its list of process steps. These are shown in the center of Figure 1-3 below. The
Process Editor has a property editor for editing the properties of the step that is selected in the tree of items, which is
shown at the bottom of Figure 1-3. The Process Editor has an Item Library and a Comment pane that are not dis-
played by default. To show these panes, right click on any pane title bar, and select the pane you would like to dis-
play.

U1-6 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

Figure 1-3 Process Editor Tab Organization

Process Editor’s Step List

M
Property Editor

1.3.1: Adding and Editing Items


Items can be added to a material database, process description, component library, or Innovator model by right-click-
ing in the tree of items or on the item you would like to add to and then choosing the desired new item from the Add
sub-menu. Optionally, items can also be dragged and dropped from the Item Library or copied and pasted from
another file.
In the case of Innovator, double clicking on an item will bring up a property dialog window to enter appropriate prop-
erties. In the case of the Material Database, Process Editor, and Component Library, single clicking on an item will
show its properties in the property window, as shown in the previous section.

1.3.2: File Association and Tab Ordering


The order of the Material Database, Process Editor, Component Library, and Innovator tabs in MEMS+ reflects their
dependency on one another. Progressing from right to left: the Innovator 3-D schematic depends on the active Com-
ponent Library, which in turn depends on its associated process description, and in turn the process description
depends on the materials defined in the associated material database. Each type of document stores its filename
dependencies and when opened in MEMS+, the dependency will automatically be loaded into the tab to the left. For
instance, opening an Innovator 3-D schematic document causes its associated component library to be loaded in the
Component Library tab, which in turn causes the process description to be opened in the Process Editor tab and the
process description's material information to be loaded into the Material Database tab.
To change this association, use the Replace icon on the appropriate tab. For instance, to change the process used
by a component library file, open it from the Component Library tab, then click on the Process Editor tab, click
Replace, and choose another process file. Click on the Component Library tab, and you will see the orange bar to
update your library document to accept this change.
Typically, many 3-D schematics are created from the same process description, so it is convenient to set a certain pro-
cess description to be the default process for newly created documents.
You can use the Application Options dialog to define a default material database, process, or Component Library,
thereby eliminating the need to select a file when creating a new design:

Coventor, Inc. May 31, 2018 U1-7


Section 1: Using MEMS+ Version 6.3

1. Click on the Applications Option icon.


2. Click on the MEMS+ tab.
3. Click on the Browse icon in the Default Document file field.
4. Navigate to directory that has the material database, process or component library you would like to make the
default document.
5. You can refine the type of files that are displayed in the browser window by selecting the type of file you
would like to make the default from the drop-down menu to the right of the File name field.
6. Select the desired file, then click on OK.

Whenever MEMS+ is started, this default document will be automatically loaded. Note that if you select a default
component library, the process file and material database file that are associated with that file will also be used in any
new design. So if you set a default component library, you will automatically have a default process and material
database.

U1-8 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

1.3.3: Customizing the Interface


MEMS+ has a tabbed interface that gives users easy access to all its modules. Changing modules is as simple as click-
ing on a tab. Users have the option to view all modules at once by dragging a tab to a standalone window or docking
it in another’s module’s interface; this last option is shown below:

M
To return the module to the its tab interface, click on the X in the upper right corner.

Configuring Tab Components


In the individual module tabs, tab components (pane or icon bar) can be moved, hidden, displayed, and resized. All of
the tab components with minimizing and closing icons (shown in Figure 1-4) can be moved to different locations on
the canvas and can also be undocked so that they are free-standing.

Figure 1-4 Movable Panes

To move a pane, click on its title to select it, and drag it to the desired location. To redock a pane that has been
undocked, double click on that pane’s title bar. To return all the panes of an active tab to their default locations, use
the keyboard shortcut Ctrl + Shift + W.
To hide a pane, simply click on the X in the upper right corner of that pane. To configure which tab component is dis-
played or to display a tab component that has been hidden, right click on the title bar of any of the visible panes or on

Coventor, Inc. May 31, 2018 U1-9


Section 1: Using MEMS+ Version 6.3

the icon bar, and a list of available component appears, as shown in Figure 1-5. Visible components are checked. If a
component is hidden, selecting it from this list will display it. If that component is displayed, selecting that compo-
nent will hide it.

Figure 1-5 Selecting Panes for Viewing

1.3.4: MEMS+ Icons


MEMS+ has three different types of icons: application icons, which are the top-row icons and are available no matter
which module is available; common icons, which are available in most of the MEMS+ modules; and speciality icons,
which are available only individual modules. The application and common icons are discussed here. The module
icons are explained in the individual module reference sections.

Application Icons
On the application level, four icons are always available in the top icon row no matter which module is active: New,
Open, Application Options, and Open Transcript. The New icon opens a new instance of the MEMS+ application
with no Innovator document loaded. If a default file is selected from the Application Options dialog (see below), that
file will be loaded in the corresponding tab. The original MEMS+ application and its active document are left open.
The keyboard shortcut for this functionality is Ctrl + Shift + N.
The Open icon opens up a file browser that allows you to select another file, which will open in a new instance of
the MEMS+ application. The original MEMS+ application and its active document are left open. The keyboard short-
cut for this functionality is Ctrl + Shift + O. Also note that Scene3D files can only be accessed from this icon; see
page R6-1 for more details.
The Application Options icon opens a dialog for configuring default settings for each of the MEMS+ modules. It
has the following tabs:
 MEMS+: This tab is used to configure global settings for the software.
 License Server: Specifies the license to be used by the software. For information on configuring a license,
see “Licensing” on page U1-18.

U1-10 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

 Hardware Rendering: By default hardware rendering (OpenGL) is checked, but if you are having prob-
lems with display problems, you may want to uncheck this option. Unchecking this option turns off
OpenGL, which on a Linux machine or on a system with an integrated graphics card may give the best
results for displaying remotely.
 Log File Location: Specifies the directory to which to write the log file for MEMS+; this log file can be
useful for troubleshooting any problems encountered with MEMS+.
 Default Document: Specifies a default file to open each time a new MEMS+ console window is opened.
 Undo Stack Depth: Sets the number of undo/redo actions that are stored in memory. Reducing the number
of undo/redo actions may help if a user is having problems with computer memory.
 Innovator: This tab has its own subtabs for designating a default process for any new 3-D schematic, and for
configuring canvas views, and colors. See page R4-36 for more details.
 Scene3D: This tab has its own subtabs for configuring how the results are displayed. See page R6-12 for

M
more details.
The keyboard shortcut for opening this dialog is Ctrl + Shift + P.

For a complete listing of available keyboard shortcuts, see the section beginning on page U6-1.

The Open Transcript icon opens a transcript window that displays the Python commands executed for any con-
struction activity that takes place in any of the tabs in the MEMS+ Console. From this window, you can enter your
own Python commands or execute Python scripts. You can write a Python script to automate repetitive tasks, and then
execute that script from the transcript window. Communication between the transcript window and the software inter-
face is two-way, so if you make a change in the transcript window, it is reflected in the model displayed in the inter-
face. For more information on using this transcript window, see page U1-12.
The keyboard shortcut for opening the transcript window is Ctrl + Shift + T.
For information on the Python scripting language, go to http://www.python.org.

Bottom Row Icons


The icons listed in Table 1-1 are available in the Material Database, Process Editor, Component Library, Innovator,
and Simulator modules. For information on icons unique to a particular module, see that module’s reference section.

Table 1-1 Icon Functionality

Keyboard
Icon Function Description
Shortcut

Open a new
Closes the active file and opens a new, blank document Ctrl + N
document

Opens file dialog that allows you to select and open a file that will replace
Replace the current file. The available files will be filtered according to which Ctrl + O
module is active.

Save Saves the active file. Ctrl + S

Save the Opens a file dialog to specify a new file name. The dialog that opens
document displays not only the active file, but all the files the active file is dependent
---
with another on. From this dialog the user can specify a new name of the active file and
name for the files it is dependent on.

Coventor, Inc. May 31, 2018 U1-11


Section 1: Using MEMS+ Version 6.3

Keyboard
Icon Function Description
Shortcut

Undo Undos the last action Ctrl + Z

Ctrl + Y (Windows)
Redo Redos the last action that was undone Ctrl + Shift + Z
(Linux)

Copy Copies an entity for pasting in another location in the active list Ctrl + C

Cut Deletes the selected entity, but makes it available for pasting Ctrl + X

Paste Pastes the copied entity into the active list Ctrl + V

Delete Deletes the selected component Delete

If an entity is selected in a list, clicking on this icon will allow you to enter
Rename F2
a new name for that entity.

1.3.5: Session Transcript and Logging


Every editing operation is recorded in a session transcript. This transcript is a valuable record of all that has been
changed since MEMS+ was started. The transcript can be used to communicate a user's actions with Coventor techni-
cal support. It can also be used to recover modifications to a file if unsaved data is lost.
Portions of this session transcript can be viewed as operations are done. To open the transcript window, click on the
Open Transcript icon from the top icon row. A sample transcript window is show below:

Each operation is performed using proprietary bindings to the Python Programming Language (http://
www.python.org). Each operation performed starts with a comment line starting with '#' indicating the type of opera-
tion such as erase or set item's properties and consists of a few lines until the line before the next com-
ment line.
The transcript of the entire MEMS+ session is stored in the user's home directory as the file MEMSp.py. This file is
overwritten each time MEMS+ is launched, so if you need to save this file, be sure to copy it to another location.

U1-12 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

In the home directory is an annotated version of the transcript called MEMSp.log, which contains not only each oper-
ation, but also extra messages produced by MEMS+ indicating actions taken as a result of the requested operation.
This file is also valuable for communication with Coventor technical support.
The .log file location can be changed using the Applications Options dialog, which is accessible from the top row
Applications Options icon.

M
Macros and Replaying Parts of a Transcript
Creating designs in MEMS+ specific to your organization can sometimes require custom steps that must be repeated
often. To avoid repeating these steps in MEMS+, you can assemble the operations from the transcript window into a
text file and rerun those operations directly in the transcript window. The aggregate operation performed by this text
file is often called a macro operation.
Similarly, if unsaved data is lost, the lost operations can be cut from the MEMSp.py and assembled into a new text file
that can be replayed in the next MEMS+ session.
For example, if we wished to make a macro that just sets an item's properties as shown in the Transcript window in
the figure above, we'd cut just this part out of the MEMSp.py file:
##################### set Item's properties ####################
_item = _docs['3dsch'].getItem('/Beam')
p0_ = _docs['3dsch'].getItemProperties(_item)
p0_.layers.set('midlyr,toplyr')
p0_.layers.midlyr.thicknessOverride.set('ContactPadHeight+btmlyr_h+midlyr_h')
p0_.zOffset.set('-ContactPadHeight-btmlyr_h')
p0_.position.end1.x.set('AnchorLength+ActuationPadLength+SeparationBeamLength')
p0_.position.end2.x.set('AnchorLength+ActuationPadLength+SeparationBeamLength+
TransLineLength')
p0_.width.set('ActuationPadWidth')
p0_.layers.midlyr.setAttributes(isExpanded='true')
p0_.position.setAttributes(isExpanded='true')
p0_.position.end1.setAttributes(isExpanded='true')
p0_.position.end2.setAttributes(isExpanded='true')
p0_.position.end2.x.setAttributes(customCheckUnit='um', isExpanded='true')
p0_.width.setAttributes(customCheckUnit='um', isExpanded='true')
_items = _docs['3dsch'].getItems(['/Beam'])
_docs['3dsch'].setItemsProperties(_items, [p0_])
Then save it in a separate file with a .py extension. Note that this is identical to what was seen in the transcript, except
the >>> prompts have been removed. Once saved, to replay:

Coventor, Inc. May 31, 2018 U1-13


Section 1: Using MEMS+ Version 6.3

1. Open the model you would like to operate on. In this case, this operation is to be done to the RFSwitch.3dsch
provided in the Examples directory.
2. From within the transcript window, click on the Open icon to open a file selection dialog.
3. Once the file you created above is selected, click on Run in the file selection dialog.
Note if you have multiple MEMS+ windows open, the window you wish to operate on must be the last one to have
focus before clicking on the transcript window's Open icon. Also note that operations in the MEMSp.py file that are
marked do not replay in user interface should never be included in a macro file to be replayed.

1.4: Parameterizing a Design with Variables


Variables can be referenced in property parameters and used for design optimization. If a variable is used to define
several properties, then the value of all those properties can easily be changed by changing the variable definition.
Variables can be set in the Material Database, in the Process Editor, in the Component Library, in Innovator, and in
Simulator. Variables that were created and exposed in a tab will appear in the Variables pane of any subsequent tab.
For example, a variable exposed in the Material Database tab will appear in the Process Editor, Component Library,
Innovator, and Simulator tabs’ Variables pane. Note that once a variable has been exposed, it cannot be hidden from
any tab other than the tab in which it was created.
To add a variable to the Variables Pane, right click in the Variables pane, and select Add > Group or Variable. When
a variable is added, it is named numerically. To change the variable name, click on it once, and then enter the desired
name. Note that the name of an exposed variable can only be changed from the module in which it was created, but its
value can be changed from any module in which it appears.
With the Group option, you can to create categories of variables. You can create a group, and then add variables to it,
or drag already defined variables into a group. When referencing a variable that is in a group, use a combination of
the group name and the individual variable name. For example, if the group name is Beam, and the variable in that
group is named Width, to reference that variable, use BeamWidth.

Variable and variable group names can only contain letters, numbers, or underscores. No other non-alphanumeric
characters or spaces are allowed. Names must be unique for variables and groups on the same level of hierarchy,
and variable names that differ only by case are not allowed. In addition, variable and group names cannot begin
with a number.
Also note that value is a reserved keyword and cannot be used as a variable name.

To assign a value to a variable, click once in the Value field, then enter the desired value. The value can be a number,
an expression, or another predefined variable. Note that if a variable is defined with other variables, it cannot be
exposed. The default value of a variable can only be set from the module in which it was created. For example, the T
variable was created in the Material Database module, so its default value is whatever value it was set from that mod-
ule. If you were to change the temperature value from the Innovator tab, it would be saved with the schematic, but the
default value in the material database will remain the same. To set a variable value to its default value, right click on
the variable and select Default, or use the keyboard shortcut Ctrl + R.
Once a variable is defined, it can be used to define model parameters. When you type any letter in a properties field,
a drop-down menu appears with all the variables that begin with that letter. This feature allows you to easily select a
variable without having to enter its entire name or to worry about the exact spelling of a variable. If you enter a vari-
able name that does not exist in a field, the field will display an error. You can then right click on the field, and select
Add variables; a dialog will open in which you can define a value for that variable. Once you define the variable
value, the variable will be added to the Variables list.
To see if a variable has been used in a property or component definition, right click on that variable, and select High-
light dependencies, or use the keyboard shortcut Ctrl + D. In the Material Database, Process Editor, and Component
Library, the steps, parameters, or components that were defined by the variable will be displayed in the Properties
pane. In Innovator, the components that were defined with that variable will be highlighted in the canvas and in the
Components list.
By default the Variables pane displays the Name and Value parameters. To display other properties, right click in

U1-14 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

property title bar and select other options. The other options include
 Expression: This option can be used to display the expression used to define a Value. An expression can be
entered in the Value field, but only the value of that expression is displayed. With this option, the expression
can be entered and displayed in the Expression field, and MEMS+ evaluates it and puts in the result in the
Value field.
 Lower Limit, Upper Limit: These options are used to limit Value inputs; see “Limiting Variable Values” on
page U1-17.
These properties can also be viewed in the variable’s Property dialog, which can be accessed by double clicking on
the variable or by right clicking on the variable and selecting Properties.

1.4.1: Defining Variables with Functions

M
Variables can be defined with any of the functions listed in Table 1-2.

All functions are defined within the context of their mathematical description. As such, all trigonometric
functions accept radian inputs, and not degree inputs.

Table 1-2 Functions Used in MEMS+

Function Description

sin sine function; takes one argument

cos cosine function; takes one argument

tan tangens function; takes one argument

asin arcus sine function; takes one argument

acos arcus cosine function; takes one argument

atan arcus tangens function; takes one argument

sinh hyperbolic sine function; takes one argument

cosh hyperbolic cosine function; takes one argument

tanh hyperbolic tangens function; takes one argument

asinh hyperbolic arcus sine function; takes one argument

acosh hyperbolic arcus cosine function; takes one argument

atanh hyperbolic arcus tangens function; takes one argument

log2 logarithm to base 2; takes one argument

log10 or log logarithm to base 10; takes one argument

ln logarithm to base e (2.71828...); takes one argument

exp e raised to the power of x; takes one argument

sqrt square root of a value; takes one argument

sign sign function -1 if x<0; 0 if x == 0; 1 if x >0; takes one argument

rint round to the nearest integer; takes one argument

abs absolute value; takes one argument

Coventor, Inc. May 31, 2018 U1-15


Section 1: Using MEMS+ Version 6.3

Function Description

if if...then...else statement; takes three arguments:


if(condition, expression-if-condition-true, expression-if-condition-false)
For example, if(0<1, 2, 3), which would return 2.

min minimum of all arguments; number of arguments can vary

max maximum of all arguments; number of arguments can vary

sum sum of all arguments; number of arguments can vary

avg mean value of all arguments; number of arguments can vary

The following operators are supported in MEMS+:

Table 1-3 Binary Operators Supported in MEMS+

Priority in order
Operator Meaning
of operation

and logical and 1

or logical or 2

<= less or equal 4

>= greater or equal 4

!= not equal 4

== equal (Note: the equal comparator can 4


only be used with integer values.)

> greater than 4

< less than 4

+ addition 5

- subtraction 5

* multiplication 6

/ division 6

^ raise x to the power of y 7

U1-16 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

1.4.2: Limiting Variable Values


In addition to specifying a value, you can also limit the possible values for that variable in the current MEMS+ sche-
matic model and in the exported MEMS+ model. To assign an upper and/or lower limit on a variable, double click on
the Variable Name or Value to open the Properties dialog, as shown below. Click on the + sign beside Limits to
expose the Upper and Lower fields.

M
When these fields are set, the Value field cannot be changed to a value that is lower than the lower limit or higher
than the upper limit. If that variable is exposed (see page U1-17), the value can be changed in other modules, but the
limits cannot. If the MEMS+ model is exported, the limits will also be included.

1.4.3: Exposing Variables


To expose a variable so that it can be used in another module, right click on the variable and select Expose, or use the
keyboard shortcut Ctrl + E. If this action is applied to a group, all the variables in that group will be exposed. If a vari-
able is exposed in a tab, it will appear in the Variables pane of any subsequent tab because MEMS+ tabs are ordered
according to dependencies. For example, a variable exposed in the Process Editor will appear in the Variables pane of
Component Library, Innovator, and Simulator tab because all of these tabs depend on the contents of the process file.
This exposed variable can be referenced by library components. But a variable exposed in the Process Editor Vari-
ables pane will not appear in the Material Database Variables pane because the Material Database tab precedes the
Process Editor, and therefore is not dependent on its contents.
If a variable was created and exposed in a module, it will be designated with the icon in other modules.

Variables that are defined using other variables cannot be exposed.

The exposed variable value can be changed from any module it appears in, but its name can only be changed from the
module in which it was created. If you have changed a variable value in a module other than the one it was created in,
you can revert to its original value by right clicking on the variable and selecting Default. If a variable is changed in a
module other than the one it was created in, it will be designated with a icon in the Variables Pane of module in
which it was changed.
When a local variable already exists, and an exposed variable with the same name is created in a dependency, an
update will connect the two variables with the same name as one unique exposed/imported pair. The local variable
keeps its original value, and appears as an overridden variable (with a icon). Also note that in this unique case
(local variable created first, then exposed variable with the same name is created in a dependency), the linked variable
can only be deleted or renamed in the dependency file, not from the module it was created. For example, if a variable
is created in Innovator first, and then the same named variable is created and exposed in the Material Database Editor,
the exposed variable can only be deleted and renamed in Material Database Editor, even though it was first created in
Innovator.
If a variable is exposed from any of the MEMS+ modules, it will appear as a schematic model parameter of the cre-
ated MEMS+ symbol (in the symbol’s CellView Properties dialog).

Coventor, Inc. May 31, 2018 U1-17


Section 1: Using MEMS+ Version 6.3

To hide an exposed variable, right click on it and select Hide, or use the keyboard shortcut Ctrl + H. If this action is
applied to a group, all the variables in that group will be hidden.

1.5: Licensing
Before you can run MEMS+, you must specify a license file. The first time you run MEMS+, you will be prompted to
select a license. The Application Options dialog opens with the License tab displayed. Set the License Server field, to
54000@hostname, where hostname is the name of the computer where the license is installed. This dialog can also be
accessed from the Application Options icon.

To specify more than one license server, separate the portnumber@hostname entries with a comma.

Note that a single license server specification (portnumber@hostname) cannot be more than 65 characters long.

1.6: Tips for Design Entry in MEMS+


Keep in mind when building a device in MEMS+ that you are building in 3-D. Users with layout experience may
think of creating a design with polygons and will want to assign function to those shapes after the design is finished.
But with MEMS+, you have to take into consideration the function of the shape, and then use the correct component
to create that shape. For example, an electrode may have a rectangular shape, but instead of creating it with a rectan-
gular rigid plate, then trying to define it as an electrode, you should add a Gap component to rectangular rigid plate
segment, and then assign an electrode/contact model to that gap. Below are guidelines to help you build the most effi-
cient model in MEMS+.
1. Decide on the basic "unit cell" in the design, distinguishing between suspension and rigid, movable parts.
Consider ways that the mirror and replicate functions can be used later on in the design entry to save time, but
defer use of these functions as long as possible.
2. Determine the solid movable geometry. Generally, rigid plates should be used for initial modeling unless the
device is a type that depends on plate flexibility for its function, such as a pressure sensor, a microphone, or a
bulk-mode resonator.
3. Determine if there is any symmetry that can be exploited in the design. Create all rigid geometry under as few
plates as possible. Many designs require only one rigid plate that is assembled by Booleaning plate segments
of various shapes, but some design will require more than one rigid plate.
4. Determine which parts of that geometry are best represented by beams, rigid plates, and/or shape compo-
nents.

U1-18 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

5. Draw all rigid geometry under one rigid plate (see page C3-6 for details on this component):
a. Look for the minimum number of segments needed to build the rigid geometry.
b. Define variables to describe these segments.
c. Add the segments to the rigid plate.
6. Add any needed gaps to the rigid plate segments (see page C4-2 for details on rigid plate gaps):
a. Distinguish between side gaps and top/bottom gaps.
b. Define the extra variables to describe the gaps (use rigid geometry variables in other places)
c. Add the gaps to the rigid plate segments.
d. Define the fixed deposit of the gap.
e. Define the gap with an electrode/contact model, a squeezed-film damping model, or both.

M
7. Add flexible beams to the model (see page C3-69 for details on this component):
a. Define variables to describe the beam segments and the electrodes that may be associated with those beams.
b. Add beams to the model.
c. Add any gaps that need to be defined in relation to the beams, and define the appropriate gap model(s).
8. Use the Mirror, Replicate, and Group functions to define other parts of the geometry (see page R4-8 for
details on these functions).
9. Use the Wizard function to connect the various components and to set appropriate scale factors (see page R4-
17 for details on this function). In the case of the rigid plate, this function will connect other segments to a
single connector of the rigid plate.
10. Rename and expose any connectors that you want exposed. See page R4-13 for details on mechanical con-
nectors; see page R4-24 for details on electrical connectors; and see page R4-26 for details on fluidic connec-
tors.
11. Expose variables that need to be visible in the schematic symbol.
Note that for shape components and for some of the beam models, you can change the underlying model used and the
number of integration points even after the design is complete. This feature allows the user to initially focus on creat-
ing geometry rather than worrying about underlying model elements. But whenever you change the model or the
number of integration points, make sure to rerun the Wizard before simulation.

Coventor, Inc. May 31, 2018 U1-19


Section 1: Using MEMS+ Version 6.3

1.7: Simulation Options for MEMS+


Once a user has completed a design in Innovator, the next step is to simulate the design. With MEMS+, the user has
four simulation options:
 The built-in MEMS+ Simulator module (target user is a MEMS designer)
 MATLAB (target user is a MEMS designer)
 Simulink (target users are MEMS designers and system designers)
 Cadence (target user is an IC designer who wants to include MEMS+ models)
Only the MEMS+ Simulator option is available from within MEMS+; for the other simulators, the user will have to
purchase additional software and then import the MEMS+ model into that simulation environment.
The charts below summarize the capabilities of the MEMS+ simulation options.

Table 1-4 Simulator Capabilities

MEMS+
MATLAB Simulink Cadence
Simulator

MEMS Device Capabilities

DC analysis: steady-state equilibrium with mechanical Yes Yes Yes Yes


and electrostatic forcing, electrostatic pullin & lift-off,
and contact

Mechanical Modal Analysis: including electrostatic Yes Yes Yes


spring softening effects

Small Signal AC: linear frequency response to Yes Yes Yes Yes
mechanical and/or electrostatic forcing with Reynolds
gas damping effects

Nonlinear AC: nonlinear frequency response to Yes Yes


mechanical and/or electrostatic forcing with Reynolds
gas damping effects

Electrostatic pull-in/lift-off hysteresis and Frequency Yes Yes


hysteresis (non-linear duffing effect)

Transient analysis: time-dependent response, time Yes Yes Yes


constants, switching time, including non-linear
mechanics, electrostatics, and damping effects

Noise analysis Yes Yes Yes

System and IC Modeling Capabilities

Include multiple MEMS devices in the same Yes Yes


simulation, e.g. mirror array

Include system components such as transpedance Yes Yes


amps, filters, etc. for passive & active sensing

Include transistor models, etc. Yes

A transient analysis can be one of the most difficult analyses to converge. The optimal settings for each simulator is
summarized below.

U1-20 May 31, 2018 Coventor, Inc.


Section 1: Using MEMS+ Version 6.3

Table 1-5 Recommended Transient Options for Each Simulator

Cadence Virtuoso/
Simulation
Spectre MATLAB2 Device Type

Contact (stiff oscillatory) gear2only, @ode15s, RF Switch, Display


conservative1, MaxOrder=2, NDF3 Mirror (analog), etc.
RelTol=10-3 NormControl=’off’
RelTol=10-4

Oscillatory traponly, @ode23t, resonator, gyroscope,


conservative1, NormControl=’off’ scanning mirror, etc.
RelTol=10-3 RelTol=10-4
1
Accuracy default is conservative, which also acts on Relative Tolerance (divide by 10)

M
2 Transient ODE MATLAB Default options is ode15 when started from a DC and ode23 when started from an AC.

3
BDF corresponds to the Gear method, but NDF is an enhanced version offered in MATLAB.
For more details on the MEMS+ Simulator module, see page R5-1 of the MEMS+ Reference.
For more details on using MEMS+ models with MATLAB, see page U2-1.
For more details on using MEMS+ models with Simulink, see page U3-1.
For more details on using MEMS+ models with Cadence, see page U4-1.

1.8: MEMS+/C++ API


MEMS+ includes a C++ API can be used to do the following:
 fully control the numerical process,
 embed the MEMS+ device in a more general framework (like SystemC/SystemC-AMS),
 write a custom analysis that MEMS+ does not provide.
The interface is not platform dependent. To use, you need the following libraries:
 Eigen
 Lapack
 CBlas
Examples and documentation are located in the //CoventorMP1.1/MEMS+6.3/runtime/API directory. For more infor-
mation, contact your Coventor representative.

Coventor, Inc. May 31, 2018 U1-21


Section 1: Using MEMS+ Version 6.3

1.9: Exporting MEMS+ Designs to Other Programs


Innovator schematics can be exported as a 2-D GDS file or as a 3-D SAT file. From Innovator, click on the Export to
icon , select the desired file type from the drop-down menu, and then enter the file name in the File name field.
When you click on OK, the file is written to the same directory location as the schematic file, unless otherwise spec-
ified.
Note that the model can be exported in SAT format versions 20, 22, or 24.
For more information on exporting MEMS+ designs, see page R4-40 of the MEMS+ Reference.

U1-22 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Section 2: Using MEMS+ with MATLAB

MEMS+-for-MATLAB adds the scripting flexibility and data post-processing of the MATLAB platform from Math-
Works to Coventor’s MEMS+. MEMS+-for-MATLAB provides a variety of MATLAB script functionality that
allows model import, manipulation and simulation directly from the MATLAB command line interface. The scripts
provided by MEMS+ support DC, Modal, AC, pull-in, nonlinear frequency hysteresis, and transient analyses without
requiring any additional toolbox. It can also be used to model squeezed-film damping and substrate coupling. All
MATLAB simulation results can be loaded back into the MEMS+ Scene3D module for 2-D and 3-D viewing. Users
can also edit existing MEMS+ files or create MEMS+ files within the MATLAB interface.
This section details the steps necessary to use the MEMS+-for-MATLAB interface. It assumes familiarity with both

M
MATLAB and MEMS+ Innovator for MEMS model creation. Note that this interface is for creating and accessing
MEMS+ Innovator models and performing analyses on them. It is not for accessing a Simulink model containing a
MEMS+ symbol. For information on using MEMS+ with Simulink, see the section that begins on page U3-1.

Before you can use your MEMS+ models in MATLAB, you must set up your MATLAB environment so that you
can access those models; see page 4-1 of the MEMS+ Installation Guide for more details.

2.1: Updating a Script from a Previous Version


If you have MATLAB scripts that were created in conjunction with a previous version of MEMS+, they have to be
updated before you can run them in MEMS+ 6.3. MEMS+ 6.3 for MATLAB includes codeUpdater utilities for updat-
ing script syntax from MEMS+ 4.0 to 5.0, from 5.0 to 6.0/6.1, and from 6.x to 6.3. The utility can be run on individual
scripts or on a entire folder.
Note that if you have scripts from versions older than 6.x, you cannot update them directly with the 6.3 codeUpdater.
You must update them in sequence. For example, if you have 4.0 script, first run
cov.memsplus.utilities.codeUpdater_MEMSp4_to_MEMSp5()
Then run
cov.memsplus.utilities.codeUpdater_MEMSp5_to_MEMSp6()
And finally, run the current cov.memsplus.utilities.codeUpdater().
If run without arguments, the codeUpdater converts all the .m files in the current MATLAB folder (the subfolders are
not considered). If run with one argument, codeUpdater converts only the script specified by this argument. The orig-
inal file is then stored in a file named <oldScriptFilename>_MEMSp62.m.
For example:
cov.memsplus.utilities.codeUpdater('RF_Switch.m');
creates RF_Switch.m, which is the newly converted 6.3 script, and RF_Switch_MEMSp62.m, which is the original 6.2
script.
If you run codeUpdater with two arguments, the original script (specified by the first argument) is not modified. With
this syntax, the name of the converted script is given by the second argument:
cov.memsplus.utilities.codeUpdater('fileToBeConverted.m', 'file62.m');
FileToBeConverted.m will remain in its original script format, file62.m will be newly converted 6.3 script.

Note that the codeUpdater utility will not preserve line continuations (lines that end with ...). Multi-line
functions will be merged into one line.

Coventor, Inc. May 31, 2018 U2-1


Section 2: Using MEMS+ with MATLAB Version 6.3

2.1.1: Limitations of codeUpdater


Critical issues with the codeUpdater are printed in the MATLAB console after the update is complete. Listed below
are known limitations of the codeUpdater.

Variable Names
In versions of the software earlier than 6.2, if a variable was part of a group, its name in MATLAB was a concatena-
tion of the group name and the variable name. Below is an example of how to call a variable in MEMS+ 5.0:
vars('ElectrodeProtrude') = 10
In MEMS+ 6.2 onward, the variable names reflect the structure of the variable tree:
h.Variables.Electrode.Protrude = 10;
The codeUpdater does not have information about the variable groups and will not be able to update the variable
names to the new structure. Users will have to update these variable names manually.

Use of cov.memsplus.Document
cov.memsplus.Document has to be replaced by one of cov.memsplus.MaterialDatabase, cov.mem-
splus.Process, or cov.memsplus.Schematic. The codeUpdater handles the most frequent situations; for
example:
cov.memsplus.Document('../a/b.mmdb'); is updated as
cov.memsplus.MaterialDatabase('../a/b.mmdb');
cov.memsplus.Document('filename.3dsch']); is updated as
cov.memsplus.Schematic('filename.3dsch');
However, a line in which if the complete filename is hidden in a variable, such as
cov.memsplus.Document(filename)
will not be handled and should be updated manually.

U2-2 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

2.2: Creating and Editing MEMS+ Documents in MATLAB


The MEMS+ material database, process, component library, and Innovator documents can be created or edited
directly in MATLAB. In this section we describe the commands necessary to build these MEMS+ documents.

2.2.1: Terminology
All MEMS+ documents use the same structure of items, children of items, properties and subproperties to store their
contents. To explain the concept of items and properties in detail, we will use a material database as displayed in the
MEMS+ interface as an example:

Figure 2-1 Root Item, Children, and Properties

M
Root Item

Top-level
Children items properties of
of the Root Aluminum

Subproperties
of Piezoelectric
Coefficients

Every type of document has a root item. The name for the root that appears in the user interface is Material List for
the Material database, Substrate for the Process Editor, User Library for the Component Library, Components for
Innovator, and Analyses for the Simulator. When item a is added to item b, item a is called a child of item b, and item
b is the parent of child a. Children are shown indented underneath the parent, as shown in Figure 2-1. The root item
with all its descendants is collectively called the item tree. When the user double clicks on an item, a separate window
with the item's properties opens. In the case of the Material Database and the Process Editor, properties are also dis-
played when an item is selected, as shown in Figure 2-1. Properties can have children properties. Properties that are
not a child of another property are called top-level properties. Most of the properties shown in Figure 2-1 are top-
level properties. Top-level properties have subproperties if there is a triangle displayed to the left of the property. If
the triangle is unfilled, the subproperties are hidden.
All MEMS+ documents have a main item tree as described above, and some documents have additional supplemental
item trees. For example, in Innovator, the Components tree is the main item tree, and the Mechanical, Electrical, and
Fluidic Connector trees are supplemental item trees.

Type and Property Names


The names needed to write a script are usually the same as the names in the MEMS+ user interface. For instance,
"Solid" is used in the MEMS+ Materials Editor to refer to type Solid, and "Density" is used to refer to the Den-
sity property.

Coventor, Inc. May 31, 2018 U2-3


Section 2: Using MEMS+ with MATLAB Version 6.3

To get a list of available choices for an item or an item property, enter the item name.property with no defined value.
For example, entering
Aluminum.Properties.ElasticConstants
prints the following:
Available choices are: 'Isotropic', 'Cubic', 'Orthotropic', 'Anisotropic';

2.2.2: Updating MEMS+ Files from Within MATLAB


To update MEMS+ files from within MATLAB, use the following command:
cov.memsplus.utilities.updateMEMSpFiles
This command will update all the MEMS+ files in the current MATLAB folder.
To update a specific file and its dependencies, run updateMEMSpFiles with one argument. For example,
cov.memsplus.utilities.updateMEMSpFiles('RF_Switch.3dsch');
This command will update the RFSwitch.3dsch, as well as the .mlib, .mproc, and .mmdb files on which it depends.

2.2.3: Creating a New Document


New blank documents are created by specifying the relevant document command and its file dependency. For
instance, to create a new process file, the command is cov.memsplus.Process, and the dependency is a Mate-
rial Database file because each layer in the process is composed of a material. For material database creation, no file
dependency is required. An example is given below.
mat = cov.memsplus.MaterialDatabase; % create a blank MMDB
proc = cov.memsplus.Process('NewMPD.mmdb'); % create a blank proc based on NewMPD.mmdb
lib = cov.memsplus.ComponentLibrary(‘NewProcess.mproc’)
innov = cov.memsplus.Schematic('MyLib.mlib');% create a blank 3dsch with Component Lib
In order to properly resolve the location of subschematics, the Innovator documents containing subschematics should
be opened using absolute path. This can be achieved, for instance, using the command:
innov = cov.memsplus.Schematic(fullfile(fileparts(mfilename('fullpath')), 'rela-
tive_path_to_master_schematic.3dsch'));

Creating Materials Database and Process Files


The example shown below creates a simple material database (with the .mmdb extension) with a solid material, Alu-
minum, and then uses the created materials database file to make a process file from scratch.
The name of the script is MakeMpdProcess.m, and it can be found in the /MEMS+6.3/Examples directory.
% How to create or modify MEMS+ files from MATLAB.

d = cov.memsplus.MaterialDatabase; % create a blank MMDB


%d = cov.memsplus.MaterialDatabase('MyOldMPD.mmdb') % or open an old one

d.MaterialList.add('Solid'); % Add solid material, but hold a handle to it so we can


add props
d.MaterialList.SolidMaterial1.rename('Aluminum'); % change the material's name
d.MaterialList.Aluminum.printWithProperties; % Note default values (mainly zeros)

% For practical use (smaller code lines, one can create the following Item:
Aluminum = d.MaterialList.Aluminum;

% Set the Aluminum density as the Expression of Variable T (temperature)


Aluminum.Properties.Density = {'T*12','kg/um^3'};

% Set the Elastic properties (Isotropic, Young's Modulus and nu)


Aluminum.Properties.ElasticConstants = 'Isotropic';
Aluminum.Properties.ElasticConstants.Isotropic.E = {'77e9','Pa'};
Aluminum.Properties.ElasticConstants.Isotropic.nu = 0.3;

% Set alpha Thermal Coefficient of Expansion


Aluminum.Properties.ThermalCoefficientOfExpansion.alpha = {'2.31e5','1/K'};

U2-4 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Aluminum.Properties.ThermalCoefficientOfExpansion.ZeroStressTemperature =
{'273.15','K'};

% Set the Electrical Conductivity


Aluminum.Properties.ElectricalConductivity = {'1.92002e+08','S/m'};

d.save('MPD.mmdb'); % Save the new doc in MPD.mmdb

proc = cov.memsplus.Process('MPD.mmdb'); % create proc with new MMDB as its MMDB


% Get Substrate (Process tree root)
Substrate = proc.Substrate;

% Print Substrate Properties


Substrate.printWithProperties;

% Set the Material of Substrate to Aluminum

M
Substrate.Properties.Material = 'Aluminum';

% Add a Stack Deposit


Substrate.add('StackMaterial') % Add stacked material
% Set the properties of the Stack deposit
Substrate.StackMaterial1.Properties.Thickness = {'1','um'};
Substrate.StackMaterial1.Properties.Material = 'Aluminum'; % Set material name

% Print substrate Properties


Substrate.printWithProperties;

proc.save('Process.mproc'); % Save the new doc in Process.mproc


This script creates a blank .mmdb file, then gets the root item MaterialList, which is created by default. It adds a chil-
dren item of type Solid to this root item and then sets the values for key properties of this material. It then creates a
process that is dependent on the material database, and adds children to the Substrate root of that process.

Creating a Component Library


Below is an example of how to create a Component Library file. Note that by default, when this file is created, it has
all possible components. Components can be deleted or customized within the script.
%Create a library file that is dependent on the Gyro_scripting.mproc
mlib = cov.memsplus.ComponentLibrary('Gyro_scripting.mproc');
mlib.saveAndOpenInMEMSp('Gyro_scripting.mlib');
To view a list of components that are part of a library, enter mlib.Prototypes. and hit the Tab key:

Lock and constraint properties can also be set with scripting:


mlib.Prototypes.Beam.Properties.VerticalOffset.Constraint = 'value > -1';
mlib.Prototypes.Beam.Properties.Width.Lock = true;
Note that the input for the Constraint property is a string.

Coventor, Inc. May 31, 2018 U2-5


Section 2: Using MEMS+ with MATLAB Version 6.3

Creating a Schematic
Below is an example of a script that creates a new schematic and populates it with variables and components:
h = cov.memsplus.Schematic('Gyroscope_scripting.mlib');

h.Variables.add('Variable')
h.Variables.Variable1.rename('PlateSizeX')
h.Variables.PlateSizeX.Properties.Value = 100;

h.Variables.add('Variable')
h.Variables.Variable1.rename('PlateSizeY')
h.Variables.PlateSizeY.Properties.Value = 100;

RigidPlate = h.Components.add('RigidPlate')

Rectangle = RigidPlate.add('RectangularSegment')
Rectangle.Properties.Deposits = {'poly'};
Rectangle.Properties.RectangleDefinition.BySize.Size.x = 'PlateSizeX';
Rectangle.Properties.RectangleDefinition.BySize.Size.y = 'PlateSizeY';

IGap = Rectangle.add('InheritedGap')
IGap.Properties.FixedDeposits = {'elec'};

Beam1 = h.Components.add('Beam')
Beam1.Properties.Deposits = {'poly'};
Beam1.Properties.Position.End1.x = -50;
Beam1.Properties.Position.End2.x = -150;
Beam1.Properties.Width = 5;
Beam1.Properties.FaceType.End2 ='Fixed';

h.applyWizardActions
h.save('RigidPlate_Beam')
This script creates the device shown below. Note that if you create a schematic using a MATLAB script, be sure to
open it in MEMS+ to verify that you have the desired geometry and that it is constrained properly.

U2-6 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Creating a Model from Layout


When creating a MEMS+ model, the user has two options: importAsRigidPlate and importAsPolygon-
Segment. The importAsRigidPlate is new to MEMS+ 6.3, and offers the ability to create a model from an
entire top cell. In previous releases of MEMS+, users could only create polygon segments from individual GDS lay-
ers; with this method, the user had to map the individual GDS layers to process deposits and assign the correct Merge
parameter (Add/Subtract) to generate the desired geometry. The importAsRigidPlate is the preferred method.
Whichever option the user chooses to employ, after adding the Layout to the schematic, the user must do an update to
refresh the GDS cells and layers. Each option is detailed below.

importAsRigidPlate
This option imports a top cell of a Layout component as a rigid plate, as demonstrated below:
s = cov.memsplus.Schematic('Microbolometer.mlib');

M
% Add a new Layout component
s.Components.add('Layout');

% Assign the appropriate layout file to the Layout component


s.Components.Layout1.Properties.Filename = 'microbolometer.gds';

% Update the Layout component to confirm the selected layout to refresh the GDS cells
% and layers. This is equivalent to selecting Apply in the MEMS+ interface.
s.Components.Layout1.update

s.Components.Layout1.TopCellMicrobolometer.importAsRigidPlate
s.saveAndOpenInMEMSp('MicrobolometerFromLayoutScript')
The above method has an optional argument allows the user to specify the new name of the rigid plate to be created:
s.Components.Layout1.TopCellMicrobolometer.importAsRigidPlate('newPlateName');
The resulting 3-D model is shown below:

Figure 2-2 Imported GDS Top Cell to Rigid Plate

Coventor, Inc. May 31, 2018 U2-7


Section 2: Using MEMS+ with MATLAB Version 6.3

importAsPolygonSegment
The option imports the selected GDS layer to a Rigid Plate\Polygon Segment. This method requires more input from
the user: the user must map the process deposits to the correct GDS layer, as well as set the correct merge setting.
This option has the following arguments:
importAsPolygonSegment(parentRigidPlate, listofLayers, merge)
parentRigidPlate: the name to the parent rigid plate the polygon segment will be added to; it can be left empty
(e.g. '') to create a new one.
listofLayers: Specifies a cell array of strings with required layer names
merge: true if the segments should be added; false if the segments should be subtracted.
To create the same device shown in Figure 2-2, you would need the following code:
s = cov.memsplus.Schematic('Microbolometer.mlib');

% Add a new Layout component


s.Components.add('Layout');

% Select the appropriate layout file


s.Components.Layout1.Properties.Filename = 'microbolometer.gds';

% Update the Layout component to confirm the selected layout;


s.Components.Layout1.update

% Create 3D Model from GDS layers using importAsPolygonSegment option.

s.Components.Layout1.TopCellMicrobolometer.L5D0.importAsPolygonSegment('',
{'Ti','Al', 'Ti2', 'TiN'}, true);
s.Components.Layout1.TopCellMicrobolometer.L3D0.importAsPolygonSegment(s.Compo-
nents.RigidPlate1, {'AnchorVia'}, true);
s.Components.Layout1.TopCellMicrobolometer.L0D0.importAsPolygonSegment(s.Compo-
nents.RigidPlate1, {'aSi', 'TiN_Absorption'}, true);
s.Components.Layout1.TopCellMicrobolometer.L3D0.importAsPolygonSegment(s.Compo-
nents.RigidPlate1, {'aSi', 'TiN_Absorption'}, false);
s.Components.Layout1.TopCellMicrobolometer.L2D0.importAsPolygonSegment(s.Compo-
nents.RigidPlate1, {'TiN_Absorption'}, false);
s.Components.Layout1.TopCellMicrobolometer.L4D0.importAsPolygonSegment(s.Compo-
nents.RigidPlate1, {'Anchor'}, true);
%%
s.saveAndOpenInMEMSp('MicrobolometerFromLayoutScript')

2.2.4: Opening an Existing Document


Opening an existing MEMS+ document in MATLAB allows you to edit that document. Listed below are the com-
mands for opening the different types of MEMS+ documents:
mat = cov.memsplus.MaterialDatabase('MyDatabase.mmdb');
proc = cov.memsplus.Process('MyProc.mproc');
lib = cov.memsplus.ComponentLibrary('MyLib.mlib')
innov = cov.memsplus.Schematic('MySchematic.3dsch');
msim = cov.memsplus.Simulation('MySimulations.msim')
result = cov.memsplus.Result('MyResult.simulationextension');
Document and result files can also be opened (instantiated as a MATLAB global variable) by dragging and dropping
them from Windows explorer or from MATLAB current folder window into the MATLAB console:

U2-8 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Figure 2-3 Opening a File by Dragging into MATLAB Console

M
You can also double click on a file in the Current Folder pane to open it.
Note that the opened document will be stored in global MATLAB variable named h. If the h variable is already
defined, it will be overwritten by this operation.
If necessary, the name of global variable h, as well as the desired behavior (e.g. associate .3dsch files with Schematic
document or with the Simulation document), may be adjusted in the MATLAB scripts located in /runtime/matlab/file-
Associations/.

2.2.5: Saving a Document


If d is a MATLAB variable referring to an existing document,
d.save()
will save it under the name used to open it and return the saved file name as an output argument. The .save com-
mand will return the absolute path to the saved file even if the file was opened using the relative path. To silence the
output, add a semicolon:
d.save();
Note that d.filename stores the name used to open the document.
To save a new document or an existing document to a new name:
d.save('SaveAsAnotherName.mproc')
or
d.save('SaveAsAnotherName')
Note that specifying a name of an existing file will result in this file being overwritten by the new one.
You can also use h.saveAs to rename MEMS+ documents or to save them to new directories. For example,
hSim.saveAs('new_msim_filename', 'new_3dsch_filename', 'new_mlib_filename',
'new_proc_filename', 'new_mmdb_filename')
will rename each document as specified (e.g. the active schematic to new_3dsch_filename.3dsch), leaving them in
their original directories. Note that the order of the file names must be maintained (from the active tab, working back-
ward); here we are working with a Simulator file, so first we list the Simulator file, then the Innovator file, then the
Component Library file, etc.
hSim.saveAs('new_msim_filename', 'new_3dsch_filename')
will rename only the Simulator and Schematic documents as specified (e.g. the schematic is saved as new_3dsch_file-
name.3dsch) and overwrite component library, process and material database files, leaving them all in their original
directories.
hSim.saveAs('new_directory/new_msim_filename', 'another_directory/new_3dsch_file-
name')
will save the Simulator document in the current MATLAB directory to /new_directory/new_msim_filename.msim,
and the Innovator 3D Schematic in the current MATLAB directory to /another_directory/new_3dsch_filename.3dsch.

Coventor, Inc. May 31, 2018 U2-9


Section 2: Using MEMS+ with MATLAB Version 6.3

Note that additional files, such as subschematics and GDS files cannot be saved using the saveAs command.
To save MEMS+ documents to the Devices subdirectory of a CoventorWare project, use
.saveAsProject(projectName)
If the name of an existing project was specified, the files will be added to the project’s Devices subdirectory, overwrit-
ing any files of the same name files already contained in it. If the specified project does not exist, it will be created,
and then the files will be added.

2.2.6: Exporting MEMS+ Files


To an Archive
Any document can be exported to a zip archive using .exportZip function. Omitting the filename argument will
create the archive named <schematic name>.zip in the current MATLAB directory (and overwrite this file if it
exists).
To export your MEMS+ documents and the created simulation result files to an archive, add the following at the end
of a MATLAB simulation script:
hSimulation.exportZip('archiveName')

To a Process Design Kit


To export a Component Library to a MEMS+ Process Design Kit, use .exportMPDK.

Exporting a Schematic
When exporting a schematic, the user has several options:
.exportACIS('filename.ext') exports a binary (.sab) or text (.sat) ACIS geometry file. The ACIS file type
is determined based on the filename extension. If no file extension is specified, the .sab extension is appended, and
the file is saved in binary format.
For the .sat export, the user can also specify a version number, for example,
h.exportACIS('file.sat', 25)
If no version number is specified, the .sat file is exported in R26 format.
.exportGds('filename') export the layout in .gds format.
.exportCoventorWare(projectName, modelName) exports a solid model from the Innovator Schematic
to the specified CoventorWare project and model. If an existing model of an existing CoventorWare project was spec-
ified, it will be overwritten. Otherwise, a new project and a new model will be created.

To accelerate the export to CoventorWare, start the CoventorWare user interface beforehand. In this case, the
database server will be started, and each call to .exportToCoventorWare in MATLAB will be significantly
faster.

To open CoventorWare from a MATLAB script, use


system('C:\Coventor\CoventorMP1.1\CoventorWare10.3\bin\NT40_x64\coventorStart.exe&')
substituting your own file path to the coventorStart.exe file.

2.2.7: Sending Documents to MEMS+


Once you have a MEMS+ document opened in MATLAB, you can send it to the MEMS+ interface using
h.saveAndOpenInMEMSp()
This function will overwrite the document file on disk and then load it in MEMS+. The filename is returned as an out-
put argument. To silence output to the MATLAB console, add a semicolon:
h.saveAndOpenInMEMSp();

U2-10 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

The saveAndOpenInMEMSp command also takes a name argument if you would like to save the document under
another name. For example,
h.saveAndOpenInMEMSp('SaveAsAnotherName.3dsch')
To reload a modified MEMS+ document in MATLAB, use
h.reload()
There is a similar function for a result file:
h.Analyses.DC1.Result.openInMEMSp()
However, it does not overwrite the result file, it just loads the original version of the result file in MEMS+.

2.2.8: Deleting Simulation Files


To recursively remove all the MEMS+ simulations files from the current MATLAB directory and its subdirectories,
use

M
cov.memsplus.utilities.deleteSimulationFiles

2.2.9: Items
A MEMS+ document contains several trees (e.g. Components, Inputs, Mechanical Connectors trees of an Innovator
document). The elements that compose the trees are called items.
In the MATLAB scripting these trees are translated as trees of MATLAB objects, each of them represents a MEMS+
item. Useful functions for these MATLAB objects are explained below.

Accessing Tree Items


To access the list of item trees, instantiate a MEMS+ document, and then use the Tab key to access its list of methods.
In the example below, we use a schematic, so we see a list of methods for manipulating the schematic as well as for
accessing Innovator trees.
>> rf = cov.memsplus.Schematic('RFSwitch_prebuilt.3dsch');
rf.<Tab>

All the tree panes that are available in MEMS+ Innovator are now accessible as items in MATLAB.
The same method can be used to get a list available tree items:

To access an item in one of these trees, use the item tree name, then the name of the item:
>> tip = rf.MechanicalConnectors.Beam_Tip
Another example:
>> actuation = rf.Components.Actuation_Pad.Actuation

Coventor, Inc. May 31, 2018 U2-11


Section 2: Using MEMS+ with MATLAB Version 6.3

Printing the Contents of an Item Tree


The print function is very useful in MATLAB for exploring the items in a design. It prints the name of the item on
which it is called as well as all its descendants. For instance, the following is the result of calling print() on the
root item Components of the RF Switch tutorial:
>> rf = cov.memsplus.Schematic('RFSwitch_prebuilt.3dsch');
>> rf.Components.print
Components (Tree root)
Anchor (Beam)
Depositbtmlyr (Deposit)
Depositmidlyr (Deposit)
Deposittoplyr (Deposit)
Actuation_Pad (Beam)
Depositbtmlyr (Deposit)
Depositmidlyr (Deposit)
Deposittoplyr (Deposit)
Actuation (BeamInheritedGap)
Depositpads (Deposit)
Separation_Beam (Beam)
Depositbtmlyr (Deposit)
Deposittoplyr (Deposit)
Tip (Beam)
Depositmidlyr (Deposit)
Deposittoplyr (Deposit)
UpperXLine (BeamInheritedGap)
Depositpads (Deposit)
LowerXLine (BeamInheritedGap)
Depositpads (Deposit)
Calling Components.printWithProperties will print the item tree, along with the properties of each item.
Components (Tree root) with properties:
LocalFrame:
Origin:
x: 0 um
y: 0 um
InPlaneAngle: 0 degrees
Flip:
AboutLocalX: 0

AboutLocalY: 0

NumericalSimulationSettings:
SamplePointDensity: 1
DrillingDOFPenaltyFactor: 1.000000e-01
...

Get Item Info


The function getInfo allows to access the same information about the current item as in the MEMS+ interface. The
item information is displayed in a browser window, and the contents is determined by the type of item on which it is
called. For example, rf.Components.getInfo displays the information below:

U2-12 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

M
Similarly to the interface, the analysis has to be up-to-date in order to have a non-empty information.
To specify a custom title for the information window, use .getInfo('My getInfo title').

Filters
The functions filterByName and filterByType allow the user to recursively select some items by its name or
its type.
In the function
filteredItems = filterByName(obj, namePattern)
the input argument namePattern is a regular expression (see http://mathworks.com/help/matlab/ref/regexp.html),
so by default, filterByName searches for an occurrence of namePattern in the names (or types) of the items.
For example,
h.Components.filterByName('Actuation')
will return Actuation and Actuation_Pad.
To search the exact phrase:
h.Components.filterByName('^Actuation$')
where the identifiers ^ and $ denote the beginning and the end of the string respectively (an exact match). To search
for a string beginning with a phrase, use ^ ; to search for a string ending in an phrase, use $. The MATLAB regexp
syntax is used in the argument of filterByName.
If namePattern is not specified, this function returns all the children items nested under current item. When
applied to a component of an Innovator document, the filterByName function will also return deposit items.
The filterByType function behaves similarly to filterByName, but here typePattern defines a regular
expression to be searched among the types of items. If no typePattern is specified, this function returns an empty
array and prints out the types of children that are available under the current item.
The use of regexp allows the user to search for all the strings that do not contain a certain pattern. For example, the
following line returns all the components except Deposit components:
h.Components.filterByType('[^(Deposit)]')
To recover filtered names in a cell array, use
{h.MechanicalConnectors.filterByType('MechanicalConnector').Name}'
or
filteredItems = h.Components.filterByName();
{filteredItems.Name}'
To get a list of the initial positions of all mechanical connectors:
[h.MechanicalConnectors.filterByType('MechanicalConnector').InitialPosition]
For the tutorial RF switch design (see page T4-1 of the MEMS+ Tutorials), this command returns an array of the x,y,z

Coventor, Inc. May 31, 2018 U2-13


Section 2: Using MEMS+ with MATLAB Version 6.3

coordinates for each mechanical connector:


ans =

1.0e-03 *

0.1050 0.0550 0.1550 0.2250 0 0.0275 0.1675 0.1800


0.2025
0 0 0 0 0 0 0 0 0
0.0032 0.0032 0.0032 0.0035 0.0032 0.0032 0.0032 0.0032
0.0035
Note the use of brackets [ ] for this command. Brackets are used to concatenate numerical vectors; the curly brackets
{ } are used to concatenate strings (like .Name)
The filterByType function can also be used to apply an action to a group of actions, as demonstrated below:
h.MechanicalConnectors.filterByType('MechanicalConnector').connect
h.MechanicalConnectors.disconnect
The filtering functions above can be applied recursively. For instance, to search for all the items that are contained
inside a group and with a name that starts with an upper-cased letter L or W, use
h.Variables.filterByType('Group').filterByName('^[LW]').print

Parent and getChildrenNames()


These commands can be used to retrieve the item’s relatives. Below is a simple example of using getChildren-
Names(). The children of the root item are acquired and printed:
>> d = cov.memsplus.Schematic('Gyroscope_prebuilt.3dsch');
>> root = d.Components.getChildrenNames
root =
'RigidPlate'
'TopRight'
'BottomRight'
'TopLeft'
'BottomLeft'

Type
Returns the type of the item, such as SolidMaterial for material items.

add()
This command corresponds to the Add right-click action in the MEMS+ interface. For example, it can be used to add
a material item to a database:
d = cov.memsplus.MaterialDatabase;
d.MaterialList.add('Solid');
or to add an analysis item:
h.Analyses.add('DC')
You can use the output of the add function to recover the handle to the newly created item directly:
dc1 = h.Analyses.add('DC')
If you call the add command without arguments, it will print the list of items that can be added under the current
item:
h.Analyses.add

Please specify the type of item to be added. Available choices are:


'DC'
'DCSweep'
'DCSweepVariable'
'AlterOperatingPoint'
'AlterVariables'
'AlterSources'

U2-14 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

'Vary'
'ModelReduction'

Other Right-Click Menu Options


The equivalents of other right-click menu actions in MEMS+ can be invoked on items in MATLAB using the syntax
doc.TreeName.ItemName.action. Below is an example of how to delete an item:
doc = cov.memsplus.Schematic('Gyroscope.3dsch');
doc.Components.RigidPlate.delete
Note that the delete is done to the object in MATLAB; if you want to save the delete action to the MEMS+ object,
issue doc.save.
For the commands move and copy, the arguments should be specified in field / value order. The first argument in the
pair should be a case-insensitive string 'under', 'before' or 'name' (the abbreviated versions 'u', 'b', or
'n', respectively, are also allowed), followed by a handle to an existing item. For instance, consider the following

M
initial state:
h.Analyses
DC1
DCtoMove
DC2
The command
DCtoMove = DCtoMove.move('childOf', h.Analyses)
places the dc Analyses item at the last position under h.Analyses:
h.Analyses
DC1
DC2
DCtoMove
While the command
DCtoMove = DCtoMove.move('before', h.Analyses.DC1)
produces the following output:
h.Analyses
DCtoMove
DC1
DC2
There is also an after function:
DCtoMove = DCtoMove.move('after', h.Analyses.DC1)
which produces
h.Analyses
DC1
DCtoMove
DC2
Note that the handle to the item has to be reassigned using the output argument, i.e.,
dc = dc.move('childOf', h.Analyses); % After this command, dc will point to the moved
item.
and not
dc.move('childOf', h.Analyses); % After this command, dc will point to a deleted MAT-
LAB object, which cannot be used any more.
The optional argument 'name' is used to rename the item being removed or copied:
dc = dc.move('childOf', h.Analyses, 'name', 'newDC');

Coventor, Inc. May 31, 2018 U2-15


Section 2: Using MEMS+ with MATLAB Version 6.3

2.2.10: Properties
Retrieving and Setting Properties
To access properties of item, specify their full path using "." as the separator. For instance, the number of integration
points for the straight comb item is a subproperty of the numerical settings, as shown below:

doc = cov.memsplus.Schematic('Gyroscope_prebuilt.3dsch')
it = doc.Components.RigidPlate.TopComb.StraightCombStator
it.Properties.NumericalSettings.IntegrationPoints = 4
If it is unclear whether the specified property exists, press the Tab key after typing a period to see the available prop-
erties, as shown below:

Or you can output the property tree to the MATLAB console using the Properties command. For example,
it.Properties
ans =

GapFluid: {''}
NumericalSettings:
IntegrationPoints: 1
CombCells:
ByNumber:
NumberOfCombCells: 1
...

U2-16 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

For more information on how to set properties, see the section beginning on page U2-29.

Get Commands
The property's expression, units, and evaluated value of its expression can be accessed with get(). For example:
myexpr = h.Variables.Beam.Length.get();

Viewing Errors on Properties


Any errors in the specification of properties can be printed using getErrors(). For instance, in the Materials

M
Database example, not all required properties were set on the new materials. This is why those items were colored red
when the document was opened in MEMS+. To see a list of all of the errors for an item's properties, first get the root
property (parent of all the top-level properties), the item name, and then call getErrors():
mat = cov.memsplus.MaterialDatabase('MEMSpMaterialDatabase.mmdb')
p = mat.MaterialList.Aluminum.Properties()
errs = p.getErrors()

ans =

Elastic Constants required but not set.


alpha required but not defined.

2.2.11: Accessing Variables


Every MEMS+ document has variables that can be used to parameterize the properties of items. For instance, the
variables of the Gyroscope tutorial are shown on the left of the figure below.

Variables are stored as part of a special item tree and are accessed and modified in a similar manner as the main item
tree described in the section beginning on page U2-11. To access the variable AnchorLength, first note that in the tree

Coventor, Inc. May 31, 2018 U2-17


Section 2: Using MEMS+ with MATLAB Version 6.3

this variable is a leaf named Length whose parent is a group named Anchor that is a child of the root. A variable can
be changed with document.Variables.VariableName. The lines below demonstrate how to create an object
representing the variable, and then change its value through the owning document:
d = cov.memsplus.Schematic('RFSwitch_prebuilt.3dsch');
v = d.Variables.Anchor.Length
v = 75

For users of previous versions of MEMS+, note the change in syntax when creating a variable object that is part of
a group. In previous versions, a variable that was part of a group was called by GroupNameVariableName. In
MEMS+ 6 and later, the variable names reflect the structure of the variable tree, so hierarchy is denoted by a period
(GroupName.VariableName),

The above script changes the value of AnchorLength to 75 by accessing the value property of the variable item. A
variable has other properties besides its value. For example, all the properties of AnchorLength are shown in the mid-
dle of the figure above. Because the variable v is an item object type, the methods described in “Properties” on page
U2-16 can be used to access its other properties. For instance, the printWithProperties method shows all the
properties of v:
v.printWithProperties
outputs the following:
Length (Variable) with properties:
Value: 75
Exposed: 0
Limits:
Lower: NaN
Upper: NaN

And printing from the root lists all the variables without their properties
d.Variables.print
outputs the following:
Variables (Tree root)
T (Variable)
Pressure (Variable)
BottomPassivation_h (Variable)
Dimple_h (Variable)
TopPassivation_h (Variable)
Sacrificial_h (Variable)
Anchor (Group)
Length (Variable)
Width (Variable)
...
To list only exposed variables in Innovator, use filterByType, as demonstrated below:
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
{h.Variables.filterByType('Variable').Name}
outputs the following:
ans =

Columns 1 through 6

'T' 'Pressure' 'BottomPassivation_h' 'Dimple_h' 'TopPassivation_h'


'Sacrificial_h'

Columns 7 through 10

'Length' 'Width' 'Height' 'beta'


To display the values of exposed variables or verify that a variable value has been changed, use the printWith-
Properties method:
d.Variables.filterByType('Variable').printWithProperties
outputs the following:

U2-18 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

beta (Variable) with properties:


Value: 1.000000e-08
Exposed: 1
Limits:
Lower: NaN
Upper: NaN
Width (Variable) with properties:
Value: 100
Exposed: 1T (Variable) with properties:
Value: 2.731500e+02
Exposed: 1
Limits:
Lower: 1.000000e-03
Upper: 10000000000
Pressure (Variable) with properties:

M
Value: 101325
Exposed: 1
Limits:
Lower: 1.000000e-03
Upper: 10000000000
...

2.2.12: Comparing Documents, Items, and Properties


Two documents, items, or properties can be different in minor ways. Finding those differences by searching through
the items and properties manually can be difficult. This section shows methods that can automatically perform this
comparison.

Comparing Documents
Two documents can be compared using doc.compareTo(otherDoc). The results of the comparison will be dis-
played in a separate window, as shown below. Here is an example of documents that have the same items, but the
properties are different:
d2 = cov.memsplus.Schematic('Beams_prebuilt.3dsch');
d3 = cov.memsplus.Schematic('Beams_nonlinear.3dsch');
d2.compareTo(d3);

Coventor, Inc. May 31, 2018 U2-19


Section 2: Using MEMS+ with MATLAB Version 6.3

In the above example, for the Beam models, the Model Type has been changed from 0 (linear) to 1 (nonlinear). These
differences are highlighted in red.
By default, only the differences are shown. If you would like to see the changes in the context of the entire file, click
on the View tab, and then click on the Filter drop-down menu to uncheck Show Differences Only.

If the items are not identical, such as when an item is removed, added or renamed, the comparison reports that a dif-
ference exists, but not in full detail. For instance, in the material database below, the second file is identical to the
first, except that material Gold has been removed.
m1 = cov.memsplus.MaterialDatabase('MEMSpMaterialDatabase.mmdb');
m2 = cov.memsplus.MaterialDatabase('MEMSpMaterialDatabase2.mmdb');
m1.compareTo(m2)

The comparison detected that Gold is in one document, but not the other. Differences of addition are highlighted in
green.
Note that the comparison is only on the parts of the document accessible to MATLAB scripting.

U2-20 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Comparing Properties
Properties are often copied and slightly modified within a document. To detect those differences, two properties can
be compared with prop.compareTo(otherProp). For instance, in the Gyroscope tutorial, the two sets of comb
fingers on opposite sides of the proof mass should be mirror images of one another. To confirm:
d2 = cov.memsplus.Schematic('Gyroscope_prebuilt.3dsch');
pbotcomb = d2.Components.RigidPlate.BottomComb
ptopcomb = d2.Components.RigidPlate.TopComb
pbotcomb.compareTo(ptopcomb);
The comparison shows that only the name and the mirror flag about the y-axis are different, as expected:

M
2.2.13: Updating MEMS+ Documents and Items in MATLAB
Due to the inherent limitations of MEMS+ for MATLAB scripting, in some situations you need to manually update
the documents, the items, and/or their properties in order to have them accessible in MATLAB. If the item you edit
has hierarchy, you will need to update. For example, if you add a Layout component to a schematic, and specify the
filename of GDS to be used, you will need to do an update to refresh the GDS top cells and layers, which are children
of the Layout component, as demonstrated below:
schematic.Components.add('Layout');
schematic.Components.Layout1.Properties.Filename = 'microbolometer.gds';
schematic.Components.Layout1.update

2.2.14: Innovator-Specific Commands


Connectors
For a given connector, you can access its position and the list of the connected components:
connector = h.MechanicalConnectors.M1
connector.getComponents()
connector.InitialPosition
The .InitialPosition property can be accessed on an array of connectors:
[h.Components.StraightBeam1.getMechanicalConnectors.InitialPosition]
[h.MechanicalConnectors.filterByName.InitialPosition]
For an electrical output (capacitance, charge or conductance), you can get the list of two electrical connectors
between which this output is defined:
h.Outputs.Cap1.getElectricalConnectors()
To retrieve the connectors associated with a component, use the following commands:
beam.getMechanicalConnectors()

Coventor, Inc. May 31, 2018 U2-21


Section 2: Using MEMS+ with MATLAB Version 6.3

beam.getElectricalConnectors()
beam.getFluidicConnectors()
beam.getOutputs()

Connecting Connectors and Ports


In the MEMS+ Innovator user interface, you can connect connectors and port connections in a variety of configura-
tions.

connector

port connector

In MATLAB scripting, the following actions are supported:


 A connector can be connected to a vector of connectors. For example:
h.MechanicalConnectors.M1.connect([h.MechanicalConnectors.M2 h.MechanicalConnectors.M3])
 A connector can be connected to a vector of port connections. For example:
h.MechanicalConnectors.M1.connect([h.MechanicalConnectors.M2.StraightBeam1End1
h.MechanicalConnectors.M3.StraightBeam1End2])
Note that in this case the mechanical connector should be the first element of the vector.
 A port connection can be connected to a vector of port connections. For example:
h.MechanicalConnectors.StraightBeam2End1.connect([h.MechanicalConnec-
tors.M2.StraightBeam1End1 h.MechanicalConnectors.M3.StraightBeam1End2])
 An arbitrary vector of connectors or port connections can be disconnected. For example:
h.MechanicalConnectors.M1.disconnect
You can also use an alternative syntax:
connect([h.MechanicalConnectors.M1 h.MechanicalConnectors.M2 h.MechanicalConnectors.M3])

2.3: Simulating a MEMS+ Innovator 3D Schematic


2.3.1: Creating and Running an Analysis
Using the MEMS+-for-MATLAB script interface to perform a particular analysis involves
1. Creating a Simulation object based on the appropriate Innovator 3-D schematic,
2. Creating an instance of the appropriate Coventor analysis object, such as DC, AC, Modal, Pull-in, etc.,
3. Setting the desired inputs on the object,
4. Calling run() on the object to compute results, and
5. Extracting the result data from the object.
The first step in running an analysis is to create an analysis object, which will hold both the settings for the analysis as
well as the results. As an example, we compute the static (DC) response to static electrical and mechanical inputs
using the RF Switch device that is included in \\MEMS+6.3\Examples\RFSwitch. We will put 1 volt on the Actuation
Electrode of the switch, call dc.run() to compute a result, and then observe the outputs, as shown below. Note
these results were generated with T = 273.15.
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
This command creates a Simulator object based on the specified file. The specified filename can be relative, as shown
above, or absolute. Relative filenames are relative to the Current Folder of the MATLAB workspace. Absolute paths
are in the form: C:\Coventor\CoventorMP1.1\MEMS+6.3\Examples\RFSwitch\RFSwitch_prebuilt.3dsch. Both '/' and

U2-22 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

'\' or a mixture of path separators are permitted.


dc = h.Analyses.add('DC');
dc.Properties.ExposedConnectorsValues.ActuationElectrode = 1.0;
dc.run();
Starting DC Analysis
Maximum error at iteration 1: dx(23)= 2.911e-03, F(31)= 8.196e-19. Tolerances are:
Tol_dx(23) = 3.911e-06 and Tol_F(31)= 1.000e-12.
Maximum error at iteration 2: dx(23)= 3.799e-09, F(14)=-1.952e-22. Tolerances are:
Tol_dx(23) = 3.911e-06 and Tol_F(14)= 1.001e-12.
Converged in 2 iterations

>> dc.Result.Outputs.print;
1 P_Beam_Tip_z m -2.91106e-09
2 A_Beam_Tip_ry rad 1.47973e-05

M
If your answers differ from the ones displayed above, you may need to use the format short e command to
make the console display the answers in exponential format with more significant digits.

The line dc = h.Analyses.add('DC'); creates a new blank DCAnalysis object with default settings. The
name dc is arbitrary and can be any valid MATLAB variable name. Then one or more statements set up the object
until finally dc.run() is called. The parameters of the analysis are defined with analysisObject.Proper-
ties.argument. Note that no calculation happens until dc.run() is executed, so multiple dc.Proper-
ties(…) statements can be run in order to set various DC voltages.
When dc.run() is executed, extra output is printed showing the result of each iteration of the DC solution. This
extra output can be disabled with dc.Verbose = 0. The outputs can be displayed with row labels as the output
name with dc.Result.Outputs.print. MATLAB vectors and matrices containing the result data for outputs
and states can be returned through the dc.outputs and dc.states objects, which will be described later.
A more sophisticated example involves a DC sweep over many voltages:
>>dcsweep = dc.add('DCSweep')
dcsweep.Properties.SweepSource = 'ActuationElectrode';
dcsweep.Properties.SweepSource.ActuationElectrode = 'SweepValues';
dcsweep.Properties.SweepSource.ActuationElectrode.SweepValues.Values = [0:0.5:20,
20:-0.5:0];
dcsweep.run()
Running DC Sweep
Maximum error at iteration 1: dx(23)=-2.911e-003, F(17)=-6.930e-023. Tolerances are:
Tol_dx(23) = 1.000e-006 and Tol_F(17)=1.000e-012.
Maximum error at iteration 2: dx(23)=-1.792e-013, F(14)=-9.839e-033. Tolerances are:
Tol_dx(23) = 1.000e-006 and Tol_F(14)=1.000e-012.
Converged in 2 iterations
...
>>dcsweep.Result.Outputs.print()
1 P_Beam_Tip_z m 3.57623e-30 -7.27078e-10 -2.91106e-09 ...
2 A_Beam_Tip_ry rad -2.34443e-26 3.69583e-06 1.47973e-05 ...
With the dcsweep, only one input can be swept, and all other inputs will retain their fixed value from previous
dc.Properties statements.
Note that if you need to specify many points in the sweep, use LinearByNumberOfSteps, LogarithmicBy-
NumberOfSteps, LinearByIncrement, or LogarithmicByIncrement instead of specifying
SweepValues directly. In this case, the creation and calculation of points will be handled more efficiently.
A dcsweep.Properties.DCSolverSettings.MaximumSolverIterations statement can be
included to increase the number of iterations the solver will attempt to reach convergence for each step. The default is
100. Increasing the maximum number of iterations is often necessary to compute the solution for voltages after pull-
in or release.

Coventor, Inc. May 31, 2018 U2-23


Section 2: Using MEMS+ with MATLAB Version 6.3

DC Sweep is only useful for computing pull-in and release hysteresis in limited cases. See “Computing Pull-in and
Release Hysteresis Curves” on page U2-65 for the recommended techniques for computing these quantities.

Some functions are provided for convenience for plotting the results. For instance by accessing the "outputs" property
object, we can plot all outputs that begin with "P_" on the same graph:
dcsweep.Result.Outputs.plot('P_');
Because there is only one output starting with P_ for this example, the plot produced, shown in Figure 2-4, has just
one curve that clearly shows the tip touching down after pull-in:

Figure 2-4 DC Sweep Plot

Note that the user is then free to modify this plot using the standard MATLAB plot controls. More details on access-
ing the result data will be described later in this document.
Finally, the results of the DC sweep can be opened in the MEMS+ Scene3D module. A result file with a .dc_sweep
extension is written to the same directory where the original schematic resides:

Figure 2-5 MATLAB Results Visualized in Scene3D

U2-24 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

2.3.2: Running Analyses Created in MEMS+


As an alternative to writing a script that defines the desired analyses, the user can create the analysis or analyses in
MEMS+ Simulator, and then execute them in MATLAB. After creating the analyses in the MEMS+, the user should
save the analysis configuration as a .msim file, as shown below:

M
From the MATLAB console, the user enters
h = cov.memsplus.Simulation('filename.msim')
h.Analyses.run()
The h.Analyses.run command will run all the analyses in the .msim file in the order they are in the Analyses
tree.
The user can also drag the .msim file from the Current Folder pane into the Command Window to load the simula-
tions:

To run only one analysis, enter ParentName.ChildName.run, as shown below:


h.Analyses.DC1.AC1.Transient1.run()
Note that even though the analyses were created in MEMS+ Simulator, you can access and modify the configured
properties using the MATLAB commands; see the section beginning page U2-42 for the commands for setting analy-
sis parameters.

Coventor, Inc. May 31, 2018 U2-25


Section 2: Using MEMS+ with MATLAB Version 6.3

2.3.3: Inputs, Outputs and States


All simulations involve stimulating the MEMS device at its inputs and then solving for the displacements and rota-
tions across the device. These displacements and rotations are the states of the system. These states are then used to
compute certain desired outputs such as capacitance. The MEMS device may be defined parametrically with respect
to certain variables, such as deposit thickness, spring width, and electrode size.
These quantities are all defined through the MEMS+ Innovator user interface. Figure 2-6 highlights the exposed
quantities in Innovator. These exposed inputs and outputs can be accessed from within in the MEMS+-MATLAB
interface, as shown in the methods that follow.

Figure 2-6 Exposed Inputs and Outputs in MEMS+

The script below shows how to access the list of exposed inputs and outputs, as well as the states, from the Simulation
object created from the gyroscope model shown in Figure 2-6:

h = cov.memsplus.Simulation('Gyroscope_exposedZ.3dsch');
h.ExposedConnectors.printWithProperties()
outputs the following:
ExposedConnectors (Tree root)
ElectricalConnectors (ExposedConnectorsGroup)
Ecombbottom (ElectricalConnector) with properties:
DCValue: 0 V
ACSettings:
Magnitude: 0 V
Phase: 0 degrees
Ecombtop (ElectricalConnector) with properties:
DCValue: 0 V
ACSettings:
Magnitude: 0 V
Phase: 0 degrees
Esensing (ElectricalConnector) with properties:
DCValue: 0 V
ACSettings:
Magnitude: 0 V
Phase: 0 degrees

U2-26 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Inputs (ExposedConnectorsGroup)
avx (AngularVelocityInput) with properties:
DCValue: 0 rad/s
ACSettings:
Magnitude: 0 rad/s
Phase: 0 degrees
MechanicalConnectors (ExposedConnectorsGroup)
M1 (MechanicalConnector)
M1_z (TranslationalConnector) with properties:
SourceType:
Force:
DCValue: 0 N
ACSettings:
Magnitude: 0 N
Phase: 0 degrees
>> h.Analyses.getOutputNames()

M
ans =

'P_M1_z'
'Cap1'

>> h.Analyses.getStateNames()
ans =

'M1/x'
'M1/y'
'M1/z'
'M3/x'
'M3/y'
'M3/z'
...
The output from h.ExposedConnectors.printWithProperties() shows that force in Newtons is the
input for exposed mechanical displacements (F_M1_z), voltage is the input for exposed electrical connectors (V_E-
combbottom, V_Ecombtop, V_Esensing), and angular velocity of the reference frame are specified with avx.
Optionally, the position of mechanical displacements can be specified as the input instead of force. This can be done
with
h.ExposedConnectors.MechanicalConnectors.M1.M1_z.Properties.SourceType = 'Position';
h.ExposedConnectors.printWithProperties()
outputs the following:
ExposedConnectors (Tree root)
ElectricalConnectors (ExposedConnectorsGroup)
Ecombbottom (ElectricalConnector) with properties:
DCValue: 0 V
ACSettings:
Magnitude: 0 V
Phase: 0 degrees
Ecombtop (ElectricalConnector) with properties:
DCValue: 0 V
ACSettings:
Magnitude: 0 V
Phase: 0 degrees
Esensing (ElectricalConnector) with properties:
DCValue: 0 V
ACSettings:
Magnitude: 0 V
Phase: 0 degrees
Inputs (ExposedConnectorsGroup)
avx (AngularVelocityInput) with properties:
DCValue: 0 rad/s
ACSettings:
Magnitude: 0 rad/s

Coventor, Inc. May 31, 2018 U2-27


Section 2: Using MEMS+ with MATLAB Version 6.3

Phase: 0 degrees
MechanicalConnectors (ExposedConnectorsGroup)
M1 (MechanicalConnector)
M1_z (TranslationalConnector) with properties:
SourceType:
Position:
DCValue: 0 um
ACSettings:
Magnitude: 0 um
Phase: 0 degrees

>> h.Analyses.getOutputNames()

ans =

'F_M1_z'
'Cap1'
Note the difference between this output and the previous output. M1_z is the position of M1/z, specified in microns
(µm), and the output F_M1_z is the reaction force to M1/z being held at a specified position.

Note that the default units of the Position source is um, which is consistent with the Simulator Exposed Connector
Properties dialog. However, the results will show the input in base SI units (m). For more information on MATLAB
results, see page U2-32.

In addition to getInputNames, getOutputNames, and getStateNames, there is also a getInputUnits,


which reports the units used for exposed connectors, getOutputUnits, which reports the units used for exposed
outputs, and getStateUnits, which reports the units of DOFs in the state vector.

2.3.4: Run the Innovator Wizard


If you have modified the Innovator schematic from within MATLAB script, run the Wizard function before perform-
ing any analyses. To run the Wizard from the MATLAB command line or in a script,
%load a Document
h = cov.memsplus.Schematic(‘filename.3dsch’)

h.applyWizardActions

2.3.5: Simulation Properties and Methods


Other settings and the simulation results are stored as MATLAB object properties within the Analysis object. To
explore what is inside an Analysis object, or any of the Coventor MATLAB objects, type the name of the object at the
command prompt, as demonstrated with a dc object below:
>> dc
outputs the following:
DC named DC2 with properties:
Result: []
Contributions: [1x1 cov.memsplus.Contributions]
saveContributions: 0
Verbose: 1
Name: 'DC2'
Type: 'DC'
Parent: [1x1 cov.memsplus.SimulatorCompositeItem]
Document: [1x1 cov.memsplus.Simulation]
Properties: [1x1 cov.memsplus.CompositePropertyElement]
Note the Verbose sets the level of output printed in the MATLAB console during a simulation; 0 means no infor-
mation will be output; 1 means major diagnostic information will be output, and 2 means all diagnostic information
will be output.

U2-28 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

For more detailed information about an object, type the objectName.details, as demonstrated below:
>> dc.details
outputs the following:
cov.memsplus.AnalysisItemWithData handle with properties:

Result: []
Contributions: [1x1 cov.memsplus.Contributions]
saveContributions: 0
Verbose: 1
Name: 'DC2'
Type: 'DC'
Parent: [1x1 cov.memsplus.SimulatorCompositeItem]
Document: [1x1 cov.memsplus.Simulation]
Properties: [1x1 cov.memsplus.CompositePropertyElement]

M
Methods, Events, Superclasses
Clicking on the Methods link will generate a list of methods available for the object:

Methods for class cov.memsplus.AnalysisItemWithData:

AnalysisItemWithData filterByType getOutputUnits rename


add getChildrenNames getStateNames run
cat getInfo getStateUnits runRecursively
compareTo getInputNames horzcat update
copy getInputNamesUnprefixed move vertcat
delete getInputUnits print
filterByName getOutputNames printWithProperties
display getSystemMatrices

Methods of cov.memsplus.AnalysisItemWithData inherited from handle.


The help lists both Properties and Methods of an object. Properties are internal variables to the object. The Proper-
ties property can be used to set the parameters of the simulation. Properties such as Inputs, Outputs, and
States are used to store the results of a simulation (see page U2-26). Methods are functions that can be called on
the object, such as dc.run() as shown previously.
The names of the arguments for Properties correspond to the names of property parameters that can be specified
for the corresponding analysis in the MEMS+ Simulator module, but the spaces have been removed and the first letter
of each word has been capitalized.

Setting Property Values for Simulation


After creating an analysis object, the properties can be accessed like MATLAB struct properties with the "." operator.
For instance:
>> h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
>> dc = h.Analyses.add('DC');
>> dc.Properties.DCSolverSettings.Tolerances.AbsolutePositionTolerance

ans =

1.0000e-006

>> dc.Properties.DCSolverSettings.Tolerances.AbsolutePositionTolerance = 1e-8;


This shows how the absolute tolerance property can be viewed and set to a new value.

Reset to Inherited Value


If a property has been changed from its inherited value, you can reset it to the inherited value with = ‘Inher-
ited’. For example,
dc.Properties.ExposedConnectorsValues.avx = 'Inherited'

Coventor, Inc. May 31, 2018 U2-29


Section 2: Using MEMS+ with MATLAB Version 6.3

Working with Drop-Down Menu Property Elements


The Properties element that corresponds to a drop-down menu in the MEMS+ interface can be manipulated from
MATLAB by putting a string with the desired option name into the Properties element.

For example, to switch AC.Properties.SweepType from the default LinearFrequencyStepsByNumber


to LogarithmicFrequencyStepsByNumber, use the following syntax:
AC.Properties.SweepType = 'LogarithmicByNumberOfSteps';
This command will dynamically add LogarithmicByNumberOfSteps field to SweepType structure, so that
you access the subproperties of that particular sweep type. For example,
AC.Properties.SweepType.LogarithmicByNumberOfSteps.StartFrequency = 1000;

Note that you have to execute the AC.Properties.SweepType = 'LogarithmicByNumberOfSteps'


command before you can access any of the LogarithmicByNumberOfSteps properties.

To see the available choices, put the handle to the property element without trailing semicolon:
>> AC.Properties.SweepType

ans =
LinearByNumberOfSteps:
StartFrequency: Start Frequency required but not defined. NaN Hz
EndFrequency: End Frequency required but not defined. NaN Hz
NumberOfPoints: 100
Available choices are: 'LinearByNumberOfSteps', 'LogarithmicByNumberOfSteps', 'Lin-
earByIncrement', 'LogarithmicByIncrement', 'FrequencyValues'; use '' to empty the
selection.'.
To put an empty value into a drop-down menu Properties element:
dc.Properties.SweepSource = '';

Working with Expressions


To use an expression to define a property:
dc.Properties.ExposedConnectorsValues.M1_x = 'aVariable';
To define a property and its units:
h.ExposedConnectors.MechanicalConnectors.M1.M1_x.Properties.SourceType.Force.DCValue =
{1, 'uN'};
In the commands above, the property can be defined as a number or as a string.
To access a property in a right-hand side of a MATLAB expression, the function get() should be called. For exam-
ple, to define a value as a variable, enter
myexpr = h.Variables.Beam1_Length.get();
When defining properties, take care that you are at the appropriate level of hierarchy in the property element. For
example, in the command below, the user is trying to set the M1_x value to 1 for an AC analysis:
ac.Properties.ExposedConnectorsValues.M1_x = 1;
But this command will generate an error message because it is setting the value of an intermediate node in the prop-
erty tree. In order to set, for instance, the stimulus magnitude, you should use
ac.Properties.ExposedConnectorsValues.M1_x.Magnitude = 1;

U2-30 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Set Array Elements


For array elements, such as
transient.Properties.TimeSpan
dcsweep.SweepSource.<connector name>.SweepValues
the user can specify the number of elements as shown below:
transient.Properties.TimeSpan.Values = 3
To define a vector containing the values of each element, use the syntax
transient.Properties.TimeSpan.Values = [0.1 0.2 0.5]

Visualizing Changes in Property Values


To view changes to properties as they are made, first define the following:
properties = dc.Properties;
Then, when a property is assigned using this variable, MATLAB outputs the property assignments, as shown below:

M
properties.ExposedConnectorsValues.M2_y = 2
produces the following output:
properties =
ExposedConnectorsValues:
avz: NaN
M2_y: 2
M2_z: NaN
DCSolverSettings:
Tolerances:
RelativeTolerance: 1.000000e-03
AbsolutePositionTolerance: 1.000000e-06
AbsoluteForceTolerance: 1.000000e-12
MaximumSolverIterations: 100
RecursiveIterationDepth: 8
SaveAllIterations: 0

Hints for Remembering Properties and Methods


The MATLAB interpreter responds to the Tab key to suggest completion of names. This can be extremely helpful for
remembering the names of needed properties and methods. For instance, to plot a certain output, it can be hard to
remember the method plotByName. By pressing the Tab key after typing the "." in dc.Result.Outputs.
MATLAB will present a box of names that are possible completions, as shown in the image below. The user can then
use the mouse to select a particular method name and double-click or hit the Enter key.

For dynamic properties of a class (such as Properties.), autocomplete is available only after an object of the class
is created. To get a list of Properties arguments for a particular analysis type, first create the analysis, then type
analysisObject.Properties. and hit the Tab key. A list of available arguments will appear, as show below:

Coventor, Inc. May 31, 2018 U2-31


Section 2: Using MEMS+ with MATLAB Version 6.3

For more information on properties, see the section beginning on page U2-16.

2.3.6: Recursive Runs for Analyses


The analyses tree root (i.e., h.Analyses), Vary, AlterVariable, AlterOperatingPoint and Alter-
Sources analysis items are run recursively in MEMS+. In other words, when one of these analysis items is exe-
cuted, all the analyses nested below it are executed as well. This feature enables a convenient syntax:
h.Analyses.run
which will execute all the analyses defined in the current simulation document.
The same logic applies for verbosity property. For example,
h.Analyses.Verbose = 0
will turn off the messages for all the analyses nested under h.Analyses, whereas
h.Analyses.AlterSources.Verbose = 1
will turn on the messaging for all the analyses nested under h.Analyses.AlterSources.
For all other analyses, the function .run is not recursive. This implies that the parent analysis should be up to date
(any property change should be followed by .run) in order to successfully execute a child analysis. For example,
consider the following structure:
>> h.Analyses.print
Analyses (Tree root)
ParentDC (DC)
ChildDC (DC)
If you run ChildDC without running ParentDC beforehand, you will see the following error message:
Error using MemsplusDocMex
Operating point from analysis /ParentDC is needed but is out of date. Rerun /ParentDC
to update the operating point.
Error in cov.memsplus.Item/method (line 189)
MemsplusDocMex('itemTask', obj.Document.handle, obj.treeName, obj.itemInternalName,
methodName, varargin{:});
Error in cov.memsplus.SimulatorCompositeItem/run (line 27)
obj.method('compute');
To run the current analysis and all the analyses nested under it, use .runRecursively.

2.3.7: Accessing Results


Result Matrices
The matrices of data and information about them can be accessed through the Outputs and States properties of
the analysis object. These properties are objects for holding multiple sets of XY data that share a common X-axis. For
instance, for the DC sweep above, dc.Result.Outputs shows
>> dc.Result.Outputs

ans =

DataSet with properties:

Names: {2x1 cell}


Units: {2x1 cell}
Values: [2x1 double]
P_Beam_Tip_z: [1x1 cov.memsplus.Vector]
A_Beam_Tip_ry: [1x1 cov.memsplus.Vector]

U2-32 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Clicking on DataSet opens a brief help window on the methods and properties for outputs and state data:

M
Our example object has a MATLAB matrix for all the Values. This example has two outputs and 41 voltages in the
DC sweep, so the Values matrix is 2x41. The input voltage values are stored in dc.Result.XValues as a
length 41 vector.
It is generally inconvenient to figure out which rows in the output Values correspond to a certain output of interest.
Instead, it is highly recommended to use
>> v = dc.Result.Outputs.P_Beam_Tip_z
to directly return a vector of data corresponding to a particular output.

Note that dc.Result.Input, .Output, and .State will report values in units of base SI (m).

You can also filter results by name:


>> dc.Result.Outputs.getValuesContaining('rx')

The order of rows may change when rereading this data from disk in a later session, so hard coding row numbers
into scripts will not work if the data is later reread from disk. Instead, use getByName() to create a robust script

The States property holds the state values for each DC sweep point:
>> dcsweep.Result.States

ans =

DataSet with properties:


Names: {96x1 cell}
Units: {96x1 cell}
Values: [96x82 double]
NumHarmonics: 1
M2_x: [1x1 cov.memsplus.Vector]
M2_y: [1x1 cov.memsplus.Vector]
M2_z: [1x1 cov.memsplus.Vector]
.....

Coventor, Inc. May 31, 2018 U2-33


Section 2: Using MEMS+ with MATLAB Version 6.3

For this example, there are 96 displacements and rotations. The States property object stores these states as the
first 48 entries of each column of the Values. The second 48 entries of each column are the time derivatives of all
these states to make a vector of length 48. Thus, the Values above is now a 96x82 matrix because there are 96 states
for this device and 82 voltages in the DC sweep.

Plotting Results
With the MATLAB plot function, the user can specify which signals to plot using the signal name as an argument in
the form of a string. For example,
dcsweep.Result.States.plot('ProofMass_y');
will plot all signals that have 'ProofMass_y' in their name ('ProofMass_y' and 'ProofMass_y_dot').
To plot a single signal, such as ProofMass_y, use
dcsweep.Result.States.plot('^ProofMass_y$');
or call the plot directly on the ProofMass_y field:
dcsweep.Result.States.ProofMass_y.plot();
You can specify the color of plot line and the style of data markers using arguments. For example,
dcsweep.Result.States.ProofMass_y.plot('*r');
specifies that the plot line is red and the data markers are asterisks.

For more information on how to specify plot arguments, line colors and styles, etc., see
http://www.mathworks.com/help/matlab/ref/plot.html

For a transient analysis, you can plot results as they are being computed using the setStateToPlot command
before running the simulation. An example is shown below:
...
tran.setStateToPlot('M1/y');
tran.setStateToPlot('M1/z');
tran.run()

Plotting Harmonic Results


If a signal has several harmonics, using the .plot function plots all the harmonics generated by the simulation in
one plot, excluding the DC state (0th harmonic). For example, using a hysteresis analysis of the tutorial gyroscope
with the beams set to nonlinear (see page U2-75),
hyst.Result.States.M1_y.plot() creates this plot:

Figure 2-7 Plotting Individual Harmonics in Same Plot

U2-34 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

To plot a specific harmonic, specify the number: hyst.Result.States.M1_y.plot(5)

M
You can also specify a range of harmonics; for example: hyst.Result.States.M1_y.plot(3:5)

2.3.8: Saving to and Loading from a File


Individual Scene3D Files
Each analysis automatically creates a MEMS+ Scene3D file for viewing results. The name is of the form Gyro-
scope.DC1.dc where Gyroscope.3dsch was the Innovator file name, DC1 was the default name given to the DC anal-
ysis, and dc is the analysis type. The default name, DC1, can be changed with
>> dc.rename('DC_highVoltage')
Now, the Scene3D file will be named Gyroscope.DC_highVoltage.dc.
The simulation result data can be reread into a MATLAB variable in a later MATLAB session with
>> dc_old = cov.memsplus.Result('Gyroscope.DC1.dc')
And then the data can be accessed as described above in the Accessing Results section.

The above command can be used to load Scene3D files generated from Simulink, Cadence Spectre, or the MEMS+
Simulator in MATLAB for post-processing.

Coventor, Inc. May 31, 2018 U2-35


Section 2: Using MEMS+ with MATLAB Version 6.3

Full Analysis Session


The number of Scene3D files created by a single script can be overwhelming. To help organize this data, information
about the analysis set up and Scene3D files for a set of simulations can be stored in a MEMS+ Simulator file for
viewing in the Simulator user interface. To do so, add the line
>> h.save();
at the end of the script, where h was created with
>> h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch')
The file RFSwitch_prebuilt.msim will be created, which can be opened in MEMS+ Simulator as shown below:

Every simulation performed has an entry in the Analyses pane, and the 3-D results can be viewed by double clicking
the item under each analysis. For certain analyses, the settings used can be displayed by double clicking on the Anal-
ysis item itself. For instance, double clicking on AC1 shows the frequency and voltage settings used for the analysis:

U2-36 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Simulator files as generated above apply to one set of Variables only. If the MATLAB script changed variables
values, then the Scene3D result files will only be visible in the Analyses window for Analysis items after the
variable change.

Simulation data can also be reloaded into MATLAB in a future MATLAB session. First, the Simulator file is opened,
and the result files are automatically loaded to a MEMS+ object in MATLAB. Then the analysis is retrieved by name
and assigned to a MATLAB variable:
>> h = cov.memsplus.Simulation('RFSwitch_prebuilt.msim')
>> ac_old = h.Analysis.DCSweep1()
The results can be accessed as described in Accessing Results using the assigned variable, ac_old.

2.3.9: Displaying Individual Component Force Contributions

M
Understanding how each component contributes to maintaining force balance at each degree-of-freedom is an import-
ant tool for building confidence that a MEMS+ model is assembled correctly. Reaction forces and moments are avail-
able as outputs to the DC analysis, but the user can call the Contributions methods to understand how each
component contributes to maintaining force balance at each degree-of-freedom. DC, DC sweep, and transient analy-
ses can track this information as a simulation progresses. To track this information, set the saveContributions
method to true before calling run(). For instance:
>> h2 = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
>> dc = h2.Analyses.add('DC');
>> dc.saveContributions = true;
>> dc.Properties.ExposedConnectorsValues.ActuationElectrode = 13;
>> dc.run();
>> dc.Result.States.Actuation_Pad_Center_z

ans =

Vector with properties:

Values: -2.6462e-07
Units: 'm'
In the above, 13 volts is applied to the actuation electrode, which causes a z deflection at connector Actua-
tion_Pad_Center of 0.265 microns.
After performing an analysis, Contributions.print can be used to display contributions to the force balance
from each of the components of the Innovator 3D Schematic. This method has the following syntax:
analysis.Contributions.print(stateList, iteration)
stateList (optional): can either be a cell array of state names or a regular expression pattern matching a subset
of the complete list of states. State names can be retrieved with analysis.getStateNames(). Omitting
stateList or putting stateList = {} will print for all states.
iteration (optional): specifies a transient solver iteration or a DC convergence step (if .SaveAllItera-
tions flag was set). If not specified, it will print for all the iterations.
In the example below, we run a DC analysis on the RFSwitch_Damping_ForceContribution.3dsch, with all the beams
set to linear models:

Coventor, Inc. May 31, 2018 U2-37


Section 2: Using MEMS+ with MATLAB Version 6.3

Each line reports the individual force contributions on each connector DOF.
For linear models, LinearComponents is a sum of the elastic restoring force of ALL mechanical components
influencing a particular DOF. For greater granularity, nonlinear components must be used.
Entries such as /ElectroMechanicalModel:/Actuation_Pad/Actuation will differ based on design
and must be interpreted correctly based on the boundary conditions applied. /ElectroMechanicalModel:/
Actuation_Pad/Actuation is the hierarchical representation of the Actuation electrode, which is a child elec-
trostatic element of the Actuation_Pad mechanical component. Thus, /ElectroMechanicalModel:/Actua-
tion_Pad/Actuation reflects the electrostatic force applied by the potential difference between the Actuation
electrode and the Actuation_Pad structure.

True zero values are omitted from Contributions.print. That is, if a component exerts no force whatsoever
on a mechanical connector, that force contribution is NOT reported. This is intuitive, but can be confusing if the
hierarchical relationship between MEMS+ components is not understood.

In the example above, linear beams were used, but if nonlinear beams are used, Contributions.print outputs
the following:

LinearComponents has been replaced by the individual components contributing to the elastic restoring force
applied to a particular DOF. For example, whereas in the linear model report, the force contributions for Actua-
tion_Pad_End1/z included a value from LinearComponents of 3.239e-07 N, in the nonlinear model report, Actu-
ation_Pad_End1/z is shown to be influenced by both the /Actuation_Pad and /Anchor components
contributing an elastic restoring force of -2.0476e-06 N and 2.3715e-06 N, respectively. The sum of these two indi-
vidual contributors is the 0.3239e-06 N reported in the linear case. Nonlinear models MUST be used if this kind a
granularity is required.
While displayContributions can be useful for recovering a overall summary and identifying the names of
force contributors and DOFs in the MEMS+ model, the volume of information for even a few nodes makes the com-

U2-38 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

mand inconvenient. However, the command does allow for optional inputs to limit the DOFs reported (single or array
of values is permitted). The syntax and output is as follows:
>> dc.Contributions.print('Actuation_Pad_Center/z');
Actuation_Pad_Center/z ElectroMechanicalModel:/Actuation_Pad/Actuation --> -
1.57458e-06 NonlinearFiniteElementModel:/Actuation_Pad --> 1.57458e-06 Sum of con-
tributions = -5.09141e-14
Actuation_Pad_Center/z_dot Sum of contributions = 0
The contribution from each nonlinear component is stored separately, and the net contribution from each component
and pre-stress are stored as a sum. In the above example, the electrode /Actuation_Pad/Actuation connected to Actu-
ation_Pad_Center/z exerts -1.57458e-6 Newtons in the negative z direction. The nonlinear beam model exerts an
equal and opposite force of 1.57458e-6 Newtons. The precision with which the simulator achieved force balance is
demonstrated in the Sum of contributions, which in this case is several orders of magnitude less than the forces
applied.

M
get
get retrieves the value of the contribution by the specified modelTypeAndName to the state equation for the spec-
ified stateName, similar to Contributions.print.
The syntax for this method is
analysis.Contributions.get(stateName, modelTypeAndName, iterations)
stateName: can be retrieved with analysis.getStateNames()
modelTypeAndName: can be retrieved with analysis.Contributions.ModelsTypeAndName
iterations (optional): specifies a transient solver iteration(s), or a DC convergence step(s) (if .SaveAl-
lIterations flag was set). If not specified, it will get values for all the iterations.
For example:
values = tran.Contributions.get('M1/z', 'NonlinearFiniteElementModel:/LocalFrame3/
LocalFrame1/ArcPlate1');
plot(time,values,'-o');
The above will plot the force over time that the component ArcPlate1 exerts on the z motion of connector M1.
If the model only includes a few mechanical connectors, Contributions.get can be used to calculate the total
electrostatic force in the Z direction:
>> dc.Contributions.get('Actuation_Pad_Center/z','ElectroMechanicalModel:/Actua-
tion_Pad/Actuation') + dc.Contributions.get('Actuation_Pad_End1/z','ElectroMechani-
calModel:/Actuation_Pad/Actuation') + dc.Contributions.get('Actuation_Pad_End2/
z','ElectroMechanicalModel:/Actuation_Pad/Actuation')

ans =
-2.3715e-06

sum
The sum method is used to sum all force contributions by the models specified in modelListOrPattern for all
the states specified in stateListOrPattern, and for all the points specified by iterations.
The syntax for this method is
analysis.Contributions.sum(stateListOrPattern, modelListOrPattern, iterations)
stateListOrPattern: can either be a list of state names, or a pattern matching a subset of the complete list
states. State names can be retrieved with analysis.getStateNames().
modelListOrPattern: can either be a list of models, or a pattern matching a subset of the complete list of
models. Model names be retrieved with analysis.Contributions.ModelsTypeAndName.
iterations (optional): specifies transient solver iteration(s), or DC convergence step(s) (if .SaveAllIt-
erations flag was set). If not specified, it will sum values for all the iterations.

Coventor, Inc. May 31, 2018 U2-39


Section 2: Using MEMS+ with MATLAB Version 6.3

Note that analysis.saveContributions must be set to true for the sum method to work.
For example:
>> values = tran.Contributions.sum('/z','NonlinearFiniteElementModel');
plot(time, values)
The above will plot the force over time that all nonlinear finite elements exert on the z motion of all connectors.
sum is a convenient method for summing all force contributions in a particular direction acting on ANY mechanical
connector from a specified force source. Therefore, we can easily determine the total electrostatic force in Z acting on
the device without having to know the names of the mechanical connectors:
>> Eforce = dc.Contributions.sum('/z','ElectroMechanicalModel:/Actuation_Pad/Actua-
tion');
>> fprintf('Total electrostatic force in Z associated with the Actuation Electrode:
%1.5e\n',Eforce);
Total electrostatic force in Z associated with the Actuation Electrode: -2.37150e-06

Transient Analysis
For a transient analysis, Contributions.print can be used to recover the force contributions on any DOF at
any time during the simulation. The first argument is the DOF of interest; the optional second input is the time
"index". The second term defaults to the first time index "1", which corresponds to t = 0 sec.
tran.Contributions.print('Actuation_Pad_Center/z',100)
Actuation_Pad_Center/z SqueezeFilmDampingModel:/Actuation_Pad/Actuation -->
3.26404e-07 ElectroMechanicalModel:/Actuation_Pad/Actuation --> -3.90578e-06 Non-
linearFiniteElementModel:/Actuation_Pad --> 3.58058e-06 Sum of contributions =
1.20303e-09
Actuation_Pad_Center/z_dot LinearComponents --> -0.00120843 Sum of contributions =
-0.00120843
tran.Contributions.print('Actuation_Pad_Center/z',100) gives the force contributions to the
Z DOF of the Actuation_Pad_Center mechanical connector at time index = 100. time(100) shows that this is 0.02 sec.

Saving contributions for a transient analysis can greatly increase the memory consumption of the MATLAB session
and is not recommended for long transient simulations.

For a more in-depth example of how to extract force contributions, see the section beginning on page T4-95 of the
MEMS+ Tutorials.

U2-40 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

2.3.10: Stopping a Simulation


With a Keyboard Shortcut
The keyboard shortcut Ctrl + C will interrupt a native MATLAB script and can also be used for interrupting a script
with MEMS+ objects. For portions of the script that use MEMS+ computational routines, the interrupt will be
deferred until the next iteration of those routines. For instance, a DC Analysis that takes ten iterations to complete and
is interrupted with Ctrl + C at the beginning of the third iteration will not stop until the third iteration is complete.
Analyses that are not iterative, such as modal analysis, cannot be interrupted.

Specifying a Simulation Stop Event


You can specify a stop condition for a transient, pull-in, or frequency hysteresis simulation. For conditions that fit the
form

M
<state> <binary operator> <value>
you can use analysis.StopCondition.set(). For example, to set a stop condition of M1/x < 0.5e-6 in
a transient simulation, use
transient.StopCondition.set('M1/x', @lt, 0.5e-6);
For the Operator argument, specify the function handle to the binary comparison operation, such as
@lt for <
@le for ≤
@eq for =
@gt for >
@ge for ≥
@ne for ≅
More advanced stop conditions can be defined by deriving a subclass of cov.memsplus.StopCondition;
please contact Coventor support for the details.

Coventor, Inc. May 31, 2018 U2-41


Section 2: Using MEMS+ with MATLAB Version 6.3

2.4: Analysis Types


2.4.1: Small-Signal AC Analysis
Computing the AC small-signal response around a DC operating point is done through the AC Analysis Coventor
object. This section assumes familiarity with the DC analysis section. To specify the DC operating point, the object is
constructed from a DCAnalysis object for which run() has already been called. Below we demonstrate the use of
the ACAnalysis object:
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
dc = h.Analyses.add('DC');
dc.Properties.ExposedConnectorsValues.ActuationElectrode = 1.0;
dc.Verbose = 0;
dc.run();

ac = dc.add('AC');
ac.Properties.ExposedConnectorsValues.ActuationElectrode.Magnitude = 1; %AC stimulus
ac.Properties.SweepType = 'LogarithmicByNumberOfSteps';
ac.Properties.SweepType.LogarithmicByNumberOfSteps.StartFrequency = 1e3;
ac.Properties.SweepType.LogarithmicByNumberOfSteps.EndFrequency = 1e5;
ac.Properties.SweepType.LogarithmicByNumberOfSteps.NumberOfPoints = 1000;
ac.run();
ac.Result.Outputs.P_Beam_Tip_z.plot(1)
Above, an ACAnalysis object, ac is created from the DCAnalysis object with ac = dc.newACAnalysis(). A
small-signal AC source is placed on the ActuationElectrode. Also the DC voltage used for this analysis has already
been specified as part of the DCAnalysis object. The LogarithmicByNumberOfSteps method creates points
between 1 kHz and 100 kHz with log spacing. For setting the frequencies, the user has the FrequencyValues,
LinearByIncrement, LinearByNumberOfSteps, and LogarithmicByIncrement SweepType
options. The results are computed with ac.run(). The ACAnalysis object has an outputs property just like the
DCAnalysis, so the results can be plotted by name. The .plot function plots the sum of the contributions from all
harmonic output. The .plot(1) command listed in the code above creates a plot of only harmonics 1 (the AC
results):

Figure 2-8 AC Analysis Plot Results

Note that the user is then free to modify this plot using the standard MATLAB plot controls.
Instead of a DC analysis, the AC small-signal response can also be computed about the final simulation point of other
analyses such as a DC sweep, transient, or pull-in analysis. For instance, the pull-in analysis on page U2-67 computes

U2-42 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

the solutions to force balance between 0 volts and 50 volts. Because the simulation ends at 50 volts, the small signal
response for this solution at a DC voltage of 50 volts can be computed by creating the AC object using:
ac = pullin.add('AC');
where pullin is the name of the MATLAB object for the pull-in analysis.

2.4.2: Modal Analysis


Calculation of the damped eigenmodes, or poles, of the system are computed through the ModalAnalysis Coventor
object. The physical shape, frequency, and Q factor for each pole are computed. The ModalAnalysis object must be
created from a DC, DC Sweep, Transient, or Pullin Analysis object for which run()has already been done. The con-
cepts are identical to computing an AC small-signal analysis described above:
>> h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
>> dc = h.Analyses.add('DC');

M
>> dc.Properties.ExposedConnectorsValues.ActuationElectrode = 1.0;
>> dc.Verbose = 0;
>> dc.run();

>> modal = dc.add('Modal');


>> modal.run;
>> modal.getInfo;
Above a ModalAnalysis object modal is created from the DCAnalysis object, and the eigenmodes are computed.
Then modal.getInfo displays results for the first ten modal frequencies of this device with various modal mass
quantities in a web browser window, as shown below. A Scene3D file RFSwitch.DC1.Modal1eig.ac is written for 3-D
viewing in MEMS+ Scene3D.

This design has a high level of damping, as can be seen from the values of Q = -abs( π )/(2*real( π )), which are less
than 3 for all but the first mode.

Coventor, Inc. May 31, 2018 U2-43


Section 2: Using MEMS+ with MATLAB Version 6.3

The 3-D shapes corresponding to these modes are automatically written to a Scene3D file in a similar fashion as the
other analysis. Modal analysis Scene3D files have extension .eig.ac. Purely real poles (very overdamped) will appear
with a frequency of 0 in Scene3D.

For systems with unphysically large damping, the pole computation can be inaccurate. For instance, if the
rotational damping on the rigid plate in the Gyroscope tutorial example is set to 1e-3 kg-m-m/s, which is many
orders of magnitude higher than critical damping, then these large values can cause the pole computation to report
other lightly damped modes as overdamped. It is recommended that damping values be kept within physically
reasonable values.

Also, to access the MATLAB vectors and matrices of results, use the Outputs and States properties of the
ACAnalysis object. These work identically to that for DCAnalysis; please see “Accessing Results” on page U2-32 for
details.

Sparse vs. Dense Solver


By default, the modal analysis runs with the Sparse solver and solves for the first three modes. The Sparse solver is
fast, but less robust (the simulation may have convergence issues). It should be used for large problems (> 200
DOFs), and the fewer modes requested, the faster the computation. The Dense solver is slow, but robust; it should be
used for small problems or big problems that fail to converge with the Sparse solver. The Dense solver solves for all
modes.
To set the number of modes for the Sparse solver to a value other than 3, enter
>> modal.Properties.ModalSolver.SparseModalSolver.NumberOfModes = 4
To set the Dense solver, enter
>> modal.Properties.ModalSolver = 'DenseModalSolver';
To reset it to the Sparse solver:
>> modal.Properties.ModalSolver = 'SparseModalSolver';
Note that with the Sparse solver:
 The simulation may report less than the number of specified modes because of convergence difficulties.
 Simulation times for the Sparse solver may be very long when dealing with overdamped modes.
 The Sparse solver is not able to recover modes overdamped (modes with zero imaginary parts) by Rayleigh
damping. So if the Sparse solver reports “not converged” entries in the Modal Get Info window, it is likely to
be the result of overdamping induced by Rayleigh damping.

Sparse Modal Advanced Options


The Sparse solver has advanced settings that may be used if the simulation has convergence problems. These settings
are accessed with the AdvancedOptions argument. Users can set target frequency, target frequency Q factor,
maximum number of iterations, and tolerance, as shown below.
modal.Properties.ModalSolver.SparseModalSolver.AdvancedOptions.TargetFrequency
modal.Properties.ModalSolver.SparseModalSolver.AdvancedOptions.TargetFrequencyQFactor
modal.Properties.ModalSolver.SparseModalSolver.AdvancedOptions.MaximumNumberOfIterations
modal.Properties.ModalSolver.SparseModalSolver.AdvancedOptions.Tolerance
For an explanation of each of these settings, see page R5-34 of the MEMS+ Reference.

Using the Index Command


When using the index command to retrieve modal results, keep in mind that the indexing in MEMS+ is zero-based,
whereas it is one-based in MATLAB. This means that the indices returned by modal1.Result.Outputs.Max-
imumTranslationalDOF.Values should be incremented by 1 (as shown below) in order to be used as indices
for the state names in MATLAB.
Furthermore, in the case of a purely rotational mode, no maximum translation can be identified. In such a case, Max-
imumTranslationalDOF equals -1.

U2-44 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

If you want to obtain the names of maximum translational degrees of freedom, use:
stateNames = modal1.getStateNames();
indices = modal1.Result.Outputs.MaximumTranslationalDOF.Values;
maximumTranslationalDOFNames = cell(length(indices), 1); % Creates a column vector
% Increment by one and skip purely rotational modes (-1 in indices)
maximumTranslationalDOFNames(indices ~= -1) = stateNames(indices(indices ~= -1) + 1)

'Beam_Tip/z'
'Beam_Tip/y'
'Actuation_Pad_Center/z'
[]
'Actuation_Pad_End1/z'
'Beam_Tip/z'
'Actuation_Pad_End1/y'
'Beam_Tip/x'
'M2/z'

M
[]
The fourth entry is empty because the corresponding mode is a purely rotational one.
Similarly, in a case of purely translational mode, no maximum rotation can be identified.

Modal Analysis of Solid Mechanical States


To compute eigenmodes of only the solid mechanical states of the system, use the command
modal.Properties.MechanicalOnly = true;
Damping is not included nor are spring effects from fluidic forces such as those from squeezed film damping at high
frequency. This command can be used to run undamped modal analysis from the end of a damped transient analysis.
For example,
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
dc = h.Analyses.add('DC');
dc.run

modal = dc.add('Modal');
modal.Properties.MechanicalOnly = true;
modal.run();
modal.getInfo();
This example returns

Coventor, Inc. May 31, 2018 U2-45


Section 2: Using MEMS+ with MATLAB Version 6.3

2.4.3: DC Sweep and DC Sweep Variable


The MEMS+/MATLAB interface has two types of DC Sweeps: DCSweep and DCSweepVariable. DCSweep is
used to sweep exposed connectors, and DCSweepVariable is used to sweep exposed variables. These methods
have the same DC settings and tolerances, but for the DCSweep, the user specifies SweepSource parameters, and
for the DCSweepVariable, the user specifies VariableSelectionList parameters.
The DCSweep method is demonstrated on page U2-65. A DCSweepVariable example is shown below.

DCSweepVariable Example
In the example below, we will use a DCSweepVariable to alter the position of the straight comb figure and calcu-
late the effect vertical displacement has on capacitance and force. The MEMS+ model is shown below:

For the rigid mechanical connector, only the Displacement in z DOF is exposed, and in the script below, we change
this connector to a Position source, and the Zoffset variable is assigned as its value. The Zoffset variable is swept
from -160 to 160 in increments of 2, and the resulting capacitance and electrostatic force is plotted for each Z posi-
tion.
Schem = 'OneComb.3dsch';
h = cov.memsplus.Simulation(Schem);

h.ExposedConnectors.MechanicalConnectors.rigid.rigid_z.Properties.SourceType =
'Position';
h.ExposedConnectors.MechanicalConnectors.rigid.rigid_z.Properties.SourceType.Posi-
tion.DCValue = 'Zoffset';

h.ExposedConnectors.ElectricalConnectors.rotor_rigid.Properties.DCValue = '1';

dcsweepvariable = h.Analyses.add('DCSweepVariable');
dcsweepvariable.Properties.VariableSelectionList='Zoffset';
dcsweepvariable.Properties.VariableSelectionList.Zoffset= 'LinearByIncrement';
dcsweepvariable.Properties.VariableSelectionList.Zoffset.LinearByIncrement.Start-
Value = -160;

U2-46 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

dcsweepvariable.Properties.VariableSelectionList.Zoffset.LinearByIncrement.EndValue
= 160;
dcsweepvariable.Properties.VariableSelectionList.Zoffset.LinearByIncrement.Incre-
ment = 2;

dcsweepvariable.Verbose=0;
dcsweepvariable.run;

% capacitance plot
figure(1);
dcsweepvariable.Result.Outputs.Cap_rigid.plot;
grid on;
ylabel('Capacitance (F)');
xlabel('Vertical disengagement (um)');
title('Capacitance vs. Vertical Disengagement')

M
% electrostatic force plot
figure(2);
dcsweepvariable.Result.States.F_rigid_z.plot;
grid on;
ylabel('Vertical force (N)');
xlabel('Vertical disengagement (um)');
title('Vertical Force vs.Disengagement')

Figure 2-9 DC Sweep Variable Results

The simulation also generates a 3-D result file with a .DCSweepVariable1.dc extension, which can be loaded in
MEMS+ Scene3D:

ZOffset = -160 ZOffset = 0 ZOffset = 160

Coventor, Inc. May 31, 2018 U2-47


Section 2: Using MEMS+ with MATLAB Version 6.3

2.4.4: Parametric Study


To do a parametric study of a design variable, the user has two options: vary analysis, and a MATLAB for loop.

Vary Analysis
The MATLAB vary analysis corresponds to the Vary analysis available in MEMS+ Simulator (see page R5-26 of
the MEMS+ Reference for more details).
With the vary analysis, the user first defines the variable to sweep and the sweep parameters, and then adds the anal-
ysis that will be run for each step in the variable sweep. In turn, other analyses can be nested under the analysis added
directly to the vary analysis. An example script is shown below, which uses the Gyroscope example included in the
Examples directory of the installation:
clearvars;
clc;
close all;

h = cov.memsplus.Simulation('Gyroscope_prebuilt.3dsch');

% Define the variable to sweep and the sweep parameters


h.Variables.add('Variable', 'name', 'DC_Bias');
v = h.Analyses.add('Vary');
v.Properties.VariableSelectionList = 'DC_Bias';
v.Properties.VariableSelectionList.DC_Bias = 'LinearByIncrement';
v.Properties.VariableSelectionList.DC_Bias.LinearByIncrement.StartValue = 0;
v.Properties.VariableSelectionList.DC_Bias.LinearByIncrement.EndValue = 15;
v.Properties.VariableSelectionList.DC_Bias.LinearByIncrement.Increment = 3;
v.Properties.CreateMergedResultFile = 1;

% Add a DC analysis and define the voltages on the exposed electrodes


dc = v.add('DC');
dc.Properties.ExposedConnectorsValues.Ecombbottom = 'DC_Bias';
dc.Properties.ExposedConnectorsValues.Ecombtop = 'DC_Bias';

% Add an AC under the DC analysis because the DC operating point result will be the
% initial state for the AC analysis
ac = dc.add('AC');
ac.Properties.ExposedConnectorsValues.Ecombbottom.Magnitude = 2;
ac.Properties.ExposedConnectorsValues.Ecombbottom.Phase = 180;
ac.Properties.ExposedConnectorsValues.Ecombtop.Magnitude = 2;
ac.Properties.ExposedConnectorsValues.Ecombtop.Phase = 0;
ac.Properties.SweepType = 'LinearByNumberOfSteps';
ac.Properties.SweepType.LinearByNumberOfSteps.StartFrequency = 6500;
ac.Properties.SweepType.LinearByNumberOfSteps.EndFrequency = 7500;
ac.Properties.SweepType.LinearByNumberOfSteps.NumberOfPoints = 1000;
v.run();

for i = 1:length(ac.Result)
plot(ac.Result(i).XValues, abs(ac.Result(i).States.M1_y.Values(:,2)), 'Display-
Name', sprintf('DC_Bias = %d (V)', i*3));
hold on;
end
set(gca, 'xlim', [6840 6900]);
xlabel('frequency (Hz)');
ylabel('M1_y displacement (m)', 'interpreter', 'none');
set(legend('location', 'northeast'), 'interpreter', 'none');
When this script is executed, it generates a plot, shown in Figure 2-10, of the y degree of freedom on the gyroscope’s
rigid plate results for each vary step. Compare this simulation setup and results with the Simulator setup and results
shown in the Gyroscope Tutorial (see the section beginning on page T2-35 of the MEMS+ Tutorials).

U2-48 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Figure 2-10 Vary Analysis Plot

M
Of special note is the plot command used for this simulation:
plot(ac.Result(i).XValues, abs(ac.Result(i).States.M1_y.Values(:,2))
We are plotting the X values (frequency) of each vary analysis versus the absolute values of the M1_y degree of free-
dom. The (:,2) is needed because an AC analysis has two result sets; 1 represents the DC results and 2 represents
the AC results. So with (:,2)the colon tells MATLAB to plot all the rows in the M1_y data table, 2 tells MATLAB
to plot second column (the AC results) of the data table.
Note that the data table for an analysis is available in the MATLAB workspace. If the workspace is not open, enter
workspace in the MATLAB console. The workspace for the AC analysis is shown below:

For another example of a Vary analysis, see page U2-80.

Coventor, Inc. May 31, 2018 U2-49


Section 2: Using MEMS+ with MATLAB Version 6.3

for Loop
This section demonstrates sweeping a design variable by placing analyses in a MATLAB for loop. It uses nested
for loops to sweep the variable ActuationPad.Length over three values and midlyr_h over three values. It
then plots an exposed output for all nine AC sweeps. It also demonstrates MATLAB script-level plot controls.

Script:
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');

padLengths = 50:25:100;
Dimple_hs = 0.9:0.1:1.1;
outputName = 'P_Beam_Tip_z'; % output we care about. usually a capacitance.
stateName = 'Beam_Tip/ry'; % an unexposed state to plot (could get this in Scene3D)

% clear a couple figures, get handles to the axes, and set some titles
figure(5); clf; axis5 = gca; hold on; title(outputName,'Interpreter','none');
figure(6); clf; axis6 = gca; hold on; title(stateName,'Interpreter','none');
colors = 'bgrcm'; % line colors to cycle through for plotting
linestyles = {'-',':','-.','--'}; % line styles to cycle through

count = 0;
for k=1:length(padLengths)
h.Variables.ActuationPad.Length = padLengths(k);
for m=1:length(Dimple_hs)
count = count + 1;
% modify variables
h.Variables.Dimple_h = Dimple_hs(m);

% A nice string to describe this step. 'Dimple_0.9_PadLength_100'


sweepVarsStr = ['Dimple_',num2str(Dimple_hs(m)),'_PadLength_',
num2str(padLengths(k))];

fprintf('Working on %s\n',sweepVarsStr);
% Make new DC and AC objects (recycling is not recommended) so we
% get a different item in the tree
dc = h.Analyses.add('DC');
% Use the built-in function matlab.lang.makeValidName
%in order to generate a valid MATLAB name from an arbitrary string
dc.rename(matlab.lang.makeValidName(['DC_',sweepVarsStr]));
dc.Verbose = 0; % don't print iteration information
dc.Properties.ExposedConnectorsValues.ActuationElectrode = 1.0;
dc.run();

ac = dc.add('AC');
ac.Properties.ExposedConnectorsValues.ActuationElectrode.Magnitude = 1;
% AC stimulus, complex amplitude
ac.Properties.SweepType = 'LogarithmicByNumberOfSteps';
ac.Properties.SweepType.LogarithmicByNumberOfSteps.StartFrequency = 1e3;
ac.Properties.SweepType.LogarithmicByNumberOfSteps.EndFrequency = 1e5;
ac.Properties.SweepType.LogarithmicByNumberOfSteps.NumberOfPoints = 200;
ac.run();

% get output and state of interest for summary plotting


xaxisVals = ac.Result.XValues;
% get an output (imagine this is a capacitance)
zpos = ac.Result.Outputs.(strrep(outputName, '/', '_')).Values(:,2);
% get an unexposed state
ry = ac.Result.States.(strrep(stateName, '/', '_')).Values(:,2);

% pick a color and a linestyle. example: 'b:' - blue dotted. Do 'help


% plot' for more info. This cycles through the list of colors and

U2-50 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

% linestyles.
color_line = [colors(mod(count-1,length(colors))+1),linestyles{mod(count-
1,length(linestyles))+1}];

% add curve to plots and give legend entry with 'DisplayName'


% The first will have a thicker line width (2)
plot(axis5, xaxisVals, abs(zpos),color_line,'DisplayName',sweepVarsStr,'Line-
Width',2);
plot(axis6, xaxisVals, abs(ry),color_line,'DisplayName',sweepVarsStr);

end
end

% create a legend for P_Beam_Tipz


lh = legend(axis5, 'toggle');

M
set(lh,'Interpreter','none'); % no Latex interpretation of '_' in legend
% Set x and y axes labels
xlabel(axis5, ac.Result.XNameAbbreviationAndUnit,'Interpreter','none'); % no Latex
interpretation of '_'
ylabel(axis5, ac.Result.Outputs.(strrep(outputName, '/', '_')).Units); % get a unit for
the y-axis label. Only works for inputs and some outputs

% legend and axes for Beam_Tip/ry


lh = legend(axis6, 'toggle');
set(lh,'Interpreter','none'); % no Latex interpretation of '_'
xlabel(axis6, ac.Result.XNameAbbreviationAndUnit,'Interpreter','none'); % put Frequency
as x-axis label
% set x and y to log scale ('loglog' instead of 'plot' inside loop would do
% the same thing
set(axis6,'XScale','log');
set(axis6,'YScale','log');
The above script runs in about 30 seconds and generates the following plots:

Figure 2-11 Parametric Study Results Generated with a for Loop

It also generates a separate Scene3D file for each of the nine runs.

Coventor, Inc. May 31, 2018 U2-51


Section 2: Using MEMS+ with MATLAB Version 6.3

2.4.5: Transient Analysis


Transient analysis is performed through the TransientAnalysis Coventor object. The procedure involves the following
steps:
1. Specify a DC or AC solution from which to start the transient.
2. Set the span of time to simulate, such as t = 0 to t = 20 ms.
3. Specify the inputs as a function of time.
4. Optionally specify settings for the simulator.
5. Optionally specify signals to plot while the simulation runs.
6. Run, and optionally stop and continue the simulation.
Each of the above steps will be detailed in the next sections. The procedure is best summarized with an example. The
example below applies a very slow ramp function to the actuation electrode of the RF Switch Design Tutorial, which
starts on page T4-1 of the CoventorMP Tutorials, and plots the ramp and the tip position as the simulation progresses:
% Open RFSwitch tutorial design
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');

% Create and compute a DC solution


dc = h.Analyses.add('DC');
dc.Verbose = 0;
dc.run();

% Create and set up a transient analysis


tran = dc.add('Transient'); % Make a TransientAnalysis object that starts at DC solu-
tion
tran.Properties.TimeSpan.Values = [0 20]; % Set simulation to run from t = 0 to t =
20 sec
ramp = @(t) t; % Define function of one variable: f(t) = t
tran.Properties.ExposedConnectorsValues.ActuationElectrode = ramp; % apply ramp to
the actuation electrode

% optionally specify signals to plot while the simulation runs


tran.setInputToPlot('ActuationElectrode');
tran.setOutputToPlot('P_Beam_Tip_z');

tran.run(); % run the transient


The comments above describe the purpose of each statement.

Users should always set a Rayleigh damping beta value when running transient simulations. If Rayleigh damping is
not set in the imported schematic or defined in the script, simulation performance will degrade as high frequency
modes will be undamped, leading to a small solver timestep and slow simulation time.

Figure 2-12 shows the plot that is drawn as the simulation progresses. It shows the actuation voltage as a function of
time and the tip displacement as a function of time:

U2-52 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Figure 2-12 Transient Plot Results

M
Because V = t, the device experiences pull-in between 14 and 15 seconds (14-15 V) as expected from the DC sweep
in the section above on DC analysis.
Recall that the <Tab> key in MATLAB can be used to help remember the methods available. The <Tab> key works
with partially completed names, so to recall all the methods for setting up a transient, type tran. and then press Tab:

The next sections provide further details and options for setting up a transient analysis.

Specify a DC or AC Solution as the Initial State


Transient simulations typically start from a static (DC) solution. To specify this as the initial state, x0, the Transien-
tAnalysis object in the example above is created from the DC solution of interest with the line:
tran = dc.add('Transient');
This will use both the static displacements and rotations as the initial states for the transient, and also use the DC
inputs as constant inputs for the transient. In the example above, all the input voltages were zero, but not the initial
state. Due to a small thermal stress, the relaxed initial state has the tip deflected slightly upward, as can be seen in the
bottom plot of Figure 2-12 at time t = 0. The tip displacement was slightly positive at t = 0, confirming that a non-zero
initial state was used for the transient simulation.
If instead, the DC analysis had static voltages applied, such as below on the Tip electrode:

>> dc = h.Analyses.add('DC');
>> dc.Properties.ExposedConnectorsValues.Tip = 1;
>> dc.Verbose = 0;
>> dc.run();

Coventor, Inc. May 31, 2018 U2-53


Section 2: Using MEMS+ with MATLAB Version 6.3

>> tran = dc.add('Transient');


then the transient, by default, would apply that voltage throughout the simulation.
In the case of resonators and gyroscopes, it is often of interest to start the simulation not from a DC state, but from the
sinusoidal steady-state as computed by AC analysis. For instance, to investigate the sensitivity of a gyroscope via
transient simulation, the angular rate should be applied only after the gyroscope has reached steady-state oscillation.
For high-Q devices, running a transient from DC to reach the steady-state can take far longer than the desired simula-
tion at steady-state. To avoid the unnecessary simulation from DC, the AC analysis result can be used as the initial
state by constructing the TransientAnalysis object from an AC analysis:

ac = dc.add('AC'); % AC analysis for DC solution around 1 volt.

ac.Properties.ExposedConnectorsValues.Ecombbottom.Magnitude = -2;
ac.Properties.ExposedConnectorsValues.Ecombtop.Magnitude = 2;

freq = 6870.29;
ac.Properties.SweepType = 'FrequencyValues';
ac.Properties.SweepType.FrequencyValues.Values = freq;
ac.run();

tran = ac.add('Transient')
The above example uses the tutorial Gyroscope model. Two sinusoidal sources of amplitude 2 and 180 degrees out-
of-phase are applied to the combs on opposite sides of the mass, and the sinusoidal steady-state is computed at a fre-
quency around 6870 Hz. This is then used to create the TransientAnalysis object. Both the initial state, x0, and the
input functions, u(t), are taken as the appropriate combination of the AC analysis result and the DC analysis from
which the AC analysis was created. For instance, the AC analysis above came from a DC analysis that had 14.3 volts
on the two combs. The appropriate transient source should then be v(t) = 14.3 + 2 * sin(2*pi*6870*t) for the Ecomb-
top electrode. To see this, use tran.displayInputs():
>> tran.Properties.ExposedConnectorsValues
Ecombbottom: Inherited @(t) 14.3 + 2 * sin(2*pi*6870.29 * t + 3.1415927)
Ecombtop: Inherited @(t) 14.3 + 2 * sin(2*pi*6870.29 * t + 0)
Esensing: Inherited @(t) 0.1
avx: Inherited @(t) 0
M1_x: Inherited @(t) 0
M1_y: Inherited @(t) 0
M1_z: Inherited @(t) 0
M1_rx: Inherited @(t) 0
M1_ry: Inherited @(t) 0
M1_rz: Inherited @(t) 0

The initial state and inputs from the DC and AC analysis objects are copied in the statements tran =
dc.newTransientAnalysis()and tran = ac.newTransientAnalysis(); thus, if the values of
inputs or states are changed on the DC or AC object, the TransientAnalysis object will not have the correct stimuli.
To use those changed values in a transient analysis, either recreate a new TransientAnalysis object from the
changed DC/AC object, or call tran.setInput() appropriately as described later.

The drive frequency in the script above was hard-coded to the frequency 6870.29, which is generally not recom-
mended. Slight changes in the design that change the resonance frequency would leave the script driving at the wrong
frequency. Instead, a modal analysis should be run to compute the resonance frequency and the value extracted from
the modal object:
modal = dc.add('Modal')
modal.run();
freq = modal.Result.Outputs.Frequencies.Values(1);

U2-54 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Set the Span of Time to Simulate


The statement
tran.Properties.TimeSpan.Values = [0 20e-3];
sets the start time, t0, to 0 and the end time, tend, to 20 ms. A number of intermediate time points can also be specified
with
tran.Properties.TimeSpan.Values = [0:1e-4:20e-3];
which is a MATLAB vector of values 0, 1e-4, 2e-4, 3e-4, … 20e-3. This specifies the same start and end time, but
will cause the simulator to only store results for the specified time points. If only a start and end time are specified
with [0 20e-3] then every time point solved to meet the desired simulation accuracy will be stored.

Specify the Inputs, u(t), as a Function of Time


The default input stimulus from the DC or AC initial state can be overridden by specifying either a scalar or a MAT-

M
LAB function handle to the Properties() method. With MATLAB function handles, any function can be defined
for use with transient simulation. Extensive MATLAB documentation exists for MATLAB function handles. Search
for "function_handle" in the MATLAB help system. A brief overview will be given here.
Here are common forms for specifying function handles for MEMS+ inputs, with comments explaining their func-
tion:

% A constant for all time


tran.Properties.ExposedConnectorsValues.ActuationElectrode = 5;

% A function that starts at 0 and exponentially decays to 1 with a time


% constant of 20 ms. Uses MATLAB "anonymous functions"
tran.Properties.ExposedConnectorsValues.ActuationElectrode = @(t) 1 - exp(-t/20e-3);

% A Coventor-supplied object for a piecewise-linear function


p = cov.memsplus.sources.pwl([0 50 75 575 600 1000]*1e-6, [0 0 20 20 0 0],false);
tran.Properties.ExposedConnectorsValues.ActuationElectrode = p;

% A function defined in an M-file (most general)


tran.Properties.ExposedConnectorsValues.ActuationElectrode = @myfunc;
The first example sets the input to 5 volts for all values of time. The other three forms use function handles and are
described next.

Anonymous Functions
Simple functions can be easily specified with anonymous functions. For details, see the MATLAB documentation. A
brief overview is given here.
Anonymous functions for MEMS+ inputs must be functions of one variable and are of the form @(varname)
expression where varname is a name that is used in the expression. For example,
f = @(w) 1 - exp(-w/20e-3)
creates a variable f that is a function handle to a function taking 1 input argument. The variable used to define the sin-
gle variable expression is w. The function can be plotted with MATLAB's fplot:
f = @(w) 1 - exp(-w/20e-3);
fplot(f,[0 40e-3])

Coventor, Inc. May 31, 2018 U2-55


Section 2: Using MEMS+ with MATLAB Version 6.3

The function handle can then be set as an input with


tran.Properties.ExposedConnectorsValues.ActuationElectrode = f;
Or more compactly, the expression can be passed directly with
tran.Properties.ExposedConnectorsValues.ActuationElectrode = @(w) 1 - exp(-w/20e-3);
Note that you can use multi-variable functions if you specify all but one of the variables as constant by creating an
anonymous function from an anonymous function. For instance, the above exponential has a hard-coded time con-
stant of 20e-3. Instead, define
g = @(t,tau) 1 - exp(-t/tau);
tran.Properties.ExposedConnectorsValues.ActuationElectrode = @(w) g(w,20e-3);
Or the anonymous function can use variables from the MATLAB workspace
tau = 20e-3;
tran.Properties.ExposedConnectorsValues.ActuationElectrode = @(w) 1 - exp(-w/tau);
The value of tau when the line above is executed will be stored as a constant for all evaluations of the function.

Coventor-Supplied Function Objects


With MEMS+ two sources are supplied for convenience: a piecewise-linear source and a pulse source. The piece-
wise-linear source is identical to the "Repeating Sequence" Simulink source and linearly interpolates between a set of
given values at given time points.
First, create an object of the desired source as shown below:
p = cov.memsplus.sources.pwl([0 50 75 575 600 1000]*1e-6, [0 0 20 20 0 0],false);
Here, the time points are 0, 50 us, 75 us, etc., and the value at those time points is 0, 0, 20, 20, etc. The false indi-
cates it is not periodic. If set to true, the sequence would repeat after the last time point (1000 us). The func()
method returns a function handle that can be plotted using fplot:
p = cov.memsplus.sources.pwl([0 50 75 575 600 1000]*1e-6, [0 0 20 20 0 0],false);
fplot(p.func, [0 2000]*1e-6);
set(gca, 'Ylim', [-2 22]);
which produces

U2-56 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

M
The Coventor source p can also be used to specify an input for transient analysis:
tran.Properties.ExposedConnectorsValues.ActuationElectrode = p;
Another function supplied with MEMS+ is a pulse. To specify the above function with a pulse source,
p = cov.memsplus.sources.pulse;
p.period = 1e-3;
p.delay = 50e-6;
p.width = 500e-6;
p.risetime = 25e-6;
p.falltime = 25e-6;
p.onvalue = 20;
p.offvalue = 0;
fplot(p.func, [0 2000]*1e-6);
set(gca, 'Ylim', [-2 22]);
which produces

If period had been specified as 2e-3, then the second pulse would not have appeared.

Coventor, Inc. May 31, 2018 U2-57


Section 2: Using MEMS+ with MATLAB Version 6.3

Function Defined in an M-File


MATLAB M-files (files with extension ".m") provide the most versatile way to define a custom function. The func-
tion is defined in a separate file, and full constructs of the MATLAB language can be used to define the function. The
MATLAB on-line documentation should be consulted for details, but we will summarize the use here.
Instead of a pulse source, below we create a periodic function that has a rise and fall curve that is a decaying exponen-
tial, as one would expect from a real electrical wire with a resistance and capacitance. To define the function
myfunc, create a file myfunc.m in the current MATLAB directory or somewhere in the MATLAB path with the fol-
lowing contents:
function v = myfunc(t)
mytau = 2e-3; % decay time constant
myperiod = 40e-3; % period
v = zeros(size(t));
for i = 1:length(t)
tp = mod(t(i),myperiod); % modulo period to get time since beginning of cycle
if (tp/myperiod < 0.5)
v(i) = 1 - exp(-tp/mytau); % rising to 1 on first half
else
v(i) = exp( -(tp - myperiod/2)/mytau); % falling to 0 on second half
end
end
end
then we have defined a function of a single variable that returns a single value:
>> myfunc(0)

ans =

>> myfunc(2e-3)

ans =

6.3212e-001

A function handle for this function can be created by pre-pending an '@' to the name. So to plot it:
>> fplot(@myfunc, [0 80e-3])
which produces

This function can then be passed as an input for transient analysis with
tran.Properties.ExposedConnectorsValues.ActuationElectrode = @myfunc;

U2-58 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Of course it is somewhat inconvenient to have put the time constant and the period as fixed values within the func-
tion. So instead we make a function of three variables:
function v = myfunc(t, mytau, myperiod)
v = zeros(size(t));
for i = 1:length(t)
tp = mod(t(i),myperiod); % modulo period to get time since beginning of cycle
if (tp/myperiod < 0.5)
v(i) = 1 - exp(-tp/mytau); % rising to 1 on first half
else
v(i) = exp( -(tp - myperiod/2)/mytau); % falling to 0 on second half
end
end
end
And then make an anonymous function that sets a particular time constant and period that can be used for transient
analysis:

M
f = @(t) myfunc(t, 2e-4, 40e-3);
tran.Properties.ExposedConnectorsValues.ActuationElectrode = f;

Viewing the Current Settings for an Input


To plot the input over a range, the function handle can be accessed using
dc = h.Analyses.add('DC');
dc.Verbose = 0;
dc.run();

tran = dc.add('Transient');

tran.Properties.TimeSpan.Values = [0 1e-3];
tran.Properties.Tolerances.RelativeTolerance = 1e-4;

p = cov.memsplus.sources.pwl([0 50 75 575 600 1000]*1e-6, [0 0 20 20 0 0],false);


tran.Properties.ExposedConnectorsValues.ActuationElectrode = p.func

index = h.Analyses.getInputIndex('ActuationElectrode')

index =

fplot(tran.Properties.ExposedConnectorsValues.ActuationElectrode.Function,[0 1e-3])
which produces the plot below:

Note that even if the input is set to a constant value, it will be returned as a function handle.

Coventor, Inc. May 31, 2018 U2-59


Section 2: Using MEMS+ with MATLAB Version 6.3

Changing Default Simulator Settings


The default simulator settings are often adequate for an accurate simulation. However, after some experience with
simulating a particular design, users may find that they need to change the simulator settings for optimal perfor-
mance. The most important setting is the relative error tolerance. For advanced users, the simulation algorithm can
also be changed, as well as some of the advanced settings. The TransientAnalysis object uses a modified version of
the MATLAB ODE suite. The MATLAB ODE suite's documentation explains all the possible settings in detail.
Below we show how to change the desired settings through the TransientAnalysis object.
The default settings for a transient analysis are
 Solver = @ode15s; specifies the stiff solver for contact
 RelativeTolerance = 1e-4; defines the Relative Tolerance
 AbsolutePositionTolerance = 1e-6; defines the Absolute Tolerance
 NormControl = 'off'; controls global error rather than all component errors
 MaxOrder = 2; defines the maximum polynomial order formula used to compute the solution (1 to 5).
Increasing this value may help with convergence, but the higher values are not as stable.
 BDF = 'off' (NDF). If set to off, NDF (Numerical Differentiation Formula) is used. It is generally more effi-
cient (more accurate and faster) than BDF (Backward Differentiation Formula, which is the Gear method).
NDF is a MATLAB enhanced Gear method, but it less stable for higher orders (3 to 5).
For a summary of the default and optimal settings for a transient analysis, see page U1-21.
RelativeTolerance and AbsolutePositionTolerance are set using tran.Properties.Tolerances.
NormControl, MaxOrder, and BDF are set using tran.Properties.AdvancedOptions.

Changing the Relative Error Tolerance


Of particular relevance is the relative error that is tolerable in the solution at each time step. This setting can be used
to trade solution accuracy for speed. A smaller relative tolerance gives more accurate results, but requires the simula-
tor to take smaller time steps to meet the tighter requirement, which increases simulation time. Because of its impor-
tance, the relative tolerance can be set directly on the TransientAnalysis object. The value that will be used for a
TransientAnalysis object can be displayed with
>> tran.Properties.Tolerances.RelativeTolerance

ans =

1.0000e-004
This value can be changed with
>> tran.Properties.Tolerances.RelativeTolerance = 1e-5
Reducing the relative tolerance is particularly important for lightly damped systems when the amplitude of oscillation
is important. For instance, in the Gyroscope tutorial, an error tolerance of 1e-3 creates too much numerical damping,
and it becomes necessary to reduce this tolerance to 1e-4 in order to maintain the amplitude of the oscillation within a
few percent over the nearly 300 periods of oscillation in that simulation.

Changing Convergence Criteria


By default, a transient analysis uses a component-wise criteria for convergence (normControl = 'off'). This criteria
means that the simulation determines convergence by looking at the error for each DOF; if the error for each DOF is
below the default error value, that step is considered to have converged. This method may result in a considerably
slow transient analysis. To speed up a transient analysis, the user can invoke the normControl method:
tran.Properties.AdvancedOptions.NormControl = ‘on’
This setting has a looser convergence criteria; instead of looking at the error for each DOF, it looks at the average
error for all the DOFs. For more information, this setting and other transient analysis settings, please see the MAT-
LAB online documentation, accessible from MATLAB console’s Help icon or by pressing F1. Search the documenta-
tion for the term ODEset.

U2-60 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

To turn off the normControl method:


tran.Properties.AdvancedOptions.NormControl = ‘off’

Changing the Simulation Algorithm


The MATLAB ODE suite offers a number of simulation algorithms. The TransientAnalysis object uses a Coventor
modified version of ode15s if created from a DC Analysis and a modified version of ode23t if constructed from
AC Analysis. This can be changed if there is reason to believe another algorithm is better:

>> tran.Properties.Solver

ans =

@ode15s

M
>> tran.Properties.Solver = @cov.memsplus.ode.ode23t;
In general, the ode15s solver is recommended for a transient analysis with contact, and it is the default solver. Note
that with this solver, it is recommended to set the Maximum order parameter to 2. The ode23t solver is recommended
for systems with high-frequency oscillations (resonator, gyroscope, scanning mirror, etc.); this solver will avoid
numerical damping of those oscillations. It is a conservative solver, i.e., it favors numerical accuracy over simulation
speed when dealing with stiff problems.

Other ODE Settings


All other simulator settings must be set with the MATLAB odeset function and passed to the TransientAnalysis
object with the tran.Properties.AdvancedOptions.odesetOptions method. For example, to print
statistics at the end of a simulation:
>> tran.Properties.AdvancedOptions.odesetOptions = odeset('Stats','on');
See the MATLAB documentation for odeset for a full list of available options. Each call to setODEoptions
replaces options from previous calls. The options specified via setODEoptions overrides any default options set
within the TransientAnalysis object except those to specify the Mass Matrix, the Jacobian, and OutputFcn (see the
MATLAB documentation for a definition of these terms).

Optionally Specify Signals to Plot While the Simulation Runs


Selected states, inputs, and outputs can be plotted as a simulation progresses. This is done through the setStates-
ToPlot, setInputsToPlot, and setOutputsToPlot methods. For example, the following sets one input, 2
states, and the first output to be plotted (from the Gyroscope tutorial):
tran.setInputToPlot('avx');
tran.setStateToPlot('M1/y');
tran.setStateToPlot('M1/z');
outNames = h.Analyses.getOutputNames();
tran.setOutputToPlot(outNames{1}); % Cap1_E6Esensing
If no quantities are set to plot, all outputs will be plotted.

Running a Simulation then Saving and Viewing the Results


Once the desired settings are complete, the simulation can be started with the run method, which is the last line in
the following script that puts a fast pulse on the RF switch tutorial design:
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
dc = h.Analyses.add('DC');
dc.run();
tran = dc.add('Transient');
tran.Properties.TimeSpan.Values = [0 1e-3];
tran.setStateToPlot('Beam_Tip/z');
tran.setInputToPlot('ActuationElectrode');
tran.setOutputToPlot('A_Beam_Tip_ry');
p = cov.memsplus.sources.pwl([0 50 75 575 600 1000]*1e-6, [0 0 20 20 0 0],false);

Coventor, Inc. May 31, 2018 U2-61


Section 2: Using MEMS+ with MATLAB Version 6.3

tran.Properties.ExposedConnectorsValues.ActuationElectrode = p;
figure;
tran.run();
Note that when accessing individual DOFs, for states, the DOF is preceded by a backslash (i.e., tran.setState-
ToPlot('Beam_Tip/z'), but for outputs and inputs, the DOF is preceded by an underscore (i.e., tran.setOut-
putToPlot('A_Beam_Tip_ry').
When the tran.run() statement is executed, the figure window will display the specified states, inputs, and out-
puts as the simulation progresses. Here is a screen capture part way through:

New data points are plotted every 100 time steps. To force immediate plotting before the 100 steps have finished, use
the Refresh button. A refresh will also rescale the y-axis if the initial values are significantly smaller than 1, as is the
case for Beam_Tip/z and A_Beam_Tipry above. For efficiency, only new data points are plotted, which means vari-
ous windowing events can cause the early points to disappear. A refresh will redraw the earlier points as well.
The Stop button can be used to stop the simulation.
When the simulation is complete, the plots looks as shown below:

U2-62 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Simulation Results
After simulation, all inputs, outputs and states are available through the States, Outputs, and Inputs properties
as in the other analysis objects. The simulation also creates a MEMS+ Scene3D file to view the solution as 3-D
motions of the device.
In addition, states, outputs, and inputs are all available for plotting or other data analysis. Below we take the z deflec-
tion as a function of time for four different points along the axis of the switch:
s = tran.Result.States;
zTip = s.Beam_Tip_z.Values;
z1 = s.Actuation_Pad_End1_z.Values;
z2 = s.Actuation_Pad_End2_z.Values;
z5 = s.Actuation_Pad_Center_z.Values;
figure
plot(tran.Result.XValues, [zTip, z1, z2, z5]);

M
In the script above, for convenience, we copy tran.Result.States into a variable s. This is only to make the
statements easier to write, and is not necessary because z1 = tran.Result.States.Actua-
tion_Pad_End1_z.Values would work as well.
Results are also written to a Scene3D file with extension .trans. The volume of data written to the Scene3D file can
be reduced by setting the tran.Decimation to a value larger than 1. For instance, a value of 10 would save every
tenth transient point, thus reducing file size by a factor of 10.

Continuing a Stopped, Interrupted or Saved Simulation


If the Stop button is clicked, the simulation stops, and the solution is saved to the TransientAnalysis object just as if
the simulation had ended normally. The simulation can then be continued by creating a new transient object from the
stopped one:
>> tran2 = tran.add('Transient');
>> tran2.run();
The new object will not show the data that has already been simulated, as illustrated below:

Coventor, Inc. May 31, 2018 U2-63


Section 2: Using MEMS+ with MATLAB Version 6.3

The simulation can be extended by increasing the end time and continuing the simulation. Below the simulation con-
tinues until the released switch settles down:
>> tran3 = tran2.add('Transient');
>> tran3.Properties.TimeSpan.Values = [0 2e-3];
>> tran3.run()

If a simulation is interrupted with Ctrl+ C, it may be possible to continue the simulation, using the above procedure.
If you are continuing a transient loop in a for loop, e.g.
for i = 1:1000
tran = tran.add('Transient')
% .. adjust properties ..
tran.run
% filename Transient1.Transient1.Transient1.trans is too long and the script fails
end
the resulting filename may get too long, and the simulation will terminate. To avoid this situation, use
tran = tran.move('childOf', h.Analyses.DC1)
in order to shorten the result filename length.

U2-64 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

For information on how to troubleshoot a MATLAB transient simulation, see page U5-8.

2.4.6: Computing Pull-in and Release Hysteresis Curves


Computing pull-in and release voltages and the behavior of the device between those voltages is key to many MEMS
designs. This section describes the various techniques to compute this behavior within the MEMS+-for-MATLAB
environment. The best technique is design dependent.
A summary of the three techniques is provided here, with more details on each technique in the sections that follow.
 DC Sweep Analysis: easy to set up and interpret, but can fail to find a solution after pull-in or release

M
 Pullin Analysis: easy to set up, captures multiple pull-in/release and hidden states, requires effort to interpret
results (this is the recommended technique)
 Slow Transient Analysis: requires effort to set up, usually solves, but can have transient artifacts

DC Sweep
In “Creating and Running an Analysis” on page U2-22, the following script was used to sweep the voltage in 0.5 volt
steps from 0 to 20 volts:
dcsweep = dc.add('DCSweep');
dcsweep.Properties.SweepSource = 'ActuationElectrode';
dcsweep.Properties.SweepSource.ActuationElectrode = 'SweepValues';
dcsweep.Properties.SweepSource.ActuationElectrode.SweepValues.Values = [0:0.5:20];
dcsweep.run();
dcsweep.Result.Outputs.print();
dcsweep.Result.Outputs.plot('P_');
xlabel('Voltage');
ylabel('Displacement (um)');
The position of the tip of the switch showing pull-in between 15 and 15.5 volts is below:

The script succeeded, but with other designs, the maximum solver iterations may need to be increased from the
default value of 100 because near pull-in, the solver may need more than the default 100 iterations to converge.
To compute a full pull-in hysteresis curve, you can specify up and down values:
dcsweep1 = dc.add('DCSweep');
dcsweep1.Properties.DCSolverSettings.MaximumNumberOfIterations = 200;

Coventor, Inc. May 31, 2018 U2-65


Section 2: Using MEMS+ with MATLAB Version 6.3

dcsweep1.Properties.DCSolverSettings.Tolerances.RelativeTolerance = 1e-04;
dcsweep1.Properties.SweepSource = 'ActuationElectrode';
dcsweep1.Properties.SweepSource.ActuationElectrode = 'SweepValues';
dcsweep1.Properties.SweepSource.ActuationElectrode.SweepValues.Values = [0:0.15:20,
20:-0.15:0];
dcsweep1.run();
dcsweep1.Result.Outputs.plot('P_');
xlabel('Voltage');
ylabel('Displacement (um)');
Note that with this simulation, you have to increase the DC solver iterations and reduce the relative tolerance.

Figure 2-13 Hysteresis Plot Results

The plot shows that pull-in occurs around 15 V, and release occurs around 14.9. These results can be viewed in
MEMS+ Scene3D:

Figure 2-14 Hysteresis 3_D Results

U2-66 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

As a side note, it is recommended that the MATLAB plot commands be used to plot individual displacements and
rotations for hysteresis curves rather than the Scene3D plotting tools. Also note that the Scene3D animation slider
cannot be used to move the animation frame to an arbitrary voltage in the sweep because the hysteresis curve is multi-
valued for a given voltage. Instead use the Play, Backward One Frame and Forward One Frame controls. The Show
Each Simulation Point option is recommended as well.
The above example highlights the simplicity of setting up the DC sweep. If you have difficulties attaining the
expected results, first try increasing the number of iterations. Second, try reducing the relative tolerance.

Pull-in Analysis
This section describes the pull-in analysis functionality that computes pull-in and release voltages and the behavior of
the device between and beyond those voltages. It avoids the challenges of a DC sweep by using an independent vari-
able, assigned the name of lambda, to follow the curve of solutions to force balance rather than compute the solution

M
to force balance at given voltages. Pull-in analysis will almost always compute the first pull-in and release voltages
with the default settings. Secondary pull-in and release may require changing settings as will be described below. For
background information on the pull-in analysis, see page R5-17 of the MEMS+ Compact Modeling Reference.
To demonstrate calculating the first pull-in and release, we will use the RF Switch tutorial in the Examples directory
of the MEMS+ installation.
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');
dc = h.Analyses.add('DC');
dc.run();

pullin = dc.add('PullIn');
% Sweep variable is generic 'lambda' and V_ActuationElectrode = lambda
pullin.Properties.ExposedConnectorsValues.ActuationElectrode = 'lambda';
pullin.Properties.ArcLengthContinuation.LambdaDomain.InitialValue = 0; % start here
pullin.Properties.ArcLengthContinuation.LambdaDomain.MaximumValue = 50;
pullin.Properties.ArcLengthContinuation.LambdaDomain.MinimumValue = 0;
pullin.run();
% Plot results in the same plot window
subplot(2,1,1), pullin.Result.States.Actuation_Pad_Center_z.plot();
subplot(2,1,2), pullin.Result.States.Beam_Tip_z.plot();
The script generates the following figures from which pull-in can be identified:

Collapse onto
Pull-in
actuation electrode

Full release

Beam_Tip/z is a point on the beam tip and Actuation_Pad_Center/z is a point on the actuation electrode. Wherever
the curve has an infinite slope is an instability, and the first instability is pull-in.
Continuing to trace the curve beyond the sharp corner at release may require tuning the parameters so the simulator
more precisely follows the curve. One way to accomplish this is to define step size\minimum and maximum values.

Coventor, Inc. May 31, 2018 U2-67


Section 2: Using MEMS+ with MATLAB Version 6.3

Reducing the relative tolerance allows less error in finding a solution for each point along the curve. For more infor-
mation on the Pull-In analysis parameters, see page R5-19 of the MEMS+ Compact Modeling Reference.

Sweep Variable Lambda


Pull-in analysis can be used for arbitrary instabilities other than pull-in, such as buckling. The sweep variable thus is
generically called lambda, and the inputs to the MEMS+ design are specified as functions of lambda. For instance,
in the example above:
pullin.Properties.ExposedConnectorsValues.ActuationElectrode = 'lambda';
sets the voltage on the actuation electrode equal to lambda. At least one exposed connector must be set to the
lambda value. The profile created by lambda is then applied to the exposed connector. This functional means of
applying voltages allows the sweeping multiple voltages at once. For instance,
pullin.Properties.ExposedConnectorsValues.ActuationElectrode = 'lambda';
pullin.Properties.ExposedConnectorsValues.OtherElectrode = '-lambda';
would sweep equal and opposite voltages on ActuationElectrode and OtherElectrode. For more information on the
lambda, see page R5-17 of the MEMS+ Compact Modeling Reference.

Viewing Settings
As with other objects, typing just the name of the MATLAB variable for the object will show its properties. Below we
show the result for the object from the first run of this section and are primarily the default settings.
>> pullin

pullin =

PullIn named PullIn1 with properties:


Instabilities: [14.9590 14.9104 35.1449 34.9480 40.7577 7.1788 12.8935 12.4268]
Result: [1x1 cov.memsplus.Result]
Contributions: [1x1 cov.memsplus.Contributions]
saveContributions: 0
Verbose: 1
Name: 'PullIn1'
Type: 'PullIn'
Parent: [1x1 cov.memsplus.AnalysisItemWithData]
Document: [1x1 cov.memsplus.Simulation]
Properties: [1x1 cov.memsplus.CompositePropertyElement]
Some of these settings are common to all Analysis objects and have been described previously. Next we describe the
settings that are of interest for use in a pull-in analysis.

Specifying How to Start and End a Pull-in Analysis


Starting and Stopping Based on the Value of Lambda
The lines below show how to start tracing the force balance curve at lambda = 5 and stop when lambda crosses
through 0 or 50:
pullin.Properties.ArcLengthContinuation.LambdaDomain.InitialValue = 5;
pullin.Properties.ArcLengthContinuation.LambdaDomain.MaximumValue = 50;
pullin.Properties.ArcLengthContinuation.LambdaDomain.MinimumValue = 0;
By default, InitialValue = 0 and MinimumValue = 0. If InitialValue is given a non-zero value as in
the lines above, then the DC Analysis used in the creation of the pull-in analysis should have voltages that correspond
to the value of InitialValue. For instance, for the above example with InitialValue = 5, the DC should
be set as follows:
dc = h.Analyses.add('DC')
dc.Properties.ExposedConnectorsValues.ActuationElectrode = 5
dc.run();

pullin = dc.add('PullIn');
...

U2-68 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Setting the Starting Direction


By default the force balance curve is initially traced in the direction of increasing lambda. To initially trace the curve
backwards, use
pullin.Properties.ArcLengthContinuation.LambdaDomain.ReverseInitialDirection = true;

Controlling Step Sizes


The analysis attempts to step along the solution curve with as large a step as possible to save computation time. The
step is measured as the change, ds, in the length, s, along the solution curve. The length is measured in the multi-
dimensional space of all the degrees of freedom in the system. The default maximum step size is 3 to restrict the
solver from taking such large steps that it misses important behavior. The value of 3 can be too conservative or too
liberal depending on the design and can be modified to improve performance. To modify the first step taken, set the
StepSize.InitialValue property. To set the maximum allowed step for the entire simulation, set the Step-

M
Size.MaximumValue property. For example:
pullin.Properties.ArcLengthContinuation.StepSize.InitialValue = 10;
pullin.Properties.ArcLengthContinuation.StepSize.MaximumValue = 10;
Other factors can limit the step size as well which will be described below.

Controlling Solution Accuracy


The solution for each value of lambda is computed with a certain accuracy governed by these parameters:
 pullin.Properties.ArcLengthContinuation.Corrector.MaximumNumberOfIterations
 pullin.Properties.ArcLengthContinuation.Corrector.AbsoluteForceTolerance
 pullin.Properties.ArcLengthContinuation.Corrector.AbsolutePositionTolerance
 pullin.Properties.ArcLengthContinuation.Corrector.RelativeTolerance
The settings are identical to those found in the MEMS+ Simulator Pull-In Analysis Properties dialog; see page R5-17
of the MEMS+ Compact Modeling Reference for details.

For information on how to troubleshoot a Pull-In analysis, see page U5-6.

Monitoring Simulation Progress


MATLAB pull-in, nonlinear AC, and frequency hysteresis now use the same simulation algorithms as the MEMS+
Simulator analyses with the same names. Because of this change, the ability to plot the evolution of a selected DOF
during an analysis is no longer available. If you would like to visualize the simulation progress, load the partial result
file in Scene3D, plot the desired DOF, and then periodically refresh.
In MATLAB, you can plot results with a command:
hResult = cov.memsplus.Result('myPullInResultFile.dc'); hResult.States.MyDOFOfIn-
terest.plot

Coventor, Inc. May 31, 2018 U2-69


Section 2: Using MEMS+ with MATLAB Version 6.3

Slow Transient Analysis to Determine Pull-in and Release


The third technique for finding instabilities is to run a transient analysis with a slowly varying stimulus. The first
example in Section 2.4.5 demonstrated determining pull-in with this approach. To determine more than the first insta-
bility, a slowly increasing and then decreasing voltage could be applied using a piecewise-linear source, as demon-
strated below:
% Open RFSwitch tutorial design and compute static deflection
h = cov.memsplus.Simulation('RFSwitch_prebuilt.3dsch');

h.Variables.beta = 1e-06;

dc = h.Analyses.add('DC');
dc.run();

% Make a Coventor Piecewise-linear source and plot the function for confirmation
p = cov.memsplus.sources.pwl([0 20 40],[0 20 0]);
fplot(p.func,[0 40]);

Figure 2-15 Piecewise Linear Source

Note that we are increasing the value of the beta variable because we are running a slow transient analysis. The goal
of a slow transient analysis is to simulate the quasi-static state; thus, inertial effects are not wanted and can be damped
out by increasing the beta value (Rayleigh damping).

% Create and set up a transient analysis


tran = dc.add('Transient'); % Make a TransientAnalysis object starting at DC
tran.Properties.TimeSpan.Values = ([0 40])
tran.Properties.ExposedConnectorsValues.ActuationElectrode = p; % apply pwl source
to the electrode

% optionally specify signals to plot while the simulation runs


tran.setInputToPlot('ActuationElectrode');
tran.setOutputToPlot('P_Beam_Tip_z');

tran.run(); % run the transient

U2-70 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Figure 2-16 Transient Analysis with Piecewise Linear Source

M
The curves above show pull-in around 15 seconds, which corresponds to 15 volts. And release is around 25 seconds,
which is around 15 volts. The raw data can be extracted to plot a typical hysteresis curve:
z = tran.Result.Outputs.P_Beam_Tip_z.Values;
v = tran.Result.Inputs.V_ActuationElectrode.Values;
plot(v,z);

The MATLAB data tips have been added above to show the pull-in and release voltages of 14.04 and 14.96, respec-
tively, which correspond well to the values determined in the previous section.
Note that at release, the tip overshot its steady-state value and then oscillated at its resonance frequency. This can be
seen by zooming in to the region around release on the original transient result of Figure 2-16:

Coventor, Inc. May 31, 2018 U2-71


Section 2: Using MEMS+ with MATLAB Version 6.3

Figure 2-17 Zoomed View of Transient Results

The overshoot makes the hysteresis curve misleading but even worse, it can make the simulation take unnecessarily
long to complete, especially for more complex designs. This transient behavior is not of interest for determining static
instabilities, so damping can be added to the design to eliminate these oscillations. Because this is a slow transient,
damping well above what is physical can be set. To that end, we can increase the Rayleigh damping beta coefficient
to 1e-5:
h.Variables.beta = 1e-05;

dc = h.Analyses.add('DC');
dc.run();

% Make a Coventor Piecewise-linear source and plot the function for confirmation
p = cov.memsplus.sources.pwl([0 20 40],[0 20 0]);
fplot(p.func,[0 40]);

% Create and set up a transient analysis


tran = dc.add('Transient'); % Make a TransientAnalysis object starting at DC
tran.Properties.TimeSpan.Values = ([0 40])
tran.Properties.ExposedConnectorsValues.ActuationElectrode = p; % apply pwl source
to the electrode

% optionally specify signals to plot while the simulation runs


tran.setInputToPlot('ActuationElectrode');
tran.setOutputToPlot('P_Beam_Tip_z');

tran.run(); % run the transient

z = tran.Result.Outputs.P_Beam_Tip_z.Values;
v = tran.Result.Inputs.V_ActuationElectrode.Values;
plot(v,z);
And rerun this simulation. The result is a much faster simulation and a cleaner result without overshoot:

U2-72 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

M
The pull-in and release voltages are different compared to the results with the 1e-06 beta value. Zooming in to when
the release first occurred and turning on symbols we see

Note that the simulator took very few time steps in this very important region. Tightening the relative tolerance forces
the simulator to more carefully navigate this region and produces pull-in and release voltages that match the pull-in
and release voltages computed in Pullin Analysis of the previous section:
tran.Properties.Tolerances.RelativeTolerance = 1e-5;
tran.run();

Coventor, Inc. May 31, 2018 U2-73


Section 2: Using MEMS+ with MATLAB Version 6.3

Increased damping can make the simulation take much less time, however, too much damping will slow the motion at
the instabilities making it difficult to determine the voltage of the instability. For instance, if the Rayleigh damping
beta property is further increased to 1e-2, the simulation finishes very quickly. However, there is no longer a vertical
drop at pull-in, so it is not clear where to probe the curve or whether there is even an instability at all.

Figure 2-18 Rayleigh Damping b = 1e-02

U2-74 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

2.4.7: Nonlinear Frequency Hysteresis (Duffing)


The frequency response of a MEMS device under some desired excitation is a key tool in understanding device per-
formance. Typically, it is assumed that the excitation is sufficiently small that the device remains within its linear
regime, and therefore, the amplitude of the response is proportional to the excitation. This is the assumption when
simulating harmonic response in CoventorWare's Analyzer tool, or AC analysis in MEMS+. However, in several
MEMS applications, the amplitude of motion is large enough that this assumption is violated either by the strong non-
linearity of the electrostatic force, which varies like 1/(g -x)2 where g is the gap and x is the displacement, or by the
nonlinearity in beam bending. Figure 2-19 shows how the frequency response can vary for large amplitude motion of
the device in the Gyroscope Tutorial:

Figure 2-19 Frequency Response with Large Amplitude Motion

M
The x-axis is the frequency, and the y-axis is the amplitude of motion of the proof mass in the y-direction. Each curve
is for different amplitudes of voltage applied to the combs. As the amplitude grows, two effects occur: First, the
device appears to stiffen because the peak frequency gets larger; this stiffening is consistent with stress stiffening
from large amplitude beam bending. Second, the curves starts to look like a breaking ocean wave for the larger ampli-
tudes, which describes a hysteresis effect. For frequencies underneath the breaking wave, there is more than one pos-
sible amplitude of oscillation. The actual amplitude of oscillation depends on the path to reach the frequency in the
multi-valued region. If the frequency is increased from a low frequency to a frequency in the multi-valued region, the
highest amplitude of motion will be realized. If the frequency is decreased from a frequency higher than the multi-
valued region, the lowest amplitude will be realized. Predicting this response is important to the design of devices
meant to operate in or avoid this multi-valued region.

Computing the Hysteresis Curves


The MEMS+ frequency hysteresis analysis can predict the nonlinear response shown above. Starting from an initial
frequency, frequency hysteresis analysis computes the hysteresis curve by following the solution curve in the fre-
quency domain. It is similar to the pull-in analysis, except for pull-in, the x-axis is voltage while here it is frequency.
Thus, settings for frequency hysteresis are nearly identical to those for pull-in analysis.
To demonstrate, the Gyroscope Tutorial beams, which are modeled as linear elements, must be changed to nonlinear.
In addition, the Rayleigh damping, which uses a negative damping coefficient, must be modified. The modifications
can be done in the MEMS+ user interface or from within MATLAB. Below is a MATLAB script that finds all beams
of type Beam in the Beams_prebuilt.3sch subschematic, and changes their model type to nonlinear. It then updates
the master Gyroscope_prebuilt.3dsch to use the nonlinear beams subschematic. It also changes the Rayleigh damping

Coventor, Inc. May 31, 2018 U2-75


Section 2: Using MEMS+ with MATLAB Version 6.3

to have only non-negative coefficients while preserving Q = 1500 for the mode of interest:
% Change all components of type Beam to nonlinear
d = cov.memsplus.Schematic('Beams_prebuilt.3dsch');
%
% Get all objects of the type Beam
objects = d.Components.filterByType('^Beam$');

% Loop over all Beam components, and change to nonlinear


for i = 1:length(objects)
objects(i).Properties.ModelType = 1;
end

% Save under new name


d.save('Beams_nonlinear.3dsch');

% Print differences to transcript window to confirm changes


d_orig = cov.memsplus.Schematic('Beams_prebuilt.3dsch');
d_orig.compareTo(d);

h = cov.memsplus.Schematic('Gyroscope_prebuilt.3dsch');
objects = h.Components.filterByType('^SubSchematic$');
for i = 1:length(objects)
objects(i).Properties.SchematicFile = 'Beams_nonlinear.3dsch';
end

% Change Rayleigh damping to have only positive coefficients and preserve


% Q of first mode
h.Components.Properties.RayleighDamping.a.set(0);
h.Components.Properties.RayleighDamping.b.set(1.5137e-08);

% Rerun the Wizard to connect new subschematics to Rigid Plate


h.applyWizardActions;
h.save('Gyroscope_nonlinear.3dsch');
More explanation of the above script can be found in “MATLAB Scripting Examples” on page U2-84. See also the
Examples section on page U2-84.
The following lines demonstrate generating the curve for an AC magnitude of 2:
%% Run Analyses on new 3dsch
hh = cov.memsplus.Simulation('Gyroscope_nonlinear.3dsch');
dc = h.Analyses.add('DC');
dc.Properties.ExposedConnectorsValues.Esensing = 0.1;
dc.Properties.ExposedConnectorsValues.Ecombbottom = 14.3;
dc.Properties.ExposedConnectorsValues.Ecombtop = 14.3;
dc.Verbose = 0;
dc.run();

modal = dc.add('Modal');
modal.run();

% Freq range: Primary mode of interest +- 60 Hz


f0 = transpose(modal.Result.Outputs.Frequencies.Values(1)); % 6866 Hz
firstFreq = f0 - 60;
lastFreq = f0 + 60;

acMag = 2; % 2 volts on the combs as in Gyro tutorial

% Solve for first frequency point


hyst = dc.add('FrequencyHysteresis');

%Specify a non-zero phase angle using complex number


hyst.Properties.ExposedConnectorsValues.Ecombbottom.Magnitude = -acMag*exp(sqrt(-1)*0/180*pi);
hyst.Properties.ExposedConnectorsValues.Ecombtop.Magnitude = acMag*exp(sqrt(-1)*0/180*pi);
hyst.Properties.NumberOfHarmonics = 5;

% Compute hysteresis curve starting at first frequency

U2-76 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

hyst.Properties.ArcLengthContinuation.FrequencyDomain.InitialFrequency = firstFreq;
hyst.Properties.ArcLengthContinuation.FrequencyDomain.MinimumFrequency = firstFreq;
hyst.Properties.ArcLengthContinuation.FrequencyDomain.MaximumFrequency = lastFreq;
hyst.run();

figure;
hyst.Result.States.M1_y.plot();

% Report results
fprintf('First Resonance: %g, Q=%g\n',modal.Result.Outputs.Frequencies.Val-
ues(1),modal.Result.Outputs.Q.Values(1));
fprintf('Instability Frequencies for amplitude 3:\n');
hyst.Instabilities;
which creates the following plot:

M
Figure 2-20 With AC Magnitude = 2

And prints this at the end:


First Resonance: 6870.22, Q=1530.38
Instability Frequencies for amplitude 3:

ans =

1.0e+03 *

6.8791 6.8763

Max freq is: 6878.950024


The script above uses a modal analysis to find the small-signal resonant frequency and sets the frequency range to be
60 Hz above and below that frequency. The frequency hysteresis then computes the first frequency 60 Hz below the
resonance. The amplitude of the sinusoidal stimuli at this frequency is set to -2 and 2 on the two comb electrodes,
which is similar to the stimuli in the gyroscope tutorial in order to excite the resonance. Because the system is nonlin-
ear, the stimuli at a single frequency will generate a displacement response that includes that frequency, f, as well as
its higher harmonics, 2f, 3f, 4f, etc., and a DC component. The number of harmonics for this computation was limited
to 5. A higher number of harmonics can increase accuracy at the cost of computation time.
The y-displacement (M1_y) is chosen as the value to plot. The resulting harmonics are shown on the right of Figure
2-20. Only the odd harmonics, f, 3f, 5f, are significant. The dominance of the odd harmonics is consistent with the
stress stiffening nonlinearity, which is an odd function (f(x) = -f(-x)).

Coventor, Inc. May 31, 2018 U2-77


Section 2: Using MEMS+ with MATLAB Version 6.3

Starting a Transient Analysis from a Hysteresis Result


In the gyroscope tutorial, the transient analysis was started from the sinusoidal steady-state computed by an AC anal-
ysis. Starting from an AC result eliminates the unnecessary simulation needed to achieve transient steady-state. If,
however, nonlinearity creates significant harmonics not captured by AC analysis, then the transient will not start in its
true steady-state. For example, the beginning 4 ms of the gyroscope tutorial's transient analysis (see “Transient Anal-
ysis” on page T2-48 of the MEMS+ Tutorials) is shown below:

This portion of the simulation is before any angular rate is applied and thus every signal should be in its steady-state.
From the figure above, the drive mode, M1/y, is clearly in its steady-state; however, the sense mode, M1/z and thus
the capacitance as well, appear to contain a second frequency in addition to the drive frequency. Because AC analysis
only computes the content at the drive frequency, these signals cannot possibly be at their steady-state.
If determining the true, nonlinear sinusoidal-steady-state is desired, the hysteresis analysis of this section should be
used to initiate the transient instead of an AC analysis. To do so, first we look at the harmonic content of M1/z with
hyst.Result.States.M1_z.plot();

U2-78 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Figure 2-21 Harmonics of M1/z

M
Note that the dominant harmonics are now the even harmonics (2, 4). This is because the levitation force that moves
the device in the z-direction is a nonlinear even function of the drive amplitude, i.e., f(y) = f(-y), which is described
more below. To see the impact on the initial cycles of the transient analysis, the script below starts a transient analysis
from the peak frequency of the first hysteresis analysis done above:

% Get the peak amplitude (maxIndex)


[maxY,maxIndex] = max(abs(hyst.Result.States.M1_y.Values(:, 2)));
maxFreq = hyst.Result.XValues(maxIndex);
fprintf('Max freq is: %f\n', maxFreq); %6878.950037

% Copy the operating point of the maximum amplitude (maxIndex)


% CopyOperatingPoint is a user-defined analysis (see section 2.4.8 of MEMS+ User
Guide).
% Like AlterOperatingPoint, it can take arbitrary inputs and state values and start
another analysis from these values.
% If you want to alter a large number of states, it may be much more efficient to use
CopyOperatingPoint instead of AlterOperatingPoint.
% This file is located in ../runtime/matlab/+cov/+memsplus/CopyOperatingPointItem.m
%
% Here we are taking the states corresponding to the maximum amplitude of M1_y
attained in the frequency hysteresis.
% Then we start a transient analysis from this state
op = hyst.add('CopyOperatingPoint');
op.Inputs = abs(sum(hyst.Result.Inputs.Values(:, maxIndex, :), 3));
op.States = abs(sum(hyst.Result.States.Values(:, maxIndex, :), 3));
% Execute the analysis in order to enable child analysis recover the inputs and
states set above.
op.run();
% Start a transient from the peak amplitude
tranhyst = op.add('Transient');
tranhyst.Properties.ExposedConnectorsValues.Ecombbottom = ...
@(t) dc.Properties.ExposedConnectorsValues.Ecombbottom.get() ...
- acMag*sin(2*pi*maxFreq*t);
tranhyst.Properties.ExposedConnectorsValues.Ecombtop = ...
@(t) dc.Properties.ExposedConnectorsValues.Ecombtop.get() ...
+acMag*sin(2*pi*maxFreq*t);
tranhyst.Properties.TimeSpan.Values = [0 4e-3];
tranhyst.setInputToPlot('avx');
tranhyst.setStateToPlot('M1/y');
tranhyst.setStateToPlot('M1/z');

Coventor, Inc. May 31, 2018 U2-79


Section 2: Using MEMS+ with MATLAB Version 6.3

outNames = h.Analyses.getOutputNames();
tranhyst.setOutputToPlot(outNames{1}); % Cap1_E6Esensing
tranhyst.run();
which generates the plot below:

Figure 2-22 Transient Analysis Started from Peak Frequency

Now it is clear M1/z and the capacitance are in their steady-state, which is at twice the frequency of the drive as
expected because the second harmonic is the dominant non-zero harmonic. To understand intuitively why the M1/z is
at twice the drive, note that the levitation force is always positive and grows significantly as each set of comb fingers
increases its overlap with the electrode underneath. This overlap occurs twice per drive cycle: once for positive M1/y
as the top comb overlap increases, and again for negative M1/y as the bottom comb overlap increases. Because this
positive force occurs twice per cycle, M1/z will be at twice the drive frequency.

Vary Analysis with Frequency Hysteresis


The script below demonstrates how to vary the beam widths of gyroscope tethers, run a frequency hysteresis for each
value, and then plot the harmonics for each run. We use a simplified version of the script used in the first frequency
analysis:
h = cov.memsplus.Simulation('Gyroscope_nonlinear.3dsch');
vary = h.Analyses.add('Vary');
vary.Properties.VariableSelectionList = 'Beam1_Width';
vary.Properties.VariableSelectionList.Beam1_Width.LinearByNumberOfSteps.StartValue = 7;
vary.Properties.VariableSelectionList.Beam1_Width.LinearByNumberOfSteps.EndValue = 9;
vary.Properties.VariableSelectionList.Beam1_Width.LinearByNumberOfSteps.NumberOfPoints =3;
dc = vary.add('DC');
dc.Properties.ExposedConnectorsValues.Esensing = 0.1;
dc.Properties.ExposedConnectorsValues.Ecombbottom = 14.3;
dc.Properties.ExposedConnectorsValues.Ecombtop = 14.3;
hyst = dc.add('FrequencyHysteresis');
hyst.Properties.ExposedConnectorsValues.Ecombbottom.Magnitude = 2;
hyst.Properties.ExposedConnectorsValues.Ecombtop.Magnitude = -2;
hyst.Properties.ArcLengthContinuation.FrequencyDomain.InitialFrequency = 6500;
hyst.Properties.ArcLengthContinuation.FrequencyDomain.MaximumFrequency = 7500;
vary.run()
figure('units','normalized','outerposition',[0 0.1 1 0.9])

U2-80 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

for i = 1:3;
vary.DC1.FrequencyHysteresis1.Result(i).States.M1_y.plot();
hold on;
end
% Set legend and legend handle
hleg = legend('Vary1\_Harmonic1', 'Vary1\_Harmonic2', 'Vary1\_Harmonic3', 'Vary2\_Har-
monic1', 'Vary2\_Harmonic2', 'Vary2\_Harmonic3', 'Vary3\_Harmonic1', 'Vary3\_Harmon-
ic2', 'Vary3\_Harmonic3');
% Set legend font and location
set(hleg,'FontSize',8, 'Location','northeast')

M
Modifying Settings
Frequency hysteresis has the settings AbsoluteForceTolerance, RelativeTolerance, MaximumNum-
berOfIterations, MaximumLengthOfStateVector, and MaximumNumberOfIterations, which
operate identically to those in the pull-in analysis. Please see “Pull-in Analysis” on page U2-67 for details on these
settings.

2.4.8: User-Defined Custom Analyses in MATLAB


To perform an advanced operation with the entire state vector and system matrices, you must define your own custom
analysis. The first step in creating a custom analysis is to define your own MATLAB class deriving from cov.mem-
splus.CustomAnalysisItem. Once you have this analysis available on your MATLAB path, you can nest it
under any MEMS+ analysis using the command
myAnalysis = dc.add('ExampleCustomAnalysis');
You must also define a function called computeCallback, which will be called when you issue the command
myAnalysis.run(). Please refer to the //runtime/matlab/+cov/+memsplus/CustomAnalysisItem.m and //runtime/
matlab/+cov/+memsplus/SystemMatricesInterface.m for the list of functions available inside the computeCall-
back.
Below is a simple example:
classdef ExampleCustomAnalysis < cov.memsplus.CustomAnalysisItem
methods
function obj = ExampleCustomAnalysis(parent, document, itemDisplayName, internalName)
obj@cov.memsplus.CustomAnalysisItem(parent, document, itemDisplayName, internalName);
obj.method('setCustomAnalysisParameters',...
'trans',... % Result file extension
'phase,rad,float',... % Name, unit and type of the first column in result files
false); % Should operate on complex values?

Coventor, Inc. May 31, 2018 U2-81


Section 2: Using MEMS+ with MATLAB Version 6.3

end
end

methods (Hidden)
function computeCallback(obj)
obj.preCompute(); % Required

[states, inputs] = obj.getSystemOperatingPoint();


outputs = zeros(obj.getNumOutputs(), 1);
obj.setSystemResultPoint(states, inputs, 0);
obj.writeResultLine(states, inputs, outputs, 1);

obj.postCompute(); % Required
end
end
end

2.4.9: Creating a Reduced-Order Model


The MEMS+ Simulator tool has a Model Reduction functionality that can be used to create a reduced-order model for
analysis in Simulator or MATLAB scripting or for export to Verilog-A or MROM file format. This reduced-order
model is a low-order polynomial version of the MEMS+ schematic and will simulate faster than the full model. The
exported model can be analyzed in third-party simulation software, such as Virtuoso/Spectre, MATLAB, or MAT-
LAB Simulink. This export function can also be included in a script, as outlined below.
The ModelReduction object is created using the following command:
rom = h.Analyses.add('ModelReduction');
The export format can be selected using the command
rom.Properties.ExportToFormat = 'MROM';
or
rom.Properties.ExportToFormat = 'VerilogA';
Note that the default export format is MROM. To run any analysis on the ROM in MATLAB, it must be in MROM
format.
To specify a meaningful name for the exported model:
rom.item.rename('file_name');
For example, for the DoubleMassGyro.3dsch, we specify
h = cov.memsplus.Simulation('DoubleMassGyro.3dsch')
rom = h.Analyses.add('ModelReduction');
rom.Properties.ExportToFormat = 'MROM';
rom.rename('electricalOrder2_withACNonlinearity');
In this case the resulting file will be named DoubleMassGyro.electricalOrder2_withACNonlinearity.mrom.
To specify the modes that need to be preserved in the reduced model, use
rom.Properties.ModelReduction.PreservedModes = 2;
rom.Properties.ModelReduction.PreservedModes.Values{1}.TargetFrequency = 15347
rom.Properties.ModelReduction.PreservedModes.Values{2}.TargetFrequency = 15940
To set a Q factor:
rom.Properties.ModelReduction.PreservedModes.Values{i}.QFactor = Qvalue
where index number is the number of the target frequency (for our example, it would be 1 or 2).
To create the reduced-order model, execute the run() command:
rom.run();

U2-82 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Add Analysis to Reduced-Order Model


Users can run an analysis on a reduced-order model by adding the analysis to the reduced-order model object. For
example, to add a DC analysis:
dc_ROM = rom.add('DC');
dc_ROM.Properties.ExposedConnectorsValues.Comb_Inner = 14.7;
dc_ROM.Properties.ExposedConnectorsValues.Comb_Outer = 14.7;
dc_ROM.Properties.ExposedConnectorsValues.Sense_Left = 0.1
dc_ROM.Properties.ExposedConnectorsValues.Sense_Right = 0.1
dc_ROM.Verbose = 0;
dc_ROM.run()
dc_ROM.getInfo
Note that the analysis nested directly under the Model Reduction entry does not inherit the exposed connector values
from the Model Reduction, so they must be set.

M
Users can add a DC, DCSweep, or Modal analysis to a Model Reduction object. Analyses can also be nested under
the DC and DCSweep objects nested under the Model Reduction object. The results for these analyses can be loaded
into MEMS+ Scene3D.

Reduced-order models do not include contact models, so they cannot be used to model pull-in and lift-off
phenomena.

2.5: Utility Functions


The cov.memsplus.utilities class contains some useful functions, some of which are documented below.
For a complete list of functions, see //CoventorMP1.1/MEMS+6.3/runtime/matlab/+cov/+memsplus/+utilities. Each
function script includes a brief description of its functionality.
 cov.memsplus.utilities.assertCompatibleMatlabVersion: Checks the version of MAT-
LAB that you are using and throws an exception if it is not supported.
 cov.memsplus.utilities.codeUpdater: Updates the MATLAB scripts to the latest version of
MEMS+ for MATLAB syntax.
 cov.memsplus.utilities.deleteSimulationFiles: Recursively removes all the MEMS+
simulation files from the current MATLAB directory and its subdirectories.
 cov.memsplus.utilities.enableMixedJacobian: Enables the use of the analytical Jacobian
matrix for MEMS+ models in Simulink.
 cov.memsplus.utilities.findSimilarModes: Compares the results of two specified modal
analyses and calculates the mapping between the modes.
 cov.memsplus.utilities.getAbsolutePath: Returns an absolute path to the specified file name
or file path that is in the user’s MATLAB path.
 cov.memsplus.utilities.getPositionOfMechanicalConnector: Returns the coordinates
of the specified Innovator mechanical connector.
 cov.memsplus.utilities.python: Enables the calling of Python code from MATLAB.
 cov.memsplus.utilities.rdir: Recursively lists all files of the specified type. For example,
cov.memsplus.utilities.rdir ('*.3dsch') returns a list of all the schematic files in the active
directory.
 cov.memsplus.utilities.SystemInfo: Collects the information about MEMS+ for MATLAB
configuration.
 cov.memsplus.utilities.updateMEMSpFiles: Updates all MEMS+ documents in the active
directory in a batch.

Coventor, Inc. May 31, 2018 U2-83


Section 2: Using MEMS+ with MATLAB Version 6.3

2.6: MATLAB Scripting Examples


Full examples showing multiple analyses and other features not demonstrated here are available in the Examples
directory of the MEMS+ installation. The following scripts are included in the MEMS + distribution:
 RFSwitch.m, which is located in \CoventorMP1.1\Examples\RFSwitch: Many of the scripting examples in
this section were taken from this script. It includes pullin, liftoff, modal, harmonic, parametric study, and
transient analyses, as well as damping analysis with the a damped version of the RF Switch.
 RFSwitch_ForceContributions.m, which is located in \Coventor\MEMS+6\Examples\RFSwitch: This script
demonstrates how to recover reaction forces and to extract component force contributions on mechanical
nodes in order to verify force balance.
 Gyroscope.m file, located in \CoventorMP1.1\Examples\Gyroscope: This script demonstrates how to run a
number of simulations from the Gyroscope Tutorial in the MATLAB scripting interface, including pullin,
levitation, modal analysis, and transient analysis from a steady state.
 deviceOnly.m and deviceWithPackage.m, located in \CoventorMP1.1\Examples\AccelerometerWithPack-
age:The first script evaluates the sensitivity of a two-axis accelerometer, and then the second script builds on
the first by simulating the packaging effects on zero-g offset of the two-axis accelerometer.
 DisplayMirror.m, located in \Coventor\MEMS+6.3\Examples\Display_Mirror: This script demonstrates how
to vary a variable in a simulation, and then run a transient analysis with the optimal value.
 parametricROM.m, located in \Coventor\MEMS+6.3\Examples\DoubleMassGyro: This script demonstrates
how to user MATLAB scripting to create a series of MROMs that have different thicknesses for the mechan-
ical deposition layer, and then use each MROM in the Simulink model, and run a transient analysis for each
thickness.

U2-84 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

2.7: Help
2.7.1: Help on Classes
In addition to this document, users can get help on the MEMS+ classes in the MATLAB console, by entering
doc cov.memsplus.ClassName
Use the TAB key after doc cov.memsplus. to select the desired class.
For a complete list of MEMS+ classes, enters
help cov.memplus
which displays the list of class with a brief description of each in the MATLAB console, as shown below:

Figure 2-23 MEMS+ Classes

M
Clicking on the class name will open more detailed documentation about the class.

2.7.2: Help on Objects


For help on the properties and methods available for a MATLAB object, enter objectName.details
For example, we created an object called dcsweep1:
dcsweep1 = dc.add('DCSweep');
dcsweep1.details
The MATLAB console returns:
cov.memsplus.AnalysisItemWithData handle with properties:

Result: [1x1 cov.memsplus.Result]


Contributions: [1x1 cov.memsplus.Contributions]
saveContributions: 0
Verbose: 1
Name: 'DCSweep1'
Type: 'DCSweep'
Parent: [1x1 cov.memsplus.AnalysisItemWithData]
Document: [1x1 cov.memsplus.Simulation]

Coventor, Inc. May 31, 2018 U2-85


Section 2: Using MEMS+ with MATLAB Version 6.3

Properties: [1x1 cov.memsplus.CompositePropertyElement]

Methods, Events, Superclasses


Clicking on Methods displays a list of available methods for that object.

2.7.3: MATLAB Help


To get help on MATLAB functionality, which is beyond the scope of the MEMS+ documentation, click on the Help
icon in the upper-right corner of the MATLAB console interface to open the Search function. The F1 key can be used
to open available documentation for the keyword that has the cursor focus in the console.

2.8: List of Available MATLAB Commands


This section includes a list of MATLAB commands specific to MEMS+. Where available, each entry also includes a
page number for more information about that command.

2.8.1: Memsplus
This class of commands is used to create and/or access MEMS+ documents.

Command Page

MaterialDatabase U2-4

Process U2-4

ComponentLibrary U2-4

Schematic U2-4

Simulation U2-8

Result U2-8

2.8.2: Document
The commands listed in this section can be used on any file created in MEMS+.

Command Page

save U2-9

saveAs U2-9

saveAsProject U2-9

saveAndOpenInMEMSp U2-10

exportZip U2-10

reload U2-10

compareTo U2-19

U2-86 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

2.8.3: Items

Command Page

add U2-14

delete U2-15

details U2-85

move U2-15

copy U2-15

rename U2-4

M
expose

unexpose

filterByType U2-13

filterByName U2-13

getChildrenNames U2-14

compareTo

getInfo U2-12

print U2-12

printWithProperties U2-12

update

2.8.4: Properties

Command Page

get U2-17

set

reset

getErrors U2-17

getChildrenNames U2-14

Parent U2-14

compareTo U2-21

update

Coventor, Inc. May 31, 2018 U2-87


Section 2: Using MEMS+ with MATLAB Version 6.3

2.8.5: Arrays

Command Page

Values

2.8.6: ComponentLibrary

Command Page

exportMPDK U2-10

2.8.7: Innovator
Schematic

Command Page

applyWizardActions U2-28

exportGDS U2-10

exportACIS U2-10

exportToCoventorWare U2-10

Components

Command Page

mirrorAboutLocalX

mirrorAboutLocalY

replicate

group

getMechanicalConnectors U2-17

getElectricalConnectors U2-17

getFluidicConnectors U2-17

getOutputs U2-17

importAsRigidPlate U2-7

importAsPolygonSegment U2-8

U2-88 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

Connectors / Port Connections

Command Page

InitialPosition U2-21

connect U2-22

disconnect U2-22

fix

release

M
getComponents U2-21

2.8.8: Simulator
Analyses

Command Page

run U2-22

runRecursively U2-32

setInputToPlot U2-61

setStateToPlot U2-61

setOutputToPlot U2-61

StopCondition U2-41

Verbose U2-28

Decimation U2-63

getInputNames U2-26

getUnprefixedInputNames U2-28

getStateNames U2-26

getOutputNames U2-26

getInputUnits U2-26

getStateUnits U2-26

getOutputUnits U2-26

getDisplacementStates

getVelocityStates

getMechanicalStates

getNumInputs

getNumStates

Coventor, Inc. May 31, 2018 U2-89


Section 2: Using MEMS+ with MATLAB Version 6.3

Command Page

getNumOutputs

getInputIndex U2-59

getStateIndex

getOutputIndex

Pull-in and Frequency Hysteresis

Command Page

Instabilities U2-67

Result

Command Page

openInMEMSp U2-10

Datasets
Datasets are result matrices, for example, dc.Result.States.

Command Page

Values U2-32

Units U2-32

nElements

nXValues U2-32

getValuesContaining U2-32

getIndicesContaining

print

Force Balance Contributions

Command Page

sum U2-39

get U2-39

print U2-37

U2-90 May 31, 2018 Coventor, Inc.


Section 2: Using MEMS+ with MATLAB Version 6.3

SystemMatrices

Command Page

getA

getB

getC

getD

getE

getY

M
getModelOutputsY

getModelOutputsC

getModelOutputsD

getRHS

getRHSReference

getRHSContributions

getRHSScaling

getStateScaling

2.8.9: Utilities

Command Page

assertCompatibleMatlabVersion U2-83

codeUpdater U2-1

deleteSimulationFiles U2-11

enableMixedJacobian U2-83

findSimilarModes U2-83

getAbsolutePath U2-83

getPositionOfMechanicalConnector U2-83

python U2-83

rdir U2-83

SystemInfo U2-83

updateMEMSpFiles U2-4

Coventor, Inc. May 31, 2018 U2-91


Section 2: Using MEMS+ with MATLAB Version 6.3

2.8.10: Access to CoventorWare

Command Page

system('filepath') U2-10

2.9: References
1 S. D. Senturia, Microsystem Design. Boston, MA: Kluwer Academic, 2000, p 134.

U2-92 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

Section 3: Using MEMS+ with Simulink

3.1: Importing a MEMS+ Model


Before you can import a MEMS+ model into the MathWorks Simulink, you must configure your Simulink installa-
tion to work with MEMS+. See page 4-1 of the MEMS+ Installation Instructions for more information.
After you have configured your Simulink installation to work with MEMS+, to import a MEMS+ model:
1. Open the Simulink Library Browser by clicking on the Simulink icon , or by typing simulink at the
MATLAB prompt.

M
2. In the Simulink Library Browser that opens, select the New Model icon. If you have configured Simulink cor-
rectly, a MEMS+ menu appears in the interface.
3. Select the MEMS+ > Import MEMS+ Model or use the Alt + I shortcut.
4. In the Open dialog, navigate to the location of the MEMS+ .3dsch file, click on the desired file to select, then
click on Open. The MEMS+ model will appear as a block with the MEMS+ logo. The block can then be
rotated, flipped, moved, and connected to other Simulink blocks.

3.1.1: Updating an Imported Model


If you have modified a MEMS+ schematic that is used in a Simulink model, it must be updated in Simulink:
 If you open a Simulink block diagram that contains a modified MEMS+ model, the interface detects that the
.3dsch source file has been changed in Innovator since the last session, and opens a dialog that prompts you
to update the model used in Simulink. If you want to keep the MEMS+ model as originally imported, click on
No. If you want to reimport the MEMS+ model so that the Simulink block diagram will have the latest
changes, click on Yes.
 If you modify a .3dsch file while the Simulink schematic is open, you can double-click on the MEMS+ mod-
els that you want to reimport, or select the Simulink MEMS+ > Update MEMS+ Models menu. Another
alternative is to use the Alt + U keyboard shortcut.

3.1.2: Opening Imported Model in MEMS+


After an Innovator schematic has been imported into Simulink, you can open it in MEMS+: select the generated block
in the Simulink diagram, and then select MEMS+ > Open Selected Model in MEMS+ (or use the Alt + M shortcut).
This command will open the schematic in the MEMS+ canvas so that you can visualize and modify the model. If you
make any modifications to the model in MEMS+, from the Simulink menu, select MEMS+ > Update MEMS+ Mod-
els.

3.1.3: Modifying the Path to the Model


You can see and change the location of the MEMS+ file used for a given Simulink block using MEMS+ document
location on the first tab of mask parameters dialog (shown below), which is opened by double clicking on the
MEMS+ block, or by right clicking on the block and selecting Mask > Mask Parameters.

Coventor, Inc. May 31, 2018 U3-1


Section 3: Using MEMS+ with Simulink Version 6.3

The document location can be specified as an absolute path or a path relative to the current MATLAB folder. If you
want to associate a Simulink block with another MEMS+ model, point the MEMS+ document location to the new
model location and name. After modifying the path to MEMS+ model, select MEMS+ > Update MEMS+ models
from the Simulink main menu, or use the keyboard shortcut Alt + U.
Only a valid MEMS+ document path will be effectively applied. Otherwise, an error message will appear, and the
previous MEMS+ document path will still be used.

3.2: MEMS+ Model Ports


The MEMS+ model symbol in Simulink includes pins that represent the electrical, mechanical, and capacitance ports
exposed in Innovator:
 Exposed electrical ports appear as voltage inputs.
 Exposed mechanical ports appear as force/torque inputs and position/angle variation outputs.
 Exposed capacitance ports are pure outputs.
Inputs and outputs in the Simulink integration are in SI units. The SI units for the input quantities are
 Acceleration is in meters/seconds2 (m/s2)
 Angular velocity is in radians/second (rad/s)
 Force is in Newtons (N)
 Voltage is in Volts (V)
 Torque is in Newton-meters (Nm)
 Pressure is in Newtons/meters2 (N/m2)
The SI units for the output quantities are
 Capacitance in Farads (F)
 Conductance in Siemens (S)
 Position in meters (m)
 Angle in radians (rad)
Figure 3-1 illustrates how electrical connectors, mechanical connectors, input pins, and output pins exposed in Inno-
vator are represented in an imported MEMS+ model in Simulink.

U3-2 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

Figure 3-1 MEMS+ Model Exposed Ports

M
The imported MEMS+ device model also has all the parameters that were exposed in MEMS+ Innovator. To view
these parameters, in the Simulink interface double click on the MEMS+ symbol, or right click on the symbol and
select Mask Parameters.

Coventor, Inc. May 31, 2018 U3-3


Section 3: Using MEMS+ with Simulink Version 6.3

Figure 3-2 Exposed Variables in Simulink

Z=5

Once the MEMS+ model is imported, the system designer can complete the system model using blocks from the Sim-
ulink library.

U3-4 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

3.3: Running Simulations


The MEMS system designer confirms device performance by running simulations in Simulink. By default Simulink
runs transient simulations, but the user can compute the initial DC and AC points to input to a transient analysis.

3.3.1: Compute Initial DC Point


The MEMS+-Simulink interface offers a convenient way to create operating points for transient analysis. To compute
the initial DC point, double click the MEMS+ symbol block to open its properties. From the Setup tab, select one of
the options from the Compute initial DC point field’s drop-down menu. The default setting is Using block inputs at t
=0.
Note that the user cannot view the DC results. To compute and view the DC operating point, use the Control Design
Toolbox application; see page U3-10 for more details.

Coventor, Inc. May 31, 2018 U3-5


Section 3: Using MEMS+ with Simulink Version 6.3

3.3.2: Compute Initial AC Point


The user can also compute an initial AC point to input to a transient analysis. The MEMS+ symbol’s Function Block
Parameters dialog offers a means of configuring the computation of the initial AC point, as shown in Figure 3-3:

Figure 3-3 Computing Initial AC Point and AC Inputs

 AC Frequency: The user enters a frequency for which the solver will generate a result that acts as an input
variable for a transient simulation. The acInit variable is saved in the user’s workspace and can be used to
start a transient simulation from steady state; for an example, see page T2-58 of the MEMS+ Tutorials.
 The AC Inputs tab allows you to input AC mag values on any sources in the model.

To run and view the AC and modal analyses, use the Control Design Toolbox application; see page U3-
11 for more details

U3-6 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

3.3.3: Transient Simulations


By default, Simulink runs transient simulations. The parameters for a simulation are set from the Configuration
Parameters dialog, which is opened from the Simulation > Model Configuration Parameters menu. The simulation
stop time can be also be set from this dialog or from the main Simulink window. To start the simulation, click on the
Run icon, , or select Simulation > Run, or use the keyboard shortcut Ctrl + T.

Figure 3-4 Configuring a Transient Simulation

Opens dialog for


setting solver options,
data import/export,
and more.

M
To start a transient analysis from an initial DC or AC point, open the MEMS+ function block’s parameters dialog,
and configure one or both of these simulations from there; see page U3-5 and page U3-6 for more details.
When running a transient simulation, keep the following in mind:
 The Rayleigh damping beta value should always be defined in the imported MEMS+ schematic. If Rayleigh
damping is not included in the model, simulation performance will degrade as high frequency modes will be
undamped, leading to a small solver timestep and slow simulation time.
 Pick a stiff solver: ode15s (Gear) for faster convergence and less accurate results, ode23t (Trapezoidal) for
smooth graphs, but longer simulation time.
 The ode15s solver is recommended for a transient analysis with contact. Note that with this solver, it is
recommended to set the Maximum order parameter to 2.
 The ode23t solver is recommended for systems with high-frequency oscillations; this solver will avoid
numerical damping of those oscillations. It is a conservative solver, i.e., it favors numerical accuracy over
simulation speed and dealing with stiff problems.
 Users do not have to explicitly set the solver. MATLAB has a default auto option that is usually sufficient.
If the auto option results in difficult convergence or too long of a simulation time, you can set the solver
to ode15s or ode23t.
 Set a reasonable simulation end time (a few milliseconds is often enough).
 If you are not interested in Scene3D result files, select Save None in the MEMS+ Simulink block parameters.
 If some of the blocks do not provide an analytical Jacobian, Simulink computes Jacobian numerically for all
the blocks in the system, which will significantly slow down a simulation including a MEMS+ model. There-
fore, a good practice is to check that the Sparse analytical Jacobian option is specified in the simulation con-
figuration and that a warning about changing the Jacobian type does not appear during the simulation. If this

Coventor, Inc. May 31, 2018 U3-7


Section 3: Using MEMS+ with Simulink Version 6.3

is the case, a workaround provided by Mathworks can be used in order to use mixed numerical/analytical
Jacobian inside the same system.
 If simulation does not converge,
 try relaxing relative tolerance;
 try increasing the minimum step size, but also increase the number of consecutive violations allowed
(several thousands is not too much);
 change order of the Gear method (ode 15s);
 try another solver, but stay with variable-step, stiff solvers.
 Transient simulation time is available in the Diagnostic Viewer; see page U3-9 for more details.
 While visualizing the results in a scope, do not forget to uncheck the Limit Data Points To Last option on the
Data History tab of the Scope Parameters dialog.
For more information on troubleshooting a transient simulation, see page U5-8.

3.3.4: View Results in Scene3D


Simulink transient results can be plotted using the Scope library block. If you would like to view the Simulink tran-
sient results in MEMS + Scene3D, double click on the MEMS + symbol, and from the Setup tab, select one of the Save
all options from the Save simulation document and Scene3D files drop-down menu. This setting defaults to Save none
because transient results can be large, and therefore take up a lot of disk space.
If you select one of the Save all options, Simulink will write out a result file to the directory where the MEMS + sche-
matic resides. The result name is constructed as follows:
SchematicName.slxName.SymbolName.Analysis.SimulinkTransient.trans

If you select the Save all with decimation defined below, enter a Decimation value to limit the result file output. For
example, if you enter a Decimation value of 10, the solver will save every tenth transient point, thus reducing file size
by a factor of 10.

U3-8 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

3.3.5: Simulink Diagnostic Viewer


Simulink writes DC and AC simulation times to the MATLAB console, but transient simulation time and any simula-
tion warnings are written to the Diagnostic Viewer. The Viewer can be opened from the Simulink’s View > Diagnos-
tic Viewer menu, or by clicking on View Diagnostics at the bottom of the Simulink Model window once the
simulation has started, as shown below.

Figure 3-5 Accessing the Diagnostic Viewer

Coventor, Inc. May 31, 2018 U3-9


Section 3: Using MEMS+ with Simulink Version 6.3

3.4: MEMS+ Model Simulation with Simulink Control Design


This section shows the user how to use the MATLAB Control System Toolbox and Simulink Control Design toolbox
to run DC, AC, and modal analyses. These toolboxes can be used to simulate the complete system, as opposed to sim-
ulating only the MEMS+ model. We will demonstrate the procedure for computing a steady-state operating point and
linearizing a MEMS+ model included in a Simulink schematic using the functionality in the toolboxes above.

Note that the Control System Toolbox and Simulink Control Design toolbox require additional MATLAB license
features. Please contact your MathWorks support representative for more details.

3.4.1: Computing the Operating Point (OP)


Computing a steady-state operating point using specifications in the Control and Estimation Tools Manager is equiv-
alent to running a DC analysis. For this simulation, we are using the Gyroscope tutorial device; its Simulink model is
shown below:

To access the Control and Estimation Tools Manager, in the model window, select Analysis > Control Design > Con-
trol System Designer; if you do not have this option, then you do not have a license for this feature or you have not
installed these toolboxes. In the dialog that opens, select Operating Points in the Workspace panel, and then click on
the Compute Operating Points tab. To perform the OP computation, be sure to check Known for all the Simulink
Inport block values. This setting tells the OP search algorithm that these values are not allowed to vary (see Figure 3-
6).
The user may need to tune the OP Search settings in the Tools/Options dialog to obtain optimal convergence. For this
particular simulation, the constraint tolerance has to be changed to 3.0e-05 in order for the simulation to complete.

U3-10 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

Figure 3-6 Simulink Control Design - Steady-State OP Computation

M
3.4.2: AC and Modal Analysis
The Control Design toolbox can be used to compute linear frequency domain analysis, and then output a Bode plot or
pole/zero map. A linear Bode plot shows the linearized system's frequency response (usually magnitude and phase,
magnitude being the ratio between the output and the entry in SI units). An AC analysis is typically a linear analysis
of the system's frequency response for a specific AC stimulus. So the linear Bode plot capability of Control Design
Toolbox can be used to generate and view AC results.
A pole/zero map is a plot of the poles of the system in the real/imaginary map. A modal analysis computes the poles
of the linearized system. So the zero/pole map capability can be used to generate and view modal results.
The linear analysis tool is accessed from Analysis > Control Design > Linear Analysis:

Coventor, Inc. May 31, 2018 U3-11


Section 3: Using MEMS+ with Simulink Version 6.3

There are two algorithms that can be used for linearization: Block-by-block analytic and Numerical perturbation. You
can select one or the other algorithm from the Linearization tab, which is accessed by clicking on More Options (see
Figure 3-7).

Figure 3-7 Linearization Algorithms

In terms of results, the Block-by-block analytic linearization is more accurate, and Coventor recommends this algo-
rithm. The Numerical perturbation linearization also produces good results for MEMS+ models, provided the Rela-
tive perturbation level parameter is set to a value between 1e-8 and 1e-12; the latter will give optimal results in most
cases.

U3-12 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

Linearization Inputs and Outputs


Simulink Control Design selects the inputs and outputs of the system to be linearized differently according to which
linearization algorithm is used.
The Block-by-block analytic algorithm lets the user specify the input and output points through linearization annota-
tions. Right clicking on the wires of the Simulink schematic can set these, as shown in Figure 3-8. The gyroscope
example has root-level Input blocks (CombBias, ElectrodeBias) and root-level Output blocks (CapSensing and
M1_y). We want to specify the CombBias block as an input point, and the M1_y block as an output point.We right
click on each of the respective wires connecting these blocks to the rest of the model, and select Linear Analysis
Points > Input Perturbation or Output Measurement.
The Numerical perturbations algorithm requires the user to set the linearization input and output points using Inport
and Outport blocks on the Simulink schematic.

M
Figure 3-8 Linearization Input and Output Points

Linearization
annotations

AC Results
We will use the default operating point for our linearization, assuming it is the correct DC point with respect to the
bias settings.We are ready to linearize the system. We will ask for a Bode plot of the resulting SISO transfer function,
then click on the Linearize icon.

Coventor, Inc. May 31, 2018 U3-13


Section 3: Using MEMS+ with Simulink Version 6.3

Figure 3-9 Linearization Results

If we want to compare our results to MEMS+ Simulator resonant frequency results, we can right click on the Bode
plot and select Properties, then change the Frequency units to kHz:

The default values of the Units settings can be configured in the dialog that appears on typing ctrlpref in MAT-
LAB; this method resets the default values so the user no longer needs to set them again for each Bode plot.
Right click again on the plot and select Characteristics > Peak Response. Click on the peak of the Magnitude plot to
mark the resonant frequency in Y. The results match the resonant frequency results we generated for the gyroscope
tutorial (see page T2-33 of the MEMS+ Tutorials).

U3-14 May 31, 2018 Coventor, Inc.


Section 3: Using MEMS+ with Simulink Version 6.3

M
It is possible to transfer the linearization result to the MATLAB workspace with a drag and drop of lynsys1. Then
the user can use lynsys1 in the MATLAB console with the bode() function and specify the frequencies of inter-
est.

Modal Analysis
The Linear Analysis tool also allows the user to perform a zero/pole map of the linearized schematics. A pole/zero
map is a plot of the poles of the system in the real/imaginary map. A modal analysis compute the poles of the linear-
ized system, so it is possible to generate modal results with the zero/pole map capability of Control Design Toolbox,
as illustrated below:

Coventor, Inc. May 31, 2018 U3-15


Section 3: Using MEMS+ with Simulink Version 6.3

U3-16 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

Section 4: Using MEMS+ with Cadence Virtuoso

4.1: Importing a MEMS+ Model


Before you can import a MEMS+ model into Cadence Virtuoso, you must configure your Cadence Virtuoso installa-
tion to work with MEMS+; see page 5-1 of the CoventorMP Installation Instructions for more information.
After you have configured your Cadence installation to work with MEMS+, the first step in using a MEMS+ model in
Cadence Virtuoso is to import it. How you import a MEMS+ model depends on whether or not you already have a
technology library. Most users will already have a standard technology library and only need to import their model
into that library, as outlined below. For users without a technology library, the MEMS+ plug-in allows them to create
one from a MEMS+ process; see the second set of instructions below.

M
If you already have a technology library created:
1. From the Library Manager, select the desired technology library from the Library pane.
2. Select MEMS+ > Import Innovator 3D Schematic.
3. Browse to select the Innovator schematic that you want to import.
4. In the Import options dialog that opens, edit the cell name if you want, and choose one or more of the follow-
ing options:
 Layout: Check this option if you want to generate a P-Cell from the schematic.
 Model: Check this option if you want to generate the Cadence Spectre models from the schematic.
 Local: Check this option if you want to create a local copy of the 3-D schematic and its associated process
and material database files within the newly created cell’s directory. This option makes it easier for users
to share designs because the cell will contain the needed 3-D schematic, as well as the Virtuoso informa-
tion. Note that this option alters the search for schematics when the Absolute option is unchecked; see
“MEMSPLUS_SCHEMATIC_PATH Environment Variable” on page U4-5.
 Absolute: This option is checked by default, and when checked, the location of the imported Innovator 3-
D schematic is stored using an absolute path. To only have the name of the 3-D schematic remembered
and the actual path resolved at simulation time, uncheck this option, and set the MEMSPLUS_SCHE-
MATIC_PATH environment variable, as described on page U4-5, to the location of the 3-D schematic or
libraries defined by the Local option.
5. Click on OK.

If you checked the Layout and Model options, the cell you just created will have a layout, spectre, and symbol view.
If you do not already have a technology library:
1. In the Library Manager window, select MEMS+ > Create Tutorial Tech Lib from Process.
2. In the dialog that opens, enter a name in the New Technology Library Name field, and then use the Browse
button beside the process field to select a MEMS+ process file. Click on OK.
3. Select the tech library you just created.
4. Select MEMS+ > Import Innovator 3D Schematic.
5. Browse button to select the Innovator schematic that you want to import.

Coventor, Inc. May 31, 2018 U4-1


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

6. In the Import options dialog, edit the cell name if you want, and leave the Layout, Model, and Absolute
options checked. Click on OK.
7. After you have imported the MEMS+ model, from the Library Manager, open the layout and symbol view to
make sure it has been imported correctly.

Although MEMS+ allows file names with spaces, Virtuoso may not handle these file names correctly. If you are
going to be working in Cadence, Coventor recommends that you name your schematic and the files it depends on
without any spaces.

To place a MEMS+ model in a schematic:


1. From the Library Manager menu select File > New > Cell view, enter a new cell name (cannot have the same
name as any other cell in the library), View should be schematic, and Type should be set to schematic. For the
Application, you can select Schematic L or Schematic XL.
2. In the schematic editor that opens, select Schematics XL from the Launch menu to open an enhanced version
where you can access instance properties on the left and also get the world view to manipulate the canvas
(right click on an empty spot of the menu bar).
3. To add the symbol of the Innovator schematic you just imported, select Create > Instance.
4. In the dialog that opens, select the desired library and cell, and the symbol view.
5. Click in the Schematic Editor to place the symbol. Press the Esc key to exit the placement mode.
6. When you are done with schematic editing, click on the Check and Save icon.
7. From the Launch menu, select ADE L.
8. Make Spectre aware of the MEMS+ model: select Setup > Model Libraries. Open the file dialog of the first
row, navigate into your library, and into your cell (the MEMS+ imported symbol).
9. At that point you should see a file named cellName.scs (with cellName corresponding to what you filled in
during import). Select that file, and click on OK for closing the file dialog, and on OK again to close the
model library. This step makes Spectre aware of the MEMS+ model.
You are now ready to simulate your schematic. Note that simulation results that can be viewed by the MEMS+
Scene3D module are automatically written to the folder where the Innovator schematic is saved.
For examples of how to import and simulate a MEMS+ model in Cadence Virtuoso, see the tutorials starting on page
T4-54 and page T2-66 of the MEMS+ Tutorials manual.

4.1.1: Updating an Imported Model


If you make changes to an Innovator schematic that you have already imported into Cadence or if you rename a cell
or library, you do not have to reimport the schematic:
1. From the Library Manager, select the cell that contains the imported Innovator schematic. You can also select
the library if there are multiple cells to update.
2. From the MEMS+ menu, select Refresh. With this option, you do not need to reselect the file inputs.
If you created a design with MEMS + 4 or 5, you will need to refresh the associated cell before you can use it. For
more information on updating schematics for MEMS+ 4 or 5, see page 5-3 of the Installation Instructions.

U4-2 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

4.1.2: Exporting/Importing to Archive


The Export to/Import from archive functions make it easy for users to share Virtuoso libraries. The Export Library to
archive function, available from the Cadence Library Manager’s MEMS+ menu, allows a user to save all the files
associated to a Virtuoso library to a single archive. Another user can import that archive into his/her Cadence Library
Manager using the MEMS+ > Import from archive function.

Export Library to Archive


1. Open the Library Manager.
2. Select a library.
3. From the MEMS+ menu, select Export Library to archive...
4. In the dialog that opens, specify a filename to save the library to; its extension has to be .mcl.tbz2. Then click

M
on Save.
Cadence reports when the archive is successfully created.
The created archive will include all the files needed to run a simulation (.scs, .mmdb, .mproc and .3dsch files) as well
as any saved analysis cell views.

Import from an Archive


1. Open the Library Manager.
2. From the MEMS+ menu, select Import Library to archive...
3. Specify the archive file (with the .mcl.tbz2 filename extension) you want to import.
4. Specify a directory to install the new library in.
The new library must have a different name than any other library in your Cadence Library Manager. Existing library
names cannot be changed.
Cadence will report when the archive has been successfully imported and the library created.

When an archive is imported, any MEMS+ simulation results will be written to the directory where the archive files
were saved instead of the location specified in the MEMS+ > Options dialog with the Scene3DfileBasename
parameter.

Importing from an Archive Created in a Previous Release


If you import an archive created in a previous release, you will be prompted to open the file in MEMS+ to update it
before continuing in Cadence Virtuoso.
If you click on OK to update the file:
 If MEMS+ is not already running, MEMS+ opens with the schematic, you have to save it, and once MEMS+
is closed, Cadence Virtuoso will restart where it stopped.
 If MEMS+ is already open, the schematic is sent to the running application, and a dialog pops-up in Virtuoso
asking the user to select OK when the file is updated.

Coventor, Inc. May 31, 2018 U4-3


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

4.1.3: Setting Default Import Options


The MEMS+ > Options menu opens a dialog for setting the default behavior for importing a MEMS+ schematic.
Whatever options are selected here will be reflected in the Import Options dialog (see “Importing a MEMS+ Model”
on page U4-1).

 Open location of file browser


Sets the default location for the file browser; whenever a user opens a file browser, it will open to this directory.

 Create layout
Creates the PCell layout.

 Create model
Creates the Cadence Spectre model from the MEMS+ schematic.

 Copy MEMS+ files in cell


This option makes and uses a local copy of the MEMS+ schematic and its associated files. If this option is checked,
the Innovator schematic and its associated material database and process files are copied into the device cell. If
you are going to use this option and choose to not preserve the location of the 3-D schematic within the model
and/or layout definitions, note that it alters the search mechanism of schematics and the directories to point the
MEMSPLUS_SCHEMATIC_PATH environment variable to; see page U4-5 for more details.

 Keep absolute reference to MEMS schematic


The option preserves the location of the original 3-D schematic as an absolute path. Note that if you uncheck this
option, you must also set the MEMSPLUS_SCHEMATIC _PATH environment variable, see page U4-5 for more
details.

 Default value for Scene3DfileBasename parameter


If this value is set, the analysis name is appended to this name to define the Scene3D result filename. If not set,
the default is to create a new Scene3D directory next to Spectre's psf folder in ~/simulation/SchematicName/spec-
tre/schematic and derive Scene3D result file name from the MEMS+ schematic name. This parameter can take a
full path or a relative path (relative to the location where the simulator runs). The value does not have to be in
quotes (unlike the parameter set in the individual MEMS+ model Properties dialog). For a more complete expla-
nation of this setting, see “Naming Simulation Results” on page U4-11.

U4-4 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

 Define quantity functions


If checked, this option allows the user to update any scale factors that were changed in the MEMS+ schematic by
refreshing the cell in Virtuoso (from the Library Manager’s MEMS+ menu, select Refresh). If unchecked, the user
will have to recompute any applied values in the Cadence schematic to make sure that these values reflect the
changes to the scaling factors in the MEMS+ schematic.
For example, if you want to add an angular rate of 1 rad/s on the reference frame, you have to take into account
that the radians to meter scale factor is 1e-4, the meters per second to voltage scale factor is 1e-2 and set your
voltage source to 1 [rad/s] * 1e-4 [m/rad] * 1e-2 [V/m] = 1e-6 [V], and then connect it to the reference frame pin
to get your rotation rate. If the Define quantity functions option is checked, you can instead set your voltage source
to angularVelocity(1) and let the function handle the scaling. If you change your scale factors in Innovator,
you only have to refresh the cell. But if this option is unchecked, you cannot use these functions and will have to
recompute the value that needs to be applied to the voltage source. For more information on these quantity func-
tions, see page U4-8.

M
 Layer-purpose pair for error reporting
When the PCell generation fails, errors are reported in the Command Interpreter Window (CIW). (See page U4-
11 for more information on PCell generation.) A marker indicating an error occurred is drawn on the layer-purpose
pair specified here. Note that the layer-purpose pair is saved in the PCell when importing or refreshing the MEMS+
cell. If you want a new layer-purpose pair to be used in an existing cell, please refresh this cell.

 Import MEMS+ symbols/Advanced options


This dialog allows the user to select in which library the Advanced Options component symbol will be created
and to specify a name other than the default. For more information on this component, see page U4-13.

4.1.4: MEMSPLUS_SCHEMATIC_PATH Environment Variable


With the Local Option and Without the Absolute Option
For schematics imported using the Local option, as described in the previous section, you must add an environment
variable to indicate to the simulator where the library into which the 3-D schematic was imported can be found. For
the example above, the Cell directory is /home/user/Cadence616/RFSwitchTechLib/RFSwitch, so the following must
be added to your environment (on the tcsh shell as an example):
setenv MEMSPLUS_SCHEMATIC_PATH /home/Cadence616
If there are multiple library locations on a Linux machine, these can be ":" separated as in
setenv MEMSPLUS_SCHEMATIC_PATH /home/user/Cadence616:/home/OtherLibraries
Again, if you use this Local option and ever change the library or cell name of the imported 3dsch, please be sure to
use the Refresh menu option as described in “Updating an Imported Model” on page U4-2.
When running a simulation, if the 3D schematic cannot be found, then you will see an error that indicates the MEM-
SPLUS_SCHEMATIC_PATH environment variable is not set correctly. If set correctly, then Spectre log window will
report the full path to the schematic found and used:
MEMS+ schematic file: /home/user/Cadence616/RFSwitchTechlib/RFSwitch/
RFSwitch.3dsch

Without the Local or Absolute Option


If you do not want to copy the .3dsch schematic within the cell, but would like to store its location as a relative file
path, uncheck the Local and Absolute options, and set the MEMSPLUS_SCHEMATIC_PATH as shown below (using
the tsch shell as an example):
setenv MEMSPLUS_SCHEMATIC_PATH /home/my3dschs

Coventor, Inc. May 31, 2018 U4-5


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

In this example, the 3D schematic file to be imported resides in the directory /home/my3dschs/SomeDesign.3dsch,
and the search path will not assume a Library and Cell name.
If there are multiple library locations on a Linux machine, these can be ":" separated.
Note the difference from the Local option mentioned previously. For a cell that was imported with Local, the Library
and Cell name were appended to the path to find the .3dsch file. Without the Local option, the search path is expected
to be the exact location of the .3dsch file.

With or Without the Local Option and With the Absolute Option
Regardless the status of the Local option, if the Absolute option is checked, the absolute location of the 3-D schematic
file (whether local to the cell or not) is referenced in the layout and/or model definition. The MEMSPLUS_SCHE-
MATIC_PATH environment variable is not used.

4.2: MEMS+ Model in Cadence Virtuoso


4.2.1: Properties
The MEMS+ model has properties that can be set or changed from within Cadence schematic or layout editors. To
access these properties, right click on the MEMS+ symbol in the Schematic Editor, and select Properties. The dialog
that opens has fields for any variable that was exposed in MEMS+, as well as properties for setting Scene3D result
names, using scaling factors, and using symmetry.

Figure 4-1 Symbol Properties

Variables exposed
in MEMS+

U4-6 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

For more information on the Scene3DFileBasename setting, see page U4-11.


For more information on the SuggestScaling setting, see page U4-17.
For more information on the multiplier (m) setting, see page U4-18.

UseSimulatorTemperature Setting
All MEMS+ models have a temperature variable exposed (T) defining the temperature used to compute thermal
effects on a MEMS+ device. Cadence simulators have their own temperature variable that can be modified or swept
through the Analog and Design Environment [ADE]. When UseSimulatorTemperature is set to no (default value), the
MEMS+ temperature and the Cadence Simulator temperature are treated as independent of one another. Varying the
Cadence simulator temperature during a simulation will not have any impact on the MEMS+ device.
When UseSimulatorTemperature is set to yes, MEMS+ models will ignore the value of the exposed parameter T and
use the temperature defined by the Cadence simulators instead. Note that the default temperature of MEMS+ (which

M
generally is also the zero-stress temperature of materials) is 273.15K, but the default temperature of the Cadence sim-
ulators is 300.15K. This could lead to unexpected thermal stresses being computed when MEMS+ models are set to
use the Cadence simulators temperature.

4.2.2: Ports
The MEMS+ model symbol in Cadence Virtuoso includes pins that represent various ports exposed in Innovator. All
pins in Cadence are electrical pins. For each quantity, we use a scale factor to convert it to a voltage or current. Some
of these scaling factors are exposed in Innovator’s top-level Components properties (see page C2-1 for more details).
All others (referred to as a default scale factor below) are a 1-to-1 conversion from SI units to voltage/current. The
ports in Innovator are imported and scaled in Cadence as listed below:
 exposed electrical ports in Innovator > electrical input/output pin in Cadence
 Across value units: volts [V], no conversion needed
 Through value units: amperes [A], no conversion needed.
 exposed mechanical ports > electrical input/output pin
 Across value units: from meters [m] to [V] with the position scale factor;
from radians [rad] to [V] with the position and the rotation scale factors.
 Through value units: from newtons [N] to [A] with the force scale factor;
from newtons meter [N.m] to [A] with the force and the rotation scale factors.
 exposed fluidic ports > electrical input/output pin
 Across value units: from pascals [Pa] to [V] with the pressure scale factor.
 Through value units: from [m3/s] to [A] with the flow rate scale factor.
 exposed input ports > electrical input pin (infinite impedance to the ground)
 Across value units: from [m/s2] to [V] with the acceleration scale factor;
from radians per second [rad/s] to [V] with the velocity and the rotation scale factors
 Through value: ignored.
 exposed output ports > electrical output pin (ideal controlled voltage source)
 Across value units: from farads [F] to [V] with a default scale factor of 1
from siemens [S] to [V] with a default scale factor of 1.
 Through value: ignored.
Figure 4-2 illustrates how electrical connectors, input pins, and output pins exposed in Innovator are represented in an
imported MEMS+ model in Cadence. Ports are gathered by type: input ports on one side, input/output ports on
another side, and output ports on a third side.

Coventor, Inc. May 31, 2018 U4-7


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

Figure 4-2 MEMS+ Model Exposed Ports in Cadence

4.2.3: Quantity Functions


Because all physical quantities are scaled to voltages and currents in Cadence simulators, parameters representing
such physical quantities on voltage or current sources need to be converted to their scaled values. MEMS+ offers a
number of functions that can help set up component parameters in a Virtuoso schematic, or a variable in ADE. But
these functions cannot be used to set up a simulation in ADE. These quantity functions will convert a value from its
original SI value to the scaled value that must be used to be consistently with the MEMS device representation. To
use these functions, you must check the Define quantity functions option in the default import options dialog; see
page U4-4 for more details.

If the unit scale factors of the Top-level Components of MEMS+ Innovator are defined using exposed variables, the
quantity functions are not defined and cannot be used.

For instance, if you exposed the acceleration of the reference frame in z direction on your MEMS+ device, and want
to impose an angular velocity of 1 radians/s, then you can connect a voltage source to the exposed pin and set its
value to angularVelocity(1), as demonstrated below:

U4-8 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

M
The following functions are available to scale parameters to their appropriate value:
 displacement(value): from [m] to [V]
 rotation(value): from [rad] to [V]
 translationalVelocity(value): from [m/s] to [V]
 angularVelocity(value): from [rad/s] to [V]
 translationalAcceleration(value): from [m/s2] to [V]
 angularAcceleration(value): from [rad/s2] to [V]
 force(value): from [N] to [A]
 moment(value): from [N.m] to [A]
 pressure(value): from [Pa] to [V]
 flowRate(value): from [m3/s] to [A]

Coventor, Inc. May 31, 2018 U4-9


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

4.2.4: MEMS+ Model Signals in Virtuoso Result Viewer


Though MEMS+ maps all quantities to the electrical domain for Cadence simulators, signals appear in Virtuoso result
viewer with their own units and scale factor if defined.

Support for custom labels is dependent on the selected output format for Spectre's results. PSF format is
recommended. SST2 and PSFXL might not display the labels as shown below.

For signals with a one to one conversion from SI units to voltage/current, the conversion is transparent to the user.
Figure 4-3 shows the result of a capacitance plot, clearly identifying the signal with its prefix and units: femto-Farad.

Figure 4-3 Capacitance Result from a MEMS+ Model

Signals using scale factors indicate the conversion factor from volts to the unit with prefix displayed, as shown in Fig-
ure 4-4. The curve is still scaled in volts, but the marker reads 1.848185 mm/s x100 for I0.M1vy at 7.0273 kHz. This
is to be understood as I0.M1vy = 1.848185 * 100 mm/s = 184.8185 mm/s at 7.0273 kHz.

U4-10 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

Figure 4-4 Translational Velocity Result from a MEMS+ Model

M
4.3: Naming Simulation Results
By default, the simulation result files are written to a Scene3D directory next to Spectre's psf result folder. The result
file name is the name of the MEMS+ schematic used to create the MEMS+ cell, and it is appended with the type of
result that was run. For example, if the Gyroscope.3dsch file was imported into Cadence Virtuoso for simulation and
a DC Sweep analysis was run on the schematic that uses this model, a Gyroscope.3dsch.dc_sweep file is written to the
Scene3D directory next to the psf folder where Spectre wrote its results.
You can specify a file name to write results using the schematic model’s Properties dialog, which has a parameter
called Scene3DfileBasename (see Figure 4-1 on page U4-6).This parameter is useful for running multiple analyses of
the same type with different settings. You can specify a different result file name so that the previous results are not
overwritten. The default value is “.../Scene3D/SchematicName.3dsch” or if defined, the default value defined in the
Defaults and Options dialog (see “Setting Default Import Options” on page U4-4). Quotes are required. This parame-
ter is able to take a full path or a relative path (relative to the location where the simulator runs). The analysis name is
appended to this name to define the Scene3D result filename. The full path to this file is now available from the sim-
ulator log window. If there are several Innovator device instances on the schematic, the first one that is read imposes
its name. This action checks that you have write permission on the specified location, and if you specify multiple
folders that do not exist in a place where you have write permission, then the software will create the subfolders col-
lection to the result file.

4.3.1: Naming Results and Result Locations Using Keywords


If you have already run a parametric analysis in the Virtuoso Analog Design Environment, you may have noticed that
MEMS+ is overwriting Scene3D result files to leave you with the last simulation result only. However, there is a way
to have MEMS+ generate a new name for each analysis within the loop. To achieve this, we have to use a keyword
recognition feature. The keyword is added to the Scene3DfileBasename parameter (see Figure 4-1 above), and more
than one keyword can be used at the same time. The keywords can be used to create new result folders or new file
names. The available keywords are listed below:
 ANALYSISNAME: the type of the analysis. This will be replaced with the actual type of analysis (dc,
dc_sweep, ac, or trans) in creating the result file name/path. Note that by default the result type is appended to
the end of the file name. For example, an AC analysis will generate a file named RFSwitch.3dsch.ac. This
keyword can be used to create a result directory, for example, ANALYSISNAME/RFSwitch for an AC analysis
will create /ac/RFSwitch.ac.

Coventor, Inc. May 31, 2018 U4-11


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

 ANALYSISID: each analysis is given an identifier (integer), which is used to replace this keyword. When
placed at the beginning of the Scene3DfileBasename parameter, this keyword can be used to create a new
result folder; when placed at the end of the Scene3DfileBasename parameter, it can be used to create a new
result file; for example:“/home/user/Coventor/MEMS+6.3/RFSwitch/RFSwitch.3dsch.ANALYSISID”. Note
that this identifier is given by Spectre and that a Spectre analysis can generate to 0 to 2 Scene3D result files.
More on that in the example below.
 PATHTO3DSCH: will be replaced with the actual full path to the .3dsch file.
 BASENAME3DSCH: will be replaced with the base name of the .3dsch file (without the path to it, without
the .3dsch extension).
 ROOT/: replaced with system root ('/') when found at the very beginning of Scene3DfileBasename parameter
(see Naming Results and AMS Simulations).
 CURRENT/: replaced with current folder ('./') when found at the very beginning of Scene3DfileBasename
parameter (see Naming Results and AMS Simulations).
 PARENT/: replaced with parent folder ('../') (see Naming Results and AMS Simulations).
 OUTDIR/: replaced with simulator's path to output directory folder when found at the very beginning of
Scene3DfileBasename parameter.
 RAW/: replaced with simulators's path to raw folder (Cadence result folder) when found at the very begin-
ning of Scene3DfileBasename parameter.

Note that the OUTDIR/ and RAW/ keyword functions are not part of the public interface of any simulator and
might lead to unexpected results.

Now let's take a sweep analysis as an example. Assuming ADE was used to drive the simulation and the results were
created at their default location, the part of the netlist describing the analyses would look something like this:
[...]
dc1 dc dev=V0 param=dc start=0 end=10 lin=10
sweep sweep dev=V1 param=dc start=0 end=10 lin=10 {
ac ac [...]
}
[...]
The analysis dc1 is given the identifier 1 and produces a single Scene3D result file *.dc_sweep. The analysis sweep
is given the identifier 2 and does not produce any Scene3D result file. The analyses ac are given identifier 3 to 12,
each producing two Scene3D result files: a *.dc and a *.ac.
If you set Scene3DfileBasename to '/RAW/DesignName.ANALYSISID', you would get the following output:
- [Project Directory]
- [Cell Name]
- spectre
+ netlist
- psf
[Collection of cadence result files]
DesignName.1.dc_sweep
DesignName.3.ac
DesignName.3.dc
[...]
DesignName.12.dc
Note that psf is the default relative path to the result folder. Also note that the above example cannot exactly be run
with ADE: the parametric analysis does not produce a netlist that can be saved, does not let you run a single analysis
before sweeping parameters, and does not even use Spectre's sweep analysis, but rather a combination of alter and
analyses. However, this illustrates how identifiers are incremented and how one can associate Scene3D result files

U4-12 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

with analyses. This example also assumes that the AC analyses are running their DC point (which can be disabled in
the options of the AC analysis), so each AC analysis in the netlist produces two Scene3D result files: a *.dc and a
*.ac.

4.3.2: Naming Results and AMS Simulations


In the process of running simulations with AMS, the Scene3DfileBasename parameter is evaluated twice. With this
mechanism, characters with special meaning to the parser are exposed instead of being escaped with the quotes.
Some examples of strings that are not valid for AMS:
"/home/user/results/device" : the leading '/' is the issue here
"./results/device": the leading . is the issue here
"../results/device": the leading .. is the issue here

M
To use exactly those names with AMS, escape the string with a backslash character before each quote:
\"/home/user/results/device\"
\"./results/device\"
\"../results/device\"
Please note, however, that escaping the quotes will make the parameter incompatible with Spectre. To have the
Scene3DfileBasename parameter accepted by Spectre and AMS, no leading slash or current folder or parent folder
can be used. Above examples can be converted to use keywords instead:
"ROOT/home/user/results/device"
"CURRENT/results/device"
"PARENT/results/device"
Creating MEMS+ result files within Cadence result folder is also an effective way of working around the issue:
"RAW/device"

4.4: Sampling Simulation Results


Cadence simulations run over a long period of time or with many degrees of freedom may generate very large
Scene3D result files. For these simulations, you may want to write a sampling of simulation points to the result file.
To sample simulation results, you must place an Advanced Options symbol in the simulation schematic. This compo-
nent is accessed by selecting the Advanced options from the MEMS+ defaults and options window:

Coventor, Inc. May 31, 2018 U4-13


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

This button opens a dialog that allows you to select in which library the Advanced Options component symbol will be
created and to specify a name other than the default. Once the component has been imported, it can be used in any
schematic, and it can be used to control the simulation output. Its properties are shown below:

The relevant parameters are listed below:

 Scene3DfileBasename
This is the same parameter seen in the properties dialog of an imported MEMS+ device, but it takes precedence
over the parameter set in individual symbols. So if you have multiple instances of MEMS+ devices in your sche-
matic and want to change the name/location of the result file, you can change the Scene3DfileBasename parameter
here, and it will be applied to all instances in the schematic. By default it is blank and takes its value from the
master instance (the master instance is the first MEMS+ instance to appear in the netlist, which can be displayed
from the Analog Design Environment window’s Simulation > Netlist > Display menu).

 XSampling
Specifies the time sampling used to generate the transient result. Input is a text string, which must be enclosed in
double quotes. It must be a list of sets of three elements { start, end, step }. For instance "{{0,10e-6,1e-6},{10e-
6,100e-6,2e-6}}", which means
 when the simulated time is between 0s and 10µs, write a point every 1µs
 when the simulated time is between 10µs and 100µs, write a point every 2µs
Spaces are allowed. If a time step is covered by multiple sets, the first one is used. You can omit any of the three
values. In that case, start defaults to beginning of the simulation, end to end of simulation and step to every point.
For times outside specified ranges, all points are written to the result file. So if you set XSampling to "{{10e-
6,20e-6,1e-6}}" and your simulation span from 0 to 30µs, then all simulated points from 0 to 10µs and from 20µs
to 30µs are written, and from 10µs to 20µs, a point is written every 1µs. The step value must be a positive number.
Also, this setting has no effect on DC, DC sweep, and AC simulations.

 Point Sampling
Similar to XSampling, except that you specify how many simulation points to skip. The two are exclusive, so if

U4-14 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

you specify one, the other must be blank. The input is still a list of sets of three elements { start, end, number of
steps skipped }, which must be enclosed in double quotes. For example "{{,,2}}". The first number indicates the
start of the range, the second number is the end of the range, and the last number indicates the number of steps
skipped. So the example means all over the simulation, write 1 point, skip 2 (meaning that for 3 simulated points,
1 gets written to the result file). The number of steps skipped value must be a positive integer. You can have spaces,
multiple sets, omit values (the number of steps skipped defaults to 0, to write every simulated point). This param-
eter only applies to transient simulations, and the default is to write every point for time ranges not covered by a
particular setting.

 GenerateResults
This drop-down menu allows you to choose whether to write Scene3D result files or not. Default is yes. A tran-
sient, pss, or envelop simulation may generate a substantial number of result files, cluttering the simulator output
with messages indicating Scene3D result file creation and occasionally generating errors on result file creation.

M
Setting this value to no will disable Scene3D result file creation. For an example of when this setting might be
appropriate, see page T2-87 of the MEMS+ Tutorials.

4.5: Plotting Current, Force and Moment Contributions


To plot current, force and moment contributions of a MEMS+ component, do the following:
1. From the ADE window menu, select Outputs > Save All...
2. In the dialog that opens, select all for the Select device currents option, as shown below, then click on OK.

3. Run your simulation.


4. From the ADE window, select Tools > Result Browser, then click on the analysis folder, and then the I0
folder. The moments, forces and currents signals are now listed in the browser window.

Coventor, Inc. May 31, 2018 U4-15


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

The MEMS+ current, forces, and moment names are defined with MEMS+ fully qualified component name, a colon,
and a terminal name. A terminal name can be a component of a MEMS+ mechanical, electrical, or fluidics connector,
an input, or an output. In the figure above, the force in the z direction of the TopComb straight comb stator of the
gyroscope Tutorial model has been output and selected.
With this functionality, note the following:
 Please be aware that not all currents / forces / moments under a MEMS+ instance are of interest for the user.
For instance the current flowing through a source holding a translational velocity is a required component of
the system, but of no interest to the user.
 The forces and moments displayed are actually the opposite of the expected values. In the example above the
force in z direction of the TopComb element is expected to be positive, but is displayed as negative.
 The terminal names displayed are not those of wires or connectors as specified in Spectre's netlist or MEMS+
schematic, but the name of pins as defined on the component in the MEMS+ component library for Cadence.
p_Kxx (where xx is a number) designates a component of a mechanical connector, Exx names an electrical
connector of a MEMS+ component instance. E00 is the first electrical connector, E01 the second, etc...
For mechanical connectors, p_K00 through p_K05 are all the components of the first mechanical connector of
a MEMS+ component instance. p_K06 to p_K11 are the components of the second mechanical connector, and
so on. For a mechanical connector, components are ordered with displacements first, in x (p_K00, p_K06, ...),
y (p_K01, p_K07, ...) and z (p_K02, p_K08, ...) directions. Followed by the components of the rotation vector
on x (p_K03, p_K09, ...), y (p_K04, p_K10, ...) and z (p_K05, p_K11, ...). So SomeDevice:p_K08 designates
the opposite of the force contribution in y direction on the second mechanical connector on the MEMS+ com-
ponent named SomeDevice.
 The name of a MEMS+ component is always: I1__ComponentType(1)_InstanceName(1)__...__Component-
Type(n)_InstanceName(n). All the path from the top-level component to a particular instance in the compo-
nent tree is written in that name. For example, in our selected signal above,
I1__RigidPlate_RigidPlate1__StraightCombSegment__TopComb__StraightCombStator_StraightCombStato
r1. StraightCombStator1 is an instance of type StraightCombStator, which is the child of instance TopComb
of type StraightCombSegment, which in turn is a child of instance RigidPlate1 of type RigidPlate under the
top-level of the MEMS+ component tree, as pictured below:

U4-16 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

M
4.6: Optimizing Simulations
When using a MEMS+ model in Cadence Virtuoso schematic, you may need to change certain default settings to
optimize results. If a simulation is taking too long, you can also start a simulation with an existing MEMS+ DC anal-
ysis. These settings are explained below.

4.6.1: Suggested Scaling Tool


MEMS+ Innovator maps mechanical motion and forces to voltages and currents when simulating with a Cadence Vir-
tuoso simulator. Cadence Virtuoso simulators define and enforce precision for voltages around 1V and currents
around 1µA. It is important for performance and precision to get relevant mechanical signals around those signals. If
the scaling used leads to mechanical signals much higher than 1V and 1µA, it will affect the simulation speed; if they
are much lower, it will affect the simulator’s ability to compute an accurate result; if they are slightly below 1V and
1µA, it will affect the precision of the simulator. These unit scale factors are set in the top-level Components (see
page C2-1).
On any MEMS+ Innovator imported device, a SuggestScaling option is available in the model’s Properties dialog
(see Figure 4-1 on page U4-6). If this setting is turned on, a tool will analyze a transient simulation to suggest scaling
coefficients appropriate to your device and simulation. These recommendations will be printed to the Spectre log
window, which opens when the simulation is launched and will appear at the end of the simulation. SuggestScaling
tries to balance signals such that Cadence Virtuoso simulators enforce the same precision on all signals independently
of their quantity (translational position, angular position, velocities, accelerations, forces and moments, voltages and
currents). The suggested coefficients may speed up simulation time or increase the accuracy and precision of the sim-
ulation results (if the simulation results are not in the desired range).
Note the following limitations when using this tool:
 This tool can only be used on transient simulations.

Coventor, Inc. May 31, 2018 U4-17


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

 There must be at least one nonlinear component in the MEMS+ model for the tool to provide output. It can be
a nonlinear plate, a nonlinear suspension, an electrode, or a comb. For best results from the SuggestScaling
tool, it is recommended to switch all mechanical models to the nonlinear type.
 The transient simulation has to be relevant for the scaling coefficients reported to mean anything; i.e., the
results have to be correct for the tool to work. If the signal is out of bounds and the simulation is diverging,
the tool cannot help.

Tips for Using SuggestScaling Tool


The first time you use the SuggestScaling tool, run the transient simulation with the Conservative Accuracy Defaults
setting. After you get the suggested scale factor settings and have updated your MEMS+ schematic accordingly, then
you can run the transient simulation with the Liberal or Moderate Accuracy Defaults setting. If you use the quantity
functions (see “Setting Default Import Options” on page U4-4), you will need to refresh your cell, save your Virtuoso
schematic, and relaunch the simulation. If not, you need to adjust your Virtuoso schematic to take the new scaling
into account on sources connected to non-electrical pins, save the schematic, and relaunch the simulator (you might
need to close ADE or select Simulation > Netlist > Recreate from the menu).
The suggested values output from the SuggestScaling tool can be rounded to the nearest power of ten. For example, if
the SuggestScaling tool outputs a scaling factor of 0.085, you can round it to 1e-01. Rounding values to the nearest
power of ten makes it easier to map the scaled values to the original values.

4.6.2: Multiplier Setting


This Properties setting allows you to model a symmetrical design by only building part of the device. If the schematic
represents only half of the device, set this number to 2. If it represents a quarter of the device, set this number to 4,
etc. This value multiplies relevant parts of the device by the given value so that when the model is connected to an
electronic circuit, the simulator will "see" an entire device, not just the part exported from MEMS+. Note that this
parameter does not change the resulting behavior of the device.
Note that noise analysis is not affected by the multiplier in the same way as other analyses because noise is subject to
the quadratic sum. For example, when using 4 quarters in parallel, the noise force generated is only twice as large:

2 2
<FC > = 4 ⋅ <FQ >

where Fc is the complete device and FQ is a quarter of the device.


And if we only take the suspension into account, F = k * x where k is the stiffness. So

2 1 2
< x Q > = ----2- ⋅ <FQ >
k
and
2 1 2 1 2 1 2
< x C > = ----------------2- ⋅ <F C > = ----------------2- ⋅ 4 ⋅ <FQ > = --- ⋅ < x Q >
(4 ⋅ k) (4 ⋅ k) 4

From which we get that the mean displacement on the complete device (either fully assembled in MEMS+, or a quar-
ter with multiplicity factor set to 4) is half the mean displacement simulated on a quarter (without multiplicity factor):
2 1
<x C > = < x C > = --- ⋅ <x Q >
2

U4-18 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

4.6.3: Start an Analysis from an Initial DC Result


If your Cadence DC simulation is taking too long (too many iterations on a large schematic) or does not converge
(MEMS+IC DC simulation fails, when MEMS or IC DC simulation pass), you may be able to speed up your simula-
tion by starting from a MEMS+ DC analysis, as outlined below:
1. From the Library Manager, select MEMS+ > Create initial guess DC file.
2. In the Select dialog that opens, browse to the desired MEMS+ .dc file, and click on Open.
3. In the MEMS+ Instance Names dialog that opens, enter the name of the MEMS+ instance in the schematic
associated with the .dc file, as shown below. The DC file that was selected in the previous dialog will be writ-
ten to the file specified in the File output field and applied to the specified MEMS+ instance.

M
Note that with this release, only one MEMS+ instance can be specified in this dialog.
4. In the Options dialog for the analysis, for the readns parameter, select the DC output file you specified in the
instance names dialog. The location of this readns parameter varies for each analysis type. For example, for a
transient analysis, this setting is on the Algorithm tab of the Transient Options dialog.

5. Run your simulation. Spectre's DC point will be seeded with the DC file rather than starting from zero, effec-
tively accelerating DC state convergence.
Note the following:
 The DC file generated with Create initial guess DC file only defines values for signals internal to the
MEMS+ device and is not suited for skipping the DC point.

Coventor, Inc. May 31, 2018 U4-19


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

 For best results, use the same DC conditions on exposed connectors in MEMS+ Simulator as on the Virtuoso
schematic.
 When several MEMS+ devices are included in a Virtuoso schematic, it is possible to generate a DC file for
each MEMS+ device, and then copy/paste the contents of the separate files into the one used in the Virtuoso
simulation settings.

4.7: Adjusting Simulation Settings for Transient Analysis


For a summary of the default and optimal settings for a transient analysis, see page U1-21.

4.7.1: Resonant Structures


For a long transient analysis on a resonant structure, the simulation settings may need to be adjusted. The procedure
below will help the user adjust these settings for optimal results.
1. Run all transients with the Accuracy Defaults set to conservative. Make sure traponly is selected as the Inte-
gration Method (to access, click on the Options button in the Choosing Analyses/transient dialog, then click
on the Algorithm tab).
2. Run a sample transient with SuggestScaling activated and default solver settings. The pss analysis is also a
good way to identify appropriate scale factors. Without appropriate scale factors, tweaking solver settings is
close to meaningless.
Make sure to rerun the pss analysis once you have changed your scaling factors so that you initiate your tran-
sient with the new scaled signals.
Also keep in mind that if you change the unit scale factors, you may also have to adjust sources on your sche-
matic, e.g., if you set some acceleration of the reference frame with a voltage source, you need to adjust the
value for changes to the acceleration scale factor.
3. When you are done with scaling, rerun a sample transient and check if your driving amplitude drifts over
time.
4. If it does, then you are ready to adjust the tolerances:
 In the ADE window, select Simulation > Options > Analog...
 From the Main tab, divide reltol, vabstol and iabstol by 10. Always keep the ratio between reltol and vab-
stol constant and between reltol and iabstol as well. If you change the ratios, you may lose precision or
make it impossible for the solver to find a solution.
 Do not change the residualtol setting.
5. Save your settings and restart your transient.
If you are not satisfied with the envelope of your driving motion, then redivide the three tolerance parameters by 10
and rerun the transient. Do as many cycles as necessary to be satisfied with the envelope.
Figure 4-5 shows the amplitude of motion in driving direction for three different solver settings (after having properly
scaled the system so that the amplitude of the signal is close to 1, as can be seen Figure 4-5). From top to bottom:
default settings: reltol = 10e-3 ; vabstol = 10e-6 , iabstol = 10e-12
reltol = 10e-4 ; vabstol = 10e-7 ; iabstol = 10e-13
reltol = 10e-5 ; vabstol = 10e-8 ; iabstol = 10e-14

U4-20 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

Figure 4-5 Transient Simulation Results

M
4.7.2: Non-Resonant Structures
For non-resonant structures, especially contact problems, the Accuracy Defaults can be set to either liberal, moderate
or conservative as long as the Integration Method is set to gear2only.

Coventor, Inc. May 31, 2018 U4-21


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

4.8: MEMS+ Layout in Cadence Virtuoso


4.8.1: Properties
The properties of the PCell are the same as the properties of the model symbol. Compare the properties shown below
with the properties shown in Figure 4-1:

Exposed variables

Geometric parameters

Additional simulation
parameters

Because the parameters are shared for the layout and the simulation model, a number of them are not relevant to the
geometry.
In contrast with standard practices in the EDA industry, each parameter is not checked when it is entered in the Prop-
erties dialog, so you will not get immediate feedback if a parameter would cause the geometry generation to fail. All
of the parameters are verified when the user clicks on OK, and the resulting geometry is generated.

4.8.2: Ports
As of MEMS+ 6.3, pins are not drawn on the layout.

4.8.3: Geometry Generation


The list of geometries to be drawn is generated by a MEMS+ executable when parameters are changed. The MEMS+
environment for Cadence Virtuoso is required to evaluate the PCell and draw the geometry.
When evaluating the PCell in contexts where the MEMS+ environment is not loaded (for instance when streaming out
the layout to GDS), the core functionalities of MEMS+ are loaded for executing the PCell function. In those cases, the
MEMS+ installation is found using the MEMSPLUS_HOME environment variable (see page 5-1 of the CoventorMP
Installation Instructions for more details).

U4-22 May 31, 2018 Coventor, Inc.


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

4.8.4: Error Reporting


When an error occurs during the evaluation of a PCell, a marker indicating that the geometry could not be generated
is drawn on the layout (when the display level of the layout editor is set adequately):

M
The complete error message is reported to the Command Interpreter Window [CIW]:

Coventor, Inc. May 31, 2018 U4-23


Section 4: Using MEMS+ with Cadence Virtuoso Version 6.3

Notes

U4-24 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

Section 5: Troubleshooting

5.1: MEMS+
5.1.1: Replaying .py File Locks Application
Replaying certain parts of a MEMSp.py file can lock the application in an error state. Do not replay sections of a
MEMSp.py file that are marked do not replay in user interface. These sections are meant for replaying without a user
interface.

M
5.1.2: Changes Lost When MEMS+ Loses License
When a license is lost and multiple MEMS+ windows have modifications, the application does not properly prompt
to save the changes from all the windows. If modifications are lost, modifications can be cut and pasted from the
MEMSp.py file (see page U1-13 for more information).

5.1.3: Cannot Change Value of Exposed Variable


If an exposed variable's value is overridden in a module later in the flow, there is no way to revert it to the default
value. For example, the T variable is defined in the Material Database, so if the value of T is changed in the Process
Editor, its value in the Process Editor will not change even if T is changed in the Material Database.
Manually update the overridden value in the module in which it was changed, and then the variable in the later mod-
ules will also be updated.

5.2: Innovator
5.2.1: Wizard
If after running the Wizard, the device is not properly constrained, it will report a message similar to the one shown
below:

If this message appears, mostly likely you have not grounded any of your mechanical connectors or enough of your
mechanical connectors. Each device will be different in its requirements; best practices for connecting components
are discussed in detail on page C6-21 of the MEMS+ Component Reference.

Inappropriate Component Models


In this next example, it seems that the device is properly grounded, but running the Wizard still generates a message
about the device not being properly constrained:

Coventor, Inc. May 31, 2018 U5-1


Section 5: Troubleshooting Version 6.3

Figure 5-1 Model Seems to Be Properly Constrained but Generates Wizard Error

In this case, the individual beams of this suspension were modeled with shell elements:

U5-2 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

For this model, shell elements are inappropriate because they should only be used to model structures in which the
vertical dimension (the thickness) is relatively smaller than the other dimensions and where the stress in the thickness
direction is negligible. In this schematic, the beam widths of the suspensions are smaller than their thickness; thus,
shell elements result in a device that is not properly constrained. For this model, Bernoulli beams are more appropri-
ate than shells, so we edit all the beams so that they use the Bernoulli Beam model. The number and location of
mechanical connectors then change, so we have to refix the mechanical connector on the first beam’s End 1 and reex-
pose the mechanical connector on the last beam’s End 2. Rerunning the Wizard then results in a properly constrained
device.

Figure 5-2 Corrected Model

M
Incompatible Material Properties
Another source of possible constraint errors is the material properties of the components. When the Wizard is run on
the device shown below, it generates a constraint error. The mechanical connectors seem to be properly placed and
connected, so we check the material database. For the properties of Silicon, the Shear coefficient is in Pa whereas the
Young's Modulus is in GPa. Usually, they should be of the same order. If we change the Young’s Modulus units to
GPa, update the schematic, and rerun the Wizard, the error message goes away.

Coventor, Inc. May 31, 2018 U5-3


Section 5: Troubleshooting Version 6.3

Figure 5-3 Mismatch in Material Properties Result in Device that is not Properly Constrained

5.2.2: Common Design Considerations


 Do not connect the beam end connectors of the same beam together.
 Do not combine a pressure load and a gap with a squeezed film damping model on the same plate side. Simi-
larly, avoid placing pressure load / gap on floating pressure pins for perforated backplates.
 Check for disengagement of comb fingers, and adjust the Account for Out-of-Plane Finger Disengagement
setting accordingly. In particular, if this setting is off, disengagement will result in negative capacitance.
 Multi-layer Timoshenko beams do not support cross-section warping and therefore will appear erroneously
rigid when faced with torsion load. For more information, see page C6-10 of the MEMS+ Component Refer-
ence.
 The Bernoulli beam model does not include stress stiffening in torsion. For more information, see page C6-5
of the MEMS+ Component Reference.

5.2.3: Mechanical Connectors Restored Incorrectly


Undoing an operation that removes a mechanical connector can sometimes restore the default location incorrectly. To
correct this problem, go to the Mechanical Connector tree, find the connector of interest, and set the right port con-
nection as the default (first in the list). If the default is already correct, then the location has been incorrectly refreshed
for viewing. Change a property of the mechanical connector (expose a pin, for instance) to force the connector posi-
tion to be refreshed.

U5-4 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

5.3: Common Simulation Problems


This section details troubleshooting tips common to Simulator, MATLAB, and Cadence.
For any failed analysis, first check if the provided inputs are meaningful from the physical point of view. If in doubt,
divide the input amplitudes by a factor of 10, and rerun to check if the simulation converges.
If a result file was generated as part of a failed simulation, opening it in Scene3D and viewing its 3-D response can
help troubleshoot the simulation. In particular, inspect the DOFs exhibiting the maximum displacements as reported
in the convergence log (the GetInfo window for a nonlinear AC analysis or the MATLAB Command Window for DC
analyses).

5.3.1: Troubleshooting a DC or DC Sweep Analysis


When running a DC or DC Sweep analysis, users may have trouble getting a solution or have trouble getting the solu-

M
tion to converge. This section provides guidelines on how to adjust the DC settings so that a simulation will generate
results.

DC Analysis

Problem Possible Solution


Simulation fails to converge  Rerun the analysis with the Save All Iterations option checked.
after n iterations  View the results in Scene3D.
 If the solution remains steady for the given number of iterations, increase the Absolute
Force Tolerance, then rerun the simulation.
 If the solution does NOT remain steady for the given number of iterations, increase the
Maximum Solver Iterations, then rerun the simulation.
Solver could not produce a  If you did not run the Wizard before simulating that model, return to Innovator, run the
solution Wizard, then update the Simulator model.
 If you ran the Wizard before simulating the model, try running a DC Sweep, which will help
identify the step that is causing the problem. For example, the DC analysis might be failing
because pull-in has been exceeded or the geometry is displacing excessively due to the
applied forces. A DC Sweep beginning from a known stable result (such as no applied
forces) can identify the loading condition which is causing convergence difficulty.
MaxDepth reached before Increase the Recursive Iteration Depth parameter, which determines the number of
convergence intermediate DC points, each of which uses a subsequent one as the initial guess, thus
simplifying the determination of converged solution.
Excessive geometry Run a DC Sweep to identify the step that is causing the problem. For example, the DC analysis
distortion might be failing because pull-in has been exceeded or the geometry is displacing excessively
due to the applied forces. A DC Sweep beginning from a known stable result (such as no
applied forces) can identify the loading condition which is causing convergence difficulty.

DC Analysis with a Package


A DC operating point for a package analysis with non-zero DC bias is not computed correctly with a one-step DC
analysis. To obtain the correct results, nest the non-zero DC-bias simulation underneath a zero-DC bias DC simula-
tion, which will compute the mechanical solution first before applying the voltage biases.
For more information on DC analysis, see page R5-7 of the MEMS+ Compact Modeling Reference.

Coventor, Inc. May 31, 2018 U5-5


Section 5: Troubleshooting Version 6.3

DC Sweep

Problem Possible Solution


DC Sweep failed to converge Try the following in this order:
at Step n 1. Increase or decrease the Absolute Force Tolerance setting. This tolerance setting can be
Solver could not produce a increased to relax the convergence criteria, which might allow the solver to converge
solution while yielding acceptably accurate results. If increasing the tolerance setting yields
unacceptably inaccurate results, decreasing the tolerance setting can improve
convergence by forcing each step to achieve a higher level of accuracy, thus improving
the initial condition for subsequent steps.
2. Adjust the Absolute Position Tolerance setting. This tolerance setting can be increased to
relax the convergence criteria, which might allow the solver to converge while yielding
acceptably accurate results. If increasing the tolerance setting yields unacceptably
inaccurate results, decreasing the tolerance setting can improve convergence by forcing
each step to achieve a higher level of accuracy, thus improving the initial condition for
subsequent steps.
3. Increase or decrease the number of points in your DC Sweep. For example, an input
range of 0:1:10 might be able to achieve convergence where a range of 0:2:10 fails.
4. Your problem most likely involves contact. Try running your simulation in MATLAB
scripting using a PullInAnalysis or slow transient; for more details, see the section
beginning on page U2-67.
Fails with geometry error If a DC/DCSweep fails with a geometry error, there is probably too much stress. If the
simulation succeeds with 0 stress, try using a DC Sweep Variable analysis on the stress.

For more information on DC Sweep analysis, see page R5-10 of the MEMS+ Compact Modeling Reference.

5.3.2: Simulations With Contact


Check that the values of contact softening and adhesion softening (see page C2-4 of the MEMS+ Component Refer-
ence) are lower than the smallest gap defined in your schematic. Specifically, if you've defined gaps smaller than
0.03µm (the default value for adhesion softening), you may need to reduce these softening values in order to success-
fully simulate contact.
For problems that "zipper" smoothly into contact, increase the number of mechanical connectors along the length of
the zipper direction. Also try increasing the number of electrode-contact integration points along the zippering direc-
tion.

5.3.3: Pull-In and Frequency Hysteresis (Arc Length Continuation)


Before running a Pull-In or Frequency Hysteresis analysis, first try a DC Sweep or Nonlinear AC analysis, respec-
tively. If there are no instabilities in your desired simulation range, the DC Sweep or Nonlinear AC analysis may be
sufficient.
If you determine that you need to run the Pull-In or Frequency Hysteresis, always start by running a simulation with a
large Step Size\ Initial Value and permissive Acceptance Conditions. The default Step Size\ Initial Value of 0.1 is
considered large, and the default Acceptance Conditions are considered permissive.
If your simulation has difficulty converging, runs slowly, or generates unexpected results, the GetInfo window (avail-
able by right clicking on the analysis in the Analyses pane) or the MATLAB console will have information that will
help you diagnose your simulation problems. Even if a Pull-In or Frequency Hysteresis analysis has failed, you can
still access the Get Info window and plot incomplete results.

If you have convergence difficulties:


 If you have issues with the convergence at the initial step, calculate this first point separately using a DC
analysis (in case of Pull-In), or a Nonlinear AC analysis (in case of Frequency Hysteresis). The convergence

U5-6 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

logs created by these analyses will be more complete and may help you to understand the underlying issue.
For Pull-In and Frequency Hysteresis, the initial domain value (lambda or frequency) must be outside a
region of instability.
 Reduce the Step Size Scaling Factor (e.g. down to 1.1) to make the stepping more fluent.
 Reduce the Step Size\ Minimum Value by an order of magnitude.
 Loosen the Corrector tolerances by an order of magnitude.
 Reduce the Maximum Number of Instabilities. For Frequency Hysteresis analyses, a large number (>4) of
instabilities is uncommon. If the number of instabilities reported in the GetInfo window is greater than 4,
investigate your model as well as your boundary conditions for unintended system-level conditions.
To troubleshoot a simulation that fails in the vicinity of an instability, which is typically represented by a sharp corner
on a solution plot, try the following:

M
 Consider using the Arc Length Corrector.
 Try decreasing the Bound On State Vector Length and/or the Bound On Lambda Variation Acceptance Con-
ditions by factors of 10. This will allow to increase the number of points along the solution curve.
 For a Pull-In simulation, try increasing contact softening by factors of 10. Contact softening is specified in
Innovator as a property of the root of the Components tree (see page C2-4 of the MEMS+ Component Refer-
ence). Also see Simulations With Contact.

If you have performance issues:


 Increase the Step Size\ Maximum Value, for example, increase by 2X.
 Loosen the Acceptance Conditions by an order of magnitude.
 Reduce the Maximum Number of Instabilities. If the simulation is solving for instabilities you are not inter-
ested in, reducing this setting will limit the analysis to only relevant instabilities.

If you have accuracy issues:


 If you doubt the validity of results at a given iteration, consider tightening the Corrector tolerances by an
order of magnitude.
 Disable Arc Length Corrector by setting Lower Limit of Step Size to switch from Orthogonal to Arc Length
Corrector to 0.
 If the plot does not include expected instabilities, enlarge the lambda or frequency domain.
For more information on Pull-In analysis, see page R5-17 of the MEMS+ Compact Modeling Reference.
For more information on Frequency Hysteresis analysis, see page R5-42 of the MEMS+ Compact Modeling Refer-
ence.

Pull-In, Frequency Hysteresis, and Nonlinear AC analyses are in active development. We are interested in further
improving them based on your feedback. If you are unable to resolve your convergence issue, please contact
Coventor Support.

5.3.4: Nonlinear AC
If a Nonlinear AC analysis has failed, use the convergence log to help diagnose the problem. To access the conver-
gence log, right click on the analysis in Simulator and select Get Info or view the output in the MATLAB Scripting
Command Window.
Reducing the number of harmonics may help a Nonlinear AC analysis converge. Coventor recommends that you start
with a low number of harmonics. If the results are not precise enough, increase the number of harmonics to increase
the precision of lower harmonics. For example, if the symmetry of 0th harmonic is not attained precisely enough for
a symmetric device, it may be improved by increasing the number of harmonics.

Coventor, Inc. May 31, 2018 U5-7


Section 5: Troubleshooting Version 6.3

If you attempt to calculate a frequency sweep using a Nonlinear AC, and the simulation fails close to a resonance fre-
quency, to use Frequency Hysteresis instead.
For more information on Nonlinear AC analysis, see page R5-39 of the MEMS+ Compact Modeling Reference.

5.3.5: Beam Paths Do Not Appear to Simulate Correctly


A suspension created with a beam path does not appear to simulate correctly: during results visualization, one end of
the suspension appears to be inappropriately fixed while the other end appears not to be constrained at all. Coventor
recommends breaking up the suspension into more beam paths or to use simple beams to create the suspension.

5.3.6: Stopping a Simulation


For large models (that is, models with a large number of DOFs), attempting to interrupt an analysis may require a
noticeable amount of time. Note that if you try to interrupt a simulation with multiple steps, the solver will not stop
until the current step is complete.

5.4: MATLAB Simulations


5.4.1: Transient Analysis
If your transient simulation is not converging or is taking too long to simulate, try the following techniques:
1. Adjust the Rayleigh damping value: If Rayleigh damping is not set in the imported schematic or defined in
the script, simulation performance will degrade as high frequency modes will be undamped, leading to a
small solver timestep and slow simulation time. If Rayleigh damping is set and the simulation is still taking
too long, it may be that the value needs to be decreased.
2. For a long simulation time, examine the Innovator model to see if there are DOFs that can be excluded from
the simulation.
3. For a slow transient analysis, you can set NormControl to on; see page U2-60 for more details.
4. For convergence issues, try the following:
 Add more integration points.
 Relax the relative tolerance.
 Increase the minimum step size, but also increase the number of consecutive violations allowed (several
thousands is not too much).
 Decrease the order of the Gear method (ode15s) to 1.
 Try another solver, but stay with variable-step, stiff solvers.
 If a simulation has difficulty starting or starts with a very small time step, check that the transient sources
at t=0 are equal to the parent DC sources. If you are using ode23t, try switching to ode15s.

MATLAB transient analysis may give diverging results if a single point contact is reached (for example, the contact
point is the tip of a pie component). This issue can be avoided by fixing unnecessary degrees of freedom.

Daeic3 Errors
When running a transient simulation, a user may occasionally see this daeic error:
Error using MemsplusDocMex
Error using daeic3 (line 230)
Need a better guess y0 for consistent initial conditions.
This error occurs when the Jacobian at t=0 provided by MEMS+ differs significantly from that numerically estimated

U5-8 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

by MATLAB. Often this happens when the scaling of system matrices is not good enough. Try the following trouble-
shooting steps:
 Temporarily deactivate the position sources if there are any, and check if the simulation with the force
sources succeeds.
 If you change a variable in your file, try to make the same change in Innovator, and run the wizard after-
wards. A significant change in a variable value may require the scaling factors to be recalculated.
 Run a modal analysis, and make sure you have sufficient damping in your model. Increase the Rayleigh
damping beta value if needed. Typically, you need to reduce the Q factor to a value lower than 103.
 From the Innovator tab’s Document Properties dialog, check that Wizard Actions > Auto Update Unit Scale
Factors > Expected Maximum Displacement precisely describes the displacement you expect in your tran-
sient. If this value is set too high, you might run into the daeic3 error.

M
 Tighten the position tolerance of the parent DC analysis using both RelativeTolerance and Abso-
luteForceTolerance.
Another daeic error is Daeic3: This DAE appears to be of index greater than 1.This error
occurs because the algorithm tried to determine an initial state because the one provided is not suitable. Try one of the
following:
 Provide a suitable initial state (not only the state vector, but also its derivative) using a DC simulation as the
starting point.
 Modify (reduce) the targeted time span because the MATLAB algorithm uses the time span to evaluate the
starting point.

5.4.2: Contact
The recommended solver for a contact simulation is the ode15s solver. If a simulation fails to converge with the
ode15s solver and its default settings, try reducing the Maximum order (AdvancedOptions.MaxOrder in MAT-
LAB scripting) to 1.

If simulation results show undesired peaks after contact has occurred, change the Max step size from Auto to a small
size; the value will be problem dependent. Below is an example of how to change this value in MATLAB scripting:
tran.Properties.AdvancedOptions.odesetOptions = odeset('MaxStep', 1e-9)

Coventor, Inc. May 31, 2018 U5-9


Section 5: Troubleshooting Version 6.3

5.5: Cadence Simulations


5.5.1: Troubleshooting an Operating Point
An operating point is computed prior to any simulation unless you explicitly set Spectre not to do so. If you don't see
Spectre engaging in the simulation you selected (i.e., you do not see any step information in the output log), then you
might be experiencing difficulties in computing the operating point. Another symptom might be that your simulation
does not start from the expected configuration.
Before going further, the first step is to check whether or not the operating point is the issue. Set up ADE to only run
the operating point:
1. Uncheck any other simulation from the analyses list
2. Set up the DC analysis as shown below.
3. Launch the simulation.

If the simulation succeeds, check the operating point report and the Scene3D result file. If the point does not seem
appropriate, see Inaccurate or Wrong Operating Point. If Spectre failed to obtain the operating point, see Failing to
Obtain an Operating Point.

Inaccurate or Wrong Operating Point


Check each item below, and rerun the operating point after each change:
1. Check that the gmin setting is set to zero. The gmin setting is accessed from the Simulation > Options > Ana-
log dialog, from the Algorithm tab.
2. Set up a sample transient analysis and run the SuggestScaling tool. Use suggested values to modify unit scale
factors on your schematic. See page U4-17 for more details on this tool.
3. If the device has multiple stable positions for the given DC input, make sure to orient the solution toward the
appropriate solution using the Node set option, which is accessed from ADE’s Simulation > Convergence
Aids menu. For more information on the Node set option, see the Virtuoso Analog Design Environment L
User Guide, Chapter 8 “Helping a simulation to converge.”

U5-10 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

Failing to Obtain an Operating Point


Check each item below, and rerun the operating point after each change:
1. Check gmin is set to zero. The gmin setting is accessed from the Simulation > Options > Analog dialog, from
the Algorithm tab.
2. Check your DC input is not too large for the DC to solve it in one step:
 Set voltage and current source to 0
 Set residual stress to 0
 Set thermal stress to 0
If Spectre succeeds in computing an operating point with zero inputs, then run a DC sweep to gradually in-
crease DC inputs to their nominal value and save the last point computed to a file. You can then use that file
to set initial conditions (and skip the DC) or node sets (on a DC with DC inputs set to their nominal value).

M
3. In the case of a large device (this is difficult to give a defined limit, but to give a rough idea: larger than 1
mm), the noise floor on nonlinear mechanics is higher than Spectre's absolute tolerance, and it is not possible
for the solver to find an operating point. In that situation it is necessary to scale position and forces appropri-
ately to obtain the operating point. One solution is to try guessing appropriate values for these. The other
solution is to use the SuggestScaling tool, which is accessed in the MEMS+ model’s Properties dialog, as out-
lined below:
 The documentation on SuggestScaling recommends to turn all mechanical elements to nonlinear elements
for best results. In this precise situation, nonlinear mechanics is preventing Spectre from computing the
operating point.
 So first change all flexible mechanical elements to the linear model type. If the device uses rigid plates,
change those to the nonlinear model type. You need at least one nonlinear element to actuate the device
during the sample transient simulation. This nonlinear element is essential for SuggestScaling to measure
signals and propose relevant scaling factors. If your schematic is assembled from flexible mechanical ele-
ments exclusively, you need to alter the design to add a nonlinear element (planar/side electrode, comb
electrostatics, pressure load, piezoelectric model, rigid plate).
 Import this modified schematic into Virtuoso, and assemble a schematic to drive the MEMS+ device with
a representative excitation. Turn SuggestScaling on and run the sample transient simulation.
 The force scaling factor that you obtain in that situation should be much lower than the default (e.g. 1e-8
compared to the default 1e-3). Apply suggested values to your original schematic's unit scale factors
(found in the top-level Components).

5.5.2: Frequency Analysis Mismatch


If you are running a frequency analysis and see one of the following problems:
 you are not getting the frequency peak at the expected frequency,
 you are getting a damped response, but no damping was specified in any way, or
 when running several frequency analyses with different scale factors, the frequency peak shifts.
Most likely the problem can be resolved if you set the gmin setting to zero. The gmin setting is accessed from the
Simulation > Options > Analog dialog, from the Algorithm tab. If you cannot set it to zero, you can try decreasing the
value to the point where the symptoms disappear.

Explanation
Let's take a simple, one degree of freedom mass and spring device as an example. We will drive the system with a
force source with the AC magnitude is set to 1. We are interested in the magnitude of the response of the displace-
ment versus frequency. On a SPICE simulator, the system to be solved is always
J ⋅ X = RHS

Coventor, Inc. May 31, 2018 U5-11


Section 5: Troubleshooting Version 6.3

Where J is the system matrix, X the vector of node potentials to be solved, and RHS the current flowing through the
same nodes.
For our example of a mass suspended by a spring, under an AC analysis,
 J is a 3x3 complex matrix, which will be detailed later.
 X, the solution vector, is defined as [ tpz, tvz, flow_through_tvz ]. tpz is the position of the mass, tvz is its
velocity, and flow_through_tvz is the flow through the source holding tvz.
 RHS is the excitation vector, and because we're only exciting the Z force with an AC magnitude of 1, it is [ 1,
0 ,0 ].
The contribution of the spring to J is

ForceSF K
----------------------------- 0 0
PositionSF
0 0 0
0 0 0

where ForceSF is our force to current scale factor, PositionSF is our position to voltage scale factor, and K is the stiff-
ness of the spring.
The contribution of the mass to the force flowing through mirrorcenter_tpz is ForceSF*M*d_by_dt(tvz/VelocitySF).
Using the complex analogy for the frequency domain, the operator d_by_dt is equivalent to i*2* π *freq. The contri-
bution of the mass is then

2ForceSFfreq i M π
0 ------------------------------------------------ 0
VelocitySF
0 0 0
0 0 0

where M is the mass of the rigid plate and the four beams, VelocitySF is our velocity scale factor, and freq is the fre-
quency of excitation.
The last contribution is the one from the source computing mirrorcenter_tvz from mirrorcenter_tpz:

0 0 0
0 0 1
2freq iπVelocitySF
– ------------------------------------------------- 1 0
PositionSF

Now to plot the magnitude of mirrorcenter_tpz against the frequency, we just have to solve the system for X and com-
pute the magnitude of the first component, which is:

PositionSF
Abs -------------------------------------------------------------------
2 2
ForceSF ( K – 4 freq Mπ )

The peak frequency is obtained correctly when -4*freq2*M* π 2 + K = 0.


It is independent of any scale factor and does not show any damping, as expected.
The system that Spectre uses to solve the AC analysis problem looks slightly different. In order to improve conver-
gence, Spectre adds a small conductance, which is specified by the solver parameter gmin. The contribution of gmin
to the system matrix is

U5-12 May 31, 2018 Coventor, Inc.


Section 5: Troubleshooting Version 6.3

0 gmin 0
0 0 0
0 0 0
Assuming a non-zero value for gmin, the magnitude of tpz against frequency takes the following form:

PositionSF
Abs ---------------------------------------------------------------------------------------------------------------------------------------------
2 2
( ForceSF ( K – 4freq Mπ ) +2i freqgminπVelocitySF )

Here gmin introduces additional damping and hence will shift the frequency peak. How much depends on the relative
size of gmin.

M
Note that each component drives gmin's contribution to the system matrix. Thus, a different set of components will
generate a different contribution to the system matrix and yield different effects on the frequency response.
In general, it is advised to set gmin to 0, unless you can achieve convergence by any other means.
In cases where you need to set gmin to a non-zero value, measure its effect on your device using frequency analysis.

5.5.3: Current Measurement through a Source Yields Unexpected


Results
If you are running a DC sweep simulation on a voltage source connected to your MEMS+ device, and the plot of the
current through the source is a straight line instead of a curve, try one of the following:
 Set your gmin value to zero. When the gmin is a value other than zero, Spectre adds a little conductance to
help convergence, and in some cases, the current produced by this small conductance is significant compared
to the current produced by the electrical components.
 Increase the force to current scale factor in MEMS+ Innovator to get significant output from the electrical
components. For example, if the electrostatic forces produced are in the order of fA, multiply the force to cur-
rent scale factor by 1e9 to get a better output.
This problem may also manifest when running a slow transient or when using and sweeping a current source, then
probing its voltage.

5.5.4: Quantity Functions and Scale Factors not in Sync


On some occasions MEMS+ cannot properly detect that several MEMS+ devices using different scale factors are part
of the same design and will only report "Quantity scaling functions and MEMS+ innovator unit scale factors are not in
sync. Please refresh your MEMS+ cell."
If you are simulating several MEMS+ devices in the same Virtuoso schematic, all the devices are required to have the
same scale factors. If all your devices have similar behavior, copy the scale factors from one of your devices to the
others. If your devices have very different behaviors, choose the scale factors of the device experiencing the largest
displacements and/or accelerations, and verify the results of the other devices are still correct.
If the device characteristics are fundamentally different, it may not be possible to simulate them in the same sche-
matic.

Coventor, Inc. May 31, 2018 U5-13


Section 5: Troubleshooting Version 6.3

5.6: Scene3D
5.6.1: New Result File Will Not Load Automatically
When a simulation result file is overwritten, Scene3D will not automatically reload the newer result file. If a result
file is overwritten, use the Reload icon in the Scene3D tab to view the newest results.

5.6.2: Loading a Result File Crashes Scene3D


If a user attempts to load a result for which the original Innovator 3-D schematic file has been significantly modified,
Scene3D may crash. To fix this problem, restore an original copy of the Innovator 3-D schematic file if possible.

5.7: Poor Graphics Quality


Rendering problems may occur when displaying remotely or with an integrated graphics card. Users may see outlines
of windows displayed in other windows or the model may not display correctly (incorrect coloring, sizing, etc.).
When connecting over a remote X session on a Linux system, users may see problems such as the 3-D canvas never
appears and a number of "ERROR [HOOPS]" messages appear in the MEMSp.log file. The errors are often "ERROR
[HOOPS] Server does not have GLX extension" or "ERROR [HOOPS] The device for '/driver/opengl/...' doesn't
seem to be alive" or the 3D rendering is poor.
To diagnose rendering problems, first make sure that the graphics card drivers are up to date. If the drivers are up to
date, you may be able to improve rendering by turning off OpenGL. The MEMS+ Applications Options dialog has a
Hardware Rendering option on the MEMS+ tab (see page U1-10). By default, it is checked. Unchecking this option
may improve rendering.
To turn off OpenGL from a terminal window, set the following environment variable:
In a bash shell: export COV_NO_OPENGL=t
In a tcsh shell: setenv COV_NO_OPENGL t
If deactivating hardware rendering does not correct your visualization problems, follow the instructions in the “3-D
Graphics Requirements” section of the MEMS+ Installation Instructions, starting on page 6-1.
Also check that your graphics card properly supports 3-D visualization tools. For graphics card requirements, see
http://www.coventor.com/mems/support/sysreq.html.

U5-14 May 31, 2018 Coventor, Inc.


Section 6: Appendix Version 6.3

Section 6: Appendix

6.1: Keyboard Shortcuts


This section documents the available keyboard shortcuts for MEMS+ and its plug-ins. The intention is to provide the
user with all the keyboard shortcuts in one location. These shortcuts are also documented in the appropriate reference
sections. When available, the table provide a page reference for more details about each function.

Table 6-1 Keyboard Shortcuts

Function Keyboard Shortcut Reference

M
MEMS+ application

Create a new instance in another window Ctrl + Shift + N U1-10

Open a file in another window Ctrl + Shift + O U1-10

Open Application Options dialog Ctrl + Shift + P U1-10

Open Transcript Window Ctrl + Shift + T

Go to the first tab (Note that the user can


undock tabs, and if so, the first tab is not Alt + 1
necessarily the Material Database tab.)

Go to the second tab Alt + 2

Go to the third tab Alt + 3

Go to fourth tab Alt + 4

Go to fifth tab (if Scene3D is open and in


Alt + 5
default location)

Common to all plug-ins, but applicable only to the active plug-in

Open a new, blank document in active window Ctrl + N U1-11

Replace current document with another Ctrl + O U1-11

Save Ctrl + S

Undo Ctrl + Z U1-11

Ctrl + Y (Windows)
Redo U1-11
Ctrl + Shift + Z (Linux)

Open document properties (except Material


Ctrl + P U1-11
Database and Scene3D)

Reset location of window panes to default


layout. This shortcut only works for the active
Ctrl + Shift + W U1-9
tab; other tabs will keep user-specified
configurations.

Item Tree (all plug-ins except Scene3D)

Copy Ctrl + C

Cut Ctrl + X

Coventor, Inc. May 31, 2018 U6-1


Section 6: Appendix Version 6.3

Function Keyboard Shortcut Reference

Paste Ctrl + V

Delete Delete

Rename F2

Get Info Alt + I

Alt + P or double click on the


Properties
item in the tree

Variable Tree

Expose Variable Ctrl + E

Hide Variable Ctrl + H

Restore Default Ctrl + R

Highlight Dependencies Ctrl + D

Alt + P or double click on the


Properties
item in the tree

Comment Editor (Material Database and Process Editor. Note that this is opened using Alt + C)

Bold text Ctrl + B

Italicize text Ctrl + I

Underline text Ctrl + U

Align text to the right Ctrl + R

Align text to the left Ctrl + L

Align text to center Ctrl + E

Justify text Ctrl + J

Select All Ctrl + A

Material Editor List

Edit Comment Alt + C R1-2

Get Info Alt + I R1-23

Alphabetic Sort Alt + S R1-2

Process Editor Item Tree

Enable Ctrl + E R2-2

Disable Ctrl + D R2-2

Edit Comment Alt + C R1-2

Innovator
Fit to Window Ctrl + 0 R4-32

Oblique View Ctrl + 1 R4-32

U6-2 May 31, 2018 Coventor, Inc.


Section 6: Appendix Version 6.3

Function Keyboard Shortcut Reference

XY+ View Ctrl + 2 R4-32

XY-View Ctrl + 3 R4-32

XZ+ View Ctrl + 4 R4-32

XZ- View Ctrl + 5 R4-32

YZ+ View Ctrl + 6 R4-32

YZ- View Ctrl + 7 R4-32

Toggle Tesselation Ctrl + Alt + T

M
Toggle Watermark Ctrl + Alt + W

Rotate Left click + drag R4-32

Pan Right click + drag R4-32

Click right and left mouse


Zoom buttons and drag or use the R4-32
mouse scroll wheel

Selection Left click

Selection Box Shift + Left click + drag

Component View Mode Ctrl + Alt + 1

Mechanical Connectors View Mode Ctrl + Alt + 2 R4-16

Electrical Connectors View Mode Ctrl + Alt + 3 R4-25

Fluidic Connectors View Mode Ctrl + Alt + 4

Increase selected scaling ] R4-35

Decrease selected scaling [ R4-35

Innovator Components Tree

Hide component or deposit Alt + H R4-8

Show component or deposit Alt + S R4-8

Mirror about Local X Alt + X R4-8

Mirror about Local Y Alt + Y R4-8

Group Alt + G R4-8

Replicate Alt + R R4-10

Get Info Alt + I

Restore Default Rendering Options (for


Alt + D R4-9
deposits)

Material (for deposits) Alt + M R4-9

Open Properties Alt + P

Innovator Connectors Tree

Coventor, Inc. May 31, 2018 U6-3


Section 6: Appendix Version 6.3

Function Keyboard Shortcut Reference

Connect Shift + C R4-17

Disconnect Shift + D R4-17

Make default connections Shift + M

Fix (mechanical)/Ground (electrical)/Ambient


Ctrl + F R4-23
Pressure (fluidic)

Release (mechanical)/Float (electrical, fluidic) Ctrl + R R4-23

Expose (electrical, fluidic) /Expose all DOFs


Ctrl + E R4-23
(mechanical

Unexpose Ctrl + H R4-23

Properties Alt + P

Innovator Input and Output Trees

Expose Ctrl + E

Unexpose Ctrl + H

Simulator

Fit to Window Ctrl + F R4-32

Oblique View Ctrl + 1 R4-32

XY+ View Ctrl + 2 R4-32

XY-View Ctrl + 3 R4-32

XZ+ View Ctrl + 4 R4-32

XZ- View Ctrl + 5 R4-32

YZ+ View Ctrl + 6 R4-32

YZ- View Ctrl + 7 R4-32

Toggle Tessellation Ctrl + Alt + T

Toggle Watermark Ctrl + Alt + W

Rotate Left click + drag R4-32

Pan Right click + drag R4-32

Click right and left mouse


Zoom R4-32
buttons and drag

Component View Mode Ctrl + Alt + 1

Mechanical Connectors View Mode Ctrl + Alt + 2 R4-16

Electrical Connectors View Mode Ctrl + Alt + 3 R4-25

Fluidic Connectors View Mode Ctrl + Alt + 4

Increase selected scaling ] R4-35

U6-4 May 31, 2018 Coventor, Inc.


Section 6: Appendix Version 6.3

Function Keyboard Shortcut Reference

Decrease selected scaling


[ R4-35

Simulator Analysis Tree

Run an analysis Alt + R

Stop an analysis Alt + S

Open in new Tab Ctrl + T

Show selected result in Explorer window Ctrl + E

M
Scene3D

Fit to Window Ctrl + F R4-32

Oblique View Ctrl + 1 R4-32

XY+ View Ctrl + 2 R4-32

XY-View Ctrl + 3 R4-32

XZ+ View Ctrl + 4 R4-32

XZ- View Ctrl + 5 R4-32

YZ+ View Ctrl + 6 R4-32

YZ- View Ctrl + 7 R4-32

Toggle Tessellation Ctrl + Alt + T

Toggle Watermark Ctrl + Alt + W

Rotate Left click + drag R4-32

Pan Right click + drag R4-32

Click right and left mouse


Zoom R4-32
buttons and drag

Component View Mode Ctrl + Alt + 1

Mechanical Connectors View Mode Ctrl + Alt + 2 R4-16

Electrical Connectors View Mode Ctrl + Alt + 3 R4-25

Fluidic Connectors View Mode Ctrl + Alt + 4

Increase selected scaling ] R4-35

Decrease selected scaling [ R4-35

Close the Scene3D result Ctrl + F4

Scene3D Components Tree

Show Alt + S

Hide Alt + H

Get Info Alt + I

Coventor, Inc. May 31, 2018 U6-5


Section 6: Appendix Version 6.3

6.2: Additional Command Line Functionality


Additional functionality is available from a shell window on Linux and from the command line on Windows.

6.2.1: ExportSch
This command allows the user to export MEMS+ files in different formats or to export a list of variables for use in
other software programs. The command and all its operations and variables are listed below. Note that the arguments
in square brackets are optional.
ExportSch filename.3dsch [operation(s)]
The operations are
-h --help Prints this message.
*.3dsch --sch [file.3dsch] [search=true/false] [library=name] [cell=name]
[check=true/false] Reads the Innovator specified by [file.3dsch].
[search=true/false] Can be used to search for the schematic along the path MEMSPLUS_SCHE-
MATIC_PATH.
[library=name] Limit the search to the specified library.
[cell=name] Limits the search to the specified cell.
[check=true/false] If set to true, the command will not load the schematic, but will verify it can be
found and print out full path to schematic.
-v name=value Assigns a variable to a value. The name must match a valid exposed variable.
--varlist [file] [format="name=value"] Returns the list of exposed variables; requires a MEMS+
schematic (filename.3dsch) to be available. Return to the standard output if [file] is omitted. [for-
mat="name=value"]specifies the output format. The name and value keywords must appear. Defaults to
“name=value”.
--sat [file] Exports the schematic in 3-D SAT R26 format to the specified file; requires a schematic file
(filename.3dsch) to be available. [file] defaults to filename.sat if omitted.
--2dsat [file] Exports the schematic in 2-D SAT format to the specified file; requires a schematic file (file-
name.3dsch) to be available. [file] defaults to filename.2dsat if omitted.
--gds [file] Exports the schematic in GDS format to the specified file; requires a schematic file (file-
name.3dsch) to be available. [file] defaults to filename.gds if omitted.
--pcell [file] Exports the schematic as a Cadence Virtuoso PCell to the specified file; requires a schematic
file (filename.3dsch) to be available. [file] defaults to filename.pts if omitted.
--pcellcreation [file] Exports a skill script defining the P-cell to the specified file; requires a schematic
file (filename.3dsch) to be available. [file] defaults to filename.mpef_p if omitted.
--cadencelibrarycell [file] Exports a definition file for creating a new cell in Cadence Virtuoso li-
braries to the specified file; requires a schematic file (filename.3dsch) to be available. [file] defaults to file-
name.mpef_c if omitted.
--spectrenetlist [file] Exports a Spectre netlist to the specified file; requires a schematic file (file-
name.3dsch) to be available. [file] defaults to filename.scs if omitted. Other arguments include
[unitTest_time=time] Sets time limit for the simulation to run.
[resultFilename=name] Forces name of MEMS+ result file to be name.
[resultBasename=name] Changes the name of MEMS+ result file, keeping consistent extension.
[hasResultBasenameParameter=bool] Defines Scene3DfileBasename to be a parameter of the
subckt. Can be true or false; defaults to true.
[hasSuggestScalingParameter=bool] Defines SuggestScaling to be a parameter of the subckt.
Can be true or false; defaults to true.

U6-6 May 31, 2018 Coventor, Inc.


Section 6: Appendix Version 6.3

[search=true/false] Searches for schematic along the path MEMSPLUS_SCHEMATIC_PATH.


[library=name] When searching, limits the search to the specified library.
[cell=name] When searching, limits the search to specified cell.
[useMechanicalQuantities=bool] Describes mechanical signals with mechanical quantities or map
all signals to voltage/current.
[useQuantityFunctions=bool] Adds helper functions to the netlist to convert from physical quanti-
ties to voltage/current.
-l --license port Specifies license location to use. port must be specified.
*.mproc Reads a process file.
--techfilecreation [file] Creates a ASCII Technology File from a MEMS+ process description and
outputs it to [file]; requires a process file (filename.mproc) to be available. [file] defaults to filename.tf if

M
omitted.
--update [file] [copy=all] Updates and saves the schematic; requires a schematic file (file-
name.3dsch) to be available.[file]specifies the output file; it defaults to filename.3dsch if omitted. [co-
py=all]creates a copy of all dependent files next to the new schematic file name. Other arguments include
[mmdb=filename] Renames the Material Database file used by the schematic.
[proc=filename] Renames the process file used by the schematic.
[mlib=filename] Renames the Component Library file used by the schematic.
[alllocal=bool] Strips down absolute paths of all dependent documents. Defaults to false.
--log [file] [cerr=file] [cout=file] Redirects outputs to files. [file] specifies where stan-
dard error and output are both redirected. [cerr=file]specifies where standard error is redirected.
[cout=file]specifies where standard output is redirected.
--loadmodelstate file path=PathToSch stop=id skip=id Loads the state of a model from
the file and runs model. Takes care of opening the appropriate schematic that must be available from MEMS+
search path. All arguments must be provided at once; see example.
file Input file, as generated by model library.
path=PathToSch Path to be added to search path
stop=id Stop before loading state #id
skip=id Skip loading state #id
result=filename Writes out the DC Scene3D result file of the failing point to 'filename.index.dc'
*.msim --msim [file.msim] Reads the Simulator document specified by [file.msim] and executes
the simulations therein.
*.mlib Reads a component library file.
*.mmdb --mmdb [file.mmdb] [file.mpd] Reads the material database file specified by
[file.mmdb]. If [file.mpd] is specified, it exports the mmdb file to CoventorWare mpd format.
--stop Pauses the execution after reading arguments for attaching debugger.

Examples
To export a schematic to a SAT file in temporary folder with variable specifications:
ExportSch /home/user/MEMS+/RFSwitch.3dsch --sat /tmp/MEMSplus/RFSwitch.sat
-v T=273.1 -v ActuationPadWidth=200
To export an exposed variable list to a file with values separated from names by tab, one variable per line:
ExportSch RFSwitch.3dsch --varlist /tmp/varlist.file --varlist
format="name\tvalue\n"

Coventor, Inc. May 31, 2018 U6-7


Section 6: Appendix Version 6.3

To provide an operation with several arguments with a comma separated list of arguments:
ExportSch --loadmodelstate memsplus.err, path=/my/first/path,path=/my/sec-
ond/path
To modify values of exposed variables var1 and var2, and then run all simulations in file.msim:
ExportSch file.msim -v var1=2 -v var2=4

U6-8 May 31, 2018 Coventor, Inc.

You might also like