0% found this document useful (0 votes)
14 views11 pages

FUZZY Systems Notes

Uploaded by

sreeharine1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views11 pages

FUZZY Systems Notes

Uploaded by

sreeharine1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

FUZZY SYSTEMS AND

GENETIC ALGORITHMS
EEPE-13

Department of Electrical and Electronics Engineering


National Institute of Technology
Tiruchirapalli

107122016
107122039
107122051
107122114
107122119
Fuzzy Logic Control of DSTATCOM for Improving Power Quality and
Dynamic Performance

Low voltage poor power quality can be caused by the demand in reactive power as
it loads up the supply system unnecessarily. This can also be due to harmonic
pollution and load imbalance as these cause extra stress on the networks and
excessive voltage imbalance causing stress on other loads connected to the same
network. Flexible AC Transmission Systems (FACTS) devices such as Static
Synchronous Compensator (STATCOM) can address the power quality issues
related to transmission lines while DSTATCOM can improve the power quality and
dynamic performance in a distribution network. A DSTATCOM is a shunt
connected bidirectional converter based device which can provide adequate level
of reactive power to improve the quality of electrical power.

Fuzzy controllers are designed for controlling the DC voltage, AC voltage, and
current regulators.A Sugeno type of fuzzy logic controller can overcome the
computational problem a complex system such as distribution power system
encounters in both software simulation and real-time implementation. A Sugeno
type fuzzy controller can be analysed and implemented more effectively than the
Mamdani type fuzzy controller. In addition, it is more convenient in mathematical
analysis and in system analysis quality and stability of a distribution network.

A study of the PI controlled and the fuzzy logic controlled DSTATCOM for
improving the power quality and dynamic performance of a distribution power
system is simulated using SimPowerSystem in MATLAB/Simulink environment.
The performances of the DSTATCOM controllers are evaluated during grid side
voltage sag and large load variations.

NL = Negative Large
NM = Negative Medium
NS = Negative Small
ZO = Zero
PS = Positive Small
PM= Positive Medium
PL = Positive Large.
The above linguistic quantification has been used in this paper to specify a set of
rules or a rule-base. The rules are formulated from practical experience. For the
FLC with two inputs and seven linguistic values for each input, there are 72 = 49
possible rules with all combination for the inputs. The tabular representation of the
FLC rule base (with 49 rules) of the fuzzy control based DC voltage regulator is
shown

CODE

1) % Power Quality Improvement using Fuzzy Logic Controller for DSTATCOM


