Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
ПОЯСНИТЕЛЬНАЯ ЗАПИСКА_Н.А.ТЕПЛЯКОВА.doc
Скачиваний:
1
Добавлен:
01.05.2025
Размер:
9.73 Mб
Скачать

Приложение а -Technical modelling

P-CAD 2004 uses the module of modelling (Simulator) systems Altium Designer 2004 (Protel 2004). At modelling analog devices are used SPICE 3f5 algorithms. At modelling digital devices is used algorithm XSPICE with the description of models of digital elements in language Digital SimCode.

The basic scheme of the modelled device is created by means of circuit editor P-CAD Schematic. At a choice of a mode of modelling in P-CAD Schematic, data about the basic scheme are automatically transmitted in an operating environment of system Designer in a kind of the list of connections for drawing up of the task for modelling, actually modelling and viewing of its results. The basic problem at modelling is development of models of radioelements, especially not imported, as accuracy of construction of model determines adequacy of modelling.

With the aid of the powerful Mixed-Signal Circuit Simulator, you can perform an array of mixed-signal simulations on your P-CAD Schematic designs.

The Simulate menu offers two commands - Run and Setup - which allow you to run a simulation on your design directly or run a simulation after analysis criteria has been set up. Both commands become available only when a schematic design is open.

In order to perform a simulation, all parts contained within the design must be simulatable - i.e. have simulation models associated to them. A design containing non-simulatable parts will not be simulated. Instead, an error log will be generated, showing all errors that are preventing the simulation of the design from being carried out. In order to check if a component has a simulation model associated with it, use the Library Index Spreadsheet.

If the Simulate » Run command was chosen, the simulation is run straight away. If the Simulate » Setup command was chosen, the Analyses Setup dialog will appear, giving you the option to set analysis citeria (picture 21).

Picture 21 - Analyses Setup dialog

Analyses that can be carried out include:

  • Operating Point Analysis - Calculation of an operating mode on a direct current (calculation of «a working point») at linearization models of nonlinear components;

  • Transient/Fourier Analysis - The analysis of transients and the spectral analysis

  • DC Sweep Analysis - Calculation of a mode on a direct current at a variation of one or two sources of a constant pressure or a current;

  • AC Small Signal Analysis - The frequency analysis in a mode of small signals (for nonlinear schemes it is carried out in linearized a mode in a vicinity of a working point on a direct current)

  • Noise, Pole-Zero Analysis - Calculation of spectral density of internal noise;

  • Transfer Function Analysis - Calculation of transfer functions in a mode of small signals

  • Temperature Sweep Analysis – The mode of change of temperature

  • Parameter Sweep and Monte Carlo Analysis - Change of parameters of elements and the statistical analysis on Monte Carlo method.

The modelling of the electric basic scheme of the electronic device created in circuit editor PCAD Schematic, can be lead after of some preparatory operations:

  1. The components which are not having mathematical models are excluded from the scheme (sockets, elements of switching and Item).

  2. From the scheme it is recommended to exclude the functional units which are directly not influencing results of modelling, or such functional units with which it is possible to replace with sources of signals and constant pressure and currents (for example, generators of clock frequencies, sources and stabilizers of pressure of a feed and item). Exception of such functional units can essentially reduce time of modelling of the scheme.

  3. Circuits of external switching of the scheme (the elements connected to sockets at carrying out of checks of the scheme, etc.) are added if necessary.

  4. In the scheme it is necessary to add power supplies and the sources forming entrance signals, and also to set necessary parameters of these sources.

  5. Circuits "ground" should be given standard name GND.

  6. To Circuits of a feed of digital microcircuits should be given standard names (usually VCC, VDD) which should correspond to names of conclusions of a feed in components of microcircuits.

  7. In properties of passive components of the scheme (resistors, condensers and т. The item) on menu «Symbol» are corrected or set rating values of parameters of these components (parameter «Value»). For all passive components of the scheme should be set rating values of their parameters. All active components of the scheme should have the attributes of modelling belonging a category of attributes «Simulation».

  8. It is necessary to provide presence of files of mathematical models of all components used in the scheme in which attributes there are links to such files. Files of models should be placed in the directories specified in attributes «SimFile» of these components.

  9. To Circuits which enter into those units, signals in which are necessary for estimating visually after modelling, it is recommended to give unique names, for convenience of the link to them.

