workshop matlab/simulink in drives and power...
TRANSCRIPT
![Page 1: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/1.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 191
WorkshopMatlab/Simulink in Drives
and Power electronics
Lecture 2 : Introduction to Simulink
Ghislain REMY Jean DEPREZ
![Page 2: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/2.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 192
Workshop Program• 8 lectures will be presented based on Matlab/Simulink :
– 1 Introduction to Matlab
– 2 Introduction to Simulink
– 3 DC-Motor Control design
– 4 DC-Motor Chopper design SimPowerSystems
– 5 Introduction to Stateflow/Statechart
– 6 Induction Motor Inverter Control
– 7 Synchronous Motor Modeling
– 8 Synchronous Motor Control
• Two system applications (four quadrants electric drives of mechanical systems) will be used as "conducting lines" during the workshop.
![Page 3: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/3.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 193
? SIMULINK ?
SIMULINK is a complement of the MATLAB kernel, which gives a graphic interface to model dynamical systems using a block schematic representation. Using the numerous basic blocks available, it is possible to create simulation models without writing any lines of programming code.
Specialized libraries – Blocksets – are available for specific purposes (Ex : SimPowerSystems, FuzzyLogic, DSP-Target …)
The open architecture allows to extend the simulation environment by:- Creating customized blocs and libraries from MATLAB, Fortran, C or graphic representation,- C codes generation from Simulink simulation models
Several tools are available for the signal analysis
![Page 4: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/4.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Getting started with SIMULINK• Objective: Simulate a DC Permanent Magnet Motor
driving a mechanic load
4
La
Ra
E
ULoad inertia JLResistant Torque TL
Speed Ω
Electrical Torque TeFriction Torque TFMotor Inertia JMTorque Constant Ke
Ia
![Page 5: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/5.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 195
Ke = 0.49 Nm/Atf = 0.18 N.mkf = 4.610-4N.m.sRa = 0.49 ΩLa = 4.3 mHJM = 0.0035 kg.m2
DC-SEVOMOTOR RX620J
![Page 6: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/6.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Equations:
6
U = E + Ra.Ia + La.dIa/dtE = Ke. ΩTe = Ke.IaJ = JM + JLTF = sign(Ω).tf + kf.ΩTe = TF + TL + J.dΩ/dt
TeUΩ1
s
TL
+ --+
TF= Tf +kf*Ω
-1
Ra+La.sKe
Ke
Ia
E
J
x:
Simulation model:
![Page 7: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/7.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Starting SIMULINK
7
1-Click "Simulink " to open the Simulink Library Browser
2- Click "Create a new model"
3- An empty new model pop-up (.mdl file)
![Page 8: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/8.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Building the model
8
1- Select a Library
2- Select a component
3- Drag and Drop the icon into the model
4- Double Click on the icon to open the Function Block Parameters window and modify it
![Page 9: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/9.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Add a value for each Parameters
9
![Page 10: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/10.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Defining input signals values
10
The Most use Input Signal types are :
•Constant•Step
•From Workspace
•Signal Builder•Sin Wave
![Page 11: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/11.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Displaying output signals
11
The Most use Output Signal types are :•Scope
•To Workspace
•Terminator
•XY Graph
![Page 12: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/12.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Initializing the parameters of the motor
12
1- Create a M-filenamed DC_PM_motor_init.m
2- Run this M-file
The values of Ra, La, Ke, tf and kf are then stored in the workspace.
![Page 13: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/13.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Setting the Simulation Parameters
13
1- Click “Simulation”, then “Configuration Parameters”
2- Modify the value of the Stop time
3- Use a Type of Solver :•Fixed-step•Variable-step
4- Select a Solver :The Most used are :- Ode1 (Euler)
for Real-Time in Fixed-step- Ode23s (stiff/Rosenbrock)
for stiff in Variable-step
5- Select a step size
![Page 14: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/14.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Starting simulation
14
End of simulation
![Page 15: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/15.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Displaying results of Simulation: Scope
15
Autoscale
Parameters
! By default, the number of points recorded is limited to the 5000 last points !!!
(see parameters)
Zoom
![Page 16: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/16.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Saving data to workspace
16
The "To Wokspace" function blockallows the same saving of data, without screen displayUse Array Format for easier use
Solution 2:
Solution 1: The Scope Parameters
time
w
![Page 17: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/17.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Creating a Subsystem (1/3)
17
1- Select the componentswhich will be inside the Subsystem.
2- Select "Create Subsystem"
![Page 18: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/18.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Creating a Subsystem (2/3)
18
3- Model is modifyautomaticaly
4- Inside the SubsystemConnections are added:
- Input Port - Output Port
Subsytem Port names are the Port names
![Page 19: Workshop Matlab/Simulink in Drives and Power electronicslgep.geeps.centralesupelec.fr/uploads/images/lgep/... · Palestine Polytechnic University 18-21 May 2009 Workshop Matlab/Simulink](https://reader030.vdocument.in/reader030/viewer/2022040820/5e68020079a68325fa564579/html5/thumbnails/19.jpg)
Palestine Polytechnic University
Workshop Matlab/Simulink in Drives and Power electronics – Lecture 218-21 May 2009 / 19
Creating a Subsystem (3/3)
19
5- Rearrange the iconsRename the subsystemRearrange and rename inputs and outputs
This subsystem canbe insert in a library(see practice 3)