LabOne
Lab 1: Simulink Introduction
The purpose of this lab is to give you a basic idea as to how simulink looks and operates. At the end
of the lab, you are to print a schematic as well as your output and the bode plot generated. Please
name and label them “ECEN405 Lab 1: Simulink Introduction”.
Open matlab, along the top under the “home” tab you will find the Simulink icon. Alternatively, type
“Simulink” into the command window.
Fig: 1
You should now have the “Simulink Library Browser” open. There are a number of libraries listed
here, we will be using “Simscape SimPowerSystems” and a few elements from the basic “simulink”
library (note: libraries such as SimPowerSystems do not connect directly to other libraries eg
SimElectronics).
Create a new model by selecting the icon below from the top of the “Simulink Library Browser”. Save
model as “LabOne”
Fig: 2
We need to change the settings to suit our simulation (this is not always the case). The cog icon at
the top of the model will take us to “Model Configuration Parameters”. We want the stop time to be
0.1 as we only need to observe the model for a short time. We will also need to set the Max step to
1e-6. This is because we will be switching at 20kHz and if the max step is too high, you can lose some
detail.
Fig: 3
Now we will begin creating the model. Add a subsystem from the “commonly used Blocks”, and
name it PWM. Subsystems are good for keeping a model organised, especially when you have a busy
circuit. A subsystem is another layer which can have a sub circuit of your system inside, with inputs
and outputs. Although we are not using it in this lab, by right clicking on the subsystem, you can
create a “mask” where you can pass parameters into the subsystem without entering it.
Fig: 4
To enter a subsystem (when it does not have a mask) double click on it. In this subsystem we will
create our PWM generator. First add a triangle wave generator which you can find by typing
“triangle generator” into the search bar at the top of the libraries (select the one from simscape).
Once it is in your model, double click on it and change the frequency to 20000Hz. In the same way,
add a sum block, double click on it and change one of the + signs to a –. Add a Relay block (from
simulink-1),a mux and a scope (both can be found in the commonly use blocks library).
Double click on scope, go to parameters, in “general” change the number of axis to 2. In history,
uncheck the “Limit data points to last” box
Fig: 5
Now connect the above blocks as shown below (Fig 6), leave the scope open to one side
Fig 6
Go back to initial tab
Add sine wave generator and set the frequency to 50Hz (not 50hZ is 314.16 rad/s) and connect the
sine wave generator to the PWM tab and hit run (play sign at the top of the screen). If you want a
more intuitive feel of what’s happening, try changing the frequency of the sine to a much higher one
(eg 5000Hz) and zoom in (be sure to change it back to 50Hz). Below is an image of a higher
frequency sine wave compared to the triangle wave.
Fig: 7
We will now add 2 Mosfets from Simscape/SimPowerSystems/Specialized Technology/Power
Electronics
Double click on the Fet and change Ron to 20e-3 and uncheck “Show measurement port”
Fig: 8
Add 3 RLC branch blocks from Simscape/SimPowerSystems/Specialized Technology/Elements
Double click on one branch, change “branch type” to “R” and resistor value to “4”, and change the
name of the branch to “Load”
Change the next RLC block to RL, with a series resistance of 0.077 Ohms and Inductance to 560uH.
The last leg should be RC with R = 0.022 Ohms and a capacitance of 47uF.
Fig: 9
In the same library, find Ground and add it to the simulation. From
Simscape/SimPowerSystems/Specialized Technology/Measurement add a voltage and current
sensor. And from the Simscape/SimPowerSystems/Specialized Technology/Electrical Sources library,
add the DC voltage source and set it to 40V and connect as follows
Fig: 10
Add another subsystem, name it “Inv”, connected as shown below. Constant blocks can be found in
the “Commonly Used Blocks”.
Fig: 11
Now connect the high side Fet to the output of the PWM and the low side Fet to the output of the
Inv block.
Libraries from Simscape often need solvers, for the case of SimPowerSystems we need to add a
“powergui” found in Simscape/SimPowerSystems/Specialized Technology
Now add a scope, following the same procedure as we did above (2 inputs, uncheck limit data), your
model should look like this –
Fig: 12
Now if we replace the sine wave input with a DC voltage ref we have a buck converter. However, we
will now make this model a full bridge.
Fig 13 shows the full bridge layout, you have all the components to implement this except the
product block which can be found in the “commonly used blocks” library.
Once connected, run the simulation and ensure the response is similar to fig 13
Fig 13
You can also analyse the response of a system by right clicking on the line coming out of the PWM
block, on the drop down menu, going to “linear analysis” and selecting “Input Perturbation”. Repeat
this on the output of the Voltage sensor but instead of selecting “Input Perturbation”, select “Output
Measurement”. Then click “Analysis” from the top menu, “control design” and “Linear analysis”. In
the “Linear Analysis tool” window, Change the “Plot Result” to bode and hit “Linearize”.
Fig: 14
Now print the output scope, the schematic of the full bridge and the bode plot and hand them in.
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement