Design and implement digital control for grid-tied inverters
A grid-tied inverter is a power electronics device that converts direct current (DC) to alternating current (AC) so that electricity from an external power source (such as a solar plant) can be injected into a power grid. At the heart of the grid-tied inverter is a digital controller that regulates power electronics to perform power conversion and drive power output.
Engineers developing grid-tied inverters design and implement digital control to ensure the safety and efficiency of power conversion and injection. Some of the most important design objectives of the digital controller are:
- Generating stable AC power output that adheres to the grid code and meets NERC guidelines
- Maximizing power output under varying conditions
- Maintaining the inverter-grid connection during grid faults
- Providing anti-islanding protection in an event of grid outage
The controller design process can be broken down into three main stages: designing and optimizing controls using electrical systems simulation, generating code for the plant and the controller, and testing the control hardware using hardware-in-the-loop (HIL) simulation.
Design and Optimize Controls Using Electrical Systems Simulation
With Simulink and Simscape Electrical, you can create a schematic model for the grid-tied inverter and perform power electronics simulation. You can design and tune the inverter’s control algorithm, such as PID control, for regulating output voltages. The maximum power point tracking (MPPT) algorithm can be used to maximize the power output of the inverter under different conditions. You can design a fault ride-through (FRT) algorithm for the controller to provide reactive power support during low-voltage grid faults.
The digital control strategy of the grid-tied inverter can be tested against different grid codes, such as IEEE® 1547-2018, to ensure full compliance with the grid code. Simulink and Simscape Electrical provide capabilities for performing power system simulation and optimization. The entire power system that includes the power plant, the inverter, and the power grid can be modeled and simulated by connecting the inverter model to the external power source model (such as a photovoltaic plant) and a power grid model.
Simulation results from the model, such as the inverter’s output characteristics, can be easily visualized using Simscape™ logging.
Generate Code for the Plant and the Controller
After modeling and simulating the controller, you can generate defect-free, optimized C code for the controller using Embedded Coder®. The hardware support packages for Embedded Coder make it easy for you to deploy the code to supported microcontrollers. You can also generate C and HDL code for the plant by using Simulink Coder™ and HDL Coder™. The code can then be deployed to a Speedgoat® real-time target machine with a multi-core CPU and FPGA running Simulink Real-Time™.
Test the Control Hardware Using HIL Simulation
With the code deployed on the microcontroller and the Speedgoat target machine, you can perform power electronics hardware-in-the-loop (HIL) testing and thoroughly test the digital control for the inverter under normal and fault conditions.
HIL simulation enables you to replace production hardware with a real-time system. This mitigates the cost of testing and helps avoid potential damage and danger in a high-voltage production electrical system. With HIL testing, it is easy, fast, and safe to automate the testing of digital control for grid-tied inverters, especially under fault conditions.
Examples and How To
See also: simulation software, modeling and simulation, Simulink control design, PID tuning, MATLAB and Simulink for embedded code generation, Speedgoat hardware support for real-time simulation and testing from Simulink Real-Time