DOC PREVIEW
CU-Boulder ECEN 5807 - Introduction to MATLAB

This preview shows page 1-2-14-15-30-31 out of 31 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 31 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CoPEC1ECEN5807ECEN5807 supplementary notesIntroduction to MATLAB/Simulink for switched-mode power convertersECEN5807Colorado Power Electronics CenterUniversity of Colorado, BoulderCoPEC2ECEN58071.1 Getting started with MATLAB/Simulink• Starting and running simulations in MATLAB/Simulink• Constructing Simulink models•Examples:• Open-loop synchronous buck converter modelSimulink file: buck_open_loop.mdl• Buck converter and PWM subsystem models• Closed-loop synchronous buck converter model with an analog controllerSimulink file: buck_closed_loop.mdl• Load transient model and simulationsSimulink file: buck_closed_loop_load.mdl1.2 Digitally controlled buck converter: Simulink models and simulations• System model• A/D converter, discrete-time compensator, and DPWM modelsSimulink file: buck_closed_loop_discrete.mdlECEN5807 supplementary notesCoPEC3ECEN58071.1 Starting MATLAB/Simulink•Start MATLAB: (double-click on the MATLAB shortcut)• Open a file, in the MATLAB window menu: – Select file: buck_open_loop.mdl, then Open• This opens a pre-configured Simulink model for an open-loop synchronous buck switching converter• Converter parameters:• L = 4.1 µH, RL= 80 mΩ• C = 376 µF, Resr= 5 mΩ• fs= 100 KHz• Vg= 12 V, D = 0.42• Load R = 1 ΩCoPEC4ECEN5807Transient Simulations in Simulink• Make your copy of the Simulink model for further editsIn the current Simulink window:– File Æ Save As Æ File Name: enter my_buck_open_loop.mdl,thenSave• Check or adjust simulation parameters: – Simulation Æ Simulation parameters• This opens a window to adjust simulation parameters such as Start Time, Stop Time, solver options, step size, etc.• The default parameters and options are usually fine, except:– Enter appropriate Stop time(3 ms in this example)–Enter Max step size of about 1/100 of the switching period (0.1 µs in this example)CoPEC5ECEN5807Starting Transient Simulation• In the current Simulink window:– Simulation Æ Start orclick on the Start button in the toolbar Current simulation time and progress are shown hereCoPEC6ECEN5807View Simulation Results•In the my_buck_open_loop Simulink window, double-click the Scope block• Use rectangular box, X-axis, or Y-axis Zoom tools to view waveforms detailsAutoscale fits the entire waveforminto the windowCurrent axes settings can be Saved or RestoredTo enter a specific vertical axis range, right-click on the waveform, select Axes properties… then enter Y-min and Y-max, click OKVoiLVoiLCoPEC7ECEN5807Construction of Simulink Models+–VgQ1LRLQ2CRCRSwitch networkLoad modeled as a resistor R, iout= Vo/RPulse-width modulatorsubsystemConstant duty-cycle commandConstant input voltage Top-level system modelBuck converter subsystemSimulink models are block-diagrams consisting of• “Sources” (such as Constant Vg block)• “Sinks” (such as Scope) and• Various functional blocks, including subsystemsCoPEC8ECEN5807• System equations:• Double-click on the buck converter subsystem block to view a Simulink implementation of the system equationsBuck Converter Subsystem()oLLgLvRidVLdtdi−−⋅=1()outLCiiCdtdv−=1)(outLesrCoiiRvv−+=+–VgQ1LRLQ2CRCRSwitch networkBuck converter subsystemiout• Inputs:– Input voltage Vg– Switching signal d = {0,1}– Load current iout• Outputs:– Output voltage Vo– Inductor current iLCoPEC9ECEN5807InIntegratorIntegratorGainGainGainGainProductInInOutOut)(outLesrCoiiRvv−+=()outLCiiCdtdv−=1()oLLgLvRidVLdtdi−−⋅=1SumSumSumBuck Converter SubsystemOn this slide, the subsystem model is annotated with the system equations and Simulink block names, such as Product, Gain, Integrator, etc., shown in redCoPEC10ECEN5807PWM Subsystem• In the my_buck_open_loop window, double-click on the PWM block to open the subsystem window• Double-click on the Saw-tooth waveform block to view or change the block parameters• Note that Time values [0 0.001e-5 1e-5] and the corresponding Output values [1 0 1] define the saw-tooth waveform in the PWM (switching frequency is: 1/1e-5 = 100 KHz)vtdcRelay BlockCoPEC11ECEN5807Constructing a Closed-Loop Model• In this step, the objective is to construct and simulate a closed-loop voltage regulator using a simple continuous-time integral compensator• Save my_buck_open_loop.mdl as my_buck_closed_loop.mdl•In the my_buck_closed_loop window, click on the Library Browser button to open the Simulink Library Browser windowSimulink Library BrowserCoPEC12ECEN5807Constructing the Closed-Loop Model, continued– In the Simulink Library Browser window, select Simulink Æ Continuous Æ Integrator– Drag an Integrator block to the my_buck_closed_loop window, click the left mouse button to place the integrator– Similarly, add the following Simulink blocks to my_buck_closed_loop:•Two Gain blocks (Simulink Æ Math Æ Gain)•A Sum block (Simulink Æ Math Æ Sum)•A Constant block (Simulink Æ Sources Æ Constant)– Delete the Duty Cycle D (Constant): select the Duty Cycle D block and press Deletekeymy_buck_closed_loop after the edits listed on this pageCoPEC13ECEN5807– Change the orientation of the blocks for easier wiring:• Select the Gain block, click the right mouse button, select Format Æ Rotate block• Similarly, using Rotate block or Flip block, change the orientation of the Integrator, Sum, Gain1 and Constant blocks– Double-click on the Sum block to change the input for the sensed output voltage to minus (–); reorder the symbols +, –, and | as desired– Wire the blocks to construct the closed-loop model– Set the model parameters (double click the block and edit the default values):• Gain = 0.4 (gain H of the voltage divider sensing the output voltage)• Gain1 = 1000 (gain of the integral compensator); you may need to resize the block to show the parameter value: select then drag a corner to resize the block • Constant = 2 (constant Vref= 2, so that in steady-state Vo= Vref/H = 5 V)– Run a simulation to verify that the output voltage comes to Vref/H = 5 V in steady statemy_buck_closed_loop after the edits listed on this pageConstructing the Closed-Loop Model, completedCoPEC14ECEN5807Closed-Loop Simulation Results The output voltage Voand the inductor current iLduring a start-up transient in the closed-loop buck converter with the continuous-time integral compensatorDetails of the steady-state output voltage Voand the inductor current iLin the closed-loop buck converter with the


View Full Document
Download Introduction to MATLAB
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to MATLAB and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to MATLAB 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?