After preparation of the scheme for modelling it is recommended to lead its preliminary check, having chosen a command «Utils → Generate Netlist» editor P-CAD and having generated the list of connections in format XSpice. If by preparation of the scheme errors at generation of the list of connections the list of these errors is displayed have been allowed and the «name of the project».ERR is located in a file. Such check traces errors of type «for a component the file of model is not found», «in the scheme there is no circuit with name GND» and Item

For the task in the modelled scheme of pressure of a feed, currents and entrance signals, both constant, and varying in time, are applied the special components describing sources of constants and variable pressure and currents. These components are in the standard libraries delivered with P-CAD. Sources of pressure and currents of the simple standard form (constant, periodic pulse, the sine wave form), and also sources of pressure and currents of the any form (set кусочнолинейной approximation), are in library Simulation Source.lib.

Modelling of basic electric schemes in P-CAD the complex form, such, as packs of impulses, sine wave signals of variable frequency, sequence of rectangular impulses with the variable period, signals of the triangular and sawtooth form and item, are used special components, and combinations from these components and sources of signals of the simple form.

All sources of pressure and currents have an item designation «Ref Des» U. Parameters of sources of signals are set by means of attributes by updating their parameters in properties of components. Sets of attributes are defined by the models of these components built in system, therefore to add and delete any attributes in components of sources of signals it is forbidden (unfortunately, P-CAD allows to make it). Also is inadmissible to change names of parameters of attributes.

The first time a simulation is run on a design, the default analyses settings in the Analyses Setup dialog will be used. After simulation, saving the project will store these initial setting in the project file (*.PrjPcb). When you make any changes in the Analyses Setup dialog, they are stored in the project file (when saved) and subsequently applied to future simulations of that particular design.

The Spice netlist generated from the schematic document contains no analyses setup information. When the simulation is run, the defined analyses setup information (from the project file) is combined with the schematic-generated netlist to produce a modified Spice netlist (DesignName_tmp.nsx). It is this netlist file that is passed to the Simulator.

When the simulation is run, a simulation data file will be generated (DesignName_tmp.sdf) and opened as the active document in the Design Explorer. The results of simulation will be displayed in the Waveform Analysis window as a series of tabs - one per type of analysis performed (picture 22).

Picture 22 – The result of modelling

The Design Explorer project file (*.PrjPcb) is created if it does not already exist (in the same directory as the .sch and .nsx files). If it does exist, the netlist file generated will replace the previous version of the same name.

The Projects panel in the Design Explorer application shows each open project and its constituent files. The schematic-generated Spice netlist appears in the panel under the Mixed Sim Netlist Files sub-folder. The modified Spice netlist (combining original schematic-generated netlist and analyses setup information) appears under the Generated Mixed Sim Netlist Files sub-folder. The results of the simulation are stored in the simulation data file (*.sdf) and appear under the Generated SimView Data Files sub-folder.

The output path for generated files (DesignName_tmp.nsx and DesignName_tmp.sdf) is set in the Options tab of the Options for Project dialog, in the Design Explorer application. By default, the output path is set to a sub-folder under the folder that contains the project file and has the name: Project Outputs for ProjectName. The output path can be changed as required. If the option to use a separate folder for each output type has been enabled in the Options tab, then the generated files will be written to a further sub-folder, named: AdvSim Output.

Before performing a simulation run, you need to select which analyses will be performed, the signals for which data will be collected and which variable waveforms will be automatically displayed when the simulation has finished. All of these options are defined in the Analyses Setup dialog. Each analysis type ids defined on its own page of the dialog.

