0% found this document useful (0 votes)
825 views104 pages

Twin Builder Getting Started Guide 2023

The Twin Builder Getting Started Guide provides an introduction to the Twin Builder simulation package, aimed at both beginners and experienced users. It outlines the steps for creating and managing projects, including detailed instructions for modeling various electrical systems, such as a Three-Phase Rectifier and DC motors. The guide emphasizes the flexibility of Twin Builder in virtual prototyping and offers insights into its interface and functionalities.

Uploaded by

farid.mmd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
825 views104 pages

Twin Builder Getting Started Guide 2023

The Twin Builder Getting Started Guide provides an introduction to the Twin Builder simulation package, aimed at both beginners and experienced users. It outlines the steps for creating and managing projects, including detailed instructions for modeling various electrical systems, such as a Three-Phase Rectifier and DC motors. The guide emphasizes the flexibility of Twin Builder in virtual prototyping and offers insights into its interface and functionalities.

Uploaded by

farid.mmd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 104

Twin Builder Getting Started Guide

ANSYS, Inc. Release 2023 R2


Southpointe July 2023
2600 Ansys Drive
ANSYS, Inc. and
Canonsburg, PA 15317
ANSYS Europe,
[email protected] Ltd. are UL
https://www.ansys.com registered ISO
(T) 724-746-3304 9001:2015 com-
(F) 724-514-9494 panies.
Twin Builder Getting Started Guide

Copyright and Trademark Information

© 1986-2023 ANSYS, Inc. Unauthorized use, distribution or duplication is prohibited.

ANSYS, Ansys Workbench, AUTODYN, CFX, FLUENT and any and all ANSYS, Inc. brand,
product, service and feature names, logos and slogans are registered trademarks or trademarks
of ANSYS, Inc. or its subsidiaries located in the United States or other countries. ICEM CFD is a
trademark used by ANSYS, Inc. under license. All other brand, product, service and feature
names or trademarks are the property of their respective owners. FLEXlm and FLEXnet are
trademarks of Flexera Software LLC.

Disclaimer Notice

THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE


SECRETS AND ARE CONFIDENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC.,
ITS SUBSIDIARIES, OR LICENSORS. The software products and documentation are furnished
by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement that contains
provisions concerning non-disclosure, copying, length and nature of use, compliance with export-
ing laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The
software products and documentation may be used, disclosed, transferred, or copied only in
accordance with the terms and conditions of that software license agreement.

ANSYS, Inc. and ANSYS Europe, Ltd. are UL registered ISO 9001: 2015 companies.

U.S. Government Rights

For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license
agreement, the use, duplication, or disclosure by the United States Government is subject to
restrictions stated in the ANSYS, Inc. software license agreement and FAR 12.212 (for non-
DOD licenses).

Third-Party Software

See the legal information in the product help files for the complete Legal Notice for Ansys pro-
prietary software and third-party software. If you are unable to access the Legal Notice, please
contact ANSYS, Inc.

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Table of Contents
Table of Contents Contents-1

1 - Introduction 1-1

Overview of the Twin Builder Interface 1-1

2 - Creating a New Project 2-1

Expected Results 2-2

Add the New Project 2-4

Rename the Design 2-5

Add Design Notes (Optional) 2-6

Save the New Project 2-6

3 - Create the Rectifier Model 3-1

4 - Hysteresis Current-Controlled DC-Motor Start-Up 4-1

Saving the Sheet with a New Name 4-2

Defining DC Machine Values 4-2

Freewheeling Diode 4-4

Chopper Transistor 4-4

Controller Modeling Using Block Elements 4-6

Modifying Report Elements 4-8

Display Diode Characteristic 4-8

Defining Simulation Parameters 4-10

Starting Simulation (Block Components) 4-10

Connecting the State Graph Components 4-12

Defining the Properties of State Graph Components 4-12

Using Name References 4-15

Deactivating Components on the Sheet 4-15

Starting Simulation (State Graph) 4-17

5 - Current and Speed Controlled DC Motor 5-1

Contents-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Saving the Sheet with a New Name Current Speed 5-3

Defining Mechanical Load (Block) 5-4

Starting Simulation 5-9

Adjusting Plot Properties 5-11

Using Automatic Block Sorting 5-13

Using Manual Block Sorting 5-13

Rerun the Simulation (PI Controller) 5-13

Simulation Results (PI Controller) 5-14

6 - Using VHDL-AMS Components for Modeling 6-1

Save the Project with a New Name 6-2

Delete the DC Machine Component 6-3

Placing and Arranging the New VHDL-AMS Components on the Sheet 6-3

Connecting the New VHDL-AMS Components 6-3

Defining VHDL-AMS DC Machine Values 6-3

Defining Connections for Machine Current 6-4

Defining Simulation Parameters 6-5

Analyze and Display Simulation Results (VHDL-AMS) 6-5

7 - Variants of PWM Modeling 7-1

Setting Initial Conditions 7-2

PWM Modeling Using Equations 7-3

Defining Simulation Parameters 7-3

Displaying Simulation Results with Reports 7-4

Simulation Results 7-4

PWM Modeling with Equations and Time Function 7-5

PWM Modeling with State Graph Components 7-6

Place and Arrange the Components on the Sheet 7-7

Define Component Properties 7-7

Placing and Arranging the Components on the Sheet 7-9

Contents-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

8 - Using Legacy Schematics 8-1

Translating a Legacy Schematic using Release 16.2 or Earlier 8-2

Importing a Legacy Schematic into Simplorer Release 16 or earlier 8-2

Plotting Simulation Results 8-9

Index Index-1

Contents-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Contents-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

1 - Introduction
This Getting Started guide is written for Twin Builder beginners as well as experienced users
who are using Twin Builder for the first time.

Twin Builder is a simulation package for multi-domain designs that are commonly found in auto-
motive, aerospace, power electronics, and electric drive systems.

Twin Builder provides an approach for the virtual prototyping of large-scale systems by letting
you to develop a design that combines predefined basic and industry-specific components with
user-defined models. You can create models in common programming languages or standard
modeling languages such as VHDL-AMS. The basic and industry-specific model libraries avail-
able for Twin Builder provide ready-to-use parameterized components, making Twin Builder
accurate, and flexible.
l Chapter 2 of this guide shows you how to create and save a new Twin Builder project.
l Chapter 3 leads you step-by-step through creating, solving, and analyzing the results of
a Three-Phase Rectifier.
l Chapter 4 modifies the example of Chapter 3 by replacing the resistive/inductive load
with a real machine model. The example is then expanded to include a control circuit
modeled first using discrete components, then using state graph components.
l In Chapter 5 the state graph controller is replaced with a PI (proportional-integral) con-
troller implemented using block components.
l Chapter 6 substitutes the use of VHDL-AMS opponents for modeling the DC motor.
l Chapter 7 explores several different methods for modeling a PWM Controller to demon-
strate Twin Builder’s versatile modeling capabilities.
l Chapter 8 leads you through the process of importing a legacy Simplorer 7 Three-
Phase Rectifier schematic into Simplorer Release 16.2, saving it, migrating it into Twin
Builder 2018.2, then solving and analyzing the translated model.

Overview of the Twin Builder Interface


Below is an overview of the major components of the Twin Builder interface.

Introduction 1-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Project Man- The Project Manager pane shows all the components, models, and other ele-
ager pane ments of each design in the project. Each project has its own expandable Pro-
and Project ject tree. You can perform many operations on the design elements directly from
tree the Project Manager pane.
Message Displays error, informational, and warning messages for the active project.
Manager
pane
Progress Displays solution progress information.
window

Introduction 1-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Properties Displays the attributes of a selected object in the active model, such as the
window object’s name, electrical or other associated physical quantities, orientation, and
color.

Also displays information about a selected command that has been carried out.
For example, if a circle was drawn, its command information would include the
command’s name, the circle’s center position coordinates, and the size of its
radius.
Design area Displays one or more editor windows such as the Schematic Editor, model edit-
window ors, and symbol editor. It also displays various report windows.
Component Displays, on the Components tab, the component categories, including Favor-
Libraries ites, Most Recently Used, Simplorer Elements, and Project Components. You
window can pin the window to make it remain visible or make it visible only when it is
being used.

These elements are defined as favorites by default:


l R (resistor)
l L (inductor)
l C (capacitor)
l D (diode)
l E (voltage source)
l AM (ammeter)
l VM (voltmeter)

The Project Components section lists the elements that are active in your pro-
jects.

If you have created any personal libraries, a Personal Libraries section displays
them.

The Component Manager window also provides a search feature on the


Search tab.
Menu bar Provides various menus that enable you to perform Twin Builder tasks, such as
managing project files, designs, and libraries; customizing desktop components;
drawing objects; and setting and modifying project parameters and options.
Ribbons Provides tabs containing icons that act as shortcuts for executing various com-
mands.
Status bar Shows current actions and provides instructions.

Introduction 1-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

PDF layout 1-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

2 - Creating a New Project


This guide assumes that you have installed Twin Builder.

In this chapter you will complete these tasks:


l Create and save a new project.
l Add and rename a Twin Builder design in the project.

About the Three-Phase Rectifier

This example describes a three-phase power supply and a rectifier bridge with res-
istive/inductive load. For the input signals, time-controlled voltage sources are used. The diodes,
the capacitor, and the resistor are ideal components; the diodes are determined by an expo-
nential function (their characteristic).

Creating a New Project 2-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Expected Results
After the simulation is run, the results are displayed in Report windows. For example, the first
simulation variation demonstrates these results:
l Voltages of the sources ET1.V, ET2.V, and ET3.V
l Voltage of the smoothing capacitor CD.V
l Current of the load resistor R_LOAD.I

Creating a New Project 2-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Using Twin Builder to Create and Improve the Design

As you step through this Getting Started Guide, we introduce you to several key concepts:
l There are numerous ways to perform most tasks.

For example, there are several methods to select and assign design parameter values.
l There is no required sequence of events when creating a design. —

Creating a New Project 2-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

We'll demonstrate a convenient method for creating the three-phase rectifier, but you can
complete the design setup steps in any logical order.
l You can quickly modify design properties at any time.

For example, you can draw a box freehand, then specify its exact dimensions in the Prop-
erties window.
l You can easily manage your design in the Project tree.

The branches of the Project tree in the Project Manager pane provide access to set up
dialog boxes, where you can modify design properties.
l You can modify the model view at any time.

You will learn shortcut keys like Ctrl+D, which fits the model in the view window.
l You can save time by parameterizing design properties.

This enables you to quickly modify design properties and generate new results.
l You can use Twin Builder’s extensive post-processing features to evaluate solution res-
ults.

Creating the New Project

The first step in using Twin Builder to solve a problem is to create a project in which to save all of
the data associated with the problem. A project is a collection of one or more designs saved in a
single *.aedt file. By default, opening Twin Builder creates a new project named Projectn and
inserts a new design named TwinBuildern, where n is the order in which each was added to the
current session.

Add the New Project


To add a new Twin Builder project:
l Click File > New.

Creating a New Project 2-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

A new project named Projectn containing a new design named Twin Buildern is added in
the Project tree in the Project Manager pane.

Hint l If the Project Manager pane does not appear, select View > Project Manager.
l If a new design does not appear, select Tools > Options > General Options.
Under Project Options, select Insert a design of type.
l To expand the Project tree when an item is added to the project, select
Tools > Options > General Options. Under Project Options, select Expand
Project Tree on Insert.

