Intern © Siemens AG 2014 Alle Rechte vorbehalten. Answers for energy.
Model Based Design approach for HVDC applicationsMATLAB-EXPO, Munich 2014-07-09
Markus Engel, Siemens AG, E T TS PLM C&PCo-Authors: Sebastian Behnisch, Dr. Christian Siegl, Christina Zenk, Marcos Pereira, Kevin Römer
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 2 Engel / E T TS PLM
Agenda
Current situation
Challenges
Goals & Constraints
Solution
Conclusion
Outlook
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 3 Engel / E T TS PLM
Current situationTurnkey solution business & customers with high buying power We have to deal with manifold contributions – see hawker‘s tray of C&P
Control & Protection System
PAS
SICAM RTU
SIPROTEC 5
TFR Acquisition-PCs
1 2 3 4 65
TDCPLUS
Control
VBE
CCTV
S7 / PCS7 Komponents
Air ConditioningDiesel aggregatsRaw water
Chiller
Waste water
Fire detection
Door access
Weather data
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 4 Engel / E T TS PLM
Challenges: System & Software engineers work on parallel paths …
Susie‘s Simulation
Steven‘s Software
HVDC1: Blackhillock (1+2)
HVDC-Hub
HVDC5: Future B (DC Source)
HVDC4: Future A (DC Source)
HVDC2: Spittal (DC source)
VA
HVDC3: Kergord (DC Source)
VA
exBLK_4
exBLK_5VA
VA
DS
C_3
DS
C_3
DS
C_4
DS
C_4
DS
C_5
DS
C_5
DSC_2
DSC_2 DSC_1
DSC_1
wP_2
wP_4
wP_5
Udp_Hub
Udn_HubVA
VA
VA
VA
exBLK_11
exBLK_12
VA
VA
wP_12
wP_11
VA
VA
exBLK_2
HVDC2src
+-
HVDC12src
+-
Smpl_I Smpl_I
Smpl_I
HVDC11src
+-
wP_3
exBLK_3
Smpl_I
HVDC3src
+-
HVDC4src
+-
Smpl_I
HVDC5src
+-
Smpl_I
C1Cable2S1
C2S2
Cable2C
C1Cable2S1
C2S2
0.1 [ohm]
0.1 [ohm]0.1 [ohm]
0.1 [ohm]
+/- 320 kV @ 800MW37 km
C1Cable3S1
C2S2
Cable3C
C1Cable3S1
C2S2
0.1 [ohm]
0.1 [ohm]0.1 [ohm]
0.1 [ohm]
+/- 320 kV @ 600 MW255 km
Cable4C
+/- 320 kV @ 600 MW100 km
C1Cable4S1
C2S2
C1Cable4S1
C2S2
0.1 [ohm]
0.1 [ohm]0.1 [ohm]
0.1 [ohm]
C1Cable1S1
C2S2
Cable1C
C1Cable1S1
C2S2
0.1 [ohm]
0.1 [ohm]0.1 [ohm]
0.1 [ohm]
+/- 320 kV @ 1200 MW124 km
Cable5aC
C1Cable5aS1
C2S2
C1Cable5aS1
C2S2
0.1 [ohm]
0.1 [ohm]0.1 [ohm]
0.1 [ohm]
+/- 320 kV @ 800 MW200 km
VA
VA
VAVA
VA
C-programs(VHDL)
Electro-Magnetic Transients (EMT) simulation for development & optimizationof- control parameters & algorithms- steady state & dynamic performance- protection coordination
Software development in Step7/CFC (graphical & block-oriented language) & C/C++ / FPGA applications for- closed loop control- open loop control- protection and measurement
Sebastian‘s Software
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 5 Engel / E T TS PLM
Algorithms for- open-loop
- closed-loop- Protection
Electricalnetwork
models & control
algorithms
Closed loopalgorithms
Challenges: … with the same objects developed in different tools and they aredependent from each other!
Susie‘s Simulation
Steven‘s Software
EMT simulation needs- Control & protection algorithms- Communication delays- ….
Software development needs- Parameters / structure for control algorithms- ….
Sebastian‘s Software
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 6 Engel / E T TS PLM
Goal: One platform independent Model Based Design tool for all targets
Design Tool
Generate C-Code for DSP‘s
Generatefunction blocksfor Simatic TDC
(PLC)
Enable PC-basedtesting
Allow multiuserengineering
Generatefunction blocks
for EMT-simulations
Constraints:
Different automation platforms to besupported
EMT simulation program PSCAD isstate-of-the-art in HVDC business(often PSCAD models have to bedelivered to customers)
System & software engineers workin different departments
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 8 Engel / E T TS PLM
Which integration platform fits best?MATLAB/Simulink seems to be a feasible approach for HVDC
Criteria PSCAD CFC/TDC MATLAB/Simulink
integration in software development suite - - ++
rate of coverage of development lines -- - ++
test/commissioning support o ++ o
independency from automation platform o -- ++
working in distributed teams o + ++
know-how protection o o +
fulfillment of single-source principle - - ++
life cycle costs o o +
▲▲
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 9 Engel / E T TS PLM
Model Based Design approach using MATLAB/Simulink & code generationwith Embedded Coder
MATLAB/Simulink
OS1
TDC
OS2
DSP
OS3
PSCAD
OS1
…
OSx
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 10 Engel / E T TS PLM
MATLAB/Simulink & PSCADApproach is feasible, but some issues to be investigated!
USERFORTRAN
INTERFACE SUBROUTINE
P27AC_IF3.c
SIMULINKC CODE
MAIN PROGRAM
SIMULINKC CODE
PSCAD
P27ACinterface
test model
U_M_I1_AC_Volt_LL_2_or_3_PhaseU_M_I2_AC_Volt_LG_1_Phase_or_L
U_M_I3_AC_UVolt_LG_1_or_MU_M_Block_27AC_UVolt_or_3phl
U_M_Block_at_meas_FaultU_M_T1_Activ_Time_Stage1U_M_T2_Activ_Time_Stage2U_M_T2_Activ_Time_Stage3
U_M_TPW_Prewarning_Time
Y_M_OT1Y_M_OT2Y_M_PRWY_M_OT3
DWORK2
1
0.3
0.10
PDE counters (6)- Only here for test
0.130.16
110
USERC
INTERFACE FUNCTION
P27AC_IF3.f
Main approach: Unchanged use of C-code produced
automatically by Simulink Generation of lib files to be used by PSCAD
Optimal workflow to be developed with PSCAD users: Accessibility of parameters Avoid jumps between Simulink and PSCAD
as far as possible
Fortran wrapper for interfacing with PSCAD necessary Benchmark: Comparison of simulation results of Simulink-based block and original PSCAD block
without deviations
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 12 Engel / E T TS PLM
MATLAB/Simulink & Simatic TDC:Referenced models enable variant management, distributed engineering andefficient version control
One main model link to multiple and hierarchical referenced models
Implementation of different variants (e.g. different closed loop control structures) ofone referenced model possible (same external interfaces)
Integration with version control tools (e.g. SVN or GIT) possible
Referenced models enable distributedengineering
Clearness due to hierarchical structure
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 14 Engel / E T TS PLM
MATLAB/Simulink & Simatic TDC:Reuse of well-proven TDC library functions by C-macros and use of Legacy Code Tool
Integration of existing macros in Simulink:
C-Source file: hvdc_ccp_lib.cH-Header file: hvdc_ccp_lib.h
Use of Legacy Code Tool:
- Generates the following files:*.mex file for simulation*.tlc file for Simulink Coder
- Generation of library for Simulink
Exisiting function blockswhich should be re-used
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 15 Engel / E T TS PLM
MATLAB/Simulink & Simatic TDC:Automatic C-code generation for use in TDC function block generatorConventions defined and workflow tested
referenced model „CRPC“ MATLAB-Script Source files
TDC function block generatorgenerates library
Conventions:- Block names Simulink =
TDC connector names- Signalnames in Simulink=
comments in TDC- Single task within one model- Same datatypes
Additional connectors compared to original:- Version of Simulink model- Enable/disable input- Failure output- Internal variables output
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 16 Engel / E T TS PLM
MATLAB/Simulink & Simatic TDC:Runtime of Simulink generated function blocks is at least 50% less thanoriginal TDC function blocks by applying feasible granularity of packaging
performance advantage of Simulink-generated function blocks can bereached by packaging of suitablenumber of function blocks within oneSimulink model
Stateflow suitable for modelling ofplant sequences
1:1 conversion of standard functionblocks from Simatic TDC to Simulinknot feasible
Run
itme
in p
erce
nt
100
200
300
SimulinkSimatic TDC
Comparison of runtime on target platform between original Simatic TDC standard function blocks andidentical function within one function block generated from Simulink
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 18 Engel / E T TS PLM
MATLAB/Simulink & Simatic TDC:Simulink concept of constant values and signal busses is useful forparameterization of functions
All parameters are handled within separate referenced models, input e.g. via .csv file Distribution to „consumers“ via signal bus Existing procedures / tools for parameterizing remain as they are
PAM: Parameter ManagerPageTDC: Parameter Generation Tool for TDCHW Config Tool: Definition of hardware configurationFBGEN: generates function blocks from C-CodeStep 7: Engineering tool for Simatic TDC
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 20 Engel / E T TS PLM
MATLAB/Simulink & DSPBenchmark against interface-identical software of customer project positive
Critical issues:
• Code efficiency (due to very fast control cycle within µs-area)
• Proof of accurate dynamic performance
Benchmark executed in the following steps:
1. Implementation and test of developed algorithms in MATLAB/Simulink
2. Benchmark between automatic generated Simulink-based software and
(plain C) software of customer project
a) in offline simulation environment (PSCAD)
b) in realtime test environment
Benchmark Results: Control accuracy & dynamic performance nearly identical Runtime performance of Simulink-based control 14% better than original C-code
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 21 Engel / E T TS PLM
Conclusion
Overall feasibility of approach is proven andshows significant advantages! platform independency performance savings in project engineering
Closed loop control algorithms migratedinto Simulink models and tested
„One click solution“ for generation of TDC-and PSCAD-lib‘s
Intern © Siemens AG 2014 Alle Rechte vorbehalten.
17.06.2014Seite 22 Engel / E T TS PLM
Outlook
Migration and test of open-loop andprotection algorithms Use of stateflow Simulink based (automatic) component test setup Integration test in realtime simulation environment Benchmark of runtime behaviour against original
software
Integration of different components‘ models Enable PC based integration tests
Evaluation of Simulink‘s EMT simulationcapabilities
Intern © Siemens AG 2014 Alle Rechte vorbehalten. Answers for energy.
Thank you for your [email protected]