PDF (Thesis) - Nottingham eTheses - University of Nottingham
PDF (Thesis) - Nottingham eTheses - University of Nottingham
PDF (Thesis) - Nottingham eTheses - University of Nottingham
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CHAPTER 6: SIMULATIONS OF INPUT AND OUTPUT SYSTEM EMI<br />
the practical rig (described in section 2.3) and possibly reduce the simulation time, a<br />
particular feature <strong>of</strong> Saber has been used: an external DLL (Dynamic Link Library)<br />
has been created in C Language and embedded within the simulation, to control the<br />
IGBTs. Usually the native Saber MAST language is used for the simulations, but that<br />
would mean to completely re-write the whole code written for the experimental DSP<br />
controller again for the simulator as well. Furthermore that code, because it would be<br />
in MAST language, before being executed will have to be interpreted by the simulator,<br />
and this process implies more effort for the processor, hence a longer simulation time.<br />
The DLL approach, instead, will provide a compiled "ready to use" code, which is thus<br />
more time efficient because it will be already in machine-language, directly executable<br />
by the CPU. The controller’s code, as it was written for the DSP, has been compiled in<br />
such DLL with just few modifications for the interface with the simulator. The modifi-<br />
cations in the C code, are reported in the following:<br />
• The inclusion <strong>of</strong> saber’s header file,×ÖÔ, that defines all the communication<br />
variables between the library<br />
such:ËÊÇÊÁÆÊÇÍÌÁÆÎÆÌÊÄß<br />
and the simulator.<br />
• The definition <strong>of</strong> all the input/output variables with the pre-defined variables Ò℄andÓÙØ℄, for exampleÒØÑÒÔ℄will declare that the first parameter<br />
passed from the simulator will be the simulation time.<br />
• The routine has been declared as<br />
all in uppercase, where the name "Ventreal" is the name <strong>of</strong> the DLL file.<br />
Apart from these amendments, the rest can be copy-pasted directly out <strong>of</strong> the modulation<br />
DSP’s source code straight into into the C code to be compiled to obtain the final<br />
Ì Ì Ì Ì Ì Ì ÚÒØÖÐØÑÎÎ<br />
DLL file; this code is included in Appendix B.1.<br />
ÎÎÖ ÎÎÖ ÎÎ ÎÎ ÎÎÖ Õ<br />
To use it within the MAST code <strong>of</strong> the converter’s, the declaration for the external DLL<br />
must be stated as such:ÓÖÒÚÒØÖÐand will be used as a function. In the case<br />
<strong>of</strong> this work the following line is used invoke the external library:<br />
It is clear to understand which are the input variables: the simulation time "time",<br />
the input voltages "V(VA) V(VB) V(VC)", the reference for the output voltages "V(Vra)<br />
V(Vrb) V(Vrc)", and the last is the modulation index "q". The library, starting from<br />
these value, will calculate the timings for all the switches and then pass them back to<br />
the simulator. Fig. 6.1 shows a direct comparison between the Matrix converter output<br />
voltage simulated with such DLL and the output experimentally measured. The input<br />
voltage is the standard mains, 230V at 50Hz, and the output frequency is set at 100Hz.<br />
72