2)
3) % Seed for reproducibility
4) rng(0);
5)
6) % System Parameters
7) v_s = 1.0; % Source voltage per unit (p.u.)
8) v_ref = 1.0; % Reference voltage p.u.
9) i_load = 0.8; % Load current p.u.
10) num_samples = 100; % Number of test cases
11) time = linspace(0, 10, num_samples); % Time vector from 0 to 10 seconds
12)
13)
14) % Fuzzy Logic Membership Functions Definition
15) trimf = @(x, params) max(min((x - params(1)) / (params(2) - params(1)),
(params(3) - x) / (params(3) - params(2))), 0);
16) trapmf = @(x, params) max(min(min((x - params(1)) / (params(2) - params(1)),
1), (params(4) - x) / (params(4) - params(3))), 0);
17)
18) % Define fuzzy membership functions for voltage error (v_error) and change in
voltage (v_delta)
19) v_error_range = -1:0.01:1; % Voltage error range in p.u.
20) v_delta_range = -1:0.01:1; % Change in voltage range in p.u.
21)
22) % Voltage error membership functions
23) v_error_neg_large = @(x) trapmf(x, [-1 -1 -0.5 -0.2]);
24) v_error_neg_small = @(x) trimf(x, [-0.5 -0.2 0]);
25) v_error_zero = @(x) trimf(x, [-0.2 0 0.2]);
26) v_error_pos_small = @(x) trimf(x, [0 0.2 0.5]);
27) v_error_pos_large = @(x) trapmf(x, [0.2 0.5 1 1]);
28)
29) % Voltage delta membership functions
30) v_delta_neg_large = @(x) trapmf(x, [-1 -1 -0.5 -0.2]);
31) v_delta_neg_small = @(x) trimf(x, [-0.5 -0.2 0]);
32) v_delta_zero = @(x) trimf(x, [-0.2 0 0.2]);
33) v_delta_pos_small = @(x) trimf(x, [0 0.2 0.5]);
34) v_delta_pos_large = @(x) trapmf(x, [0.2 0.5 1 1]);
35)
36) % Control output membership functions (DSTATCOM reactive power injection)
37) q_inj_range = -1:0.01:1; % Reactive power range in p.u.
38) q_inj_neg_large = @(x) trapmf(x, [-1 -1 -0.5 -0.2]);
39) q_inj_neg_small = @(x) trimf(x, [-0.5 -0.2 0]);
40) q_inj_zero = @(x) trimf(x, [-0.2 0 0.2]);
41) q_inj_pos_small = @(x) trimf(x, [0 0.2 0.5]);
42) q_inj_pos_large = @(x) trapmf(x, [0.2 0.5 1 1]);
43)
44) % Plotting Membership Functions for Inputs and Outputs
45) figure(1);
46) tiledlayout(3,1)
47)
48) % Plot Voltage Error Membership Functions
49) nexttile
50) plot(v_error_range, v_error_neg_large(v_error_range), 'b', 'LineWidth', 1.5);
hold on;
51) plot(v_error_range, v_error_neg_small(v_error_range), 'g', 'LineWidth', 1.5);
52) plot(v_error_range, v_error_zero(v_error_range), 'r', 'LineWidth', 1.5);
53) plot(v_error_range, v_error_pos_small(v_error_range), 'm', 'LineWidth', 1.5);
54) plot(v_error_range, v_error_pos_large(v_error_range), 'c', 'LineWidth', 1.5);
55) title('Voltage Error Membership Functions');
56) xlabel('Voltage Error (p.u.)');
57) ylabel('Membership Degree');
58) legend('Neg Large', 'Neg Small', 'Zero', 'Pos Small', 'Pos Large');
59) hold off;
60)
61) % Plot Voltage Delta Membership Functions
62) nexttile
63) plot(v_delta_range, v_delta_neg_large(v_delta_range), 'b', 'LineWidth', 1.5);
hold on;
64) plot(v_delta_range, v_delta_neg_small(v_delta_range), 'g', 'LineWidth', 1.5);
65) plot(v_delta_range, v_delta_zero(v_delta_range), 'r', 'LineWidth', 1.5);
66) plot(v_delta_range, v_delta_pos_small(v_delta_range), 'm', 'LineWidth', 1.5);
67) plot(v_delta_range, v_delta_pos_large(v_delta_range), 'c', 'LineWidth', 1.5);
68) title('Voltage Delta Membership Functions');
69) xlabel('Voltage Delta (p.u.)');
70) ylabel('Membership Degree');
71) legend('Neg Large', 'Neg Small', 'Zero', 'Pos Small', 'Pos Large');
72) hold off;
73)
74) % Plot Control Output Membership Functions
75) nexttile
76) plot(q_inj_range, q_inj_neg_large(q_inj_range), 'b', 'LineWidth', 1.5); hold
on;
77) plot(q_inj_range, q_inj_neg_small(q_inj_range), 'g', 'LineWidth', 1.5);
78) plot(q_inj_range, q_inj_zero(q_inj_range), 'r', 'LineWidth', 1.5);
79) plot(q_inj_range, q_inj_pos_small(q_inj_range), 'm', 'LineWidth', 1.5);
80) plot(q_inj_range, q_inj_pos_large(q_inj_range), 'c', 'LineWidth', 1.5);
81) title('Reactive Power Injection Membership Functions');
82) xlabel('Reactive Power Injection (p.u.)');
83) ylabel('Membership Degree');
84) legend('Neg Large', 'Neg Small', 'Zero', 'Pos Small', 'Pos Large');
85) hold off;
86)
87) % Define Fuzzy Rules in the form: {Voltage Error, Voltage Delta, Q Injection}
88) rules = {
89) {'Neg Large', 'Neg Large', 'Pos Large'};
90) {'Neg Large', 'Neg Small', 'Pos Small'};
91) {'Neg Small', 'Zero', 'Pos Small'};
92) {'Zero', 'Zero', 'Zero'};
93) {'Pos Small', 'Zero', 'Neg Small'};
94) {'Pos Large', 'Pos Large', 'Neg Large'};
95) };
96)
97) % Aggregation and Defuzzification
98) q_injection = zeros(num_samples, 1);
99)
100) for i = 1:num_samples
101) % Simulate voltage error and change in voltage
102) v_error = (rand * 2 - 1); % Random error in p.u.
103) v_delta = (rand * 2 - 1); % Random change in voltage in p.u.
104)
105) % Membership values for voltage error
106) v_error_memberships = [
107) v_error_neg_large(v_error), ...
108) v_error_neg_small(v_error), ...
109) v_error_zero(v_error), ...
110) v_error_pos_small(v_error), ...
111) v_error_pos_large(v_error)
112) ];
113)
114) % Membership values for voltage delta
115) v_delta_memberships = [
116) v_delta_neg_large(v_delta), ...
117) v_delta_neg_small(v_delta), ...
118) v_delta_zero(v_delta), ...
119) v_delta_pos_small(v_delta), ...
120) v_delta_pos_large(v_delta)
121) ];
122)
123) % Evaluate rules by calculating minimum (AND) of membership values
124) rule_strengths = [
125) min([v_error_memberships(1), v_delta_memberships(1)]); % Neg Large
- Neg Large -> Pos Large
126) min([v_error_memberships(1), v_delta_memberships(2)]); % Neg Large
- Neg Small -> Pos Small
127) min([v_error_memberships(2), v_delta_memberships(3)]); % Neg Small
- Zero -> Pos Small
128) min([v_error_memberships(3), v_delta_memberships(3)]); % Zero -
Zero -> Zero
129) min([v_error_memberships(4), v_delta_memberships(3)]); % Pos Small
- Zero -> Neg Small
130) min([v_error_memberships(5), v_delta_memberships(5)]) % Pos Large
- Pos Large -> Neg Large
131) ];
132)
133) % Aggregating fuzzy output for reactive power injection
134) pos_large_contrib = rule_strengths(1) * q_inj_pos_large(q_inj_range);
135) pos_small_contrib = rule_strengths(2) * q_inj_pos_small(q_inj_range) +
...
136) rule_strengths(3) * q_inj_pos_small(q_inj_range);
137) zero_contrib = rule_strengths(4) * q_inj_zero(q_inj_range);
138) neg_small_contrib = rule_strengths(5) * q_inj_neg_small(q_inj_range);
139) neg_large_contrib = rule_strengths(6) * q_inj_neg_large(q_inj_range);
140)
141) % Combine using element-wise max
142) aggregated_q_inj = max([
143) pos_large_contrib;
144) pos_small_contrib;
145) zero_contrib;
146) neg_small_contrib;
147) neg_large_contrib
148) ], [], 1);
149)
150) % Defuzzification (centroid method)
151) if sum(aggregated_q_inj) == 0
152) q_injection(i) = 0;
153) else
154) q_injection(i) = sum(q_inj_range .* aggregated_q_inj) /
sum(aggregated_q_inj);
155) end
156) end
157)
158) % Display the results for each test case
159) disp('Test Case | Voltage Error | Voltage Delta | Reactive Power Injection
(p.u.)');
160) for i = 1:num_samples
161) fprintf('%8d | %12.2f | %12.2f | %28.2f\n', i, v_error, v_delta,
q_injection(i));
162) end
163)
164) % Plot the Reactive Power Injection over Time
165) figure;
166) plot(time, q_injection, 'LineWidth', 1.5);
167) title('Reactive Power Injection by DSTATCOM over Time');
168) xlabel('Time (s)');
169) ylabel('Reactive Power Injection (Q_{inj}, p.u.)');
170) grid on;

