SPICE simulation with Proteus of a Coils Tester.

Ing. Cristoforo Baldoni

This article deals with the Proteus simulation (version 7 and higher) of a low cost and very useful coils tester, easy to build by yourself. It ‘s the In-circuit LOPT (Line OutPut Transformer) Tester by Bob Parker that allows to evaluate the smooth functioning of a coil by turning on a number of different colored LEDs. It doesn ‘t measure the inductance value of a coil, but rather the ratio of its resistive part and the inductive part. This tester is very useful in finding coils with shorted turns, and wound components like yoke windings and SMPS transformers. Low loss components, will turn on four or more LEDs, while components with short circuits will turn on few or no LEDs. We ‘ll se how to implement and simulate with Proteus the circuit which consists of three sections: the low frequency pulse generator, the ring amplitude comparator and the LED bargraph display. We ‘ll se how to model a coil and try different values for the inductive and resistive component to validate the simulation. The Proteus simulation files of the device are available for download after accessing this article.

 

Premium Content

Login to buy access to this content

Designing and Simulation of Industrial PID Controllers using Microcontrollers

Ing. Cristoforo Baldoni

In this article we’ll see how to pass from the design of analog PID controllers for continuous-time systems to digital controllers, replacing operational amplifiers, resistors and capacitors with microcontrollers. Digital controllers are very compact, all the controller fits on a chip, including the A/D and the D/A converters, moreover, digital controllers are not affected by the aging of the components and don’t change their values with the temperature as analog components do. We’ll see how to apply the Z-transform, the equivalent of the Laplace transform, but for discrete-time systems, we’ll see how to identify the transfer function of a process and we’ll explain, with a step by step procedure, how to apply the theoretical knowledge learnt by examining an Proteus microcontroller based project, that uses its PWM output to control an oven ‘s temperature. The microcontroller has a 10 bit A/D converter. This procedure can be easily adapted with minimal adjustments to other processes to control.

Topics

 

1. Digital Control-System Block Diagrams

 

2. Linear difference equations, Z-Transform, Inverse Z-Transform and Discrete Transfer Function.

 

3. Sampling and A/D Analogic to Digital Converter

 

4. D/A Digital to Analogic Converter and ZERO ORDER HOLD  (ZOH) : Relationship between the Continuous Transfer Function and Discrete Transfer Function of a sampled Process.

 

5.  Block Diagram Manipulation of Sampled Data Systems

 

6. Methods for designing Digital Controllers, Stability.

 

7. Designing  PID controllers by microcontrollers

 

8. Transfer Function Identification and PID Tuning using the Ziegler–Nichols Method.

 

9. Practical case of a temperature control system implemented with a microcontroller PIC and simulated with ISIS Proteus: Step by step explanation of how to apply the theoretical knowledge for implementing and simulating a PID controller.

Premium Content

Login to buy access to this content

Proteus Video tutorials

Topic Video
How to simulate a simple circuit with Proteus
How to create a component symbol in Proteus
How to perform a Time domain analysis in Proteus
How to design a circuit board layout with Proteus ARES

How to Import PSpice models into Proteus

This article explains how to import a SPICE model with the “.model” statement  into Isis of Proteus. Suppose we want import the PSpice model of an NPN Radio frequency transistor BF199. We have the following SPICE source file:

Run Isis and click on “P” button of “Device” to pickup the generic NPN device:

write “NPN” on the keywords edit field and select “Generic NPN bipolar transistor”

GenericNPN

After placing the component on the layout, click on “Text Script Mode” button of left side toolbar and left mouse click on the layout, the Edit Script Block window pops up

Now, copy the text of source SPICE model and paste beetwen the two statements

*SCRIPT SPICE

*ENDSCRIPT

as in the figure below

It’s important to copy the source text between the two statements, otherwise the simulator warns thar can’t recognize the model and replaces it with a default NPN primitive.

Arduino Simulation with Proteus

We ‘ll show how to simulate the celebrated open-source electronics prototyping platform Arduino with Proteus .

 Let ‘s run ISIS Schematic:

isisprodemo

To simulate the core of Arduino platform we need only a few components: the atmega328P Microcontroller, a Crystal and two Capacitors.Let’ s look for these devices in the library:

Click on “P” button and write atmega as keyword:

atmega328p

Double click on the model and this appears under Devices panel:

Same operations for the Crystal and Capacitor:

crystal

cap

Getting Started with Proteus ARES PCB

Let’s start from this complete ISIS Proteus schematic

Proteus_page117_image1

this microcontroller circuit has the following components:

4 diodes 1N4148

2 NPN transistors BC547

2 electrolitic capacitors CAP-ELEC

2 zener diodes a 3EZ8V2D5 and a 3EZ5V1D5

3 resistors RES

a connector D-type 9 pin female CONN-D9

a PIC microcontroller PIC16F877

the PIC16F877 has two hidden pins VDD and VSS, the VDD pin must be set as POWER and the VSS pin must be set as GROUND. When you add a component in ISIS , some components are automatically configured with a PCB footprint, while other components don’t have PCB footprint associated with the component, and you can add it manually. In this case, you must add the appropriate footprint as in the CAP-ELEC example below:

Open the Properties dialog box for the CAP-ELEC component. Click the ? Button to open the PCB package selection dialog

Proteus_page118_image1

Choose a suitable PCB footprint, click OK to finish. Select the PCB footprints for all the components, then open the Netlist Compiler from the Tools menu of Isis Proteus menu Tools -> Netlist Compiler. The settings dialog box pops up, keep the default settings, click OK to generate the netlist file.  After the file has been generated, from the Tools menu select Tools -> Netlist to ARES, this will launch ARES software. You can also use the corresponding button on the toolbar to complete this operation.

Proteus_page119_image3

As you can see that the work area is empty , and we want to use all the elements placed in the list on the left.

Before placing the components, we must draw a border, we use the 2D Graphics Box Mode button to draw the border

Before starting to draw ,we must first select the color, since this is a border, we choose the yellow color (Board Edge), as we can see on the setting tool at the bottom of the main window.

Click in the workspace, hold down the left button ,drag a rectangle of appropriate size ,release the button.

If you later want to modify this size board, you need to click 2D Graphics Box rectangular icon again, right-click on the corner of the board: a control point appears,drag the control point to resize the board. Let’s return to the components placement view by clicking the icon below

Now put the components into the board, in order to get a general view, click F8. This is the result

Proteus_page120_image1

How to connect Proteus with Keil IDE

Thanks for this article to archeng504

Proteus  ISIS can performs a mixed-mode SPICE circuit simulation of analog devices with a variety of models of microprocessors for a complete microcontroller based design. This  feature is called VSM Virtual System Modelling. It can performs RS232 dynamic simulation, I2C simulation and debugging , SPI simulation and debugging, USB simulation, keypad and LCD system simulation functions,  it also has available various virtual instrument devices , such as oscilloscopes, logic analyzers, signal generators. ISIS Also supports third-party software to compile and debug environment, such as Keil uVision IDE software. Keil uVision is an integrated development environment that combines project management, code editing, program debugging and other facilities in a single environment.

Here a simple example to demonstrate a debugging session of a Proteus simulation project using  Keil . The communication is achieved through TCP/IP. This method has the advantage that a debug session can be run either on one computer or on two computers using the local network without any external hardware.

The core of the circuit is a microcontroller AT89C51.  A seven segments 6 digit LED dispaly is connected to the microcontroller. The segment code pins (a, b, c, d, e, f, g, dp) are connected to the port P1 of the microcontroller, six pins of the microcontroller port P2 are connected to the digit code pins ( 1, 2 , 3, 4 , 5, 6 ). We want display LED charactures with a strobe effect.

Proteus_page84_image3

 

Let’s draw the circuit schematic

Add the required components to the object selection window. Pick the components into the Schematic: click the Object Selector button, as shown

On the “Pick Devices” window edit the “Keywords” Input  “AT89C51”  to find the object library , and the search results are displayed as shown:

Proteus_page86_image1

In the “Results” column list,  select the first item “AT89C51”, again on the  “Pick Devices” window edit the “Keywords” “7 SEG” and choose the “7SEG- MPX 6 – CA – BLUE”, (6 -digit common anode 7 LED display ) as shown in the image

Proteus_page87_image1

Finally, edit the ” Keyword” RES, and select the single result as shown

Click the “OK” button to add the devices window.

How to connect components in Proteus: Wiring up Components

Connection between two objects: Line automatic path function (Wire Auto – Router or WAR)

 

left-click the first object connection point . if you want that ISIS automatically gives away the line path, simply left click on another connection point.

On the other hand , if you want to decide the alignment path , simply click the left mouse button at the desired point you wish a corner.

The wire automatic path function eliminates the need for you to draw each specific path wire. This feature is enabled by default , but that feature can be disabled in two ways. If you just left click on the two connection points , WAR will select a suitable path, but if you point a connection point , then one or several non-connected point position , ISIS will think that you are in the manual alignment path , the line will allow you to click on each corner of the path . left-clicking another connection point to complete. The other way to skip the WAR mode is by using the Tools menu in the WAR command to disable it .

This is very useful when you want to set directly between two connection points for example in the case of a diagonal path.

Repeat wiring (Wire Repeat)

Suppose you want to connect an 8-byte ROM data bus to the main data bus circuit, we have the ROM, and the bus as the one placed in the picture below.

First, left-click A, and then left-click B, draw a horizontal line between the A and B . Double-click the C, and the repeat wiring function is activated, the wiring between C and D is done automatically . Double-click the E, and it will be wired with F. The repeat wiring function copies a complete line path. If the auto-repeat function is on, It allows you to connect different wires or pins to the bus, simply connecting the first and following each pin with a double click, the connection will be carried out automatically.

Drag line (Dragging Wires)

There are some special methods that can be used to wiring two components. If you place the mouse pointer everywhere between the ends of the wire, there will be a corner and you can drag the corner of the line. Note: in order to work, the cable connected to the object can not have a label , otherwise ISIS will think you want to drag the object .

Move segment or segments group  (To move a wire segment or a group of segments)

suppose you want to move and drag a selection window as if it were a single line segment: left-click “Move” icon ( in the toolbox ) ,

left-click to choose the final position of the block. If the if the new wiring is not satisfactory  , you can always use the Undo command.