Only one simulation may be run at any one time. If a simulation is running in the Design Explorer and you attempt to run a simulation from the P-CAD schematic for the same or different design, a dialog will appear informing you that the client is busy and to try again later.

You can also generate the Spice netlist from your P-CAD schematic design, using the Utils Generate Netlist command. You are then free to open the netlist in Design Explorer and run the simulation at a later stage.

You can edit the Spice netlist file directly in the Design Explorer, using the associated Text Editor. This is particularly useful if you wish to make changes without going back to the schematic (e.g. to change the value of a resistor). The netlist used by the Simulator is always the *_tmp.nsx one. If you edit this directly, it will be used straight away. If you edit the original (schematic-generated) netlist, the *_tmp.nsx will be regenerated, overwriting that which currently exists.

If you do modify the schematic-generated .nsx file, you should save it under a different name, otherwise it will be overwritten the next time the netlist is generated from the schematic document.

The attributes that must be specified in order to make a part simulatable, are all part of the Simulation category in the Place Attribute dialog / Attribute Properties dialog. These attributes consist of:

SimType – In a simulation-ready component, the first simulation attribute to be defined in the Attributes tab of the part's Properties dialog.

The Value field of this attribute must contain the following information: The type of device that is to be simulated, and the SPICE Prefix.

Syntax: <Device Type>(<SPICE Prefix>)

The <Device Type> and <SPICE Prefix> must follow standard SPICE conventions

SimModel – In a simulation-ready component, the second simulation attribute to be defined in the Attributes tab of the part's Properties dialog.

The Value field of this attribute must contain the following information: The name of the model to use when simulating the device.

Syntax: <model_name>

If the string "<parttype>" is entered into the attribute's Value field, then the value of the Type field on the Symbol tab of the Properties dialog is inserted as the model name. Many of the components in the simulation libraries are constructed in this way to allow the simulation model to be easily changed.

Component types, such as standard resistors, capacitors, inductors and sources, which are internally defined and modeled in SPICE do not need an entry in this field.

Digital components use a model file to call a Digital SimCode file.

SimFile – In a simulation-ready component, the third simulation attribute to be defined in the Attributes tab of the part's Properties dialog.

The Value field of this attribute must contain the following information:

The location of the file in which the model specified in the SimModel attribute can be found.

Syntax: {model_path}\<subpath>\<model_name>.<ext>

SimPins – In a simulation-ready component, the fourth simulation attribute to be defined in the Attributes tab of the part's Properties dialog.

The Value field of this attribute must contain the following information: The pin listing for each component part.

Syntax: <part_no>:[<pin1>,<pin2>,<pin3>,...]...

The order in which pins are entered is not important, however it is convenient to enter the pin numbers in the order that they are required by the simulation model. This makes it straightforward to specify the mapping numbers in the SimNetlist attribute. The order information is often detailed in the header of the model file.

SimNetlist – In a simulation-ready component, the fifth simulation attribute to be defined in the Attributes tab of the part's Properties dialog.

The Value field of this attribute must contain the following information:

Netlist data for the SPICE netlist file. If you need to specify more than one line of netlist information use the vertical bar (pipe symbol) as a line delimiter.

Syntax: <SPICE Data>|<SPICE Data line 2>|...

As well as entering SPICE data directly in this line, you can also reference information in the other Simulation Attributes, as well as the 16 Simulation Field Attributes. The percent sign (%) indicates a reference to another field, the letter or number that follows the % indicates what field to use. The following options can be used on this line:

%D – Device designation: Inserts the device designator. If the first character of the designator does not match the spice prefix then the prefix is automatically inserted at the beginning of the string in the netlist.

%1, %2, %3, .. %n: Device pins to be added to the netlist, in the order required by the SPICE model. The numbers are not used directly, each is used as an index to the component pin number specified in the SimPins attribute (for this part of the component).

