Fuzzy Logic controller as a switch
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
Sam Chak
2024-3-14
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.
采纳的回答
Sam Chak
2024-3-14
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')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

