Session 2: Basic operation and simulation of a wind turbine
2.1 Aims and Objectives
The aim of this task is to develop a simple model of a wind turbine in Matlab / Simulink, while the objective is to better understand the operation of the turbine. The general principles behind developing this model can be applied to any control scheme used for your project in Simulink.
2.2 Introduction to the Wind Turbine
An introduction to the theory and principles of a wind turbine was given in Session 1, while the main equations will be repeated below for ease. The mechanical power that can be extracted from the wind is given by (1):
𝑃 =1𝜌𝐴𝑣3𝐶 (𝜆,𝛽) 𝑚𝑒𝑐h 2 𝑝
(1)
The equations for the coefficient of power and the values to use for the simulation are given in (2, 3, and 4):
𝐶𝑝(𝜆,𝛽)=𝑐1(𝑐2𝜆𝑖 −𝑐3𝛽−𝑐4)𝑒
1 = 1 − 0.035 𝜆𝑖 𝜆 + 0.08𝛽 𝛽3 + 1
𝜆𝑖 +𝑐6𝜆
1 −𝑐5 1 (2)
(3)
Where:
𝑐1 =0.5176,𝑐2 =116,𝑐3 =0.4,𝑐4 =5,𝑐5 =21,𝑐6 =0.0068 (4) The equation for the Tip Speed Ratio (TSR) is given by (5):
Page 1 of 17
𝜆 = 𝜔𝑇𝑅 (5) 𝑣
For the simulation use a value of 𝑅 = 5𝑚 for the wind turbine blade radius, and an air density of 1.225 kg/m3.
2.3 Task 1: Developing the wind turbine model using Simulink.
With the help of the standard blocks from the “Simulink” library, construct a wind turbine model in Simulink. On completion, the model should look like Fig. 1. (Don’t panic – see following instructions for some useful guidance!)
The following instructions assume you are using Matlab 2018a. Within Matlab open the Simulink library browser – this will give you a long list of libraries, each of which contains a large number of blocks which can be used to develop any given model. There are two options to open the library as shown in Fig. 2, either click on the button or type “Simulink” into the command window, this will open the “Simulink Start Page”. Choose “Blank Model”. A black model called “untitled” should appear; save this is a suitable place. To obtain the libraries, click the button as shown in Fig. 3, the library as shown in Fig. 4 should appear. For this model we are only using blocks from the standard “Simulink” library, in later sessions we will look at the “Simscape: Power Systems” library – this contains most of the basic elements required for simulating power electronics and electric drive systems. Feel free to explore the full contents of this library in your own time. Here we will just focus on the small number of components required to construct the wind turbine model.
Page 2 of 17
Figure 1: Wind Turbine Simulation
Page 3 of 17
Figure 2: Simulink Library Browser Options
Figure 3: To open Simulink Library
Figure 4: Simulink Library Browser
Page 4 of 17
Initially we will look at implementing the Tip Speed Ratio equation. Navigate to “Simulink: Sources” and right click on “In1” (Subsystem Input Port); selecting “Add block to…” this will add the block to your system. Copy and paste until there are three in your simulation, rename them by clicking on the “In1”, “In2”… as follows:
“In1”, “wind velocity (m/s)”
“In2”, “pitch angle (degrees)”
“In3”, “turbine rotor speed (rad/s)”
Navigate to “Simulink: Sinks” and insert two Subsystem output ports (“Out1”), renaming them:
“Out1”, “mechanical power (W)”
“Out2”, “mechanical torque (Nm)”
It is advantageous to include all the equations within a subsystem; this will keep your simulations tidy when you come to carry out your final project! To create a subsystem for the wind turbine equations select all the ports, right click on one of them and select “create subsystem…”, once you have renamed the subsystem you should see a block like Fig. 5.
Figure 5: Wind Turbine Subsystem
To implement the equation you will need to add the following blocks to your subsystem:
“Constant”, “Sum”, “Mux”, and “Scope” which can be found in “Simulink: Commonly
Used Blocks”, and an “Fcn” block in “Simulink: User-defined functions”.
The easiest way to add these to your wind turbine system is to have Wind Turbine Subsystem open by double clicking on it, and then when choosing a component from the “Simulink Library Browser” and right clicking on it, it should say “Add to Filename/Wind Turbine”.
Page 5 of 17
“Scope” blocks can have a limitation with the number of data points they save, it is recommended that you remove this limit. As shown in Fig. 6, if you click on the “Configuration Properties” button (highlighted in red) and click on the “Logging” tab, you can remove the limitation.
Figure 6: Scope Parameters
Page 6 of 17
Once arranged the blocks should look like Fig. 7.
Figure 7: Tip Speed Ratio Simulink Implementation
Constants 1 and 2 are added to avoid any issues with division by zero errors throughout the simulation. The mux block simplifies signal routing by combining several input signals into vector; to change the number of inputs double click on it. The user defined function block has been renamed “tip speed ratio (lambda)” and allows mathematical expressions to be input. In the case shown in Fig. 7, for the mux block, 𝑅 is input one, 𝑣 is input two, and 𝜔𝑇 is input three, and these will be in the same order for the user defined function. Therefore, the Tip Speed Ratio equation shown in (5) can be expressed within the user defined block as (6). NOTE: be careful with the placement of the brackets used!!
𝜆 = 𝜔𝑇𝑅 (5) 𝑣
(u(3)*u(1))/u(2) (6)
To check if this section has been correctly implemented, add the inputs as shown in Fig. 8,
where the ramp input is found in “Simulink: Sources” with the settings of Fig.9.
Page 7 of 17
Figure 8: Subsystem Inputs
Figure 9: Ramp parameters
2.4 Task 2: Verifying the characteristics of the circuit
If your Simulation has been correctly implemented, it is now time to simulate the circuit. The simulation time and run buttons are highlighted in Fig. 10, but a more in depth set of simulation settings can be accessed in “Simulation: Model Configuration Parameters”. For this simulation set the stop time to 10 seconds with the solver options as shown in Fig. 11, and then run the simulation. To check your implementation the output should look like Fig. 12.
Figure 10: Run and Time Buttons
Page 8 of 17
Figure 11: Simulation Settings
Figure 12: Tip Speed Ratio Result
Fix any errors with the simulation if necessary, then proceed to study the circuit as follows:
Page 9 of 17
2.5 Further Development of the Model
For the coefficient of power, (2) and (3) need to be implemented, this can be seen in Fig. 13 using the same techniques previously discussed. For (3) the user defined block code is shown in (7).
1 = 1 − 0.035 𝜆𝑖 𝜆 + 0.08𝛽 𝛽3 + 1
(3)
(1/(u(1)+(0.08*u(2))))-(0.035/((u(2)^3)+1)) (7)
For (2) I will let you try and implement the code for the user defined function block, put your final version in (8). Hint: for the user defined function, 𝑢(1) = 𝑐1, 𝑢(2) = 𝑐2, 𝑢(3) = 𝑐3, 𝑢(4) = 𝑐4,𝑢(5)=𝑐5,𝑢(6) = 𝑐6,𝑢(7)=𝜆,𝑢(8)=1⁄𝜆𝑖, and𝑢(9)=𝛽. To check your implementation the result should look like Fig. 13…………………….
1 −𝑐5 1 (2) 𝐶𝑝(𝜆,𝛽)=𝑐1(𝑐2𝜆𝑖 −𝑐3𝛽−𝑐4)𝑒 𝜆𝑖 +𝑐6𝜆
(8)
Page 10 of 17
Figure 13: 𝑪𝒑 Simulink Implementation
Page 11 of 17
Figure 14: Cp result
From your result what is the maximum value of 𝐶𝑝 when 𝛽 = 0? And why does 𝐶𝑝 go negative?
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
Page 12 of 17
Since the 𝐶𝑝 equation has now been correctly implemented and Fig. 14 confirmed, implement equations (1) and (9) to calculate the mechanical power and torque. When you have decided on the user function for (1) place it in (10). Hint: for the mechanical power user defined function, 𝑢(1) = 𝜌, 𝑢(2) = 𝐴, 𝑢(3) = 𝐶𝑝, 𝑢(4) = 𝑣. The final version should look like Fig. 1.
𝑃 =1𝜌𝐴𝑣3𝐶 (𝜆,𝛽) 𝑚𝑒𝑐h 2 𝑝
(1) 𝑇 =𝑃 ⁄𝜔 (9)
𝑚𝑒𝑐h 𝑚𝑒𝑐h 𝑇
(10)
If correctly implemented the results of the mechanical power and torque should look like Figs. 15 and 16. What are the maximum power and torque values seen?
Power: Torque:
Figure 15: Mechanical power result
Page 13 of 17
Figure 16: Mechanical torque result
2.6 Task 3: Verifying the full model
If everything has been input correctly, and the simulation works correctly it is now time to see the effect of varying parameters.
It is standard to see the coefficient of power being plotted against the Tip Speed Ratio as shown in Session 1 and Fig. 17; this is for the conditions previously given. For the same wind and turbine speeds alter the value of 𝛽 to 0, 5, 10, 15, 20 and 25 degrees, plot each and find the maximum 𝐶𝑝 and corresponding Tip Speed Ratio for each. These can be plotted on Fig. 18.
Hint: the “To Workspace” block in “Simulink: Sinks” might be useful here, set the “Save format” parameter to “Array”. The “plot” command in the command window can then be used!
Page 14 of 17
Figure 17: Example 𝑪𝒑 vs. TSR
Figure 18: 𝑪𝒑 Results
Page 15 of 17
Angle (Degrees)
𝐶𝑝
Tip Speed Ratio (𝜆)
0
5
10
15
20
25
Another common response is to see the mechanical wind turbine power vs. turbine rotor speed. For the initial conditions of 𝛽 = 0 and 𝑅 = 5𝑚, plot the power responses for four different wind speeds: 5, 6, 8, and 10m/s. Calculate the maximum power and corresponding rotor speed. These can be plotted on Fig. 19.
Figure 19: Mechanical Power Results
Page 16 of 17
Wind Velocity (m/s)
Maximum Power (W)
Rotor Speed (𝜔𝑟) (rad/s)
5
6
8
10
2.7
Some general tips on simulation modelling
If it works first time, think yourself lucky! It is rare that a simulation model will work as expected first time round – like it or not, you are going to have to debug the simulation!
When debugging a simulation, consider the problem logically and where possible simplify things as much as possible. Try to confirm that the subsystems within the model behave properly first.
No matter how small or obvious you think it is, never assume something is okay until you have checked it properly. Has this been verified on the scope?
Most important of all: A simulation model should generally be used to confirm your understanding of the system. It should not be used to generate answers to something you do not understand!! When questioned, you should be prepared to explain the result.
Page 17 of 17