I recently read a book called "Introduction to Control Engineering with Python". I'd like to try the Python-Control that comes out in it, so I'm going to try a frequency control simulation. Although it is included in the title of control, the main topic is power engineering.
・ Explanation of power system and frequency control ・ Try using Python-Control
It will be the contents.
The 100V electricity we use at home is not always 100V, but vibrates at regular intervals as shown in the figure below. At this time, the time change of voltage
For those who use electricity, the frequency of electricity is often treated as constant at 50 or 60Hz. However, the actual frequency is constantly changing, and if the frequency changes significantly, it may adversely affect electrical equipment. Therefore, the operator of the power system (that is, the power company) needs to control the frequency so that it does not fluctuate significantly.
Before explaining why the frequency fluctuates, let's first briefly explain the power system. The power system consists of a power plant that supplies power, consumers who consume power, and a transmission and distribution network that connects them. An important property of the power system is the principle of "simultaneous equal amount" (because electricity is difficult to store), where the power $ P_G $ supplied and the power $ P_L $ consumed must always match. However, the side that uses electricity (customers) wants to use as much electricity as they want, when they want, so the power plant must always match the generated power with the power consumption in order to achieve the same amount at the same time.
So how does the power plant adjust the generated power to the power consumption? It is not possible to grasp the power consumption of all consumers in real time. Therefore, ** frequency control ** becomes important.
The types of power plants are thermal power, hydroelectric power, and nuclear power generation. Recently, solar power generation and wind power generation are increasing, but I will not think about it this time. These power generation methods differ only in the part of how to obtain rotational energy (mechanical energy), but all the parts that convert mechanical energy to electrical energy are the same, and a "synchronous generator" is used.
As shown in the figure, by installing a generator on the same axis as the steam turbine, the mechanical output of the turbine is converted into electrical energy. At this time, the following relationship holds between the rotation speed of the rotor $ \ omega_m \ [\ rm {rad / s}] $ and the frequency $ f \ [\ rm {Hz}] $ of the voltage induced by the generator. I will.
-When $ P_m> P_g $, the frequency rises (oversupply) -When $ P_m = P_g $, the frequency is constant (supply and demand are balanced) -When $ P_m <P_g $, the frequency drops (insufficient supply)
In other words, it is necessary to measure the frequency of the power system, decrease the output of the generator when the frequency increases, and increase the output of the generator when the frequency decreases. Frequency control is feedback control that utilizes the relationship between supply and demand balance and frequency.
This time, let's consider the case where the generators of the entire power system are integrated into one unit. The block diagram of frequency control is as follows. The difference between the generator output and the load affects the frequency fluctuation. The system frequency characteristics in the figure take into account the frequency characteristics of the load in addition to the inertia of the generator. There are two main types of feedback loops, local control loops and global control loops.
In the local control loop, the generator governor (governor) measures the frequency and adjusts the amount of steam flowing into the turbine according to the frequency deviation. This makes it possible to maintain a balance between supply and demand even when the load fluctuates. However, even if the supply-demand balance can be maintained with only local control, the frequency will converge to a value deviated from $ 50 \ rm {Hz} $ due to a steady-state deviation.
Global control is controlled from the central power supply command center, which manages the power plant. The frequency deviation will occur only with local control, but here we will use integral control to command each generator to return the frequency to $ 50 \ rm {Hz} $ (this time one generator). ).
In addition, although simple integral control is used this time, the output is determined by comprehensively considering the speed characteristics and fuel cost of each generator in the actual system.
I referred to this article for how to use Python-Control. Get the response to the sine wave with PythonControl.
Now, I would like to simulate the frequency fluctuation with respect to the load fluctuation in Python. The sample code is put together at the end. First, as shown in the figure below, the control block is simplified and represented by a single transfer function. Using Python-Control makes it easier to handle transfer functions.
The simulation time is 100 seconds and the step is 0.01 seconds. It is assumed that the load fluctuation will increase by 10% 10 seconds after the start of the simulation.
Shows the time change of frequency deviation when load fluctuation is applied. The first is for local control only ($ K_I = 0 $). You can see that there is a steady-state deviation.
Next is the case of adding global control. It came back to 50Hz properly.
In this way, the power system constantly monitors the frequency and keeps adjusting the output of the power plant so that it can maintain 50Hz or 60Hz. However, it is difficult to control the output of renewable energy (wind power and solar power) power sources, which have been increasing in recent years, and this is a factor that reduces the frequency control capability. It seems that electric power companies are also struggling to cope with the ever-increasing number of renewable energy sources.
Actually, I wanted to make a simulation of the Hokkaido blackout in September 2018, but it was complicated and I didn't understand. So this time I tried the simplest frequency control one. I want to increase what I can do little by little.
If you are interested, please read this material. The frequency fluctuation just before the blackout is listed. What kind of phenomenon is blackout? -Institute of Electrical Engineers of Japan
Sample code
import numpy as np
from control.matlab import *
import matplotlib.pyplot as plt
def main():
#parameter settings
M = 10 #Inertia constant
D = 2 #Dumping
K_gov = 20 #Proportional control gain
K_I = 2 #Integral control gain
#Transfer function settings
System_frequency = tf(1, [M, D]) #System frequency characteristics
Governor = tf(K_gov, 1) #Governor control block
LFC = tf(K_I, [1, 0]) #LFC control block
G = - feedback(System_frequency, Governor + LFC) #System-wide transfer function
#Simulation settings
T = np.arange(0, 100, 0.01) # 0~100 seconds
dPL = np.array([0 if t < 10 else 0.1 for t in T]) #Load fluctuation setting(Step variation)
#Calculation
df, T, _ = lsim(G, dPL, T)
#plot
plt.figure(figsize=(9, 4))
plt.plot(T, dPL) #Load fluctuation
plt.grid()
plt.xlim(0, 100)
plt.figure(figsize=(9, 4))
plt.plot(T, (df+1)*50) #Frequency deviation
plt.grid()
plt.xlim(0, 100)
if __name__ == '__main__':
main()
plt.show()
Recommended Posts