Fuzzy Logic controller as a switch

조회 수: 11 (최근 30일)
Maria Theresa
Maria Theresa 2024년 3월 14일
답변: Sam Chak 2024년 3월 14일
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
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.
Maria Theresa
Maria Theresa 2024년 3월 14일
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

댓글을 달려면 로그인하십시오.

채택된 답변

Sam Chak
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개)

카테고리

Help CenterFile Exchange에서 Fuzzy Logic in Simulink에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by