Home

Machine Model Parameter Determination User Manual

image

Contents

1. bddx bx gu L pypel a Pi gt piper l wbpdd dais lt pid lt opdl l lt 4 pia L0 SV cO Sins Appendix D Sample Simulink Block Diagram Page 68 of 73 May07 18 oe oe o o o o AP oe AP o oe o oe oe oe oe oe 0 S oe oe User Manual 4 24 2007 May07 18 Appendix E Sample Simulation Script 21507 et default times fault on fault off and V ref step ton 9999 toff 9999 VrefTime 9999 VrefStep 0 00 desired event Event flags Set to one to simulat apply fault 0 trip gsu 1 Event times if apply fault ton 1 0 toff 1 1 end if trip deu ton 1 0 toff 9999 end switch test switch case 1 apply fault 0 trip gsu 0 apply vref step 1 pgen Pgen Vstep qgen Qgen Vstep vm VI Vstep va Thetal_Vstep pi 180 VrefStep 01 Vup_Vstep VrefTime Tup_Vstep case 2 apply_fault 0 trip_gsu 1 apply_vref_step 0 pgen Pgen Ld Reject qgen Qgen Ld Reject vm V1 Ld Reject va Thetal Ld Reject pi 180 ton Treject Ld Reject toff 9999 case 3 apply fault 1 trip_gsu 0 apply_vref_step 0 pgen Pgen_Flt ggen Qgen Flt vm VI Flt va Thetal Flt pi 180 ton T flt on off T flt off May07 18 Appendix E Sa
2. The next step is to run a simulation to check the results A graph appears in Figure 4 9 These appear to be logical the next step is to create a GUI setting file The Simulink model and simulation script should be copied into the directory containing the main graphical user interface and library files May07 18 Program Maintenance Page 49 of 73 Speed May07 18 User Manual 4 24 2007 Terminal Voltage a N 0 8 0 5 10 15 20 25 30 100 2 50 4 c lt op 50 0 5 10 15 20 25 30 377 02 377 01 zx 377 L a 376 99 A 376 98 L 1 376 97 L L 0 5 10 15 20 25 1 5 1 m c D O a 0 5 A 0 I l 0 5 10 15 20 25 Time s Figure 4 9 Simulation Results 4 1 5 4 Creation of GUI Setting File The GUI setting file is a Matlab script that sets up the data structures needed by the GUI to properly initialize The fields needed are described in Table 3 2 If the model to be added utilizes either the Genrou or Gensal models the setting file for these models can be copied and modified as needed This can save a great deal of time In this case the model to be added is not similar to an existing setting file a new one will be created from scratch The first step is to create a new m file This should be saved in the same folder as the main graphical user interface and library files as classical machine set
3. Se Se GR SA GR Ge ee Ge ee ee ee ee ee ee ee ee 32 44 3 Creating GUI Setting File zu stats dtd eke ee Re ERGE se 8n 33 4 14 Editing Main Window Setting File eese eese nete 33 4 1 5 Example Creation and Addition of Classical Machine vs Infinite Bus 34 4 1 5 1 Pr paration sos UR KGS ERREUR 34 4 1 5 2 Creation of Simulink Model e t ea e t Petite lat 36 4 1 5 3 Creation of Simulia 43 4 1 5 4 Creation of GUI S tting File neugierig 50 4 1 5 5 Modification of Main Window Setting File eese 56 4 1 5 6 Final Simulation Script Modifications essere 57 4 2 TESTING LIBRARY ADDITIONS u eee onon bib tot nb emi e ORC Tarn 60 4 3 TROUBLESHOOTING LIBRARY ADDITIONS sese enne en nnn rennen inneren teens 60 4 3 1 Errors in Main Window Setting File s 61 43 2 Errors in GUI Setting T ita e eter reete df 61 4 3 5 Errors in Simulation Script eee eee eee 62 4 3 4 Errors in Simulink Block Diagram i e esse esse se se se Se Se SR SA GRA Se Ge Ge ee ee ee ee ee ee 62 APPENDIX A DETAILED FLOW CHARIT 63 APPENDIX B SAMPLE TEST DATA 64 APPENDIX C SAMPLE GUI SETTING EILE 65 APPENDIX D
4. Prepare admittance matrix for load rejected network Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu srej srej srej srej srej srej srej srej srej srej srej srej srej srej srej srej srej ect zeros 4 4 ect 1 1 1 Zgen ect 1 2 0 ect 1 3 1 Zgen ect 1 4 0 ect 2 1 Ybus 1 2 ect 2 2 1 zline ect 2 3 0 ect 2 4 1 zline ect 3 1 Ybus 1 3 ect 3 2 Ybus 2 3 ect 3 3 1 Zgen 1 99999999 ect 3 4 1 99999999 ect 4 1 Ybus 1 4 ect 4 2 Ybus 2 4 ect 4 3 Ybus 3 4 ect 4 4 1 ztran 1 99999999 Use Kron reduction to reduce admittance matrix Yprereduced Ybus 1 2 1 2 Ybus 1 2 3 4 inv Ybus 3 4 3 4 Ybus 3 4 1 2 May07 18 Program Maintenance Page 59 of 73 May07 18 User Manual 4 24 2007 Yreject Ybusreject 1 2 1 2 Ybusreject 1 2 3 4 inv Ybusreject 3 4 3 4 Ybusreject 3 4 1 2 Yfault Ybusfault 1 2 1 2 Ybusfault 1 2 3 4 inv Ybusfault 3 4 3 4 Ybusfault 3 4 1 2 switch test_switch Case 1 Ydisturbance Yfault case 2 Ydisturbance Yreject end sim classical_machine oe subplot 4 1 1 plot Time V1 ylabel Terminal Voltage oe oe oe oe subplot 4 1 2 lot Time rad2deg delta abel Rotor Angle oe p y oe oe oe subplot 4 1 3 lot Time speed abel Speed oe oe ki
5. setting file name genrou setting file genrou exst4b setting file genrou rexs setting file gensal setting file gensal exstl setting file gensal exstl hygov setting file classical machine setting file aes The modifications made were to add a string Classical Model to the model name field an extra set of quotation marks to the model folder field and classical machine setting file to the the setting file name field The model name field stores the name of the model as it appears in the list on the opening window The model folder field is not used by current versions simply place in this field The setting file name field should be the name of the setting file for that model with out the extension 4 1 5 6 Final Simulation Script Modifications The final step to adding the model to the library to is to comment out the lines of code in the beginning of the simulation script that set the default values for each parameter and that graph the data The final simulation script appears below oe ae C EY de ll Pwo oe oe H w lI O L C1 oe xpd 0 2 pgen_fault 100 oe May07 18 Program Maintenance Page 57 of 73 May07 18 User Manual 4 24 2007 oe qgen fault 30 vl fault 1 t fault on 1 t fault off 1 1 zfault 0 pgen_reject 100 ggen_reject 30 vl reject i t reject 2 mva base 100 fbase 60 rl 0
6. Color Code for Edit Box Supplemental Color edit boxes to help user to visually group different types of parameters belonging to different subsystems 3 2 3 1 2 Callback Functions Callback functions are used to specify what actions should occur after a certain action is performed 3 2 3 1 2 1 Slider Bar and Edit Box Callback Functions The slider bars share a common callback function The edit boxes do as well This is possible because each slider bar and edit box has its own handle a double identification number that is unique to each object The remaining buttons have their own callback functions The edit box callback function collects the new value from the edit box and changes the position of the slider bar The slider bar s range is adjusted if May07 18 Program Structure Page 25 of 73 May07 18 User Manual 4 24 2007 necessary The slider bar call back function contains code that updates the value in the edit box and adjusts the position of the slider bar 3 2 3 1 2 2 Test Selection Menu Callback Function The test selection drop down menu call back function first deletes both the current and old simulation data so that the gray trace associated with the previous simulation will not appear when the simulation button is next pressed Each parameter is then checked to see if its status should be changed from active to inactive or vice versa 3 2 3 1 2 3 Simulate Button Callback Function The simulate button callback f
7. Ok ewa end time 10 display name UI ct pu Efd fou speed Bu laditd pu si Fwans test_data x simulation data x old simulation data x test time 0 tests setting struct test_name Voltage Step Load Rejection Three Phase Fault Fab simulin file name SMIBgensal vl simulation file Gensal Model simulation script SMIBgensal sim May07 18 Appendix C Sample GUI Setting File Page 67 of 73 A 24 2007 User Manual May07 18 dh S ao x 9 m x E E o L o e 2 c lt ame A A Wien D aT niii uo 4 3 uo eje z MOE zz 4 ez uuu la 900 green erezai ueBd EELAM EME LA T bdd bada pdd pddg paads paads peed gt p9 Bue pas S Sa oui eds Oe L L bn lt bid ik i Wa LIpddal gt IX pdx Zvl IX PdX pddx pdx EM Ix pdx IX pddx H 2 i Ge W yoowd lt peads e Er lt m lt iaa
8. 3 2 3 1 2 6 Save Button Callback Function May07 18 Program Structure Page 28 of 73 May07 18 User Manual 4 24 2007 Save As KIE Save in C3 qui 0308 2007 e e My Documents wr My Computer Figure 3 10 Save As Window The save button callback function starts by opening the standard Windows Save As dialog box This is shown in Figure 3 10 The user has the option of saving three different files The first is to save the output plots as jpeg jpg files If this option is chosen the program will save each graph individually with the workspace name of the output variable concatenated to the end of the filename If the user elects to save the parameter data save case as a mat file the parameter_setting array is saved If the user wishes to save the simulation data the simulation data is saved to an Excel spreadsheet in the format in Section 3 1 4 3 2 3 1 2 7 Undo Redo Button Callback Functions If the Undo toolbar button is pressed the program changes the last modified parameter to its previous value and enables the redo button If the redo button is pressed the last undone parameter is changed to its pre undo value It should be noted that the undo functionality is only available after the simulate button has been pressed and can only undo changes up to the previous simulation 3 2 3 1 2 8 Zoom In Zoom Out and Pan Button Callback Functions The zoom in zoom out and pan callback functions are all ver
9. May07 18 Program Maintenance Page 44 of 73 May07 18 User Manual 4 24 2007 E abs VltI Zgen deltao angle Vl I Zgen Vin f V1 ztran zline I Tm P1 Lines are needed to build the network admittance matrices These appear below The switch statement determines which admittance matrix to use during the disturbance There are many ways to build this particular part of the script The method used here will be to build full admittance matrices for each condition and then reduce the matrices SBu SBu SBu BU SBu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Pr Ybu Ybu SPr Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu using the Kron reduction technique ild prefault network admittance matrices S 1 Generator ideal source s 2 Infinite bus s 3 Generator Terminals S 4 High side of the GSU s zeros 4 4 s 1 1 1 Zgen 1 Zgen 0 Ybus 1 2 1 zline lI Es x N m D O Ybus 1 3 Ybus 2 3 1 Zgen 1 ztran 1 ztran Ybus 2 4 Ybus 3 4 1 ztran 1 zline epare Admittance matrix for faulted network sfault Ybus sfault 4 4 Ybus 4 4 1 zfault 0000001 epare admittance matrix for load rejected network sreject zeros 4 4 sreject 1 1 1 Zgen sreject 1 2 0 sreject 1 3 1 Zgen sreject 1 4 0 Ybus 1 2 1 zline 0 1 zline sreject 2 1 sreject
10. Simulation time Select a Start time fo Stop time Tstop Data Import Export t Optimization b 2 Solver options EF Diagnostics i Sample Time Type Fixed step y Solver ode3 Bogacki Shampine y ie Data Validity pe Type Conversion Periodic sample time constraint Unconstrained y Fe Connectivity Fixed step size fundamental sample time 5 tep_size P Compatibility 3 Tasking mode for periodic sample times Auto y i Model Referencing Hardware Implementation Higher priority value indicates higher task priority Model Referencing Automatically handle data transfers between tasks coca e w Figure 4 8 Configuration Parameters 4 1 5 3 Creation of Simulation Script The next step is to create a simulation script that will calculate initial conditions and execute the Simulink model Standard practice has been to create a simulation script that can be executed without the graphical user interface This allows the model to be tested apart from the GUI making the source of any errors more apparent After testing the script is edited to make it compatible with the GUI The first step in simulation script creation is to create a new Matlab m file Standard practice is to give it the name of the model with sim added to the end If the model is named classical machine the simulation script would be named classical machine sim The first few lines of
11. 2 2 sreject 2 3 sreject 2 4 sreject 3 1 Ybus 1 3 May07 18 Program Maintenance Page 45 of 73 May07 18 User Manual 4 24 2007 Ybu Ybu Ybu Ybu Ybu Ybu Ybu SUse Kron reduction to reduce admittance matrix sre sre srej srej srej srej srej ect 3 2 Ybus 2 3 ect 3 3 1 Zgen 1 99999999 ect 3 4 1 99999999 ect 4 1 Ybus 1 4 ect 4 2 Ybus 2 4 ect 4 3 Ybus 3 4 ect 4 4 1 ztran 1 99999999 Yprereduced Ybus 1 2 1 2 Ybus 1 2 3 4 inv Ybus 3 4 3 4 Ybus 3 4 1 2 Yreject Ybusreject 1 2 1 2 Ybusreject 1 2 3 4 inv Ybusreject 3 4 3 4 Ybusreject 3 4 1 2 Yfault Ybusfault 1 2 1 2 Ybusfault 1 2 3 4 inv Ybusfault 3 4 3 4 Ybusfault 3 4 1 2 switch test_switch case 1 end Ydisturbance Yfault case 2 Ydisturbance Yreject Next a line is needed to run the simulation sim classical machine For testing purposes plot commands will be added to the end of the code These appear below subplot 4 1 1 plot Time V1 ylabe subplot 4 1 2 plot Ti Terminal Voltage me delta ylabe Rotor Angle subplot 4 1 3 plot 1 ylabe abel Time w Speed ubplot 4 1 4 Time pgen S p x y lot abel Time s Pgen The completed simulation script appears below Default parameter values
12. id ppg ed ra id lppq iq angle0 va dint cd cos angle0 sd sin angle0 pmech ppd iq ppq id pelec pmech vs r ppd cd ppg sd vs_i ppd sd ppq cd vs vs_r j vs_i isorc vs zg ptd ppd lpd Ippa id pkd pfd lpd ll id pfg ppa pkq 0 sa si sb s12 May07 18 Appendix E Sample Simulation Script Page 71 of 73 May07 18 User Manual 4 24 2007 psi pfd if sa 0 sb 0 se 0 0 else a sqrt sb sa b 1 2 a 1 a a sb 1 2 b 1 2 b c a psi b psi B y D if psi gt bD se c else se 0 0 end end ladifd pfd ld lpd id pfd se efd ladifd 9 System data on gen base ztran ztran mbase sysmva zline zline mbase sysmva Ntwk Y zeros 3 Y 1 1 1 zg 1 ztran Y 1 2 1 ztran Y 2 1 Y 1 2 Y 2 2 1 ztran 1 zline Y 2 3 1 zline Y 3 2 Y 2 3 Y 3 3 1 zline 21 inv Y 1 2 1 2 D N I N m if apply_fault Y 2 2 1 Zfault 0000001 z2 inv Y 1 2 1 2 end if trip_gsu ztran 0 0 j 99999 Y 1 1 1 zg 1 ztran Y 1 2 1 ztran Y 2 1 Y 1 2 Y 2 2 1 ztran 1 zline 22 inv Y 1 2 1 2 end IY13v3 Y 1 3 v3 LY23v3 Y 2 3 v3 9 5 Perform simulation sim SMIBgensal v1 May07 18 Appendix E Sample Simulation Script Page 7
13. may be changed in The code for this appears below current value Tes 3 4 570 94 EER 100 30 Dey a ax 100 30 Ly 1 1 1 0 ky pep ez 000560 2 30 005 1 see The next field display name is the name of each parameter as it will appear on the GUI These do not need to be the same as the workspace name or the variables in the Simulink model or Simulation script but a knowledgeable user should be able to understand what it is without trouble Be sure that the name is not more than 7 or 8 characters long as this can make the parameter titles appear to run together The code for the display names appears below display name apg TEST SAN jaa ip fault G fault Vi fault rr P et TO Fat Wi EISE inn ME fit on tt flt BEET DEaulE t reject ssa tk TXE BE NIU S base Ebsse zsas Tstop Step size Fress The description field is not currently used but is still included as an empty field des rigtien ss The color field determines the color of the edit box This feature is intended to help the user visually group certain parameters and find the parameter that he wishes to adjust more guickly This field can be any of the standard Matlab colors such as yellow or white or can be a 1 row 3 column matrix that sets the colors that the colors manually The colors should be fairly light and transparent to allow the text in the edit box to be readable If the parameters are laid
14. 2 x1 0 2 rt 0 1 xt 0 5 Tstop 30 Step_size 0 005 ae ae o oO o o oe oO oe oe ae o A oo oe ae ae Flag to set which test will be executed 1 Three Phase Fault 2 Load Rejection test switch 2 switch test switch case 1 Pl pgen fault Ql qgen fault Vil vi fault Ton t fault on Toff t fault off case 2 Pl pgen reject Ql qgen reject Vl vl_reject Ton t_reject Toff 100000 end ztran rt lj xt Zzline r1 13 x1 Zgen ra lj xpd wo 2 pi fbase P1 P1 mva_base Q1 Q1 mva base S PLI JSOL I conj S V1 E abs V1 I Zgen deltao angle V1 1 Zgen Vinf V1 ztran zline I Tm P1 Build prefault network admittance matrices SBus 1 Generator ideal source Bus 2 Infinite bus May07 18 Program Maintenance Page 58 of 73 May07 18 User Manual 4 24 2007 Bus 3 Generator Terminals gBus 4 High side of the GSU Ybus zeros 4 4 Ybus 1 1 1 Zgen Ybus 1 2 0 Ybus 1 3 1 Zgen Ybus 1 4 0 Ybus 2 1 Ybus 1 2 Ybus 2 2 1 zline Ybus 2 3 0 Ybus 2 4 1 zline Ybus 3 1 Ybus 1 3 Ybus 3 2 Ybus 2 3 Ybus 3 3 1 Zgen 1 ztran Ybus 3 4 1 ztran Ybus 4 1 Ybus 1 4 Ybus 4 2 Ybus 2 4 Ybus 4 3 Ybus 3 4 Ybus 4 4 1 ztran 1 zline Prepare Admittance matrix for faul Ybu Ybu sfau sfau lt Ybus 1t 4 4 Ybus 4 lted network 4 1 zfault 0000001
15. 6 KB Apr 17 20 Em gensal exsti hygov setting file m M file 8 KB Apr 17 20 Em gensal exsti setting file m M file 7 KB Apr 17 20 Em gensal setting file m M file B KB Apr 17 20 Em GUI m M file 51 KB Apr 19 20 Eg iconRead m M file 3 KB Apr 17 20 Eb M file 15 KB Apr 17 20 Em main windo Open M file 1 KB Apr 17 20 3 SMIB mdl Run Model 90 KB Apr 17 20 SMlBgenrou View Help M file 12 KB Apr 17 20 fi SMIBgenrou Open as Text Model 165 KB Apr 17 20 SMIBgenrou open Outside MATLAB M file 15 KB Apr 17 20 fB SMIB genrou Import Data Model 250 KB Apr 17 20 Em SMIBgensal Mfile 12 KB Apr ad I Mew b N S Rename Current Directory Delete Command Histo Compare Selected Files a x abs an Compare Against A E s 4 16 Source Control P vele Cut Ctri X RS 4 16 copy Ctrl C i simuli paste Ctrl V chelo 5 Fie Fiter gt rer Add to Path jen Y 17 2 EE Refresh Ybus 1 2 3 4 Figure 2 2 Running main window m The opening window will appear A list of all of the models currently in the library will be in the center select a model and press Open This is shown in Figure 2 3 May07 18 Basic Use Page 3 of 73 May07 18 User Manual 4 24 2007 main window gui Genrou Figure 2 3 Opening Window After selecting a model and pressing the Open button the home screen will appear This is shown in Figure 2 4 May07 18 Basic Use Page 4 of 73 May07 18 U
16. Page 18 of 73 May07 18 User Manual 4 24 2007 model_setting parameter_setting Table 3 2 Data Structures and their Fields Stores the data needed by model name the opening window the name of each model in the library and the setting file associated with that model There is one structure for the entire library and one entry setting file name for each model Found in main window setting file Stores the data that is workspace_name needed for the parameters panel on the home window This information is also used by the batch simulation window There is one min_value structure for each model and one entry for each max_value Found in GUI default_value previous_value current value display name String value of the mode s name as it should be displayed on the home window String value of the setting file associated with that particular model String containing the name of the parameter as it will appear in the workspace and will be used in the simulation script and Simulink model parameter value parameter value parameter value Double containing the previous parameter value Used for undo redo functionality parameters current value String containing the name of the parameter as it will appear on the parameters panel A three double array that determines the color of the edit box An integer that determines for which tests the parameter is active If this is set to 0 the p
17. Ready lm ia eal Figure 4 4 Imbedded Matlab Function This should be connected to the rest of the block diagram as shown in Figure 4 5 From blocks should be used for Ecomplex and w For the constants use a constant block and change the value to the variable name as it will appear in the Matlab workspace The clock block should be used to import the time into the embedded Matlab function A to block should be used to connect the electrical torque with the rest of the network May07 18 Program Maintenance Page 39 of 73 May07 18 User Manual 4 24 2007 7 classical machine E E 2 5 xi File Edit View Simulation Format Tools Help DSHS BA lt gt q 202 y feo DsSASS KAEES Embedded MATLAB Function lode3 Figure 4 5 Classical Model With Embedded Matlab Function Use to workspace blocks to export simulation results to the Matlab workspace The variable name property should be set to the name as it should appear in the Matlab workspace and the save format property should be set to Array The defaults can be used for all other properties This is shown in Figure 4 6 May07 18 Program Maintenance Page 40 of 73 May07 18 User Manual 4 24 2007 Sink Block Parameters To Workspace4 x E Workspace L Write input to specified array or structure in MAT LAB s main workspace Data is not available until the simulation is stopped or paused Parameters L Wariable nam
18. SAMPLE SIMULINK BLOCK DIAGRAMA 68 APPENDIX E SAMPLE SIMULATION SCRIPT A 69 May07 18 Introduction Page 2 of 5 May07 18 User Manual 4 24 2007 List of Figures FIGURE 2 1 CHANGING MATLAB DIRECTORY ee esse ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 2 FIGURE 2 2 RUNNING MAIN WINDOW M eee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ere ete ee ee ee ee ee ee ee ee ee ee ee 3 FIGURE 2 3 OPENING WINDOW ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 4 FIGURE 2 4 HOMESCREEN uu aaa A tea tt res ra ERR E EIE de HERR feed 5 FIGURE 2 5 SLIDER NR OR EE GE dia 5 FIGURE 2 6 TEST PULL DOWN MENU sav ret asun ii 6 FIGURE 2 7 SIMULATE AND BATCH SIMULATE BUTTONS 6 FIGURE 2 8 BATCH SIMULATION WINDOW ee ee ee a 7 FIGURE 2 9 LOADING TEST DATA ete lieet kalkil ave eet ee er ce te EIE e I r 8 FIGURE 2 10 SAVING PARAMETERS ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 9 FIGURE 2 11 OPENING SAVED PARAMETER SETTINGS see eee 10 FIGURE 2 12 SAVING GRAP
19. fault OFr eran kwa E reject eos SEY pt Tel li va base VEbaset yrs Tstop Step size bass The next step is to create the min value field This field contains the minimum values for each slider bar on the main GUI It is very important that the entries in this field be in the same order as the workspace name field The minimum values were previously determined and appear in Table 4 1 The code appears below min value Oy Ue slyss 500 Uy es SV DE acen Ose wre 0 001 Di 0 001 Ly 50545 0001 KA O O O O O KA SOS aaa Son The next field is the max value field This field contains the maximum value of each slider bar These values were previously determined and appear in Table 4 1 The code appears below max value d pcs 2 ok 500 500 1 08 pa an 500 500 205 155 10e WOZ Oes HOE dy de dj dy DOO 60 9 007 Olzara buu The next field contains the information needed to set the default values for each edit box default value ses May07 18 Program Maintenance Page 51 of 73 May07 18 User Manual 4 24 2007 Lis la 100 307 Trae 100 30 1 1 35 1 0 1 S eee 00 OO as 30 005 no The previous_value field contains information for the undo redo commands In the setting file it is set to 0 The code for this appears below previous value 0 In the setting file current value field is the same as the default value field These
20. for the three main GUI components Code generated using GUIDE contains a main function that executes the create function and processes the user inputs A callback function is provided for each object button drop down menu list box edit box slider bar etc The layout function creates the GUI from standard Matlab components A create function 1s also provided for each object The callback functions allow the programmer to create code that will execute each time that a button is pressed text is selected or information entered The callback functions allow for the programmer to create code that will execute when an object is created The create functions were not used for this project 3 1 1 Program Components The program can be broken down into three basic components the graphical user interface the Simulink models and the simulation scripts that connect them The Matlab workspace serves as a swap memory of sorts In virtually every location where one subprocess interfaces with another variables are stored in the Matlab workspace by one process and called by another This greatly simplifies the calling of functions as variables do not need to be explicitly passed The simplified flow of information between the basic program components is shown in Figure 3 1 May07 18 Program Structure Page 13 of 73 May07 18 User Manual 4 24 2007 Simulation Results Simulation Results Matlab Workspace Simulink Parameters
21. frequently result from this Assuming that the block diagram was working properly before being added to the library there are really only a few possible errors e Errorin GUI at 222 o Check to be sure that there is a to workspace block for every output and that the variable name field is spelled the same as it is in the output setting data structure e Simulation Error dialog box appears o This could be a numerical error related to the combination of parameters that resulted in a divide by 0 This occurs though rarely Try changing a one or more of the parameters and resimulate o This could indicate that one of the variable names is not correct Check all of the constant blocks and any other places where variables were used to be sure that the output setting workspace name fields and usage in the Simulink block diagram are identical e Simulation time and or step size are not adjustable via the GUI o Go to the Simulation menu and choose Configuration Parameters Check to be sure that the stop time is set to Tstop and that the step size is set to Step size May07 18 Program Maintenance Page 62 of 73 May07 18 User Manual 4 24 2007 Appendix A Detailed Flow Chart Opening Window initialize GU Promot user to select machine model from Main Window m mport test data Window R Load block diagram va Load parameters value to GUI User changes parameter
22. h 3 d 1 ra 0 05 xpd 0 2 May07 18 Program Maintenance Page 46 of 73 4 24 2007 May07 18 User Manual pgen_fault 100 agen_fault 30 vl fault 1 t fault on 1 t fault off 1 1 zfault 0 pgen_reject 100 ggen_reject 30 vl reject 1 t reject 2 mva base 100 fbase 60 rl 0 2 x1 0 2 rt 0 1 xt 0 5 Tstop 30 Step_size 0 005 Flag to set which test will be executed 1 Three Phase Fault 2 Load Rejection test switch 2 switch test switch case 1 Pl pgen fault Ql qgen fault Vi vi fault Ton t fault on Toff t fault off case 2 Pl pgen reject Ql qgen reject Vl vl_reject Ton t_reject Toff 100000 end ztran rt lj xt Zzline r1 13 x1 Zgen ra 13 xpd wo 2 pi fbase P1 P1 mva_base Q1 Q1 mva base P1 13 01 conj S V1 E abs V1 I Zgen deltao angle V1 1 Zgen Vinf Vi ztran zline I Tm P1 J HW Build prefault network admittance matrices gBus 1 Generator ideal source May07 18 Program Maintenance Page 47 of 73 May07 18 User Manual 4 24 2007 SBu SBu SBu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu SPr Ybu Ybu s 2 Infinite bus s 3 Generator Terminals S 4 High side of the GSU s zeros 4 4 s 1 1 1 Zgen 1 2 0 1 Zgen Ybus 1 2 1 zline Ybus 1 3 Ybus 2 3 1 Zgen 1 ztran 1 ztran Ybus 1 4 Ybus 2 4 Yb
23. out well and pleasing colors are chosen this can be a very useful feature The standard practice has been to use yellow for generator parameters white for initial conditions red for network parameters May07 18 Program Maintenance Page 52 of 73 May07 18 User Manual 4 24 2007 purple for simulation settings green for exciter parameters and blue for turbine governor parameters The code for this field appears below olexkt lis yellow yellow yellow yellow white white white white white white white white white BITS ma 1 4 4 1 4 4 1 4 4 1 4 4 1 4 4 1 4 4 kw al ad ly ba T T so Py aa The slider_panel field was once used to group the parameters into sub panels though this field is no longer used standard practice has been to continue including it The code for this appears below slider panel T 1 dd 13 Tr eas 2 2 2 2 2 2 DDD pi 2 ues 4 LU BO PO PO N 1 r 1 ree U 1 r The last field in the parameter setting structure is the editability field This field is made up of integers A O means that that particular parameter is editable regardless of the position of the test menu If the value is set to 1 it will be editable only when the test menu is set to position 1 if the value is set to 2 it will only be editable when the test menu is set to 3 etc The code for this appears below editability D 0s 05 Oy
24. program open Matlab and change the Matlab directory to the directory directory containing the program files This is shown in Figure 2 1 MATLAB 7 3 0 R2006b N File Edit Debug Desktop Window Help DG AE ba ETI u n Ts Shortcuts 2 How to Add 2 What s New Current Directory CMowaState gui 04 19 2007 a x Command Window RD All Files File Type size To get started select MATLAB Help or Demos from the Help menu Genrou Test Data Folder Apr 22 Gensal Test Data Folder Apr 22 is O sfprj Folder Apr 22 B batch simulation m M file 20 KB Apr 1 Figure 2 1 Changing Matlab Directory In the current directory portion of the Matlab window select main window m and right click Select Run This is shown in Figure 2 2 May07 18 Basic Use Page 2 of 73 May07 18 User Manual 4 24 2007 A MATLAB 7 3 0 R2006b File Edit View Debug Desktop Window Help D Boo w r EJ 9 Current Directory C Documents and Settings Jared Des Shortcuts a How to Add 7 What s New Current Directory C Documents and Settings Jared Desktop gui 04 19 2007 a x c w 9 Az fer e rest O Genrou Test Data Folder Apr 19 20 4 OD Gensal Test Data Folder Apr 19 20 Em batch simulation m M file 20 KB Apr 17 20 genrou exst4b setting file m M file 7 KB Apr 17 20 EB genrou rexs setting file m M file 8 KB Apr 17 20 Eg genrou setting file m M file
25. structure contains two fields for each entry one for the model s name model name and the other for the name of the GUI setting file that corresponds to the model May07 18 Program Structure Page 21 of 73 May07 18 User Manual 4 24 2007 3 2 3 Home Window ali sH npp Parameters Kand EER 1 77 T T T T T imulation Tpdo m Tppdo Tppgo sede Jc BE ka La Lppd 1785 Mw E cs ENS 5 10 15 20 25 30 a E sed CU JJ 1 at Ra r Rcomp Xcomp 2 a jump x Pgen Vstp Ggen Vstp V1 Vstp mu 4 100 32 09 kx 105 A Ia Pict SESSE Rt 0 5 10 15 20 25 30 jen too jen ET los RIETI Poen FI Qgen Ft V1_Fit Te a Tup Vstep SV Vstep T Rt Si a 8 T l ladifd pu T flt on T fit off Zfautt 1 H 11 0 TR x R EH 5 10 15 20 25 30 ly S A e E us i IX MWA mach MYA sys a ja ja fbase Tstop Step Size B s sfeer os Figure 3 5 Home Window The home window GUI m is shown in Figure 3 5 This is the main interface that collects parameters from the user and displays the graphs of various parameters versus time This window can in general be divided i
26. sub panel has one plot box that consumes approximately 85 percent of the horizontal space and 92 percent of the vertical space The sub panels are arranged in a stacked manner with the horizontal x axis being much longer than the vertical y axis in any case where more than one graph is displayed 3 2 3 1 Structure A great deal of effort has been placed in making the entire graphical user interface as flexible and easily expandable as possible The home screen has been created in such a way so as to in theory allow an infinite number parameters and plots however due to space restrictions the user should attempt to limit the number of parameters to 96 and the plots to 6 The base code for the graphical user interface was created using GUIDE by building a basic window with the toolbar parameters panel and graph panel and then modifying the code to allow an infinite number of number of parameters and graphs Upon execution the parameter_setting model_setting and tests_setting data structures are collected from the Matlab workspace and are saved as global variables These are used throughout the program After the main window appears the interface waits for user commands After the simulate button is pressed each parameter is placed in the Matlab workspace as a double variable An integer corresponding to the selected test is placed in the workspace The simulation script is executed after this the simulation data is collected from the M
27. the location where the file is to be saved enter a filename and press the save button The simulation data will be saved as an Excel spreadsheet If the simulation time is particularly long or the step size particularly small the file size may be quite large Typically 30 seconds of simulation data requires approximately 1 MB of disk space May07 18 Basic Use Page 11 of 73 May07 18 User Manual 4 24 2007 Save As 3 xl Save in C gui 04 19 2007 AGE Desktop af My Documents mr LA My Computer var My Network File name simulation data m y Netw z se Save as type Save Simulation Data as Spreadsheet xls Cancel Figure 2 13 Exporting Simulation Data May07 18 Basic Use Page 12 of 73 May07 18 User Manual 4 24 2007 3 Program Structure This section is intended to provide the reader with an in depth background in the program s structure and design Complete source code appears on the accompanying CD 3 1 Design Overview The software was developed in the Matlab programming language and was designed for maximum flexibility As a result of the modular design the structure can be broken into several independent components An overview of each of these components appears in Section 3 1 with a more detailed discussion of each in Sections 3 2 through 3 4 The Matlab Graphical User Interface Development Environment GUIDE toolbox was used to generate the base code
28. until the user presses either the OK or cancel button The batch simulation window appears in Figure 3 8 After this the program resumes execution if the cancel button was pressed the program returns to the main function and does not simulate If the OK button was pressed a wait bar is displayed and the function collects the parameter minimum value maximum value and number of simulations from the workspace After this an array of parameter values for the parameter that will be varied is created and all of the parameters are placed in the workspace After the simulation has completed the data is plotted The program repeats this for the desired number of simulations 3 2 3 1 2 5 Open Button Callback Function The open button callback function starts by opening the standard windows Open File window This window is shown in Figure 3 9 The user has the option to either import test data from an Excel spreadsheet or load a saved case in the form of a Matlab mat file May07 18 Program Structure Page 27 of 73 May07 18 User Manual 4 24 2007 Open 2 x Look in oui 03 08 2007 e 5 e ER Figure 3 9 Open Window After the user has selected a file the program attempts to open it as an Excel file if it succeeds the data is plotted if it fails the program attempts to open it as a mat save case If this succeeds each parameter is set to the value in the file if this fails as well an error message is displayed
29. wou LA N La E 1 1 r 1 1 1 1 007 05 05 0 282 Q ss 000 B BB k Next the script should be executed to make sure that there is not a problem The most common errors in setting files result from one of the field having more entries than the others If this error occurs count the number of entries in each field The output setting field is normally the same for all models unfortunately the standard outputs are not logical for this model The output setting structure contains the information needed for the plots The workspace name field contains the names of the arrays that will be plotted as they appear in the Simulink model The code for this appears below output setting struct workspace name May07 18 Program Maintenance Page 53 of 73 May07 18 User Manual 4 24 2007 Vl Pgen delta speed bes The start time and end time fields are not used in current versions but are still included by standard practice The code appears below start time OH est end time 10 res The display_name is the label that gets displayed on the Y axis Common practice is to indicate the units in brackets after the name This code appears below display name V1 pu Pgen pu Delta rad speed rad s TIT The test data simulation data old simulation data and test time fields are used to store simulation and test data They are initially set to empty fie
30. 1 STARTING PROGRAM OR ted e ano ie EO esters 2 22 ADJUSTING PARAMETERS si swa is eg e re sS SSS ee eie TRS Geek E eek ee teet eren 3 2 3 SELPECTINGATPESTu T 6 2 4 RUNNING SIMULATIONS nono 6 2 5 RUNNING BATCH SIMULATIONS a a aa sy Ta E ther soon kosa aa aaah ierra hein 6 2 6 LOADING TEST DATA ois takou Suha de seye a uu PRG bee e ouben A e qia h E e ane 7 2 7 SAVING AND LOADING PARAMETERS ee esse se ee ee se ee ee ee ese ere ee ee ee enne nenne nnne Ge ee Re Be ee See ee ee 8 2 8 SAVING GRAPHS AND EXPORTING SIMULATION DATA esse 10 3 PROGRAM STRUCTURE eerie eene enses enses ense Be suse Be sens BE sesto sees sone ta nirvana 13 3 1 DESIGN OVERVIEW ecce asy ge seed Seg Re ie EE eei e 13 XF Program Components e p MAM OE HE N 13 3 1 1 1 Basic Algorithm EE RE ede e KO kases 14 34 12 Graphical User Intetface o aa oe Rr e e pedet 15 3 1 1 3 Simulink Models aun ae eR Reese OE it EE ne vade 15 3 1 1 4 Simulation Scripts daa ce ed a EE EY P m e y ve e ER 16 3 E2 The Matlab Workspace a siiis ette e Et EE ER huge 16 BAS Setting Files RE RE eee at ne EORR EER 16 SN Test DOLA ES 16 3 1 5 Interaction Between Components and Flow of Information s 17 3 2 GRAPHICAL USER INTERFAGE sw swa asi EE oo he Eb Saha n Did Mu res os sasa uha 18 SPA Dat A ER E TAN 18 32 2 Opening Window a a OE OE IE EE 20 3 2 2 1 SUA 21 3 2 2 2 Main Window Setting File eet an o e tie
31. 2 of 73 o AP o o o A o AL AP o AP AL o AL o o o AP o AP o o Ae o CP o AP o OP oe oe ae May07 18 User Manual 4 24 2007 Plot simulation results figure subplot 3 2 1 plot Time VI TET grid on ylabel V t pu FontSize 9 FontWeight bold xlabel Time sec FontSize 9 FontWeight bold set gca FontWeight Bold XMinorTick On YMinorTick On subplot 3 2 2 plot Time spd r grid on ylabel Speed pu FontSize 9 Fontweight bold xlabel Time sec FontSize 9 Fontweight bold set gca FontWeight Bold XMinorTick On YMinorTick On ubplot 3 23 plot Time Pg r grid on ylabel P_g pu FontSize 9 FontWweight bold xlabel Time sec FontSize 9 FontWeight bold set gca FontWeight Bold XMinorTick On YMinorTick On subplot 3 2 4 plot Time Qg TE grid on ylabel 0 g pu FontSize 9 FontWeight bold xlabel Time sec FontSize 9 Fontweight bold set gca FontWeight Bold XMinorTick On YMinorTick On subplot 3 25 plot Time Efd r grid on ylabel E f d pu FontSize 9 Fontweight bold xlabel Time sec FontSize 9 FontWeight bold set gca FontWeight Bold XMinorTick On YMinorTick On May07 18 Appendix E Sample Simulation Script Page 73 of 73
32. 5 30 004 display name Tpdot Tppdo ppao H re Eat T PPM Lpd Lppd bl S1 S12 Ra Rcomp ESME sus Po n Vstp Ogen Vstp Vvi Vstp Pgen Rjot Ogen Rjet Vl Rjet Pqgen FIt Ogen FIt VI FIt z Tup Vstep V Vstep tt Bie yess TELE n I Elt GEL tam ses EE xe BA X1 MVA mach MVA sys fboase Tstop Step Size fress description L SoLo yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow white white white white white white white white white white white MATE pa u white white white l 54 AL 1 4 4 4 4 1 L A ad Ed 4 24 La 44 EL 4 4 ER MEE ur ao slider panel yo dg ka A 1 1 des Rep kd dd kel dj 252 2 2 2 2 24 Ay 2 2 DER 2 252 3y3 r3y 3x 375734 4 4 uu bres editability 0 0 0 0 0 0 0 0 All Tests 0 0 0 0 0 0 0 0 1 Test 1 Only 1 dd 2 Test 2 Only 2 252 3 Test 3 Only Jagd 4 Test 4 Only May07 18 Appendix C Sample GUI Setting File Page 66 of 73 May07 18 User Manual 4 24 2007 1 1 etc Ds By 37 e 0 0 0 0 0 0 0 0 0 Es output setting struct workspace name VIT Eta spa ladita sis Prepa start time
33. 7 18 Program Maintenance Page 33 of 73 May07 18 User Manual 4 24 2007 IE T A Lre wa setting file name genrou setting file genrou exst4b setting file genrou rexs setting file gensal setting file gensal exstl setting file gensal exsti hygov setting file Las The model name field is the name of the model as it appears in the model list on the opening window If a model is added the model s name should be added in quotation marks at the end of the list The model folder field is no longer used if a model is added empty quotation marks should be added at the end of the list The setting file name should be the name of the GUI setting file that corresponds to this model the should be added in quotation marks at the end of the list with out the ec m 99 4 1 5 Example Creation and Addition of Classical Machine vs Infinite Bus In order to illustrate the concepts laid out in Sections 4 1 1 through 4 1 4 the reader will be walked through an example of creating a Simulink model and simulation script that are compatible with the GUI and then adding them to the library The example will be the classical machine against an infinite bus 4 1 5 1 Preparation The following data must be collected before beginning to create the model A basic block diagram of the model must be prepared Detailed equations to calculate initial conditions Equations linking the block d
34. 73 May07 18 User Manual 4 24 2007 Other important features in the parameters panel are the simulate and batch simulate buttons and the drop down test selection menu The simulate button places the parameters in the workspace executes the simulation script collects and plots the simulation results The batch simulate button allows the user to run several simulations at once with one variable being changed each time This allows the user to visualize the effects of one parameter on the simulation results The test selection menu allows for several different events to be incorporated into one model and display The models built thus far have three different tests a step change in reference voltage a load rejection test in which the main breakers are opened and a three phase fault Each time that the simulate button is pressed the entry selected in the test menu is placed into the workspace as an integer this is then collected by the simulation script and a switch statement determines which initial conditions to use and test to run Because in real world testing situations different tests may require different initial conditions the graphical user interface can make the edit box and slider bar associated with certain parameters inactive based on the test selected in the drop down menu This is intended to reduce the possibility of entering a parameter in the wrong edit box A sub panel is also provided for each output variable Each
35. HS SA 11 FIGURE 2 13 EXPORTING SIMULATION DATA ee ees ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 12 FIGURE 3 1 SIMPLIFIED FLOW OF INFORMATION 14 FIGURE 3 2 SIMPLIFIED FLOW CHART ee esse ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee t ee ee ee ee e ere ee ee ere ee ee ee ee ee ee ee ee 15 FIGURE 3 3 DETAILED FLOW OF INFORMATION 17 FIGURE 3 4 OPENING WINDOW ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee tte e e etere e ee ee ee ee ee ee ee ee ee ee ee ee ee 20 FIGURE 3 5 HOME WINDOW ees aaa ese gede ee ese ee ee ee eed ee ee ee ee ee ee ee ee ee ee ee ee ee ge ee ee ee ee ee ee de ee ee ee ee ee 22 FIGURE 35 6 WATLBAR EISE nas dadaisti ad nat das sel dat 24 FIGURE 3 7 SIMULATION ERROR MESSAGE BOX ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 26 FIGURE 3 8 BATCH SIMULATE WINDOW ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 27 FIGURE 3 9 OPEN WINDOW ees ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee a ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 28 FIGURE 3 10 SAVE AS WINDOW ES Ge o ou u ties 29 FIGURE 4 1 BLOCK DIAGRAM OF CLASSICAL MODEL sse eee 35 FIGURE 4 2 BASIC BLOCK D
36. IAGRAM AS SIMULINK MODEL ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 37 FIGURE 4 3 INTEGRAL INITIAL CONDITION ee ee e e ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ie ee ee ee ee ee ee 38 FIGURE 4 4 IMBEDDED MATLAB FUNCTION 39 FIGURE 4 5 CLASSICAL MODEL WITH EMBEDDED MATLAB FUNCTION ee esse ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 40 FIGURE 4 6 TOWORKSPACESETTINGS 5 roten a ouswa wou dad ouve eg ee wa dap saka vs sa eg dee Ge eg sena dep Ge Se Eg ER es 41 FIGURE 4 7 COMPLETED CLASSICAL MODEL ee esse ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee errie eerste ee ee 42 FIGURE 4 8 CONFIGURATION PARAMETERS ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee ee 43 FIGURE 4 9 SIMULATION RESUETS u lu ee Eg Ge sap Ge Ge aaa R Ee fa asis lis ee Ge es ER Ge Ge soda ea ed 50 May07 18 Introduction Page 3 of 5 May07 18 User Manual 4 24 2007 List of Tables TABLE 3 1 SAMPLE TEST DATA FORMAT L as 17 TABLE 3 2 DATA STRUCTURES AND THEIR FIELDS a 19 TABLE 3 3 PRODUCT REQUIREMENTS AND FEATURES neee 24 TABLE4 1 GUI RARAMETERS ua rre ni 36 May07 18 Introduction Page 4 of 5 May07 18 User Manual 4 24 2007 List of Definitions Block diagram A vis
37. Machine Model Parameter Determination User Manual May07 18 Client General Electric Faculty Advisor Chen Ching Liu Team Members Jared Kline Adam Wroblaski Mark Reisinger Yu Chan Disclaimer This document was developed as a part of the requirements of an electrical and computer engineering course at lowa State University Ames lowa This document does not constitute a professional engineering design or a professional land surveying document Although the information is intended to be accurate the associated students faculty and Iowa State University make no claims promises or guarantees about the accuracy completeness quality or adequacy of the information The user of this document shall ensure that any such use does not violate any laws with regard to professional licensing and certification requirements This use includes any work resulting from this student prepared document that is required to be under the responsible charge of a licensed engineer or surveyor This document is copyrighted by the students who produced this document and the associated faculty advisors No part may be reproduced without the written permission of the senior design course coordinator Submitted April 24 2007 May07 18 User Manual 4 24 2007 Table of Contents 1 INIRODUCHON pepe 1 LI PURPOSE AND INTENDED USE OF THIS MANUAL ee eee 1 1 2 ACKNOWLEDGMENTS Se Suq ata ua a e ais 1 O BA A M 2 2
38. PO oe oe ae K N O 0 ubplot 4 1 4 lot Time Pgen abel Time s abel Pgen oe oe 4 2 Testing Library Additions It is very important that the model be tested after addition to ensure that the setting file and simulation script were properly built If the model s accuracy has already been tested against known control data such as simulation results from a PSLF study then the user can simulate each test and make sure that the results are logical Additionally the each parameter should be tested to make sure that adjusting it has an effect on the simulation results 4 3 Troubleshooting Library Additions There are several mistakes that can be made while adding models to the library This section attempts to describe some of the more common errors These errors will be divided based on the area where the mistake was made The two most common places for errors are the GUI setting file and the simulation script This list of errors is by no means exhaustive and was prepared assuming that the original block diagram and simulation script were working properly and giving accurate results before addition to the library May07 18 Program Maintenance Page 60 of 73 May07 18 User Manual 4 24 2007 4 3 1 Errors in Main Window Setting File The following errors can be attributed to the main window setting file Errors in this are rare though they do occur e Errorin main window at line 32 o This ca
39. Parameters amp Initial Conditions Execute Command Command Simulation Script Figure 3 1 Simplified Flow of Information 3 1 1 1 Basic Algorithm The basic algorithm is shown in Figure 3 2 After the initial program execution the opening window appears The user selects a model and presses OK The home screen appears and the user imports test data and chooses to either batch simulate run several simulations at once with slight adjustments to one parameter or to edit parameters himself and simulate The results are plotted with the test data and the user compares the results If they are satisfactory he exits the program if they are not he can choose to edit parameters or run more batch simulations A more detailed version of this flowchart appears in Appendix A May07 18 Program Structure Page 14 of 73 May07 18 User Manual 4 24 2007 ny Select machine model N y o _ C WA Select machine test lt N WA E I Continue Simulate and plot result N F Quit A CN 7 Batch simulation Edit parameters V L Figure 3 2 Simplified Flow Chart 3 1 1 2 Graphical User Interface The graphical user interface is intended to provide the user with an easy means of entering parameters and viewing selected simulation results It also provides several features such as the ability to undo or redo certain actions and import or export data that make it much more user
40. anual 4 24 2007 Select File to Import 2 x Look in Genrou_Test_Data e er E3 fe u MmMmM import Excel Test Data xis Cancel Figure 2 9 Loading Test Data 2 7 Saving and Loading Parameters The values of the edit boxes can be saved and reimported during a subsequent session To save the parameters click the save button on the toolbar that appears across the top of the home screen The standard Windows Save As dialog box will appear This is shown in Figure 2 10 Select Save Paramter Setting from the Files of Type menu at the bottom of the window Browse to the location where the files are to be saved and enter a name Press the Save button The parameter values will be saved in a mat format May07 18 Basic Use Page 8 of 73 May07 18 User Manual 4 24 2007 Save As 21 xl Save in qui 04 19 2007 lt 5 e ER My Computer MI U iris Filename rest case m sw Places Save as type Save Parameter Setting mat Cancel Figure 2 10 Saving Parameters To open saved parameters from a previous session press the Open button from the toolbar The standard Windows save as box will appear This is shown in Figure 2 11 Select Load Parameter Setting from the Files of Type menu Browse to the folder containing the saved data select the file and press the Open button The edit box values and slider bar position will be changed accordingly May07 18 Bas
41. aphical user interface 3 1 4 Test Data The program allows data to be plotted from Microsoft Excel spreadsheets This data must be saved in the xls format and shall be arranged according to Table 3 1 It is important that the first column correspond to time in seconds and the remaining columns correspond to the outputs There must be one and only one column for each output If no data is available then that column should be left as zeros but never blank The same format is used for exporting simulation data A sample of test data appears in Appendix B May07 18 Program Structure Page 16 of 73 May07 18 User Manual 4 24 2007 Table 3 1 Sample Test Data Format Time G N O 0 1 0 2 0 2 0 4 0 3 0 6 0 4 0 8 Output 1 Output 2 Output 3 Output 4 0 4 0 8 0 6 1 6 0 8 2 4 1 2 3 2 3 1 5 Interaction Between Components and Flow of Information The flow of information between subprocesses is shown in detail in Figure 3 3 Opening Window Setting File Opening Window Data Window Settings Entry Point Opening Window Opening indow Data Execute GUI Command Setting File ome Window Data Simulation Results Simulation Batch Simulation Data Results Home Matlab Screen Workspace SINE Parameters Parameters amp Batch Initial Conditions Execute Simulation Kommand Data Initial Conditions Parameters Execute Batch Execute Command Simulation Command Window Simu
42. arameter is always editable if itis set to a number greater than O it will only be editable if the test pulldown menu is set to that position May07 18 Program Structure Page 19 of 73 May07 18 User Manual 4 24 2007 Table 3 2 Continued output_setting Stores the data that is needed workspace name String containing the name of for the ouput panel on the the variable as it appears in the home window There is one Simulink block diagram and structure for each model and workspace one entry for each output Not used on current versions Found in the GUI setting file Not used on current versions is displayed on the graph s Y test_data Double array containing the data imported from the Excel spreadsheets simulation_data Double array containing the simulation data old simulation data Double array containing the data from the previous simulation test_time Double array containing the time from the imported Excel data tests_setting Stores the strings that are test_name String containing the name of needed for the test selection the test as it is displayed in the menu on the parameter panel test selection pulldown menu of the home window Found in the GUI setting file 3 2 2 Opening Window PISE Choose machine model Figure 3 4 Opening Window May07 18 Program Structure Page 20 of 73 May07 18 User Manual 4 24 2007 The opening window is shown in Figure 3 4 and serves as a user frie
43. ased on the test selected The initial conditions corresponding to this test are chosen in this statement In the lines that follow more initial conditions are calculated using algebraic expressions The last line executes the Simulink model It is very important that the variables used in the simulation script exactly match the May07 18 Program Structure Page 30 of 73 May07 18 User Manual 4 24 2007 variables used in the Simulink models and GUI setting files An example has been included in Appendix E It should be noted that it is not necessary to use Simulink block diagrams The simulation script can be used to build a state space model of the system being studied Any one of the Matlab differential equation solvers can be used to perform the simulation 3 4 Simulink Model The Simulink models used for simulations are also very flexible They can be models of any dynamic system and do not need to be from the power industry The standard practice has been to use block diagrams for the generator windings exciters voltage regulators turbines and governors and imbedded Matlab code for the algebraic equations corresponding to the electrical network The simulation time and step size need to be adjustable via the home screen thus the appropriate settings in the configuration parameters dialog box Simulation gt Configuration Parameters need to be changed to variables Variables will be used in place of constants on all blocks in t
44. atlab workspace and plotted Because the exact number of parameters or outputs is not fixed loops were used A wait bar see Figure 3 6 is provided to remind the user that the simulation is in process To ensure that the wait bar remains on top of all other Matlab windows the window should be modal May07 18 Program Structure Page 23 of 73 May07 18 User Manual 4 24 2007 Fu io xl Simulating EE EE Figure 3 6 Wait bar 323 11 Features Several user friendly features have been added A summary of these features and their functionality appears in Table 3 3 Table 3 3 Product Requirements and Features ENE EG Supplemental Intended Functionality enter a specific value for a parameter Slider Bar Required Provide the user with an easy method to vary parameters Each slider bar shall have a default maximum and minimum value When the slider bar position is changed the value in the edit box shall update If a value is entered into the edit box that is outside of this range the corresponding maximum or minimum should reset to the value in the edit box models from the graphical user interface in the graphical user interface Import Data from Excel and Required The user shall be able to import time Display on Graphs domain data stored in Microsoft Excel spreadsheets in a format specified by the project team and plot them on the same graphs as the simulation data to previous simulation of each slider
45. bar of each slider bar from a previous session on all graphs May07 18 Program Structure Page 24 of 73 May07 18 User Manual 4 24 2007 Table 3 3 Continued Required or Feature Supplemental Intended Functionality Handle Simulation of Required The graphical user interface shall be able to Different Tests handle models capable of simulating different events Handle Multiple Models Required The graphical user interface shall be capable of handling a library of any number of models The project team shall enter at least 5 models into this library Pan Graphs Supplemental Save Graphs as Matlab Supplemental The user should be able to save graphs as Figures Matlab figures Export Simulation Data to Supplemental Excel Spreadsheet The user should be able to save simulation data as an Excel spreadsheet in a format that is the same as the imported data Batch Simulation Supplemental The user should be able to choose a single parameter specify a minimum and maximum value and any number of simulations and have the program iterate that many times between those two points and graph the simulation data Hold Previous Zoom Level Supplemental When test data has been imported the Graph s zoom level should not change after the simulate button is pressed Graph Previous Simulation Supplemental Data The previous simulation data should appear as a light gray line to allow the user to judge progress in matching the test data
46. ble to all generator models May07 18 Program Maintenance Page 32 of 73 May07 18 User Manual 4 24 2007 switch test_switch Case 1 pgen Pgen_Vstep qgen Qgen Vstep vm VI Vstep vstep 01 Vup_Vstep tstep Tup Vstep case 2 pgen Pgen Ld Reject qgen Qgen Ld Reject vm V1 Ld Reject ton Treject Ld Reject case 3 pgen Pgen Flt qgen Ogen_Flt vm V1_Flt ton T_flt_on toff T flt off end The last line executes the Simulink model using the sim command The simulation scripts appear in Appendix I 4 1 3 Creating GUI Setting File The GUI setting file is a Matlab script that sets up the databases needed for the main graphical user interface A summary of these data structures appears in Table 3 2 and a sample setting file appears in Appendix B When adding models it is usually quicker and easier to edit an existing setting file than it is to start a new one 4 1 4 Editing Main Window Setting File The main window setting file contains the data necessary to display all of the models in the opening screen and execute the correct simulation script The current file appears below model setting struct model name Genrou Genrou exst4b Genrou rexs Gensal Gensal exstl Gensal exstl Hygov Lisa model folder folder containing all the necessary files Sit should be located inside the current directory May0
47. code should list of all generator parameters and the corresponding default values This is shown below It is very important that all variables spelled and capitalized in exactly the same manner as the Simulink model h 3 d 1 ra 0 05 May07 18 Program Maintenance Page 43 of 73 May07 18 User Manual 4 24 2007 xpd 0 2 pgen_fault 100 qgen fault 30 1 fault i fault on i _fault_off 1 1 fault 0 gen_reject 100 gen_reject 30 1 reject 1 t reject 2 mva base 100 lt N ct ct lt Q O Tstop 30 Step_size 0 005 After this a switch statement should be used to determine which test to run The switched variable should be test_switch The code for this is below Flag to set which test will be executed 1 Load Rejection 2 Thr Phase Fault Switch test switch case 1 Pl pgen fault Ql qgen fault Vil vi fault Ton t fault on Toff t fault off case 2 Pl pgen reject Ql qgen reject Vl vl_reject Ton t_reject Toff 100000 end Next the initial conditions need to be calculated these were determined in Section 4 1 5 1 The complete equations can be found below The data for real and reactive power were supplied in terms of MW and MVAR they will be perunitized here The base frequency will also be computed in rad s ztran rt lj xt zline r1 13 x1 Zgen ra lj xpd wo 2 pi fbase P1 P1 mva_base Q1 Q1 mva base a P1 13 01 I conj S V1
48. deer Do ae her iii 21 IZIN Home WMAOW ise RR ERREUR DNI NIE aga 22 3 2 3 1 Nini e 3 2 3 1 1 SKEER RR ET UIDES 3 2 3 1 2 Callback Functions sss sees eee 3 2 3 1 2 1 Slider Bar and Edit Box Callback Functions 3 2 3 1 2 2 Test Selection Menu Callback Function sss sss sees eee 3 2 3 1 2 3 Simulate Button Callback Function n u 26 May07 18 Introduction Page 1 of 5 May07 18 User Manual 4 24 2007 3 2 3 1 2 4 Batch Simulate Button Callback Function eee 26 3 2 3 1 2 5 Open Button Callback Function ee ee ke GR ee ee Re Re GR ee 27 3 2 3 1 2 6 Save Button Callback NT TTT 28 3 2 3 1 2 7 Undo Redo Button Callback Functions a ee ass 29 3 2 3 1 2 8 Zoom In Zoom Out and Pan Button Callback Functions 29 3 2 3 2 GUE Setting File ertt e ree e e ee pt Oe teet e PR 30 3 24 Batch Simulation Window nue eee edm eei dese e s kous eH ava ayq 30 3 3 SIMUEAXTION SGRIPIS iesist amis EE GE a eI CPP 30 3 4 SIMULINK MODEL SE SEE paq spa eiTe bei nien aa S pe kt 31 4 PROGRAM MAINTENANCE eeuse sees sees ee see see sees se ese Se EG Be EG Be ee Ge Se EG Be EG Be Ee Ee Ge se EG ee 32 4 1 ADDING MODELS TO LIBRARY uuu diogo Ep eeue ek soda sone eee m eee syans odor 32 4 1 1 Compatible Simulink Models eese s ee Ge ee Ge ee Re ee 32 4 1 2 Compatible Simulation Scripts
49. e Mme Limit data points to last inf Decimation g Sample time 1 for inherited 1 Save format Structure w Log fixed Structure With Time Structure Array Cancel Help Apply Figure 4 6 To Workspace Settings In this model we will need to place five variables in the Matlab workspace the machine angle delta the machine speed speed the real power generation pgen and the terminal voltage V1 are the variables that will be plotted it is also very important that the simulation time be exported to the workspace as well This is shown in Figure 4 7 May07 18 Program Maintenance Page 41 of 73 May07 18 User Manual 4 24 2007 dassical machine ID xl File Edit View Simulation Format Tools Help DIE lt gt q lt r s DERE RAAD Embedded MATLAB Function Ready 100 lode3 Li Figure 4 7 Completed Classical Model The last step in model creation is to modify the configuration parameters The Configuration Parameters dialog box can be found under the Simulation menu The stop time should be set to Tstop the solver options should be changed to fixed step the ode3 solver is typically used the fixed step size should be set to Step size This is shown in Figure 4 8 May07 18 Program Maintenance Page 42 of 73 May07 18 User Manual 4 24 2007 5 Configuration Parameters classical machine Configuration Active x
50. e white white white white white i tedigabaLatyY ska 005 0 0 lt savas a 2 1 rep H N H N dr see no 70707070 0p ea Ol gas 1 OON output_setting struct workspace_name Vl Pgen delta speed H start time 0 end time 10 display name VI pu Pgen pu Delta rad speed g sivik test_data x simulation data txt asa old simulation data x y este test time 0 tests_setting struct test name sea Three Phase Fault Load Rejection gos simulin file name classical machine simulation file Classical Model simulation script classical machine sim 4 1 5 5 Modification of Main Window Setting File rad a ica The main window setting file contains the information needed to display the list in the opening screen and execute the correct GUI setting file This does not need to be May07 18 Program Maintenance Page 56 of 73 May07 18 User Manual 4 24 2007 created again from scratch 1t simply needs to modified so that the new model will be displayed in the list box The code for the new main window setting file appears below model setting struct model name Genrou Genrou exst4b Genrou rexs Genl sai Gensal exstl Gensal exstl Hygov Classical Model l model folder
51. e parameter setting workspace name field is incorrect Check to be sure that all of the variables in this field are the same as they appear in the simulation script and Simulink model e Errorin GUI at 222 o Check to be sure that the variable names in the output setting structure are spelled correctly and that a corresponding to workspace block appears in the Simulink model Also be sure that the to workspace block s save format is set to array May07 18 Program Maintenance Page 61 of 73 May07 18 User Manual 4 24 2007 4 3 3 Errors in Simulation Script There are a few places where errors could occur in the simulation script The most important ones appear below e Model simulates a different test than what is selected in the test menu o Check the opening switch statement and the tests_setting data structure to ensure that the order is the same and that the first entry in the tests setting structure is the same test as the first case in the switch statement o Check the end of the simulation script to ensure that the correct admittance matrix is assigned e Simulation results are incorrect o Check that the proper Simulink model is executed at the end of the simulation script o Check the calculations in the simulation script to ensure that they are accurate 4 3 4 Errors in Simulink Block Diagram There is much room for error in the Simulink block diagram and incorrect or inaccurate simulations results
52. etween the minimum and maximum value It is also possible to enter a number in the edit box by hand If this value is outside of the default minimum and maximum values the appropriate limit will be reset to the value in the edit box Paen stp a 100 kj Figure 2 5 Slider Bar May07 18 Basic Use Page 5 of 73 May07 18 User Manual 4 24 2007 2 3 Selecting a Test Tests can be selected from the pull down menu on the left side of the GUI This is shown in Figure 2 6 Based on the entry selected certain parameters will be uneditable This is intended to prevent the user from accidentally adjusting the wrong parameter Sunna Parameters Voltage Step voltage Step Load Rejection Three Phase Fault Figure 2 6 Test Pull Down Menu 2 4 Running Simulations Standard simulations can be run using the Simulate button located in the lower left corner of the home screen This is shown in Figure 2 7 Pressing this button will execute the simulation script Simulink model and plot the simulations results During execution a waitbar will appear to notify the user that a simulation is being executed Simulate Batch Simulation Figure 2 7 Simulate and Batch Simulate Buttons 2 5 Running Batch Simulations Batch simulations can be run by pressing the Batch Simulation button located in the lower left corner of the home screen This is shown in Figure 2 7 Pressing this butto
53. friendly It can be broken into three basic components the opening window main window m the home window GUI m and the batch simulation window batch simulation m The basic purpose of the graphical user interface is to collect parameters from the user store them in the Matlab workspace execute the simulation script collect the arrays of simulation data and plot them 3 1 1 3 Simulink Models The Simulink models are block diagram representations of the state space eguations necessary for time domain simulations It is very important that all constants be entered in as variables to ensure that they can be easily changed and that they will be changeable from the graphical user interface Selected parameters are stored as arrays in the Matlab workspace May07 18 Program Structure Page 15 of 73 May07 18 User Manual 4 24 2007 The standard practice has been to use embedded Matlab functions for the algebraic eguations corresponding to the electrical network and loads It is very important that every integral have an initial condition defined It is not necessary to use Simulink models Instead a state space model could be formulated and one of the time domain differential eguation solvers could be used to solve the system 3 1 1 4 Simulation Scripts The simulation scripts are Matlab m files that contain the eguations necessary to calculate the initial conditions After all of the initial conditions have been calculated the Simu
54. he algebraic equations in order to maximize flexibility A sample Simulink block diagram appears in Appendix D May07 18 Program Structure Page 31 of 73 May07 18 User Manual 4 24 2007 4 Program Maintenance This section is intended to serve as a guide and reference manual for product maintenance It includes information examples on how to add models to the library and modify existing models 4 1 Adding Models to Library This section will discuss the process used to add models to the library The process basically consists of creating the Simulink model and simulation script creating the GUI setting file and editing the Main Window setting file These are described in more detail Sections 4 1 1 through 4 1 4 An example appears in Section 4 1 5 Before reading this section the reader should study Table 3 2 a description of all of the data structures used in the program 4 1 1 Compatible Simulink Models A compatible Simulink model has several characteristics the first is that all parameters must be entered in as variables The name that it is used in the Simulink model will be referred to as the workspace name This name should be the same name that is used in the workspace name field of the parameter setting data structure The model must also have the simulation stop time set to Tstop and the fixed step size must be set to Step Size The solver type should be set to fixed step Standard practice has been to use the ODE 3
55. his section will outline the creation of the Simulink block diagram The first step in creating the model is to enter the basic block diagram into Simulink This is shown in Figure 4 2 Using to and from blocks can clean up the block diagram and make it more apparent what is happening The bottom set of blocks create a complex number that will be used later to determine the current that is supplied It can be difficult to create complex numbers in imbedded Matlab functions the standard practice is to combine the magnitude and angle outside of the imbedded Matlab function May07 18 Program Maintenance Page 36 of 73 May07 18 User Manual 4 24 2007 7 classical machine Lio xj File Edit View Simulation Format Tools Help Diw eel x e d Ecomplex Figure 4 2 Basic Block Diagram as Simulink Model It is very important that the right most integral s initial condition be set to deltao This is shown in Figure 4 3 Normally all integrals need an initial condition the output of the right initial condition corresponds to the speed deviation this initial condition is zero because it is assumed that the machine is starting from its base speed May07 18 Program Maintenance Page 37 of 73 May07 18 User Manual 4 24 2007 Function Block Parameters Integrator3 internal Figure 4 3 Integral Initial Condition The next step is to add an imbedded Matlab function that connects the generator to the network This f
56. iagram to the rest of the network A list of all tests that need to be built into the model and displayed on the GUI A list of all parameters that need to be displayed on the graphical user interface This information should include O O O O The name of each parameter A default value for each parameter A minimum value for each parameter A maximum value for each parameter A list of all simulation results that need to be plotted The following data has been prepared for the classical machine against an infinite bus A block diagram of the classical model appears in Figure 4 1 May07 18 Program Maintenance Page 34 of 73 May07 18 User Manual 4 24 2007 Figure 4 1 Block Diagram of Classical Model It will be assumed that the user will supply the starting terminal voltage and real and reactive power generation It will be assumed that the voltage angle at the machine terminals will be zero the initial power angle and voltage angle at the infinite bus will be adjusted accordingly The following equations can be used to calculate the initial conditions S P1 j 01 I conj S V1 E abs Vl zgen I deltao angle Vl zgen I Vinf Vl ztran zline I The model needs to simulate load rejections and three phase fault standard practice is to simulate a voltage step as well This is not logical for the classical model The eguations to do this appear in Section 4 1 5 3 The basic technigue is to develop admi
57. ic Use Page 9 of 73 May07 18 User Manual 4 24 2007 Select File to Import ax Look in O gui 04 18 2007 e My Documents ra BL My Computer VAS Filename ies cose m Places Files of type Load Parameter Setting mat vi Cancel Figure 2 11 Opening Saved Parameter Settings 2 8 Saving Graphs and Exporting Simulation Data The graphs and simulation data can also be exported The graphs can be saved in jpeg format To do this press the save button on the toolbar The standard Windows Save As dialog box will appear This is shown in Figure 2 12 Select Save Graphs from the Save as Type menu Browse to the location where the graphs are to be saved Type a file name and press the Save button The graphs will be saved seperatly with the variable s workspace name appended to the filename that was entered May07 18 Basic Use Page 10 of 73 May07 18 User Manual 4 24 2007 Save As 7 x Savein qui 04 19 2007 Ar E3 My Documents dE My Computer MI TE File name swe PI gi Save as type Save Graphs jpg vi Cancel Figure 2 12 Saving Graphs The simulation data can also be exported to an Excel file of the same format as the test data This can be done by pressing the Save button on the toolbar The standard Windows Save As dialog will appear This is shown in Figure 2 13 Select Save Simulation Data as Spreadsheet from the Save as Type Menu Brows to
58. l parameter selection process When the batch simulate button is pressed the batch simulate window appears A pull down menu allows the user to select which parameter will be varied The maximum and minimum values correspond to the points between which the program will iterate By default these are set at the minimum and maximum slider bar values A callback function ensures that when the position of the pull down menu changes that the maximum and minimum values will change The simulations edit box allows the user to set the number of times that the program will run This number must be an integer greater than 1 When the OK button is pressed five variables are passed to the Matlab workspace parameter is an integer corresponding to the parameter selected in the pull down menu The maximum value max the minimum value min the number of simulations simulations and an exit flag cancel If cancel is set to 1 because the cancel button was pressed the home screen will not run the simulation if the OK button is pressed cancel will be set to 0 and the home screen will run the simulations 3 3 Simulation Scripts The simulation scripts are Matlab scripts that collect parameters from the workspace determine which test to run and initial conditions to use calculates additional initial conditions and executes the Simulink model Though these scripts are very flexible the standard practice has been to use a switch statement that switches b
59. lation Script Figure 3 3 Detailed Flow of Information May07 18 Program Structure Page 17 of 73 May07 18 User Manual 4 24 2007 As one can see the Matlab workspace serves as the central information storage point All data that is shared among processes is entered into the Matlab workspace 3 2 Graphical User Interface The graphical user interface can be broken into three components the opening window main window m home window GUI m and the batch simulation window batch simulation m Each of these components is described in detail in Sections 3 2 2 through 3 2 4 A discussion on the data structures that store all of the information necessary appears in Section 3 2 1 Complete source code appears on the accompanying CD 3 2 1 Data Structures Several data structures are used throughout the program a summary of these appears in Table 3 2 The model_setting data structure is used by the opening window There is one data structure for the entire library The parameter_setting data structure contains the information needed for the parameters panel of the home screen There is one parameter_setting structure for each model The output_setting structure contains the information necessary for the output panel of the home screen There is one output_setting for each model The tests_setting structure is again model specific and contains the information necessary for the test selection menu on the home screen May07 18 Program Structure
60. lds but the home screen will store arrays in them at a later time It is important that the test data simulation data and old simulation data fields be set to x The GUI uses these values to choose what to plot The code for this appears below east data RE aas simulation data mt sa old simolation data x Y lt sa pest S T recs The tests_setting structure is usually the same for all models Because it does not make sense to simulate a voltage step for this model there will only be two tests Itis important that the test listed first be the same test that corresponds to an editablity of 1 in the parameter setting editability field The code appears below tests_setting struct test_name Three Phase Fault Load Rejection Fiss The last three lines store information about where the model files are located and what the title on the home window should be simulin file name is a string that contains the name of the Simulink model simulation file stores the title of the GUI This can be any name that you wish simulation_script stores the name of the simulation script Extensions should not be used on either simulin_file_name or simulation_script simulin_file_name classical_machine simulation_file Classical Model simulation_script classical_machine_sim At this point the setting file should be executed to ensure that there are not any errors The complete GUI setti
61. link model is executed 3 1 2 The Matlab Workspace The Matlab Workspace serves as a swap memory or information repository Any information that needs to be shared between subprocesses is sent to the base Matlab workspace and then read in by the next process This is intended to simplify function calling 3 1 3 Setting Files Setting files are Matlab scripts that create data structures in the Matlab workspace They are intended to store default data needed to properly initialize the opening window without reguiring the user to enter it manually each time the program executes The main window setting file main_window_setting_file m stores a list of the models in the library and the names of their respective setting files The several GUI setting files are specific to each model They contain the information necessary to initialize the home screen including the name of each parameter in the Matlab workspace the name that is to be displayed on the window the minimum value of each slider bar in addition to the maximum and default values The GUI setting files also contain the workspace and display names for each of the values that are plotted and the names of each test or simulation case that the model can execute Each model must have its own setting file While creating setting files can be tedious this method does allow the user to add models to the library without modifying the base graphical user interface code or creating a newly coded gr
62. mple Simulation Script Page 69 of 73 May07 18 User Manual 4 24 2007 end j sqrt 1 decim 1 sysmva MVA_system Operating conditions S pgen 100 0 S ggen 32 09 vm 1 050 va 16 602 pi 180 va 0 System data ztran Rt j Xt zline RI j Xl S pgen j qgen sysmva v vm cos va j sin va I S v v3 v ztran zline I Generator data WO 2 pi fbase mbase MVA_machine tpdo 7 0005 S tppdo 0 030 tppqo 0 0357 h 35000 d 0 000 ld 1 200 lq 0 800 Z lpd 02205 S lppd 0 200 lppq lppd 11 0 160 sl 0 050 s12 0 300 ra 0 000 Xd ld Xg la Xpd lpd Xppd lppd Xppg Xppd X ls Tpdo tpdo Tppdo tppdo Tppqo tppqo H h D d May07 18 Appendix E Sample Simulation Script Page 70 of 73 May07 18 User Manual 4 24 2007 Q Init gen j sqrt 1 vt vm cos va j sin va zgenr ra zgenx lppd zg zgenr j zgenx is_r pgen mbase is_i ggen mbase iterm is r j is i vt iterm iterm imag abs iterm itr pgen mbase vm iti ggen mbase vm psir vm ra itr lq iti psii r ita Lo itr epq sqrt psir psir psii psii dint atan2 psii psir cd cos dint sd sin dint eg vm cd ed vm sd id itr sd rti cd ig itr cd iti sd ppd eg ra iq lppd
63. n mean that one of the fields in the model setting structure is not the same length as the others It can also indicate a problem with the GUI setting file The best way to troubleshoot this error is to try executing each script separately to isolate the error Count the number of entries in each field of the problematic file e Errorin main window at line 248 o This can mean that the name of the setting file in the model setting structure is incorrect Check to be sure that the name of the setting file is correct 4 3 2 Errors in GUI Setting File Errors in the GUI setting file are quite common and are mostly related to typographical errors Common ones appear below e Errorin main window at 32 o This can mean that one of the fields in the parameter setting or output setting structure is not the same length as the others It can also indicate a problem with the main window setting file The best way to troubleshoot this error is to try executing each script separately to isolate the error Count the number of entries in each field of the problematic file e Simulation Error o This can indicate a lot of problems including numerical errors with in the model One possible error in the GUI setting file that could cause this is that the name of the simulation script in the simulation script string Check to be sure that this is correct and does not include the extension o Another possible problem is that one of the variable names in th
64. n will make the Batch Simulation window appear This window is shown in Figure 2 8 May07 18 Basic Use Page 6 of 73 May07 18 User Manual 4 24 2007 lol Settings Simulations Maximum value 5 Minimum value OK Cancel EE Figure 2 8 Batch Simulation Window Batch simulation allows the user to execute several simulations at one time The user can choose one parameter the minimum logical value for this parameter the maximum and the number of simulations that he wishes to perform The program will run the number of simulations that the user selects with the selected parameter being slightly different each time The parameter to be varied can be selected using the pulldown menu located at the top of the GUI The value in the Simulations box determines the number of simulations that will be run The Minimum Value and Maximum Value boxes determine the values between which the program iterates 2 6 Loading Test Data Test data can be loaded by pressing the open button on the toolbar that appears across the top of the home window The standard Windows Open dialog box will appear This is shown in Figure 2 9 In the Files of Type menu at the bottom of the window select Import Excel Test Data Browse to the relevant file select it and press the open button The data will be plotted The test data must be formatted in the manner specified in 3 1 4 May07 18 Basic Use Page 7 of 73 May07 18 User M
65. ndly interface for model selection Upon execution the main window setting file main_window_setting_file m executes placing the model_setting data structure into the Matlab workspace The model_setting data structure contains the names of each model and the name of the corresponding gui setting file After this executes a screen similar to Figure 3 4 appears The program waits for the user to select a model and press the Open button After the Open button is pressed the program executes the GUI setting file that corresponds to the selected model executes placing the parameter_setting output_setting and tests_setting data structures into the workspace The GUI setting file is described in more detail in Section 3 2 3 2 3 2 2 1 Structure The base code for the main window was generated by the Matlab GUIDE toolbox The create function contains code that executes the main window setting file placing the model setting structure in the Matlab workspace This data is then read into a global variable that is used in the layout and open button callback functions The callback function associated with the Open button was modified to execute the simulation script corresponding to the selected model The main window can support any number of models 3 2 2 2 Main Window Setting File The main window setting file is a script file that creates a data structure named model setting and places it in the Matlab workspace This data
66. ng file appears below clear parameter setting parameter setting struct workspace_name NT TAT tuat 2 lt e y ew ogen ravit qgen fault vi fault we May07 18 Program Maintenance Page 54 of 73 May07 18 User Manual 4 24 2007 pgen_reject ggen_reject vl_reject E fault on Pane OKE Saulo ess E rejeck RET EN Vae vo tsel to au base Fase dioa Tstop Step size ERT min value prea O Ln UI oo ooo oo pa 0 001 0 0 001 l 50 sis 0001 KA O O O O O KA o o max_value Trapa rs O ju aca 500 5007 120533 50 07 5007 1 05 23 T0 10 TO wan 96 dag ON Wy 5007 6072625 60 01 iuc default value A Ua 2 3434 1005 3054 AE LOO 30 Ly LL Oy l c Ll L OO OO T 30 005 PA previous value 0 current value Sly O LOOS 30 X 100 30 l d rd sd l p eo sd edel lp 0 005 GO pe an 30 005 pees display name Mg pe Rat L zs P fault O fault Vi fault sans E seel TD ppt PL ETE rie E Fit BA tg PEER AARDE iss t reject RET Xe RI XI S Base l b y se Tstop Step size Eis ESRI CET GR 1d as TRIGE Tess yellow yellow yellow yellow sw white white white May07 18 Program Maintenance Page 55 of 73 May07 18 User Manual 4 24 2007 white whit
67. nto three separate panels The first is the toolbar that appears across the top portion of the display This panel provides many features that are intended to make the software more user friendly These are discussed in Table 3 3 in Section 3 2 3 1 1 The code necessary to implement these features is discussed in Section 3 2 3 1 2 The panel on the left provides space for the simulation parameters while the panel on the right provides space for a graph of each output variable versus time The amount of space allotted to each sub panel varies depending on the number of parameters displayed For every 16 parameters an additional column of parameters is added and an additional 6 8 percent of the display is allocated to parameters For each parameter a sub panel consisting of an edit box and slider bar is provided The edit box consumes approximately 70 percent of the sub panel while the slider bar consumes the remaining 30 percent Under normal display resolutions the slider bar is small enough that only the up and down increase decrease arrows are visible For each slider bar there are default minimum maximum and current values which are found in the parameter_setting data structure The initial values of these properties are contained in the GUI setting file and with the exception of the default value may change through out the session If a value is entered into the edit box that is not between the May07 18 Program Structure Page 22 of
68. s Load machine setting file N Plot test data in GU Wait for users action User clicks simulate button Update parameters value in block cagan va simulation script Plot simu nk result in GUI I User exit GU o p Invalid file format Batch Simulation WIndow User clicks batch simulation button pt batch parameter A pp Batch aand Batch Simulation May07 18 Appendix A Detailed Flow Chart Page 63 of 73 May07 18 User Manual 4 24 2007 Appendix B Sample Test Data 0 01 0 838 0 080 1 911961 0 0 02 1 024 1 053 1 912173 0 0 03 1 024 1 343 0 999919 0 0 04 1 024 1 354 1 000052 0 0 05 1 024 1 362 0 999749 0 0 06 1 025 1 370 0 999986 0 0 07 1 023 1 340 1 000011 0 0 08 1 024 1 311 1 000044 0 0 09 1 024 1 336 0 999877 0 0 10 1 024 1 341 0 999898 0 0 11 1 024 1 337 1 000077 0 0 12 1 024 1 321 0 999906 0 0 13 1 024 1 327 0 999855 0 0 14 1 024 1 352 0 999912 0 0 15 1 024 1 351 0 999923 0 0 16 1 024 1 308 0 999853 0 0 17 1 024 1 320 0 999923 0 0 18 1 024 1 324 0 999948 0 0 19 1 024 1 334 0 999877 0 0 20 1 024 1 330 0 999842 0 0 21 1 024 1 315 1 000073 0 0 22 1 024 1 332 1 000003 0 0 23 1 024 1 329 0 999991 0 0 24 1 024 1 358 0 999722 0 May07 18 Appendix B Sample Test Data Page 64 of 73 May07 18 4 24 2007 Appendix C Sample GUI Setting File clear parameter setting parameter setting s
69. s software was developed by a team of students at Iowa State University and engineers in the Infrastructure business unit of General Electric It is intended to assist engineers in more quickly determining accurate model parameters for use in computer simulations It was developed for use in the power industry specifically the parameters associated with synchronous machine modeling but has a variety of possible applications 1 4 Purpose and Intended use of this Manual This document is intended to be used as a guide both to both the use and maintenance of the software It includes instructions on the basic use provides a detailed and technical overview of the program structure instructions for adding models to the library detailed examples of adding models to the library and the source code It is assumed that the reader is very familiar with Matlab 1 2 Acknowledgments The project team would like to thank Doug Welsh Juan Sanchez and Dan Leonard of General Electric and Dr Chen Ching Liu of Iowa State University for the assistance and technical expertise that they have provided May07 18 Introduction Page 1 of 73 May07 18 User Manual 4 24 2007 2 Basic Use This section provides instructions for the basic use of the software including initial execution running both normal and batch simulations loading test data saving and loading parameters and exporting graphs and simulation data 2 1 Starting Program To start the
70. ser Manual 4 24 2007 A nia c uS B P Parameters ladifd 1 Voltage Step Tpdo LL Tppdo Tpqo Tppao H ladifd pu n 4 o Ld Lg E J Lpd e tn 0 1 02 0 3 04 0 5 0 6 0 7 0 8 0 9 Lpq Lppd a a aki S12 a E T 9 ipo g 8 E kh T m 8 Xcomp speed pu Pgen Vstp E 2 09 m Qgen vstp V1_Vstp is d po e in 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 Gg 432 09 b a 1 jct V1 Rit B us m l 3 10 7 Qgen Fit V1 FI E a HE Ji Tup V 8 m 96v Vstp T Rjct E T E 3 id Zfault T flt off S 3 4 1 Kd D 0 1 0 2 0 3 04 0 5 0 6 0 7 0 8 0 9 x 83 F i Sch MV sys Tstop y Brr Step Size Vi pu Simulate l Batch Simulation 0 5 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 Figure 2 4 Home Screen 2 2 Adjusting Parameters Parameters can be conviently adjusted using the slider bars that are provided on the left side of the home screen A sample is shown in Figure 2 5 Each slider bar has its own default minimum and maximum value and maximum value Pressing the up or down arrows increases the value in the edit box by 1 percent of the difference b
71. solver The can be set in the Configuration Parameters dialog box This can be found in the Simulink Simulation menu All data that the user wishes to plot should be connected to a To Workspace block The variable name should be set to the same that appears in the workspace name field of the output setting data structure The save format field should be set to array Initial conditions can be imported from the workspace using constant blocks The constant value field should be set to the name as it appears in the simulation script It is very important that every integral have an initial condition A sample block diagram appears in Appendix C 4 1 2 Compatible Simulation Scripts Simulation scripts are files that calculate initial conditions and determine which test to simulate These files are very flexible though the generally excepted form is to have the first few lines be a switch statement that determines which test to execute The variable to be switched is test switch This variable is an integer that is determined based on the position of the test pull down menu when the simulate button is pressed The order that the tests appear in and thus the value of test switch that corresponds to a particular test is determined by its index in the test setting menu The generally excepted order is volage step load rejection and three phase fault The generally excepted switch statement appears below and is applica
72. ting file m The first few lines of code should clear and set up a structure called parameter setting These lines appear below clear parameter setting parameter setting struct This structure will have 11 fields workspace name min value max value default value previous value current value display name description color May07 18 Program Maintenance Page 50 of 73 May07 18 User Manual 4 24 2007 slider_panel and editability The next step is to create the workspace_name field This field should contain the name of each variable as it is used in the simulation script and block diagram The order that these appear in is of great strategic importance as it is the order in which they will appear on the main GUI and should be maintained for future fields The standard practice has been to group the parameters into several broad groups including generator parameters initial conditions terminal voltage and real and reactive power injections for each test test or disturbance parameters fault impedance disturbance time etc network parameters network impedances and base power and frequency simulation parameters and parameters corresponding to any applicable subsystems such as an exciter or a turbine governor model The code for the workspace_name field appears below workspace name e SON pot N yee gs pgen fault ggen fault vl fault pgen_reject ggen_reject vl_reject UE saul ot E
73. truct workspace_name Epdo t tepuo Eppo 1 a da dae aa Lpd ippd Lil1 si sl2 rya rfoomp aeons swa Pgen Vstep Qgen Vstep V1 Vstep Pgen Ld Reject Ogen Ld Reject V1 Ld Reject pgen Fit been FIE VI FIt Tup Vstep Vup_Vstep Treject Ld Reject Ele GAY E ETE GEL Atenlt 2 Rt Xt RI XI MVA machine MVA system fbase Tstop Step size PETF min value 2h OL Ol de Uy IN 2D pees elg ly Ly OL 2L Oe Us Lyp was User Manual 0 1000 0 Oy 1000 0543 Oy 1000 0 44 0 100 45 Oe gs Oy DO iis Q 0 Oy 07 dy l 0 0 001 max value Loge Wis der Dy Di LEO Be dra MO Soe sme so SOD why adres 1000 1000 1 057 s 1000 1000 1 05 1000 1000 1 05 10 100 T rata 10710 1005 ss 10 10 10 10 1000 1000 100 sw 60 401 default_value Tg 03 0355 By 05 del Oze woop lp O Us ae Oy Di 0533 100 32 09 1 05 100 32 09 1 05 100 32 09 1 05 Hh ip dees LL Lp Oya ee Oy ly 0 27 120 100 GO nos 30 004 previous value 0 current value dy 203 MORS Sp Us Lele Os 2225 sey A 209470634 00 Die T May07 18 Appendix C Sample GUI Setting File Page 65 of 73 May07 18 User Manual 4 24 2007 100 32 09 1 05 100 32 09 1 05 100 32 09 1 05 1 1 1 ka ka l asa Oy ly 0 2p 120 100 60
74. ttance matrices for the three scenarios pre fault faulted load rejected networks and reduce them using the Kron reduction technigue The following equations can be used to connect the block diagram to the infinite bus I Ybus E cos delta j sin delta Vinf Pe real El conj I 1 1 Te Pe w V1 EI 1 1 ratj xpd A lot of data besides the generator parameters need to be displayed on the GUI These include the simulation stop time and step size the initial conditions for each test the system power and freguency bases the disturbance time for each test and the impedances of network components such as the transmission line and transformer The data needed to create the GUI setting file appears in Table 4 1 May07 18 Program Maintenance Page 35 of 73 May07 18 User Manual 4 24 2007 Table 4 1 GUI Parameters Workspace Name Minimum Default Maximum Display Name pgen faut Of 100 5 500 Q fault 1 rjct Z 5 5 1 P fault H D 0 05 Ra Xpd 5 P fault Q fault D H Xp 2 3 1 05 2 0 0 Maximum 60 1 rict 500 S Base SIRE xi SIRE 0 0001 0 00 0 01 Step size Standard practice is to plot the terminal voltage field voltage field current and speed Because the classical model does not have field voltage or current we will plot terminal voltage rotor angle speed and real power output o Oo x d 4 1 5 2 Creation of Simulink Model T
75. ual method commonly used in engineering to depict the relationship between inputs and outputs of a system GUIDE Graphical User Interface Development Environment A Matlab toolbox that supplies a graphical and interactive method for the creation of graphical user interfaces Initial Conditions Values that determine the simulation s starting point Matlab A software package developed by Mathworks that is commonly used for engineering computation Matlab Workspace The location where all variables are stored Physical test results These are the results of actual generator performance as physical measured in the field PSLF Positive Sequence Load Flow A software tool manufactured by General Electric that is used by power systems engineers to analyze the performance and security of large interconnected power systems PSLF test results These are the results of control simulations run using PSLF Semi real time Result updates appear after the user selects the run command Simulink A Matlab toolbox that allows users to build and analyze block diagrams Simulink test results These are the results obtained using the group created Simulink tool Simulink and Matlab are copyrighted by The Mathworks Inc Windows is copyrighted by Microsoft Corporation PSLF is copyrighted by General Electric Company May07 18 Introduction Page 5 of 5 May07 18 User Manual 4 24 2007 1 Introduction Thi
76. unction first makes the simulate button inactive and changes the text from Simulate to Simulating Next a wait bar is created and each parameter is placed in the workspace If this test has been simulated previously the old simulation data is placed into the old simulation data field in the output setting data structure and the simulation is executed If there is a problem with the simulation a catch statement will cause a message box displaying Simulation error to appear This is shown in Figure 3 7 This prevents the program from crashing but does not provide much insight into the source of the problem If the simulation executes properly the results are plotted and a legend appears in the upper right hand corner of the top plot box A custom color scheme is defined to ensure that all of the plots are legible and that all colors are pleasing to the eye ici xd e Simulation error Figure 3 7 Simulation Error Message Box 3 2 3 1 2 4 Batch Simulate Button Callback Function May07 18 Program Structure Page 26 of 73 May07 18 User Manual 4 24 2007 lol Settings Simulations Maximum value 5 Minimum value OK Cancel EE Figure 3 8 Batch Simulate Window The batch simulate call back function starts by making the batch simulate button inactive and changing the text from Batch Simulate to Simulating The batch simulation window appears and the program suspends execution
77. unction will use some of the equations gathered in Section 4 1 5 1 The complete text of the embedded Matlab function appears below function Te Vl Pgen network E w Vinf Time Ton Toff Ypre Ydist zgen fbase Calculate currents if Time Ton Time gt Toff I Ypre E Vinf else I Ydist E Vinf end Find voltage at generator terminals Vt E zgen I 1 1 SFind the real power injection from the generator Pgen real Vt conj I 1 1 May07 18 Program Maintenance Page 38 of 73 May07 18 User Manual 4 24 2007 perunitize speed wpu w 2 pi fbase gFind the electrical torque supplied by the generator Te Pgen wpu Vl abs Vt A screen shot of the imbedded Matlab function appears in Figure 4 4 EY Embedded MATLAB Editor Block classical machine Embedded MATLAB Function stof File Edit Text Debug Tools Window Help ax Da l X S ocjaus 89 8 m 8x jq Er IB augs function Te Vi Pgen netvork E w Vinf Time Ton Toff Ypre Ydist zgen fhase Calculate currents if Time lt Ton Time Toff I Ypre E Vinf else I Ydist E Vinf end O J UM BEN n m ra Find voltage at generator terminals Vt E zgen I 1 1 H H H ON pa Find the real power injection from the generator Pgen real Vt conj 1 1 1 H H H m amp n Sperunitize speed vpu w 2 pi fbase J sFind the electrical torque supplied by the generator Te Pgen wpu Vi absiVt
78. us 3 4 1 ztran 1 zline epare Admittance matrix for faul sfault Ybus lted network sfault 4 4 Ybus 4 4 1 z ault4 0000001 Prepare admittance matrix for load rejected network Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu Ybu srej srej srej srej srej ect zeros 4 4 ect 1 1 1 Zgen ect 0 1 Zgen Ybus 1 2 1 zline srej srej srej srej 1 zline Ybus 1 3 Ybus 2 3 srej srej srej srej 1 99999999 Ybus 1 4 Ybus 2 4 Ybus 3 4 srej srej srej srej 1 Zgen 1 99999999 1 ztran 1 99999999 Use Kron reduction to reduce admittance matrix Yprereduced Ybus 1 2 1 2 Ybus 1 2 3 4 inv Ybus 3 4 3 4 Ybus 3 4 1 2 May07 18 Program Maintenance Page 48 of 73 May07 18 User Manual 4 24 2007 Yreject Ybusreject 1 2 1 2 Ybusreject 1 2 3 4 inv Ybusreject 3 4 3 4 Ybusreject 3 4 1 2 Yfault Ybusfault 1 2 1 2 Ybusfault 1 2 3 4 inv Ybusfault 3 4 3 4 Ybusfault 3 4 1 2 switch test_switch Case 1 Ydisturbance Yfault case 2 Ydisturbance Yreject end sim classical_machine subplot 4 1 1 plot Time V1 ylabel Terminal Voltage subplot 4 1 2 plot Time rad2deg delta ylabel Rotor Angle subplot 4 1 3 plot Time speed ylabel Speed subplot 4 1 4 plot Time Pgen xlabel Time s ylabel Pgen
79. y similar Each one changes the zoom property of each graph to either zoom in zoom out or pan disables the button that was pressed and enables the other two May07 18 Program Structure Page 29 of 73 May07 18 User Manual 4 24 2007 3 2 3 2 GUI Setting File The GUI setting file is a Matlab script that creates three data structures The first parameter_setting contains the data necessary for the slider bars and edit boxes There is one entry in this data structure for each slider bar or edit box on the parameters panel The next output_setting contains all of the information necessary for the graphs on the output panel The last test setting contains the information needed for the test selection menu These data structures are described in detail in Table 3 2 Three additional string variables simulin file name simulation file and simulation_script are also placed in the workspace simulin file name contains the name of the Simulink block diagram simulation file contains the title given to the home window simulation script contains the name of the simuation script associated with that particular model An example setting file is included in Appendix C 3 2 4 Batch Simulation Window The batch simulation window shown in Figure 3 8 allows users to run several simulations at one time varying one parameter each time This is intended to allow the user to see the effects of different values of one parameter and to aid in the overal

Download Pdf Manuals

image

Related Search

Related Contents

AVerTV 6 - AVerMedia    Epson EB-W16 [240v]  Timex 843-095002-02 EU Heart Rate Monitor User Manual  6805-GG0 Licuadora de 12 velocidades  スズキ ラパン リモコン電池の交換時の留意点  V6801-741-00 - Schneider Electric    Zeppelin Owner d  Leica Depthmaster Système d`indication de profondeur  

Copyright © All rights reserved.
Failed to retrieve file