The new project contains a file structure that organizes design elements such as: Ports,
Analysis, Optimetrics, and Results. Project Definitions such as Components, Symbols,
Models, Packages, Materials, and Scripts also appear.

Rename the Design


Follow this procedure to rename the default Twin Builder design name:

1. In the Project tree, right-click TwinBuildern and select Rename, or select a name and
press F2.
2. Type Rectifier (or some other name of your choosing) and press Enter to complete the

Creating a New Project 2-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

change.

Add Design Notes (Optional)


You can include notes about your design, such as a description of the design being
modeled, with the project. These notes are useful for keeping a running log of your
designs.

Follow this procedure to add notes to your design:

1. Select Twin Builder > Edit Notes. The Design Notes dialog box appears.
2. Click in the window and type your notes.
3. Click OK to save the notes in the Project tree under the current design.

Note:

To edit existing design notes, double-click Notes in the Project tree to open the
Design Notes dialog box.

Save the New Project


Follow this procedure to save the new project:

1. Select File > Save. The Save As dialog box appears.


2. Use the file browser to find the target directory.
3. Type the desired file name in the File name text box.
4. In the Save as type list, ensure that Ansys Electronics Desktop Project File (*.aedt) is
chosen. Project files are given an AEDT extension by default.
5. Click Save to save the project to the specified location.

Creating a New Project 2-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Note:

For further information on any Twin Builder topic, schematic editor commands or
windows, you can view Twin Builder’s context-sensitive help in one of these
ways:
l Click Help in a dialog box.
l Press Shift+F1. The cursor changes to ?. Click an item for which you need
help.
l Press F1 to open the Help window. If you have a dialog box open, the
Help window opens to a page that describes that dialog box.
l Access the Help menu.

You are now ready to create the Rectifier model.

Creating a New Project 2-7

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

PDF layout 2-8

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

3 - Create the Rectifier Model


This section describes how to complete these tasks:
l Basic Twin Builder functions
l Choosing Twin Builder components from a library
l Placing and arranging components
l Connecting components on the sheet
l Controlling the display of component properties
l Modeling with electric circuit components
l Modeling time controlled sources
l Setting up and running an analysis (simulation)
l Using Reports for displaying simulation results

Create the Three-Phase Rectifier Schematic

This example contains a three-phase power supply and a rectifier bridge with resistive/inductive
load. For the input signals, time controlled voltage sources are used. The diodes, the capacitor,
and the resistor are ideal components; the output characteristics of the diodes are determined by
an exponential function.

Create the Rectifier Model 3-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Note:

If you make a mistake, click Rectifier in the Project tree, then select Undo > Edit to
undo design operations. Twin Builder lets you undo every command performed since
the last save.

Choosing, Placing, and Arranging Components on the Schematic Sheet

First, locate and choose the components to use in the simulation model, then place and arrange
the components on the schematic sheet.

Create the Rectifier Model 3-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

1. In the Component Libraries window, select the R: Resistor element. The R: Resistor
element appears under Favorites by default.

Note:

An alternative path is to click + to expand the Simplorer Elements tree, then con-
tinue to click + symbols next to the Basic Elements folder, the Circuit folder,
and the Passive Elements. The R: Resistor element appears under Passive
Elements.

Create the Rectifier Model 3-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

2. To place the resistor onto the sheet, select R: Resistor, then click and drag the selection
onto the sheet.
3. As you drag a library component over the Schematic Editor window, the symbol for that
component appears. Press R to rotate the component before placing it on the sheet. The
component rotates 90 degrees counter-clockwise each time you press R.

After placing one resistor, notice that the cursor retains a selected resistor symbol.

Create the Rectifier Model 3-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

This feature permits you to place several instances of a component by clicking without hav-
ing to reselect the component from the library.

4. Right-click a component and select Finish to exit the “place” mode without placing a com-
ponent. Alternatively, select Place and Finish to place an additional component before
exiting “place” mode.

Note:

Press Esc to exit “place” mode without placing a component.

5. To continue the design, repeat the process outlined above and place these components
from the Basic Elements library onto the Schematic Editor sheet.

Module Group Component Quantity


Circuit Passive Elements R: Resistor 4
L: Inductor 4
C: Capacitor 1
Sources E: Voltage Source 3
Semiconductors System Level D: Diode 6

6. When you have placed the elements, use the three-phase rectifier schematic at the start
of this chapter as a guide to arrange the components.

Create the Rectifier Model 3-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Note:

Be aware of the “counting” direction when arranging components. This direction


is marked by the red “dot” or the plus sign on the symbol of electrical com-
ponents.

Once components are placed, you can select, move, copy, delete, rotate, or flip them. To
select elements:
l Click an element.
l Drag and draw a selection rectangle around multiple instances.
l Press Ctrl+click multiple instances.

Selected instances are highlighted.

Access commands for flipping and rotating selected elements in the ribbon, or by right-
clicking a component.

Hint Save your project frequently: Select File > Save.

7. To align specific components, select a component, and drag to specify a selection area.
Selected elements are highlighted.

Use Draw > Align Horizontal to horizontally align the components, and Draw > Align
Vertical to vertically align components.

8. A ground node is necessary for each separate circuit on a sheet. To place a ground node,
selectDraw > Ground or press Ctrl+G.

Hint l Zoom in and out with the View menu, the Zoom icon functions in the Twin
Builder Schematic ribbon, or Ctrl+E (Zoom In) and Ctrl+F (Zoom Out).
Ctrl+D (Fit Drawing) scales the drawing to include all of its components in
the current window.
l To move the sheet and its contents around within the window, press Shift,
select a sheet, and drag it to the desired position.

The ground symbol will stick to the mouse pointer.

Create the Rectifier Model 3-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

9. Position the terminal of the ground node over the terminal of the device you are grounding
and click to place the ground node and connect it to the device. You can rotate the ground
node to the desired position if necessary.

All of the components required for the Three-Phase Rectifier simulation model should now be on
the sheet and placed in the appropriate positions. In the next section, you will connect the com-
ponents.

Connecting the Components

When you have arranged all of the components, you are now ready to connect them as required
for this example.

1. To connect components, activate wire drawing mode by choosing Draw > Wire. The
cursor changes to crossed wires.

Note:

Press Ctrl+W to activate wire drawing mode, or click a pin.

2. Connect the components as required for the example circuit.


a. Place the cursor on the element pins and set the beginning, the corners, and the
end of a wire by clicking and dragging.
b. Press Esc to exit wire drawing mode. The cursor changes back to a pointer.

Defining Component Properties

The components that you have placed and connected still have their default parameter values,
as defined in the Basic Elements model library. You will now assign values to these com-
ponents to match the schematic at the beginning of this chapter by performing these steps:

1. First, define the parameters of the three voltage sources. All sources are time-controlled
sine function generators with a phase shift of 120 degrees with respect to each other.
a. Double-click the first Voltage Source symbol to open the component’s Parameters
dialog box.
b. Change the Name parameter to ET1.

Create the Rectifier Model 3-7

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

c. Select the Time Controlled option button and select Sine from the drop-down
menu. Keep the Phase value as-is at 0 (zero) degrees. Keep all other values at their
default values.
d. Click OK to apply the changes.
2. Double-click the second voltage source symbol to open its Parameters dialog box.
a. Change the Name parameter to ET2.
b. Select the Time Controlled option button.
c. Set the Phase value to 120 degrees. Keep all other values at their default values.
d. Click OK to apply the changes.
3. Double-click the third voltage source symbol to open its Parameters dialog box.
a. Change the Name parameter to ET3.
b. Select the Time Controlled option button.
c. Set the Phase value to 240 degrees. Keep all other values at their default values.
d. Click OK to apply the changes.

Note:
l Properties of the currently selected element are also displayed in the Prop-
erties window similar to the one shown below.

l You can modify many component properties in this window. Refer to the
Twin Builder help for details.
l Click Info to open detailed help for the current component.

4. Next, define the parameters of the phase resistors.


a. Double-click the topmost phase resistor symbol to open the resistor’s Parameters
dialog box.
b. Change the Name to R_A.

Create the Rectifier Model 3-8

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

c. Change the Resistance from 1000 ohm to 10 mOhm.


d. Click OK to apply the changes.
e. Repeat steps a through d for the other two phase resistors, naming them R_B and
R_C, respectively.
5. Define the parameters for the phase inductors.
a. Double-click the topmost phase inductor symbol to open its Paramet dialog box.
b. Change the Name to L_A.
c. Change the Inductance from 0.001 H to 0.3 mH.
d. Select the Initial Value check box and set the value to 0(zero).
e. Click OK to apply the changes.
f. Repeat steps a through d for inductors L_B and L_C.
6. Define the parameters of the diodes. In this example, all diodes are static models using an
exponential function as their characteristic.

Note:

For most applications static semiconductor models supply sufficient simulation


data. If switching, losses, thermal analysis, and other properties are targets of
your simulation, you need dynamic elements. However, using many dynamic ele-
ments in a simulation model can increase the simulation time.

a. Double-click the upper-left diode symbol to open its Parameters dialog box.
b. Change the Name to D1.
c. Change the Type by selecting the Type option button, then choosing Exponential
Function from the drop-down menu.
d. Keep all other values as they are and click OK to apply the changes.
e. Repeat steps a through d for the remaining diodes D2 through D6.
7. Define the parameters of the smoothing capacitor.
a. Double-click a capacitor symbol to open its Parameters dialog box.
b. Change the Name to CD and change the Capacitance from 1e-006 F to 1 mF.
c. Click OK to apply the changes.
8. Define the parameters of the load resistor.
a. Double-click a resistor symbol to open its Parameters dialog box.
b. Change the Name to R_LOAD.
c. change the Resistance from 1000 ohm to 1.2 ohm.
d. Click OK to apply the changes.
9. Define the parameters of the load inductor.

Create the Rectifier Model 3-9

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

a. Double-click an inductor symbol to open the Parameters dialog box.


b. Change the Name to L_LOAD.
c. Change the Inductance from 0.001 H to 9.5 mH.
d. Select the Initial Value check box and set the value to 0 (zero).
e. Click OK to apply the changes.

All components of the simulation model should now have their correct values. This table lists the
components of the simulation model and their parameter values.

Name Type Quantities


