| Static Var Generator(SVG)has been widely used in the field of reactive power compensation due to its simple structure,convenient maintenance,and rapid response.It is one of the important means of reactive power compensation in the current power system.This article takes into account that when using traditional development mode to develop static reactive power generators,it is difficult to write code and time-consuming and laborious in the testing and verification phases.The method of automatic generation based on Simulink model code is introduced to develop static reactive power generators.The software code writing,testing,and debugging of the control algorithm are completed using the Simulink toolbox.The main work content of this paper is summarized as follows:(1)Introduced the research background and current status of SVG,and selected voltage-type bridge circuit as the main loop of SVG and mathematically modeled it.The instantaneous reactive power theory is used to study the three reactive current detection methods of law,law and law,and law is selected as the reactive current detection method in this paper.The principle and realization method of voltage space vector modulation are introduced in detail.(2)The control system is designed according to the mathematical model of SVG.The current inner loop adopts PI feedforward decoupling control,and the voltage outer loop adopts sliding mode variable structure control;a simulation model is built in Simulink environment to verify the control algorithm.(3)The development process based on the automatic generation of Sumulink model code is introduced,the control strategy model is converted into code,and software-in-the-loop testing and processor-in-the-loop testing are used to verify the effectiveness of the code.Use Simulink toolbox to configure the DSP lowlevel driver.(4)Burn the automatically generated code into the high-power experiment platform,the equipment runs successfully and the DC side capacitor voltage is maintained near the given value.The experimental results show that the code generated by the Simulink model can be effectively run in the DSP. |