Fuzzy Logic controller as a switch

2 views (last 30 days)
How can I use mamdani fuzzy logic controller as a switch in case of capacitor switching for power factor correction. Here fuzzy logic controller is used as to decide which capacitor should operate for the required power factor?
  2 Comments
Sam Chak
Sam Chak on 14 Mar 2024
Are you seeking a discrete switch similar to an 'ON' / 'OFF' switch that outputs the values of '1' and '0'? It's important to determine this in order to assess whether a Mamdani fuzzy controller would be a suitable candidate for fulfilling that function.
Maria Theresa
Maria Theresa on 14 Mar 2024
Yes, I am seeking switch similar to ON/OFF, which can show values 0 or 1 as output in diplay. 0 or 1 indicating whether capacitor is on or off

Sign in to comment.

Accepted Answer

Sam Chak
Sam Chak on 14 Mar 2024
Typically, generating discrete '1' / '0' values using a Mamdani FIS can be challenging due to the intricate defuzzification steps involved. However, I can assist you in creating the fundamental fuzzy structure of an ON/OFF-like switch using a specialized Mamdani FIS. As for the remaining switching logic of the capacitor, you will need to figure it out, as power factor correction is not within my area of expertise. Best of luck!
fis = mamfis('Name', "Fuzzy_Mamdani_Switch");
% Fuzzy Input
fis = addInput(fis, [-1, 1], 'Name', 'Criterion'); % set the range of Criterion
fis = addMF(fis, 'Criterion', 'linzmf', [0 0], 'Name', 'N'); % set the threshold point
fis = addMF(fis, 'Criterion', 'linsmf', [0 0], 'Name', 'P'); % must be the same threshold
% Fuzzy Output
fis = addOutput(fis, [-0.48675496688741717, 1.5], 'Name', 'Decision'); % DO NOT ADJUST!
fis = addMF(fis, 'Decision', 'linzmf', [0.5 0.5], 'Name', 'OFF'); % DO NOT ADJUST!
fis = addMF(fis, 'Decision', 'linsmf', [0.5 0.5], 'Name', 'ON'); % DO NOT ADJUST!
% Plot membership functions
figure(1)
subplot(211)
plotmf(fis, 'input', 1), grid on, title('Input MFs for Criterion')
subplot(212)
plotmf(fis, 'output', 1), grid on, title('Output MFs for Decision')
% Rules
rules = [...
"Criterion==N => Decision=OFF"; ...
"Criterion==P => Decision=ON"; ...
];
fis = addRule(fis, rules);
% Plot output of FIS
figure(2)
opt = gensurfOptions('NumGridPoints', 20001);
gensurf(fis, opt), grid on, axis([-1, 1, -0.5, 1.5])
yline(1, '--', 'ON state', 'color', '#808080');
yline(0, '--', 'OFF state', 'color', '#808080', 'LabelHorizontalAlignment', 'left', 'LabelVerticalAlignment', 'bottom');
title('Capacitor Status')

More Answers (0)

Categories

Find more on Fuzzy Logic in Simulink in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!