ET1 Sine Amplitude [V]=326; Frequency [Hz]=50; Initial Delay [s]=0;
Phase [deg]=0;
(Time-controlled)
Offset [V]=0
ET2 Sine Amplitude [V]=326; Frequency [Hz]=50; Initial Delay [s]=0;
Phase[deg]=120;
(Time-controlled)
Offset [V]=0
ET3 Sine Amplitude [V]=326; Frequency [Hz]=50; Initial Delay [s =0;
Phase [deg]=240;
(Time-controlled)
Offset [V]=0
R_A R Resistance [mOhm]=10

R_B (Linear)

R_C
L_A L Inductance [mH]=0.3;
L_B
(Linear) Initial Current [A]=0
L_C
D1…D6 DEXP Saturation Current [pA]=1;

(Exponential Func- Thermal Voltage[mV]=35;


tion)
Reverse Resistance[kOhm]=100
CD C Capacitance [mF]=1;

(Linear) Initial Voltage [V]=0


R_ R Resistance [Ohm]=1.2
LOAD
(Linear)
L_ L Inductance [mH]=9.5;
LOAD
(Linear) Initial Current [A]=0

Create the Rectifier Model 3-10

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Next you will define the component properties that will appear on the schematic sheet.

Property Displays for Components

While most component properties are accessible in the Propertieswindow, you control the dis-
play of component properties via the Property Displays tab in the Propertiesdialog boxes.

1. For example, select Voltage Source 1 (ET1) and open its Properties dialog box. (Right-
click a component and select Properties.)
2. On the Property Displays tab, click Add.

This adds a line with three fields: Name, Visibility, and Location. Each of these fields con-
tains drop-down menus.

l For the Name field, select the Label ID of interest.

The drop-down menu for the Name field includes all available property names for
the selected instance. For each kind of component in the schematic, you will select
another property value. For now, start with the name.
l Use the Visibility field to specify the information to display about the selected Label
ID on the schematic, for example, None, the property Name, the property’s Value,
the Evaluated Value, Both (the name and value) or Evaluated Both. Select Value
from the menu.
l Use the Location field to select initial locations relative to the default orientation of
the component instance.

Create the Rectifier Model 3-11

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

3. For this example, OK the dialog box, and locate and click to select the ET1 label in its ini-
tial placement.
4. Drag the label to a position above the component instance.

5. With the label highlighted, click on the Twin Builder Schematic ribbon, or use
Draw > Rotate to rotate the label as needed.
6. Open the Properties dialog box again, and select the Property Displays tab again.

Note that the Location field for the Name property now shows Custom.

7. Now click Add again.


8. This time, use the drop-down menu in the Name field to locate and select PHASE.
9. For Visibility, select Evaluated Both and click OK.

The label PHASE=0 should now be visible on the schematic.

10. Drag the PHASE=0 label to a position to the left of the component as shown in the figure.
11. Use the foregoing techniques to activate labels for the rest of the components to match
the schematic figure.

Create the Rectifier Model 3-12

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

l For the Resistors, add “Name” and “R” name.


l For the Inductors, add “Name” and the “L” name.
l For the Diodes, add only “Name” to the display.
l For the Capacitor, add “Name” and “C”.
12. Save your work before continuing to the next step.

Create the Rectifier Model 3-13

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Note:

Set the visibility and initial location for properties to display by double-clicking a
component to open its Parameters dialog box. The Output/Display tab has
drop-down menus for setting the Visibility and Location for each property.

Specifying Simulation Outputs

During a simulation, data is generated based on outputs that you specify. These can include
quantities such as voltage, current, frequency, phase angle, torque, and displacement.

Using the outputs you define, you can create reports of simulation results, or plot output quant-
ities specified by probes that you place in the schematic.

To define simulation outputs for the example model:

1. Select Twin Builder > Output Dialog. The Output dialog box appears. The Add/Re-
move list shows all of the schematic elements. Check boxes control which quantities
appear in the selection window.
2. Type ET in the Find field.

Create the Rectifier Model 3-14

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

This moves the displayed list to the ET elements, and opens a list of check boxes that
show available outputs.

3. For ET1, select the V check box.

ET1.V is now listed as a Defined Output.

Similarly, select the V check boxes for ET2 and ET3 to add ET2.V and ET3.V to the
Defined Output list.

4. Use the Find field to locate the R_LOAD item and select the I check box.
5. Use the Find field to locate the CD element, and select the V check box.

When you have finished, the Defined Output field will list the items you selected.

Create the Rectifier Model 3-15

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

6. Click OK to close the dialog box.

Next, you will define the Solution Options and Analysis Parameters to be used when analyzing
the circuit.

Defining Solution Options and Analysis Parameters

Simulation parameters control the simulation process. The choice of simulation parameters is
important for a successful simulation. There are general and circuit simulator parameters. The
values obtained during a simulation provide valuable information about the quality of a sim-
ulation result.

To set up solution options:

Create the Rectifier Model 3-16

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

1. Right-click Analysis in the Project Manager pane, and select Add Solution Options.

The Solution Options dialog box appears.

2. On the TR tab, change the Integration formula to Euler, the Maximum number of iter-
ations from 40 to 20 and the Local truncation error from 1 to 0.1. Change the Name to
ThreePhaseOptions. Leave all other settings unchanged.
3. Click OK to apply the changes.

An icon for the new options named ThreePhaseOptions appears under Analysis in the
Project Manager pane.

4. Right-click Analysis in the Project Manager pane, and select Solution Setup > Add
Transient.

This opens a Transient Analysis Setup dialog box.

Create the Rectifier Model 3-17

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

5. Change simulation End Time from 40ms to 0.1s; Min Time Step from 10us to 1us, and
Max Time Step from 1ms to 0.5ms.
6. Click Analysis Options and select ThreePhaseOptions from the Select Solution
Options dialog box.
7. Click OK to close the Select Solution Options dialog box. Click OK again to close the
Transient Analysis Setup dialog box.

Now that you have set up the necessary conditions for finding solutions for the example circuit,
the next step is to start an analysis.

Starting an Analysis

To start an analysis:

1. Select Twin Builder > Analyze to start the analysis (simulation).

You can also right-click Analysis in the Project Manager pane and select Analyze, click

on the Simulation ribbon, or press F12 to start the analysis.

Create the Rectifier Model 3-18

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

The simulation model is compiled and outputs are calculated. During the simulation run,
the name of the model is visible in the Progress window, and a button to stop the sim-
ulation is available.

2. After the simulation, the output quantities are displayed in the plots on the sheet or in the
report windows. Output data is also saved in an SBD (Twin Builder Database) file.

Plotting Rectifier Model Simulation Results

In this section, you will create reports that graph these outputs:
l Voltages of the sources ET1.V, ET2.V, and ET3.V
l Voltage of the smoothing capacitor CD.V
l Current of the load resistor R_LOAD.I

The resulting plots should resemble those shown below.

Create the Rectifier Model 3-19

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Begin by creating a 2D rectangular report that plots the three-phase voltage source outputs.

1. Right-click Results in the Project tree and select Create Standard Report > Rect-
angular Plot.

A new Report window appears.

Create the Rectifier Model 3-20

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

2. Under Category, select Voltage. Select ET1.V, ET2.V, and ET3.V in the Quantity list with
Ctrl+click. Keep all other settings unchanged.
3. Click New Report to create a report similar to this image:

Create the Rectifier Model 3-21

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

A Result named XY Plot 1 appears in the Project Manager pane.

4. Without closing the New Report dialog box, select CD.V in the Quantity list.
5. Click New Report to create a report showing the smoothing capacitor voltage similar to
this image:

Create the Rectifier Model 3-22

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

A Result named XY Plot 2 appears in the Project Manager pane.

6. Without closing the New Report dialog box, select Current in the Category list; then select
R_LOAD.I in the Quantity list.
7. Click New Report to create a report showing the load resistor current similar to this image:

Create the Rectifier Model 3-23

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

A Result named XY Plot 3 appears in the Project Manager pane.

8. Click Close to close the New Report dialog box.

You can customize reports such as the one you created in this example in many ways. For
example, to rename plots, right-click a plot name in the Project Manager pane and select
Rename. You can also adjust the background color, grid scale and color, text font, size, and
color, trace color, line style, and thickness, legend text, add various data markers, and so on.

Use the tools in Twin Builder’s Draw menu to add your own custom elements and text to your
reports. Detailed information on generating and modifying reports is available in the help.

Create the Rectifier Model 3-24

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

4 - Hysteresis Current-Controlled DC-Motor


Start-Up
In this section, the example from Create the Rectifier Model is modified as follows:
l The resistive/inductive load is replaced with a real machine model (DC motor with per-
manent excitation).
l The example is then expanded to create a simple, current-controlled machine model by
adding a two-point hysteresis element, a chopper transistor, and a freewheeling diode.
The other parts of the circuit — the three-phase power supply with rectifier bridge —
remain unchanged.
l In the second example, the controller is modeled with state graph components.

Modify the Rectifier Model Design

This figure shows a Schematic sheet of the simulation model you will design in this section. The
model consists of a three phase power supply, a rectifier bridge with static diodes and their char-
acteristics, a smoothing capacitor, a DC machine model, Chopper transistor, and freewheeling
diode.

Deleting the Resistive/Inductive Load

Hysteresis Current-Controlled DC-Motor Start-Up 4-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

First, you need to delete the components which are not used in the modified simulation model. In
place of the resistive/inductive load, you will add a DC machine model, a freewheeling diode,
and a chopper transistor.

1. Select and delete resistor R_LOAD and inductor L_LOAD.

You can select them one at a time (selected elements turn red); or draw a box around
them to select both elements.

To delete the selected components:


l Select Edit > Delete.
l Right-click a component and select Delete.
l Press Ctrl+X.
2. Select and delete the remains of the interconnecting wires.

Saving the Sheet with a New Name


1. Choose File > Save As.
2. Enter a new file name.
3. Click OK.

Defining DC Machine Values


1. Define component properties. Double-click a DCMP machine symbol to open its Para-
meters dialog box.
2. On the Parameters tab, change the Name from DCMP… to DCM., and define these
machine parameters:
l RA: Armature Resistance:1.2 ohm
l LA: Armature Inductance:9.5 mH

Hysteresis Current-Controlled DC-Motor Start-Up 4-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

l KE: Back EMF Constant: 0.544 Wb


l J: Rotor Moment of Inertia:0.004 kgm2
3. In the Default Outputs section of the Parameters tab, select the N and IA check boxes to
enable them as outputs. You will use these later when creating reports.
4. Make the names of the mechanical load and armature current properties visible on the
sheet. These two properties are used later.
a. Click the Output/Display tab. In the Name column, select LOAD (Load Torque).
Under Visibility, select Name. Leave Location as is.
b. Similarly, set visibility and location for IA (Armature Current).
c. Click OK to apply the changes.
5. Move the property names to appropriate positions.

Click a property name and press Ctrl+R to rotate it. Hover the mouse over a property
name until the cursor changes into a pointer with a four-headed arrow, then click and drag
the name to the new position.

Defining Mechanical Load

You can set the mechanical load of the machine model in many ways. The variant used in this
example is based on an initial value (ICA) component. This component is useful when you use
initial values for different models on the sheet. In this example, the equation defined within the
ICA component is used to “connect” an initial value, 0, to the load torque parameter of the
machine component. Values in the ICA component are set only once at the simulation start.

1. Define a new entry within the initial value list.


a. Double-click an ICA symbol to open its Parameters dialog box.
b. On the State tab, change the Name to FML_INIT and select the Show Name check
box.
c. Click Add to create a new Equation entry.
d. Click in the Equation field and type LOAD:=0. This creates a new ICA parameter
named LOAD and assigns it a value of 0 (zero).

Hysteresis Current-Controlled DC-Motor Start-Up 4-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

e. To display the LOAD parameter name and value, select the LOAD parameter’s Show
check box.
f. Click OK to apply the changes. The new parameter is now defined and is available for
connecting with a quantity.
2. Connect the ICA initial value to the LOAD property of the DC machine.
a. Double-click a DC machine symbol to open its Parameters dialog box.
b. On the Parameters tab, type LOAD in the Value cell for the LOAD property, and click
OK. This “connects” the DC machine LOAD property to the LOAD value specified in
the ICA component.

Freewheeling Diode
Define the parameters of the diode.

1. Double-click a diode symbol to open its Parameters dialog box.


2. Change the Name from Dn to D7.
3. Select Type and choose Exponential Function from the list.
4. Leave all other values as they are. Click OK to apply the changes.

Chopper Transistor
The transistor turns on and off depending on the machine current, IA. Initially, the transistor is
set “on” to start the process.

Define the parameters of the transistor.

1. Double-click a transistor symbol to open its Parameters dialog box.


2. Change the Name from BJTn to TR1.

Hysteresis Current-Controlled DC-Motor Start-Up 4-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

3. Select Type and choose Exponential Function from the list.


4. Leave all other values as they are. Click OK to apply the changes.

Hysteresis Current-Controlled DC-Motor Start-Up 4-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Controller Modeling Using Block Elements


Initially, the current-controller is designed using a two-point element with hysteresis. The block
element input signal is the DC machine current, IA. The output signal controls the chopper tran-
sistor, TR1.

1. Define component properties of the Two-point element. Double-click a symbol to


open its Parameters dialog box. On the Parameters tab, change the Name from TPHn to
CONTR_OUT, then define these parameters:
l THRES1 (Threshold T1): 17.5
l THRES2 (Threshold T2):22.5
l VAL1 (Value A1):1
l VAL2 (Value A2):0
l Y0 (Initial Value):1
2. Define the Block sample time, TS. The smaller the block sample time, the more precise
the current control of the machine. In this example, the system sample time is used; that
is, the block is calculated using the same sample time that the circuit models use. To
ensure that the system sample time is used, set the TS (Sample Time) parameter to 0
(zero).
3. “Connect” the IA parameter of the DC machine (DCM) to the input of the hys-
teresis block.
a. First, on the Output/Display tab, clear the Show Pin check box for the INPUT para-
meter. For Visibility, select Both to display the parameter and its value.
b. Next, on the Parameters tab, type DCM.IA in the INPUT parameter Value field.
c. Click OK to apply the changes. Position the text as needed.
4. Connect the output pin of the block with the input pin of the control signal of the
bipolar junction transistor. The cursor changes to cross wires. Click both pins to con-
nect them. Press Esc to finish the wire mode.

All parameters of the modified simulation model should now have the correct values. This
table lists all new components of the simulation model and their parameter values.

Name Type Parameters


DCM RA (Armature Resistance)=1.2 ohm

LA (Armature Inductance)=9.5 mH

KE (Back EMF Constant)=0.544 Wb

J (Rotor Moment of Inertia)=0.004 kgm2


FML_INIT1 LOAD:=0
D7 Exponential Function ISAT (Saturation Current)=1e-012 A

Hysteresis Current-Controlled DC-Motor Start-Up 4-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Name Type Parameters


VT (Thermal Voltage)=0.035 V

RR (Reverse Resistance)=100k ohm


TR1 Exponential Function ISAT (Saturation Current)=1e-012 A

VT (Thermal Voltage)=0.035 V

RR (Reverse Resistance)=100k ohm

CTRL (Control Signal)=CONTR_OUT.VAL (pin)


CONTR_OUT THRES1 (Threshold T1)=17.5

THRES2 (Threshold T2)= 22.5

VAL1 (Value A1)=1

VAL2 (Value A2)=0

Y0 (Initial Value)=1

TS (Sample Time)=0 (System time)

INPUT (Input Signal)=DCM.IA

Hysteresis Current-Controlled DC-Motor Start-Up 4-7

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Modifying Report Elements


1. Define the model output DCM.N.
a. In the Project Manager pane, under Results on the Project tab, double-click XY
Plot 1 to open the report window.
b. Ctrl+click each of the traces to select them all, then press Del to remove the traces.
You can also right-click and select Edit > Delete.
c. Right-click XY Plot 1 and select Modify Report to open the report dialog box.
d. In the Category list, click All, then select DCM.N in the Quantity list.
e. Click Add Trace to display the output.
f. Click Close to close the dialog box.
g. In the Project Manager pane, right-click XY Plot 1 and select Rename. Change
the title of the plot to Speed. Press Enter to apply the change.
2. Define the model output DCM.IA.
a. Double-click XY Plot 2 to open the report window.
b. Select the CD.V trace and click Delete to delete it.
c. Create a new output for DCM.IA.
d. Change the title of the plot to Current. See also Plotting Rectifier Model Sim-
ulation Results in Create the Rectifier Model.

Display Diode Characteristic


You can use plots to display component characteristics. For such cases, the X-axis is defined in
some quantity other than simulation time.

1. Define the axes quantities.


a. In the Project Manager pane, under Results on the Project tab, double-click XY Plot
3 to open the report dialog box.
b. Select the R_LOAD.I trace and Delete it.
c. Create a new Y-axis output for D1.I. Remember to use Twin Builder > Output Dialog
to define output quantities as needed.
d. Select a new X-axis quantity by selecting the Default check box. Then click [...] and
select D1.V on the Select X Component dialog box.

Hysteresis Current-Controlled DC-Motor Start-Up 4-8

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

e. Click OK to close the Select X Component dialog box.


f. In the report dialog box, click Apply Trace to apply the changes, then click Close to
close the dialog box.
g. By default, the trace type is a continuous (solid) line. Click a trace to edit the trace prop-
erties so that you can see the individual simulation points on the curve. The cursor
changes color when hovering over a selectable display element. In the Properties dia-
log box, change the Trace Type to Discrete.

To view the area of interest on the characteristic curve, you need to manually edit the X- and Y-
axes properties.

a. Double-click an X-axis to select it and open its Properties dialog box.


b. On the Scaling tab, clear the Auto Units check box and select V as the Units value.
Select the Specify Min check box, then enter 0.55 in the Min Value field. Similarly,
select the Specify Max check box and enter 0.9 for the Max value. Next, select the
Specify Spacing check box and enter 0.05 in the Spacing field to set the interval
between major tick marks on the X-axis. Leave the rest of the settings as they are and
click OK to apply the changes and close the dialog box.
c. Double-click a Y-axis to select it and open its Properties dialog box.
d. On the Scaling tab, clear the Auto Units check box and select A as the Units value.
Select the Specify Min check box and enter 0 in the Min Value field. Select the Spe-
cify Max check box and enter 0.1 for the Max value. Select the Specify Spacing
check box and enter 0.025 in the Spacing field to set the interval between major tick
marks on the Y-axis. Leave the rest of the settings as they are and click OK to apply
the changes and close the dialog box.
e. Change the title of the plot to Characteristic.

Hysteresis Current-Controlled DC-Motor Start-Up 4-9

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Defining Simulation Parameters


Simulation parameters control the simulation process. The values chosen for a simulation
determine the success, and affect the quality, of a simulation result.

1. Select Twin Builder > Add Solution Setup > Transient to define the simulation para-
meters.
2. Change the default values for simulation End Time from 40ms to 100ms, for Min Time
Step from 10us to 1ns, and for Max Time Step from 1ms to 1us. Click OK to apply the
changes.

Starting Simulation (Block Components)


Select Twin Builder > Analyze to start the simulation, or right-click Analysis in the Project
Manager pane and select Analyze. The simulation model is compiled and calculated.

Simulation Results (Block Components)

The Speed and Current plots display the simulation results for the machine armature current
(DCM.IA) and speed (DCM.N). Depending on the armature current, the two-point element with
hysteresis controls the switching behavior of the chopper transistor. The speed for the DC motor
no-load starting torque approaches 2613 rpm.

The Characteristic plot displays diode D1’s current as a function of its voltage and should look
similar to the image below.

Hysteresis Current-Controlled DC-Motor Start-Up 4-10

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Controller Modeling Using State Graph Components

Twin Builder’s state graph module, which is based on the Petri Net theory, lets you model event-
driven, discontinuous processes. The theoretical basis of the modeling divides a system into sig-
nificant states and events, and transitions from one state to the other. The procedure below
explains the modeling of the two-point hysteresis controller with state graph components.

First, place and arrange the state graph components used in the modified simulation model. Any
unused area of the sheet may be used.

1. Choose the Twin Builder model library Basic Elements.


2. Place the component onto the sheet. Select the folder States. Select the component State
11and drag it onto the sheet.
3. Arrange the component on the sheet. Orient the component to connect it with the other
components as illustrated in the figure below.
4. Repeat steps 2 and 3 until all new components used in the state graph appear on the
sheet.

Module Group Component


States State 11 2x
Transition 2x
Tools Equations Initial Values 1x

Hysteresis Current-Controlled DC-Motor Start-Up 4-11

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

5. When all of the required components for the state graph are now on the sheet, connect the
components, by placing them in appropriate positions as shown in the figure below. Note
in particular the directions of the arrows on the Transition components and rotate or flip
components as needed.

Connecting the State Graph Components


When all of the state graph components are arranged, you can connect them as required for this
example. Make certain to consider the direction of the transition components.

1. Activate the wire mode. Select Draw > Wire or press Ctrl+W. The cursor changes to
cross wires.
2. Connect the components as required for the circuit. Place the cursor on the element
pins and set the beginning, the corners, and the end of a wire. Press Esc to finish and exit
the wire mode.

Defining the Properties of State Graph Components


A process sequence is a sequence of states. The current state is called active. Switching the
activity from a given state to its successor state is called an event. An event occurs only if all pre-
vious states are active, all subsequent states are inactive, and the transfer condition—in the
form of a logical expression—is true. At the beginning of the simulation, one state must be
defined as active.

1. Define the parameters of the state ON.


a. Double-click STATE11 on the left to open its Parameters dialog box.
b. Change the Name from STATE… to ON.
c. Click Add to create a new SET Action Type entry.
d. Type CS in the Name field and 1 in the Value field. This entry means that the variable

CS (control signal) is set to 1 if the state is active. Click to open the Calculator

Hysteresis Current-Controlled DC-Motor Start-Up 4-12

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

dialog box and confirm the expression CS:=1 is present. (Click OK or Cancel to close
the window.)
e. Select the Activate State check box to set the state active at the beginning of the sim-
ulation.
f. Select the TR option button.
g. Click OK to apply the changes.

The blue circle in the symbol indicates the state is active. During a simulation, the state
markers “run” through the state graph, depending on the active states in the simulation pro-
cess.

2. Define the parameters of the OFF state.


a. Double-click a state symbol on the right to open the property dialog box and set para-
meters.
b. Change the Name from STATE… to OFF.
c. Click Add to create a new SETAction Type entry.
d. Type CS in the Name field and 0 in the Value field. This entry means that the variable
CS (control signal) is set to 0 if the state is active.
e. Click OK to apply the changes.
3. Define the parameters of the initial value component.
a. Double-click an ICA symbol to open the component dialog box and set parameters.
b. Turn off the Name and click Add to create four new entries.

Hysteresis Current-Controlled DC-Motor Start-Up 4-13

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

c. Click in the Equation field and type the name:=value corresponding to the picture.

You can also enter a description of each equation in the Information field and display
the descriptions on the schematic by selecting a Show check box.

d. Click OK to apply the changes.


4. Define the parameters of the first transition.
a. Double-click the top Transition symbol to open the parameter dialog box.
b. Type DCM.IA>=IUPR in the Condition for transition field. This entry means that the
condition becomes true if the machine armature current (DCM.IA) is greater than or
equal to the variable IUPR. The variable IUPR is defined in the initial value com-
ponent.
c. Clear Show Name.
d. Select the Show Condition check box to display the condition on the schematic.
e. Click OK to apply the changes.
5. Define the parameters of the second transition.
a. Double-click the lower Transition symbol to open the parameter dialog box to define
the transfer condition.
b. Type DCM.IA<=ILWR in the Condition for transition field. This entry means that the
condition becomes true if the machine armature current is less than or equal to the vari-
able ILWR. This variable is also defined in the initial value component.
c. Turn off the name, and select the Show Condition check box to display the para-
meter value.

Hysteresis Current-Controlled DC-Motor Start-Up 4-14

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

d. Click OK to apply the changes.

Note:

Using the “=” operator type forces the simulator to synchronize on the con-
dition with the minimum time step. Because of this, the state graph works
more precisely than the two-point hysteresis component, but the processing
time of the simulation is longer.

Using Name References


To control the switching behavior of the transistor, TR1, you need to enter the control variable
CS in the transistor dialog.

1. Double-click the transistor symbol to open the Parameters dialog box to define the control
parameter.
2. Clear the Use Pin check box, and enter the control variable CS in the Control Signal
field.
3. Click OK to apply the changes.

Deactivating Components on the Sheet


You can deactivate separate components or parts of a model sheet for a simulation run. The
components and all of their properties remain on the sheet, but the simulator ignores the deac-
tivated components. The connection between the terminals is considered open. This feature is
especially helpful for testing simulation models with several different elements and parameters.
Select Edit > Deactivate (Open) to deactivate components. A deactivated (open) component
will have a large red X over it.

Select the hysteresis block CONTR_OUT and choose Edit > Deactivate (Open). The wires,
connected with the machine model and transistor, remain on the sheet.

Hysteresis Current-Controlled DC-Motor Start-Up 4-15

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

All parameters in the modified simulation model now have the correct values. This table lists all
new components of the simulation model and their parameter values.

Name Type Parameters


TR1 Exponential Function Saturation Current [A]=1e-12

Thermal Voltage[V]=0.035

Reverse Resistance[Ω]=100k
Control Signal=CS
CONTR_OUT Deactivated Threshold T1=17.5

Threshold T2= 22.5

Value A1=1

Value A2=0

Initial Value=1

Sample Time=0 (System)

Input=DCM.IA
TRANS1 DCM.IA>=IUPR
TRANS2 DCM.IA<=ILWR
ON SET: CS:=1
OFF SET: CS:=0
FML_INIT2 IREF:=20

Hysteresis Current-Controlled DC-Motor Start-Up 4-16

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Name Type Parameters


DELTA:=2.5

IUPR:=IREF+DELTA

ILWR:=IREF-DELTA

Starting Simulation (State Graph)

Select Twin Builder > Analyze to start the simulation, or right-click in the Project win-
dow and select Analyze. The simulation model is compiled and calculated.

Simulation Results (State Graph)

The Speed and Current plots display the simulation results for the machine armature current
(DCM.IA) and speed (DCM.N). Depending on the armature current (DCM.IA) the state graph
controls the switching behavior of the chopper transistor. The speed for the DC motor no-load
starting condition approaches 2550 rpm.

The tolerance band of the state graph controller is more precise than for the hysteresis con-
troller, because the = operator type in the state graph forces the simulator to synchronize on the
condition with the minimum time step. To force any of the block models to calculate more pre-
cisely, define a special sample time in the model’s property dialog box.

Hysteresis Current-Controlled DC-Motor Start-Up 4-17

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

PDF layout 4-18

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

5 - Current and Speed Controlled DC Motor


In this chapter the example from Chapters 3 and 4 is extended further:
l The state graph/hysteresis controller is replaced with a PI (proportional-integral) controller
implemented using block components.
The other parts of the circuit, such as the three-phase power supply with rectifier bridge,
remain unchanged.

In addition to basic functions (selecting, placing, arranging, and connecting components), this
chapter introduces these Twin Builder features:
l Modeling with block components
l Examining Block Sequence
l Using Pins for parameter transfer
l Using Characteristic components

Modify the State Graph Design

The figure below shows the Schematic sheet of the simulation model with the corresponding val-
ues of components: three phase power supply, the rectifier bridge, smoothing capacitor, motor,
and the PI controller.

Current and Speed Controlled DC Motor 5-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Deleting the State Graph

First, you need to delete the components that are not used in the modified simulation model.
Instead of the state graph or simple hysteresis controller, you will use a PI controller consisting of
block diagram components.

1. Select the components to delete. Ctrl+click the state graph components: FML_INIT1, and
FML_INIT2, STATE_11 (both ON and OFF), and the two Transition components.
2. Delete the components. Select Edit > Cut, or press Ctrl+X or Del to remove the com-
ponents from the sheet.
3. Delete the remaining wires. Ctrl+click to select any remaining unused wires. Press Ctrl+X
to remove the wires.

Current and Speed Controlled DC Motor 5-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Saving the Sheet with a New Name Current Speed


Saving the Sheet with a New Name

1. Select File > Save As.


2. Enter a new file name.
3. Click OK.

Placing and Arranging the New Block Components on the Sheet

First, place and arrange the new components needed for the PI Controller in the extended sim-
ulation model. The Component Libraries provide access to the library containing the Twin
Builder basic components, which are used for this example.

Module Group Component Quantity


Blocks Continuous Blocks GAIN: Gain 2

INTG: Integrator 1
Sources Blocks CONST: Constant Value 1
Signal Processing Blocks LIMIT: Limiter 1

SUM: Summation 3
Tools Time Functions DATAPAIRS: 2D Look-up Table 1

1. Open the Basic Elements model library folder; click + next to the folder, or double-click
Basic Elements.
2. Place the component onto the sheet. Select the Blocks folder, then the Continuous
Blocks folder. Select the component Gain and drag the component onto the sheet.
3. Arrange the component on the sheet. To connect the components, you must place
them in appropriate positions. See the simulation model figure on Current and Speed
Controlled DC Motor. Orient each component as needed so you can easily connect
them with other components.
4. Repeat steps 2 and 3 until all new components used in this example are placed on the
sheet.

Connecting the New Components

When all the components are arranged, you can connect them as required for this example.

Connect the components as required for the controller. Using the simulation model shown
on Current and Speed Controlled DC Motor as a guide, place the cursor on the element pins
and set the beginning, the corners, and the end of a wire. Press Esc to exit the wire mode.

Current and Speed Controlled DC Motor 5-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Note:

Connections to the motor’s LOAD (load torque), IA (armature current), and N (rotor
speed) parameters are not visible on the schematic. These connections are added
later.

Defining Mechanical Load (Block)


The DATAPAIRS: 2D Look-up Table (already placed on the sheet) enables the definition of
wave-forms from a set of fixed data points either with linear interpolation between them (straight
lines from point-to-point), or rectangular lines between them (two orthogonal lines—parallel to
the coordinate axes—from point-to-point). The X-values of the data-pairs must be monotonously
increasing. The last slope is effective for all values outside the X range. To have a constant
value outside the X-range, you need to define two data-pairs with the same Y-value at the end.
In this example, use the 2D Lookup Table to define the mechanical load of the DC machine.

1. Define the load characteristic.


a. Double-click 2D Look-up Table to open the Parameters dialog box and set
parameters.
b. Change the Name to LOAD.
c. Choose Without from the Interpolation list.
d. Click Characteristic to open the Characteristic dialog box.
e. Select the Internal Reference option button, then click Datasets to open the
Datasets dialog box.
f. Click Add to open an Add Dataset dialog box. Enter the values as shown in the
figure below.
g. A default unique name is assigned to each dataset. Change the Name to some-
thing more descriptive such as Load_Torque.

Current and Speed Controlled DC Motor 5-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

h. Click OK to save the dataset. The Add Dataset dialog box closes, returning you
to the main Datasets dialog box.
i. Click Done to close the Datasets dialog box. The Characteristic dialog box
should now show the name of the dataset you created in its Dataset field.
j. Click OK to close this dialog box.
k. On the 2D Look-up Table Parameters tab, select the Value check box in the
Outputs section.
l. Click OK to close the 2D Look-up Table Parameters dialog box.
2. Connect the output parameter value of the LOAD characteristic with the load of
the DC machine.
a. Open the LOAD characteristic Parameters dialog box.
b. On the Output/Display tab, clear the Show Pin check box for the VAL parameter,
and click OK to close the dialog box.
c. On the Parameters tab of the DC machine Parameters dialog box, type LOAD.VAL
in the Value field for the LOAD parameter. This connects the LOAD element char-
acteristic output to the machine’s LOAD input parameter.
d. In the Default Outputs section, select the N and IA check boxes for use later when

Current and Speed Controlled DC Motor 5-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

creating reports.
e. Click OK to close the dialog box.

Defining the PI Controller

The components that have been placed and connected still have their default parameter values.
You will now assign proper values for the components that comprise the PI Controller. Use the
simulation model figure "Current and Speed Controlled DC Motor " on page 5-1 as a guide.

1. Define the parameters of the first gain block.


a. Double-click a Gain block symbol to open its Parameters dialog box.
b. On the Parameters tab, change the Name to N.
c. Type -16.6667 for the KP (Proportional Gain) parameter Value and select m for its
Units.
d. Change the parameter Value to DCM.N*1. This “connects” the gain block input to the
DC machine’s rotor speed output parameter with a scaling factor of 1. On the Out-
put/Display tab, clear the Show Pin check box for the INPUT parameter.
e. Click OK to close the dialog box.
2. Define the parameters of the constant value block.
a. Double-click a CONST block symbol to open its Parameters dialog box.
b. Change the Name to N_REF and the Value to 16.6667. Select the Use System
Sample Time check box, and clear the Block Output Signal check box.
c. Click OK to apply the changes.
3. Define the parameters of the summation of the N gain block and the N_REF constant
block.
a. Double-click the summation symbol to the right of the N gain block to open its Para-
meters dialog box.
b. Select the Use System Sample Time check box and clear the Block Output Signal
check box.
c. Click OK to apply the changes.
4. Define the parameters of the second gain block.
a. Double-click a GAIN block symbol to open its Parameters dialog box.
b. Change the Name to P_GAIN and the Proportional Gain (KP) to 50.
c. Click OK to apply the changes.
5. Define the parameters of the integrator block.
a. Double-click an I block symbol to open its Parameters dialog box.
b. Change the Name to I_GAIN and the Integral Gain (KI) to 20. The specification of “0”
for upper limit (UL) and lower limit (LL) means that there is no limitation.
c. Click OK to apply the changes.
6. Define the parameters of the summation of P_GAIN and I_GAIN.

Current and Speed Controlled DC Motor 5-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

a. Double-click a summation symbol to the right of the P_GAIN block to open its Para-
meters dialog box.
b. Select the Use System Sample Time check box and clear the Block Output Signal
check box.
c. Click OK to apply the changes.
7. Define the parameters of the limiter block.
a. Double-click a limiter symbol to open its Parameters dialog box.
b. Change the Name to LIMITER and the Upper Limit of Output Signal (UL) to 20.
c. Click OK to apply the changes.
8. Define the parameters of the summation of machine current and limiter value.
a. Double-click a summation symbol to the right of the LIMITER block to open its Para-
meters dialog box.
b. For INPUT[1], clear the Use Pin check box.
c. Enter DCM.IA in the Input Signal field to link the DC machine armature current to
INPUT[1].
d. Click in the Sign column and select “–” from the list. The sign is applied to the DCM.IA
input signal.
e. Select the Use System Sample Time check box and clear the Block Output Signal
check box.
f. Click OK to apply the changes.

9. Modify the parameters of thehysteresis block.


a. Right-click a hysteresis block symbol and select Activate.
b. Double-click the hysteresis block symbol to open its Parameters dialog box.
c. Define the parameters as follows:
l THRES1 (Threshold T1):-2.5
l THRES2 (Threshold T2):2.5
l VAL1 (Value A1):0
l VAL2 (Value A2): 1

Current and Speed Controlled DC Motor 5-7

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

l Y0 (Initial Value):1
l TS (Sample Time):5 with units us
d. Click OK to apply the changes.
10. Modify the parameters of transistor TR1.
a. Right-click a TR1 symbol to open its Parameters dialog box.
b. On the Parameters tab, clear the Control Signal field, then select the Use Pin check
box to reconnect the transistor's control pin to the output of the hysteresis block.
c. Click OK to close the dialog box.

All parameters of the PI controller should now have the correct values. This table lists all com-
ponents of the PI controller and their parameter values.

Name Output To Parameters


N SUM1 KP (Proportional Gain)=-16.6667m

TS (Sample Time)=System (0)

INPUT (Input Signal)=DCM.N


N_REF SUM1 Value=16.6667

Sample Time=System
SUM1 P_GAIN Sample Time=System

I_GAIN Input[0]=N.VAL

INPUT[1]=N_REF.VAL
P_GAIN SUM2 KP (Proportional Gain)=50

TS (Sample Time)=System (0)

INPUT (Input Signal)=SUM1.VAL


I_GAIN SUM2 KI (Integral Gain)=20

Y0 (Initial Value)=0

UL (Upper Limit)=0

LL (Lower Limit)=0

TS (Sample Time)=System (0)

INPUT (Input Signal)=SUM1.VAL


SUM2 LIMITER Sample Time=System

Input[0]=P_GAIN.VAL

INPUT[1]=I_GAIN.VAL

Current and Speed Controlled DC Motor 5-8

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Name Output To Parameters


LIMITER SUM3 UL (Upper Limit)=20

LL (Lower Limit)=0

TS (Sample Time)=System (0)

INPUT (Input Signal)=SUM2.VAL


SUM3 CONTR_OUT Sample Time=System

Input[0]=LIMITER.VAL

INPUT[1]=-DCM.IA
CONTR_OUT TR1.CTRL THRES1 (Threshold T1)=-2.5

THRES2 (Threshold T2)= 2.5

VAL1 (Value A1)=0

VAL2 (Value A2)=1

Y0 (Initial Value)=1

TS (Sample Time)=5us

INPUT (Input Signal)=SUM3.VAL


LOAD DCM.LOAD Interpolation=Without

TPERIO (Period)= 0.1

PHASE (Phase)= 0

PERIO (Periodical)= Yes

TDELAY (Initial Delay)= 0

CHARACTERISTIC DATASET= $Load_Torque


x=0 y=0
x=0.075 y=10
x=0.1 y=10

Starting Simulation
Select Twin Builder > Analyze to start the simulation, or right-click Analysis in the Project
Manager pane and select Analyze. The simulation model is compiled and calculated.

Adding a Rectangular Plot (PI Controller)

Current and Speed Controlled DC Motor 5-9

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

1. Add a Rectangular Plot.

a. In the Project Manager pane, right-click and select Create Standard


Report > Rectangular Plot.
b. A Report dialog box opens.
2. Define the model outputsDCM.IA, DCM.N, LOAD.VAL.
a. Under Category, select All.
b. In the Quantity list, select DCM.N and click New Report to create the report.
c. Without closing the New Report dialog box, select DCM.IA in the Quantity list.
DCM.IA appears in the Y trace field. Its blue color signifies that it is a valid expres-
sion.
d. Twin Builder lets you apply various functions such as a scale factor to the selected
quantity. Place the cursor at the beginning of DCM.IA in the Y field and type 10* to
multiply DCM.IA by a factor of ten. As you are entering the factor, the color of the
expression may change to red at times indicating that the expression as shown at
that point is invalid. The finished expression should be: 10*DCM.IA and be blue
indicating that it is valid.

e. Click Add Trace to add the new scaled trace to the report.
f. Next select LOAD.VAL and apply a scale factor of 0.1k to it. The finished Y expres-
sion should be 0.1k*LOAD.VAL.
g. Click Add Trace to add the trace to the report.
h. Click Close to close the report dialog box. The plot should look similar to the this

Current and Speed Controlled DC Motor 5-10

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

image:

Adjusting Plot Properties


Follow this procedure to change the various properties of the X- and Y-axes.

1. Change the Y-axis Properties.


a. Position the cursor over any part of the Y-axis labeled 0.1k*LOAD.VAL on the plot.
The arrow will turn green when hovering over a selectable area of the axis. Click an
axis to select it for editing. The axis scale becomes bold when selected. The axis
name and scale numbers will also be underlined.
b. In the Properties window, select the Scaling tab.
c. Select the Specify Min check box and type -0.5k in the Min Value field below it.
d. Select the Specify Max check box and type 1.5k for the Max Value.
e. Select the Specify Spacing box and change the Spacing value to 500. This setting
controls the interval between major “tick” divisions on the axis scale.
f. Change Minor Tick Divs to 1. This setting controls the number of divisions
between major divisions.
g. Repeat steps a through f for the Y- axis labeled DCM.N.

Current and Speed Controlled DC Motor 5-11

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

h. For 10*DCM.IA Y-axis, first clear the Auto Units check box and set Units to A, then
repeat steps a through f.
2. Change the X-axis Properties.
a. Select the X-axis for editing.
b. On the Scaling tab, clear the Auto Units check box and select a Units setting of s
(seconds).
c. Set Min value to 0, Max value to 0.1, Spacing to 0.01, and Minor Tick Divs to 1.

The finished plot should look similar to this image:

3. Refer to the help for additional information on adjusting plot properties.

Checking the Block Sequence

The sequence of block computation can significantly influence the simulation result. Select
Schematic > Sort Components to change the block sequence.

Current and Speed Controlled DC Motor 5-12

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Using Automatic Block Sorting


When Block Sequence sorting is determined Automatically, the blocks are sorted according to
their signal direction after simulation begins. Automatic block sequence sorting is the default
mode used for simulation.

Using Manual Block Sorting


To sort blocks manually, select block items in the Determine Block Sequence dialog box list
and use the up and down arrows to change the sort order.

You can also click Interactive, which closes the dialog box and displays the current sequence in
digits next to the blocks. To change the sequence, click the blocks in the desired sequence on
the sheet, or arrange the block list in a new sequence in the dialog box.

Rerun the Simulation (PI Controller)


After changing the Block Sequence, select Twin Builder > Analyze to rerun the simulation. The
simulation model is recompiled and recalculated.

Current and Speed Controlled DC Motor 5-13

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Simulation Results (PI Controller)


The plot displays the simulation results for the machine armature current (DCM.IA), speed
(DCM.N), and the LOAD. Depending on the armature current, the PI controller adjusts the
switching behavior of the chopper transistor. The no-load starting speed for the DC motor
approaches 1000 rpm.

Current and Speed Controlled DC Motor 5-14

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

6 - Using VHDL-AMS Components for


Modeling
This example describes the modeling of a PI controlled DC motor system using a VHDL-AMS
component for the DC machine Twin Builder functions you will use in this example:
l Basic functions (selecting, placing, arranging, and connecting components)
l Modeling with VHDL-AMS components
l Using plots for displaying simulation results

VHDL-AMS Components

The Basic Elements VHDLAMS library provides the most common basic functionality, circuit
components and block elements as VHDL-AMS models developed according to IEEE 1076.1
(VHDL Analog and Mixed Signal Extensions Standard).

The functionality of the VHDL-AMS models is a subset of that available in the equivalent Twin
Builder SML (Twin Builder Modeling Language) models provided in the Basic Elements library.
You can use VHDL-AMS models in parallel with SML models. VHDL-AMS block and circuit mod-
els are simulated by the analog solver; while SML block elements are solved by a separate block
diagram simulator. Consequently, unlike SML models. VHDL-AMS models will not display step
delays along the simulator backplane. Numerical values of the VHDL-AMS data type generic are
defined at t = 0 and remain unchanged for the remainder of the simulation.

View the inputs and outputs of a VHDL-AMS model with the appropriate analog or digital report.
You can also view internal values used within the architecture of a model on reports and use
them as variables between models. However, if you must export the VHDL-AMS design to other
simulators, then internal values of the model should not be used outside the model.

Modify the PI Controller Design

The figure below shows the Schematic sheet of the simulation model and corresponding values
of the three-phase power supply, the rectifier bridge with static diodes and their characteristics,
the smoothing capacitor, and the VHDL-AMS machine component, DCM.

Using VHDL-AMS Components for Modeling 6-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Save the Project with a New Name


1. Select File > Save As.
2. Enter a new file name, and click OK.

Using VHDL-AMS Components for Modeling 6-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Delete the DC Machine Component


Delete the DC machine component replaced by the VHDL-AMS machine component.

1. Select the DC machine component.


2. Press Del to delete the component.

Placing and Arranging the New VHDL-AMS Components


on the Sheet
1. In the Component Libraries window, select the component AM: Ammeter from the Favor-
ites folder and drag it onto the sheet.
2. Open the Basic Elements VHDLAMS>Circuit>Electrical Machines folder. Select the com-
ponent dcmp: DC Permanent Magnet Excitation and drag it onto the sheet.
3. Arrange the components in appropriate positions. See the simulation model figure in
"Modify the PI Controller Design" on page 6-1.

Connecting the New VHDL-AMS Components


1. Connect the VHDL-AMS DC machine and ammeter component pins as indicated in
"Modify the PI Controller Design" on page 6-1.

Some pins are not available yet. Leave these connections out in this step. The connections are
created later.

Defining VHDL-AMS DC Machine Values


1. Open the VHDL-AMS DC machine Properties dialog box.
2. On the Parameter Values tab, change InstanceName to DCM, la (Armature Inductance)
to 9.5 mH, ke (Back EMF Constant) to 0.544 Wb, and j (Moment of Inertia) to 0.004
kgm2.
3. On the Quantities tab, change ra (Armature Resistance) to 1.2 ohm. For the load (Load
Torque) property, type LOAD.VAL in its Value field to “connect” it to the LOAD char-
acteristic component.

Using VHDL-AMS Components for Modeling 6-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

4. On the Property Displays tab add this property and visibility settings:

5. Click OK to apply the changes.


6. Open the Properties dialog box of Gain block N. Override the default INPUTValue by
entering DCM.n to connect it to the VHDL-AMS motor speed property.

Defining Connections for Machine Current


1. Make the ammeter Current parameter pin available for connecting with the SUM3 com-
ponent input pin.
a. Double-click an ammeter symbol to open its Parameters dialog box.
b. On the Parameters tab, change its Name to AM1.
c. On the Output/Display tab, select the Show Pin check box for the I (Current) prop-
erty.
d. Click OK to apply the changes.
2. Make the SUM3 summation input pin available for connecting with the ammeter Current
pin.
a. Double-click SUM3 to open its Parameters dialog box. If a message dialog box
appears, informing you that DCM.IA is not a defined variable, click OK to continue.
b. On the Parameters tab, for INPUT[1], delete DCM.IA in the Input Signal field and
select the Use Pin check box.
c. Select the Use System Sample Time check box and clear the Block Output Sig-
nal check box.
d. On the Output/Display tab, change the Visibility of the INPUT[1] entry to None.
e. Click OK to apply the changes.

Using VHDL-AMS Components for Modeling 6-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

3. Connect the input pin of the SUM3 with the current pin of the ammeter.

Defining Simulation Parameters


Simulation parameters control the simulation process. The values chosen for a simulation
determine the success, and affect the quality, of a simulation result.

1. Select Twin Builder > Add Solution Setup > Transient to define the simulation para-
meters.
2. Change the default values for simulation End Time from 40ms to 100ms, for Min Time
Step from 10us to 1ns, and for Max Time Step from 1ms to 1us. Click OK to apply the
changes.

Analyze and Display Simulation Results (VHDL-AMS)


1. Select Twin Builder > Output Dialog, then select DCM.n and AM1.I to add them to the
Defined Outputs. Click OK to close the Output dialog box.
2. Select Twin Builder > Analyze to start the simulation.
3. In the Project Manager pane, expand the existing XY Plot. Note that the DCM.N and
10*DCM.IA icons show that these traces are no longer valid because the variable names
to which they were linked have been removed.
4. Right-click DCM.N, select Modify Report, and set the Y trace to DCM.n.
5. Similarly modify 10*DCM.IA to 10*AM1.I. Click OK to apply the changes.

Using VHDL-AMS Components for Modeling 6-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

6. Double-click XY Plotn to display the plot which should look similar to the one below.

Using VHDL-AMS Components for Modeling 6-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

7 - Variants of PWM Modeling


A frequently used component in power electronic applications is a Pulse-Width Modulation con-
troller. This device works using a constant frequency, variable impulse width, and a pulse duty
factor.

Twin Builder offers several ways to generate a model of this kind of device. In addition to the
implementation of the internal circuit structure, behavioral models are increasingly important
because they provide high simulation speed combined with sufficient accuracy.

This example contains PWM controllers designed using several distinct Twin Builder modeling
methods. All methods are included in one sheet so that you can easily compare the differences
between them.

Twin Builder functions you will use in this example:


l Basic functions (selecting, placing, arranging, and connecting components)
l Modeling with block components
l Using Display Elements for displaying simulation results
l Using equations
l Defining block Sequence

PWM Modeling Overview

The figure below shows the Schematic sheet of the PWM controllers with the corresponding val-
ues of components. The sheet contains these modeling variants:
l Equation
l Equation and Time Function
l State Graph
l Block Diagram

Variants of PWM Modeling 7-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Create a New Project for the PWM Models

Create a new Project and Schematic sheet for the Pulse-Width Modulation models that you are
designing. See Creating a New Project for details.

Setting Initial Conditions


The initial values defined in this section are used by all modeling examples in this chapter.
These values are set only once at the start of simulation.

1. In the Basic Elements > Tools > Equations model library in the Component Libraries win-
dow, select the component Initial Values and drag it onto the sheet.
2. Double-click an ICA symbol to open the FML_INIT parameters dialog box. Click Add
to create a new entry. Click in the Equation field and enter FREQU:=10k.
3. Repeat step 2 to define the remaining initial values:
l HI:=5
l LO:=0

Variants of PWM Modeling 7-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

l DUTY:=0.8
4. Click OK to apply the changes.

PWM Modeling Using Equations


This first example describes the modeling of a PWM controller with the use of equations only.
You can separate the description into these steps:
l Triangle function
l Real value output
l Normalized value output

As you build this model, note that Time and PI are used in the expressions describing the sim-
ulation model.
l The Twin Builder simulator uses intrinsic variables for internal computation. One of these
intrinsic variables is the simulation time: Time. You can use this read-only variable in
expressions.
l The simulator also provides some natural and mathematical constants used in math-
ematical expressions within component dialog boxes. One such constant is PI.
l In addition, some standard mathematical functions, such as cos, are used in the expres-
sions. Refer to the help for information on Twin Builder’s standard functions.

1. Select the Basic Elements > Tools > Equations library in the Component Libraries win-
dow. Select the FML:Equation component and drag it onto the sheet.
2. Double-click an EQU symbol to open the FML dialog box. Click Add to create a new Equa-
tion entry. Click in the Equation field and enter:
TRIANG1:=1/PI*acos(cos(2*PI*FREQU*Time))
3. Repeat step 2 and enter these equations:
l EPWM1:=HI*(TRIANG1<DUTY)+LO*(TRIANG1>DUTY)
l EPWM1_NORM:=TRIANG1<DUTY
4. Ensure that the Calculation Sequence for all equations remains at the default Before
Analog Solver setting. Click OK to apply the changes.

Defining Simulation Parameters


Simulation parameters control the simulation process. The values chosen for a simulation
determine the success, and affect the quality, of a simulation result.

1. Select Twin Builder > Add Solution Setup > Transient to define the simulation para-
meters.
2. Change the default values for simulation End Time from 40ms to 100ms, for Min Time
Step from 10us to 1ns, and for Max Time Step from 1ms to 1us. Click OK to apply the
changes.

Variants of PWM Modeling 7-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Displaying Simulation Results with Reports


During a simulation, Twin Builder displays and prints generated data in reports, as well as saves
the data in files. Twin Builder reports are stand-alone entities, but you can also place them dir-
ectly on the sheet like components.

1. To add an on-sheet plot, select Draw > Report > Rectangular Plot. A hollow rectangular
box appears with the cursor at its center. Move the rectangle and click in the schematic
window to place the plot center. The cursor moves to the lower-right corner of the rect-
angle. Drag the cursor to resize the rectangle as needed, then click again to finish placing
the plot.
2. Select Twin Builder > Output Dialog to open the Output dialog box. Define outputs for
TRIANG1, EPWM1, and EPWM1_NORM by selecting the output boxes of these quant-
ities. Click OK to apply the changes.
3. Double-click the on-sheet report to open the Report dialog box. Ensure that the Solution
is TR, the Domain and Primary Sweep are Time, and that the X channel is set to Default
via the check box.
4. Click All in the Category list. In the Quantity list Ctrl+click TRIANG1, EPWM1, and
EPWM1_NORM. Click Add Trace to add the traces to the plot, then Close to exit the dia-
log box.
5. Name the plot Equation Models. Right-click its current name under Results in the Pro-
ject Manager pane and select Rename. Press Enter to apply the change.
6. Save the project by choosing File > Save As and entering a name.
7. Select Twin Builder > Analyze to start the simulation. The simulation model is compiled
and calculated.

Simulation Results
The plot displays the simulation results for the triangle function (TRIANG1), actual PWM signal
(EPWM1) and normalized PWM signal (PWM1_NORM). The value of DUTY determines the
pulse width.

Variants of PWM Modeling 7-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

PWM Modeling with Equations and Time Function


The second example models a PWM controller using both equations and a time function. The
same initial value assignments set in the first example are also used in this example. It is unne-
cessary to connect the components directly because references are created using component
and parameter names.

1. In the Basic Elements > Tools > Time Functions library folder, select the TRIANG:Tri-
angular Wave component and drag it onto the sheet. Select the Equations folder and
drag an FML:Equation component onto the sheet.
2. Right-click a TRIANG symbol to open the Parameters dialog box. On the Parameters
tab, change the Name to TRIANG2. Set the Amplitude (AMPL) to 0.5, Frequency (FREQ)
to FREQU, and Offset (OFF) to 0.5.
3. Select Value (VAL) and clear the Show Pin box. Click OK to apply the changes.

Note:

You can leave the Value (VAL) output pin visible; note that the pin is not used in
this example.

Variants of PWM Modeling 7-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

4. Double-click an EQU symbol to open the FML Parameters dialog box. Click Add to create
a new Equation entry. In the Equation field enter: EPWM2:=HI*(TRIANG2<DUTY)+LO*
(TRIANG2>DUTY).
5. Repeat the above step to add this equation: EPWM2_NORM:=TRIANG2<DUTY

Click OK to apply the changes.

6. Add an on-sheet Rectangular Plot as in the first example. However, for this plot, define out-
puts and add traces for the TRIANG2.VAL, EPWM2, and EPWM2_NORM signals.
7. Name the plot Equation and Time Function Model; and save the project using
File > Save As.
8. Select Twin Builder > Analyze to start the simulation. The simulation model is compiled
and calculated.

The resulting plot should be identical to the one plotted in the first example.

PWM Modeling with State Graph Components


This example models the PWM controller using state graph components. The same initial value
assignments set in the first two examples are also used in this example. Use Twin Builder’s state
graph simulator, based on the Petri Net theory, to model event-driven, discontinuous processes.
This modeling method divides a system into significant states and events, then transitions from
one state to another.

Variants of PWM Modeling 7-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Place and Arrange the Components on the Sheet


1. In the Basic Elements library, open the States folder and drag a State_11 component
onto the sheet. Change its name to OFF and rotate it to match the figure above. Drag a
second State_11 instance onto the sheet and label it ON. Next, drag two TRANS com-
ponents onto the sheet and name them TRANS1 and TRANS2. Make sure to rotate them
so that their arrows match the figure.
2. Drag a TRIANG component from the Basic Elements>Tools>Time Functions folder
onto the sheet. Change the component name to TRIANG3.
3. Connect the components as shown in the figure.

Define Component Properties


A process sequence is a sequence of states. The current state is called active. Switching an
activity from the current state to its successor state is called an event. An event occurs only if:
l All previous states are active.
l All subsequent states are inactive.
l The transfer condition—in the form of a logical expression—is true.

Variants of PWM Modeling 7-7

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

At the beginning of the simulation, one state must be defined as active.

1. Double-click an OFF state symbol to open its Parameters dialog box. Click Add to create
a new SET Action type entry. Enter EPWM3 in the Name field and LO in the Value field.
This entry means that the variable EPWM3 is set to the value LO if the state is active.
Create another SET entry and enter EPWM3_NORM in the Name field and 0 in the Value
field. Select the Activate State check box to set the state active at the beginning of sim-
ulation. Click OK to apply the changes. A blue circle in the symbol indicates the state is act-
ive.

2. Similarly define the parameters of the state ON component in its Parameters dialog box.
Create a new SET entry and enter EPWM3 in the Name field and HI in the Value field.
Create another SET entry and enter EPWM3_NORM in the Name field and 1 in the Value
field. Do not select the Activate State check box. Click OK to apply the changes.
3. Double-click TRANS1 and enter TRIANG3<DUTY in the Condition for transition field.
This entry means that the condition becomes true if the value of the triangular function,
TRIANG3, is lower than the DUTY value as defined in the initial value condition. Click OK
to apply the changes. Similarly, for TRANS2, enter TRIANG3>DUTY in the Condition for
transition field. In this case, the condition becomes true if the value of the triangular func-
tion is lower than the DUTY value. Click OK to apply the changes.
4. Double-click TRIANG3 to open its Parameters dialog box. On the Parameters tab, set
the Amplitude (AMPL) to 0.5, Frequency (FREQ) to FREQU, and Offset (OFF) to 0.5. On
the Output/Display tab, clear the Show Pin check box for Value (VAL) as the pin is not
used in this model. Click OK to apply the changes.
5. Add an on-sheet Rectangular Plot as in the previous examples. However, for this plot,
define outputs and add traces for the TRIANG3.VAL, EPWM3, and EPWM3_NORM sig-
nals.
6. Name the plot State Graph Model; and save the project using File > Save As.
7. Select Twin Builder > Analyze to start the simulation.

Variants of PWM Modeling 7-8

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

The resulting plot should be identical to the one plotted in the first example.

PWM Modeling with Block Diagram Components

This example models the PWM controller using block diagram components. The PWM is a com-
parator with two input signals: One input is the triangular wave and the other is the modulation
signal. The comparator compares the signals and provides an output signal proportional to the
modulation signal.

Placing and Arranging the Components on the Sheet


1. In the Basic Elements > Blocks > Sources Blocks folder, select CONST (Constant
Value) and drag the component onto the sheet.
2. In the Basic Elements > Blocks > Signal Processing Blocks folder, locate and place
one SUM (Summation) and two COMP (Comparator) components onto the sheet.
3. In the Basic Elements > Tools > Time Functions folder, locate and drag a TRIANG (Tri-
angular Wave) component onto the sheet.
4. Arrange and connect the components as shown in Define Component Properties.
5. Double-click a TRIANG symbol to open its Parameters dialog box and change the Name
to TRIANG4. On the Parameters tab, set the Amplitude to 0.5, Frequency to FREQU, and
Offset to 0.5. Click OK to apply the changes.
6. Double-click a CONST block symbol to open the Parameters dialog box. Change the
Name to DUTY_CYCLE and Value to DUTY. Click OK to apply the changes.

Variants of PWM Modeling 7-9

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

7. Double-click a SUM symbol to open its Parameters dialog box. Click in the Sign column
of the triangular wave Input SignalTRIANG4.VAL and select the minus sign (–) from the
list. Click OK to apply the changes.
8. Double-click the uppermost comparator symbol to open its Parameters dialog box.
Change its Name to EPWM4. On the Parameters tab, set Val1 to LO. and Val2 to HI. On
the Output/Display tab, clear the Show Pin box for the output VAL. Click OK to apply the
changes.
9. For the remaining comparator, change its Name to EPWM4_NORM, Val1 to 0. and Val2
to 1. Clear the Show Pin box for the output VAL. Click OK to apply the changes.
10. Add an on-sheet rectangular plot as in the previous examples. However, for this plot,
define outputs and add traces for the TRIANG4.VAL, EPWM4.VAL, and EPWM4_
NORM.VAL signals.
11. Name the plot Block Diagram Model; and save the project using File > Save As.
12. Select Twin Builder > Analyze to start the simulation.

The resulting plot should be identical to the one plotted in the first three examples.

Variants of PWM Modeling 7-10

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

8 - Using Legacy Schematics


To use a legacy Simplorer 7 project, you must first translate it using Simplorer Release 16.2 or
earlier, then migrate it into Twin Builder 2018.2.

In this chapter you will complete these tasks:


l Translate a legacy Simplorer 7 schematic file using Release 16.2 or earlier.
l Migrate the translated *.asmp file into Twin Builder (Ansys Electronics Desktop 2018.2)
as an *.aedt file.
l Set up and run an analysis on the translated model.
l Create reports.

Using Legacy Schematics 8-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Translating a Legacy Schematic using Release 16.2 or


Earlier
To use your legacy version 7 schematics in Release 2018.0 or later projects, you must first use
Simplorer Release 16.2 or earlier to translate and save the project to make it compatible.

In this example, you will import a Three-Phase Rectifier SSH file created in Simplorer version 7.
The legacy file’s component parameters, simulation setup parameters, and outputs translate
into a Simplorer Release 16.2 project, which you can then bring into Twin Builder Release 2018
or later for analysis and reports.

Importing a Legacy Schematic into Simplorer Release 16


or earlier
To import a legacy SSH file:

1. Select File > Open. An Open dialog box appears.


2. Select Legacy Simplorer Schematic (*.ssh) from the Files of type drop-down menu to
filter the window contents.
3. Locate the desired SSH file (LegacyRectifier.ssh for this example) and click OK to begin
the import process.

Hint You can also drag the file directly onto the open Simplorer window.

A Legacy Translation Options dialog box appears.

Using Legacy Schematics 8-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

l Use the Text Language panel to choose the Target language into which the pro-
ject’s text strings are translated. If the target language has no equivalent text for a
given element, configure the translation tool either to Ignore elements for which
there are no target language strings; or to use Substitute strings.
l Use the Symbol panel to select whether the symbols in the translated schematic
is Normal size or five times (5x) normal size. You can also select the symbol
Type and associated Symbol Language available for display on the translated
schematic.
4. For this example, we will use the default values, so leave the settings unchanged and click
OK to begin translation.

The Message Manager pane informs you of the progress of the translation.

Using Legacy Schematics 8-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Note:
l Virtually all of the project’s preprocessing data is translated.
l Optimetrics setup information, including design variables, is not translated.
However, the nominal model is translated.
l Solution data is not translated. Therefore, you must solve legacy Simplorer
projects again after translation. To import existing solution data, right-click
Analysis in the Project tree and select Import SDB File, or select Twin
Builder > Import SDB File on the main menu bar.

5. When translation is complete, choose File > Save As and save the translated project with
a name of your choosing before proceeding.
6. In the Project Manager pane, browse the Project tree.

7. Double-click and to open the Solution Options and Transient Analysis


Setup dialog boxes, and confirm that the legacy settings have been transferred correctly.

Using Legacy Schematics 8-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Using Legacy Schematics 8-5

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

8. Select Simplorer > Output Dialog to open the Outputs dialog box and observe that the
defined outputs have been translated.

Using Legacy Schematics 8-6

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Now that you have confirmed that the necessary conditions for finding solutions for the trans-
lated circuit have been correctly set up, the next step is to open the translated schematic in Twin
Builder.

Opening the Translated Schematic in Twin Builder 2018.2 or Later

To open the translated schematic:

1. Select File > Open.


2. Navigate to the location of the *.asmp project file, and open the file. The File Migration
Required dialog box appears:

Using Legacy Schematics 8-7

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Select either Copy or Convert.


l Select Copy to create the new *.aedt file and save the original *.asmp file.
l Select Convert to create the new *.aedt file without saving the original *.asmp file.
3. Click OK.

The next step is to start an analysis.

Starting an Analysis

To start an analysis:

1. Start the analysis (simulation) by selecting Twin Builder > Analyze.

You can also right-click Analysis in the Project Manager pane and select Analyze, or
press F12 to start the analysis.

The simulation model is compiled and outputs are calculated. During the simulation run,
the name of the model is visible in the Progress window, and a button to stop the sim-
ulation is available.

Using Legacy Schematics 8-8

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

At the end of the simulation, the simulator program remains open so you can run the sim-
ulation again if any model parameters changed.

2. After the simulation, the output quantities display in plots on the sheet or in report win-
dows. Output data is also saved in an SDB (Twin Builder Database) file.

Plotting Simulation Results


See Plotting Rectifier Model Simulation Results for information on plotting simulation results.
Detailed information on generating and modifying reports is also available in the help.

Using Legacy Schematics 8-9

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

PDF layout 8-10

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Index Chopper transistor 4-4

Component Libraries 1-3

. Components

.aedt file 2-4, 8-1 Connecting 3-1, 4-12, 6-3

.asmp file 8-7 Deactivating 4-15

.ssh file 8-7 Deleting 4-1, 5-2

Placing 6-3, 7-3, 7-5, 7-7, 7-9


A
Connecting components 3-1, 4-2, 4-2,
Adding a Rectangular Plot 5-9 4-12, 5-3, 5-3, 6-3
Adjusting Plot Properties 5-11 Constant block 5-6
Arranging components 4-2, 4-2, 5- Controller
3, 5-3, 6-3, 7-3, 7-5, 7-7, 7-9
Modeling using block diagram 4-4
Automatic block sorting 5-13
Modeling using state graph 4-11

B PI controller 5-6

Block diagram
D
Hysteresis controller 4-4
DC machine component 4-2
Modeling PI controller 5-4
DC machine component (VHDL-
Modeling PWM controller 7-7 AMS) 6-3
Block sample time 4-6 Deactivating components on the
sheet 4-15
Block sequence 5-12
Deleting, Components 4-1, 5-1
C design
Capacitor 3-1 adding a solution setup 4-1
Characteristic component 5-4 adding to project 2-5

Index-1

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

renaming 2-5 Intrinsic Variables 7-3


Diode 3-1, 4-4
L
Characteristic 4-8
Limiter block 5-7
Displaying

Diode characteristic 4-8 M


Pins 6-4 Manual block sorting 5-13
Property Names 4-3 Mechanical load
Simulation results 3-1, 6-5, 7-4 Characteristic 5-4

Initial value 4-3


E
Modeling
Equations, Modeling PWM con-
troller 7-3 Hysteresis controller 4-4, 4-11

PWM controller 7-1


F
With block diagram 4-4, 7-9
File Migration Required dialog 8-7
With state graph components 4-11, 7-6
Freewheeling diode 4-4
Modifying, Display Elements 4-4

G Moving, Property Names 4-2

Gain block 5-6


N
Ground node 3-7
Name Reference 4-15

H
O
Hysteresis block 4-6, 5-7
Optimetrics, capabilities 2-2

I
P
Inductor 3-7
PI (predefined constant) 7-3
Initial conditions, setting 7-2
PI controller 5-6
Initial value component 4-2, 4-13,
7-2 Pins, Displaying 6-4

Integrator block 5-6

Index-2

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Placing components 4-2, 4-2, 5-3,


5-3, 6-3, 7-3, 7-5, 7-7, 7-9 R

Plot Properties, Adjusting 5-11 Resistor 3-1

Predefined, Constants 7-3 results, expected 2-2

project
S
creating 8-1
Setting initial conditions 7-2
saving 2-2, 8-1
Sign (signal processing block com-
Project Manager 2-4, 8-1 ponents) 7-9

project tree Simulation parameters 3-16, 4-10, 4-


10, 6-5, 6-5, 7-3, 7-3
expanding automatically 2-5
Simulation results 3-1, 6-5, 7-4
introduction 2-2, 8-1
3-phase rectifier with res-
Properties
istive/inductive load 3-1, 8-9
Characteristics 5-4
Hysteresis current-controlled DC
Circuit components 3-1 motor start-up 4-10, 4-17

DC machine 4-2 solution setup, adding 4-1

State graph components 4-12 Starting, Simulation 3-1, 7-3, 7-5, 7-7,
7-9, 8-2
Time functions 7-5
State component 4-12
Property Names
State graph properties 4-12
Displaying 4-2
Summation 5-6
Moving 4-3

PWM Modeling T

Modeling with block diagram 7-9 Three-Phase Rectifier


With equations 7-3 About 2-1
With equations and time creating the schematic 3-1
function 7-5
Time (simulation time) 7-3
With state graph 7-6
Time function 7-5

Transistor 4-4, 4-15

Index-3

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.


Twin Builder Getting Started Guide

Transition component 4-12

Triangular wave function 7-5

Two-point Element 4-6

Using name references 4-15

Variants of PWM modeling 7-1

VHDL-AMS components 6-1

Voltage source 3-1

Index-4

Twin Builder 2023 R2 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential

information of ANSYS, Inc. and its subsidiaries and affiliates.

You might also like