RESULTS
INFERENCE
Dynamic Response of DSTATCOM to Voltage Fluctuations
• The DSTATCOM responds dynamically to variations in voltage error and
voltage change (voltage delta) by injecting or absorbing reactive power. By
using fuzzy logic rules, it quickly adapts to a wide range of operating
conditions, enhancing voltage stability in the distribution network.
2. Effectiveness of Fuzzy Logic in Handling Uncertainties
• The fuzzy logic controller can handle uncertainties and non-linear behaviors
associated with power systems, especially during transient disturbances. By
representing voltage conditions in linguistic terms (e.g., "Neg Large,"
"Zero," "Pos Large"), the system can manage imprecise and complex input
data, which traditional control methods might struggle with.
3. Stabilization of Reactive Power Injection
• The simulation results likely show how the DSTATCOM's reactive power
injection stabilizes over time, demonstrating the system's ability to maintain
voltage levels close to the reference voltage. The plot of reactive power
injection versus time provides insights into how well the fuzzy logic
controller minimizes deviations from desired voltage levels.
4. Impact of Different Voltage Conditions on Reactive Power Injection
• The fuzzy rules allow us to infer how varying conditions (like large negative
voltage errors or slight positive changes in voltage) impact the amount and
direction of reactive power injected by the DSTATCOM. For example, large
voltage errors may lead to larger reactive power injections, while minor
fluctuations lead to smaller adjustments.
5. Performance of Fuzzy Rules in Voltage Regulation
• By analyzing the output data, we can evaluate the effectiveness of each rule
in achieving stable voltage control. For instance, rules that lead to "Zero"
reactive power injection suggest stability, where the system’s voltage is near
the reference and no compensation is needed.

You might also like