Vestas Develops Control Software for Wind Power Plants with Model-Based Design and Continuous Integration

“With Simulink and Embedded Coder, we can show our customers and grid operators a simulation that incorporates the actual code that will run in our power plant controller. That’s what grid operators want, and it gives Vestas an advantage over competitors who still use conventional approaches.”


Develop renewable power plant control software in compliance with grid codes that evolve and vary across regions


Use Model-Based Design with continuous integration to model controllers, automate simulation-based tests, and generate production code for industrial controllers


  • Reliable, problem-free code generated
  • Multisite CI workflow automated
  • Hardware lock-in avoided
Vestas turbines and power plant control.

Vestas turbines and power plant control.

With more than 66,000 turbines totaling more than 100 GW of installed wind power capacity in 80 countries, Vestas Wind Systems A/S has installed more wind power than any other company. Vestas engineers use Model-Based Design with continuous integration (CI) to develop Power Plant Control software and demonstrate compliance with grid codes to Vestas customers and grid operators.

“Grid operators want to see a simulation of how your plant will perform, and they want to know that the control code will match the simulation one-to-one,” says Per Hagen Nielsen, control systems software architect at Vestas Wind Systems A/S. “Today, not many companies can show this. At Vestas we can because we use Model-Based Design with MATLAB and Simulink to model and simulate our power plant control systems and then use those same models to generate C++ code for system-level simulation and production.”


Before adopting Model-Based Design for power plant control design, Vestas engineers used a conventional approach in which paper-based specifications and design documents developed by power engineers were handed off to software engineers, who wrote code for individual components or features by hand. The power engineers ran simulations using PSCAD software, but these simulations focused on electrical power rather than software control. The simulations did not incorporate the control code, which meant there was little assurance that the PSCAD simulations reflected the system performance once the software was integrated and deployed. Vestas wanted to eliminate the potential for human error that comes with hand-coding while ensuring that its power systems simulations corresponded with the control software.

In addition, Vestas wanted to enable engineering teams that spanned five countries in Europe and Asia to work together on the same projects—and in some cases, on the same models. This geographically dispersed team needed to apply version control to models, manage frequent merges, and automate simulation-based tests. To meet these requirements, Vestas decided to use CI with Jenkins™ and to incorporate CI principles into an engineering workflow based on modeling, simulation, and code generation.


After securing support from senior management, Vestas power system engineers established a new workflow for power plant control design that combines CI and Model-Based Design with MATLAB® and Simulink®.

When a grid code change is proposed or a customer requests a new feature or component, Vestas engineers create a set of formal requirements. Based on the requirements, one group develops test cases with Simulink and Simulink Test™ that will be used to verify the new feature, while a second group designs the new feature in Simulink and Stateflow®.

To create a system model for closed-loop simulations, engineers in this second group combine the control model with a Simulink model that captures the impedance and dynamic characteristics of the grid at the point of connection with the plant. Using a Simulink S-function, they incorporate a wind turbine model that is developed in a proprietary tool and packaged as a DLL by another Vestas group.

After running closed-loop simulations with this system model and running checks to ensure compliance with modeling standards based on MathWorks Automotive Advisory Board (MAAB) guidelines, the engineers check the control model into a Git repository. The model check-in triggers a Jenkins job that runs the test cases developed earlier with Simulink Test, as well as additional simulation-based tests created by the power engineers and another round of modeling guideline compliance checks.

If the control model passes all tests and checks, Jenkins invokes Embedded Coder® 1 to generate C++ code from the model. The generated C++ code is compiled into a DLL, which is then used in PSCAD to run simulations of the full plant and its control software.

Vestas uses these simulations to demonstrate to transmission system operators how the plant will perform when connected to the grid under normal conditions and in the presence of voltage drops, oscillations, and other disturbances. Finally, the generated code is tested on the target industrial control system before being deployed into production.


  • Reliable, problem-free code generated. “We face penalties if our control systems do not perform as they should,” says Nielsen. “With Simulink and Embedded Coder, we learned quite fast that we could trust the code we generate—in fact, we haven’t found a single issue with it.”
  • Multisite CI workflow automated. “We have dozens of engineers worldwide working in parallel on the same model with lots of merges,” Nielsen says. “Using Model-Based Design and CI together, we’ve shortened iterations and automated testing processes.”
  • Hardware lock-in avoided. “In the past, we developed controllers by writing custom structured text for a PLC platform, which meant we were tightly bound to that platform,” says Nielsen. “Today, we generate portable C++ code from our Simulink models, giving us the flexibility to use alternative industrial controls platforms.”

1 A Client Access License may be required to use Embedded Coder on Jenkins or other CI machines.