SimDefaults –In a simulation-ready component, the sixth simulation attribute to be defined in the Attributes tab of the part's Properties dialog.

The Value field of this attribute must contain the following information (Note: this information is optional):

Default parameters that are required in the component SimField attributes.

Syntax: F1:<def1>,F2:<def2>,...

SimFields 1-16 – In a simulation-ready component, the simulation attributes SimField 1-16 can be set up in the Attributes tab of the part's Properties dialog, to contain parameters that can be specified once a component has been placed on the schematic.

Use the %F1-16, %P, %P1-16 or %PARAMS syntax in the Value field of the SimNetlist attribute to include these fields in the simulation netlist.

When using these attributes, the parameter name must be declared as a prefix when entering the value in the attribute's Value field.

Configuring a schematic for simulation

Before you can successfully simulate your circuit you need to ensure that your schematic documents contain all the necessary information. The following rules must be adhered to before you will be able to run any of the available simulations:

  • All components and parts in the schematic must properly reference a simulation device model.

  • You must place and wire up suitable signal sources to provide drive to the circuit during simulations.

  • You must add meaningful net names to identify nodes in the circuit for which you wish to plot simulation data.

  • If necessary, you must set the initial simulation conditions of the circuit.

Identifying simulation circuit nodes

Before a simulation is performed on a circuit, a SPICE netlist is produced from the schematic. To enable the circuit to be netlisted, each node in the circuit is given a unique default name. These node names are then used to identify nodes during simulation data collection.

In order to easily identify points of interest in your circuit, it is a good idea to use meaningful net names on the schematic. You can view the net name associated with a node in your circuit by selecting the node and then right-clicking and choosing the Net Info command from the popup menu. The Net Information dialog appears. The Net Name field (read only) shows the associated net name for the particular node.

The Net Name will then be used in the netlist to identify these nodes.

Setting initial conditions for simulation

Certain designs, such as astable and bistable circuits, may require node voltages to be pre-defined before a simulation will converge. There are two special devices for this purpose that you can place on your schematic: Nodeset and Initial Condition. The symbols for both these devices can be found in the Simulation Control Statement.lib library located in \P-CAD 2004\Lib\Simulation Control Statement.lib, within the drive and directory where you installed your P-CAD 2004 software.

.NS Device (Nodeset)

The Nodeset device is used to specify the starting voltage for a node in the circuit during a preliminary pass of the operating point analysis. After the preliminary pass the restriction is released and the iterations continue to the true bias solution.

After placing the .NS device you will need to specify its properties. Enter Select mode and double-click the source to open its Properties dialog, then set the fields in the Symbol tab as follows:

Ref Des - Each Nodeset device must have a unique designator

Value - Initial amplitude of the node voltage

.IC Device (Initial Condition)

The Initial Condition device is used for setting the initial conditions for a Transient Analysis. During a Transient Analysis, if the Use Initial Conditions option in the Transient/Fourier Analysis page of the Analyses Setup dialog (Simulate » Setup) is NOT enabled, the node voltage is held at the value specified by the IC device during operating point analysis. During the subsequent transient analysis this constraint is removed. This is the preferred method since it allows the SPICE engine to compute a consistent DC solution. If the Use Initial Conditions option is enabled, the value set by the IC device is used as the starting level of that node for each iteration of the transient analysis.

After placing the .IC device you will need to specify its properties. Enter Select mode and double-click the source to open its Properties dialog, then set the fields in the Symbol tab as follows:

Ref Des - Each IC device must have a unique designator

Value - Amplitude of the node voltage

Note: You can also specify the Initial Conditions for each component as a property of that component. Refer to the Selecting schematic components for simulations topic in the links section below for details on setting the simulation properties for specific component types.

Selecting simulation-ready schematic components

To perform simulation analyses, all components/parts placed on your schematic must contain special simulation-specific information which tells the Simulator how these components/parts are to be treated. This means that schematic components/parts must include a reference to an appropriate SPICE device model.