Sie sind auf Seite 1von 23

Matlab Simulink to Simulate

and Build Simple Electric


Circuits

Yousef Sardahi


Learning Outcomes

 Lab Protoboards (Breadboards)

 Resistance Color Coding

 Access Simulink powerlib

 Build simple DC circuits using Matlab Simulink

 Measure DC current, voltage and impedance

 Display a circuit measurement


Lab Protoboards (Breadboards)
Resistance Color Coding

200Ω ± 5%
Measuring Electrical Variables

Measuring Resistance using OhmMeter

Measuring Voltage using VoltMeter

Measuring Current using Ammeter


Building and Simulating Simple
Electric Circuits

 Introduction

 Building the Electrical Circuit with powerlib Library

 Explore the powerlib library

 Learn how to build a simple circuit from the powerlib


library
 Interconnect Simulink® blocks with your circuit
Basic Electric Circuits’
Elements

Element Library name Sub Library name

Resistor powerlib Elements


Capacitor // //
Inductor // //
Ground // //
DC Voltage Source // Electrical Sources
AC Voltage Source // //
AC Current Source // //

Diode // //
Measurement devices and
Display Blocks

Element Library name Sub Library name

Current Measurement // Measurements


Voltage Measurement // //
Impedance // //
Measurement
Scope Simulink Sinks
Display // //
Example 1

 Build the following Circuit,


Procedure for Simulation

1. Open the SimPowerSystems main library by entering the


following command at the MATLAB® prompt.

>>powerlib

This command displays a Simulink window showing icons of


different block libraries.
Continuation…

2. From the File menu of the powerlib window, open a new


window to contain your first circuit and save it as Example1.
3. Copy the Parallel RLC Branch block, which can be found in
the Elements library of powerlib.
4. The resistors R1, R2 and R3 of the circuit can be obtained from
the Parallel RLC Branch block. Triplicate the Parallel RLC
Branch block, which is already in your circuit1 window. Select
R for the Branch Type parameter and set the R parameter
according to Circuit to Be Modeled.
 Note: Once the dialog box is closed, notice that the L and C
components have disappeared so that the icon now shows a
single resistor.
Continuation…

5. Resize the components if necessary and interconnect blocks by


dragging lines from outputs to inputs of appropriate blocks.

6. You need an Impedance Measurement block to measure the


equivalent resistance. This block is found in the Measurements
library of powerlib. Copy it and name it U1. Connect its ends as
shown in the circuit.

7. To observe the total resistance measured by the Impedance


Measurement block named U1, a powergui block which can be
found in the powerlib is used.
Continuation…

8. From the Simulation menu, select Start.

9. Open the power gui block and then click

on Impedance vs Frequency Measurement.

Read the magnitude and the phase of the

total Resistance
Continuation…
Example 2

 Build the following Circuit,


Procedure for Simulation

1. Open the SimPowerSystems main library by entering the


following command at the MATLAB® prompt.

>>powerlib

This command displays a Simulink window showing icons of


different block libraries.
Continuation…

2. From the File menu of the powerlib window, open a new


window to contain your first circuit and save it as
Example2.
3. Copy the Parallel RLC Branch block, which can be found
in the Elements library of powerlib.
4. The resistors R1, R2 and R3 of the circuit can be obtained
from the Parallel RLC Branch block. Triplicate the
Parallel RLC Branch block, which is already in your
circuit1 window. Select R for the Branch Type parameter
and set the R parameter according to Circuit to Be
Modeled.
5. You need to rotate (see the next slide) each resistor to get
the same circuit diagram as in Example 2.
Continuation…
Continuation…

5. Resize the components if necessary and interconnect blocks by


dragging lines from outputs to inputs of appropriate blocks.

6. You need an Impedance Measurement block to measure the


equivalent resistance. This block is found in the Measurements
library of powerlib. Copy it and name it U1. Connect its ends as
shown in the circuit.

7. To observe the total resistance measured by the Impedance


Measurement block named U1, a powergui block which can be
found in the powerlib is used.
Continuation…

8. From the Simulation menu, select Start.

9. Open the power gui block and then click

on Impedance vs Frequency Measurement.

Read the magnitude and the phase of the

total Resistance
Continuation…
Example 2

 Build the following Circuit,


Resources

 Matlab help Documentation

Das könnte Ihnen auch gefallen