Fuzzy control problem: input 2 expects a value in range [-50 50], but has a value of 1035.94

I got these warning while running my model
Warning:In 'bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller', input 2 expects a value in range [-50 50], but has a value of 1035.94.
Warning:In 'bismillahfuzzysmc/SMC Controller/Position Controller XY/X Position Controller/Fuzzy Logic
Controller
with Ruleviewer/Fuzzy Logic
Controller', no rules fired for Output 1. Defuzzified output value set to its mean range value 0.
I already tried to adjust the input 2 but still got those warnings
Here's the block :
Here's the fis file:
[System]
Name='Ux3_'
Type='mamdani'
Version=2.0
NumInputs=2
NumOutputs=1
NumRules=49
AndMethod='min'
OrMethod='max'
ImpMethod='min'
AggMethod='max'
DefuzzMethod='centroid'
[Input1]
Name='x'
Range=[-5.5 5.5]
NumMFs=7
MF1='NH':'trapmf',[-6.875 -5.5 -4.95 -3.575]
MF2='NM':'trimf',[-4.675 -3.575 -2.2]
MF3='NL':'trimf',[-3.575 -2.2 -0.825]
MF4='Z':'trimf',[-0.825 0 0.825]
MF5='PL':'trimf',[0.825 2.2 3.575]
MF6='PM':'trimf',[2.2 3.575 4.95]
MF7='PH':'trapmf',[3.575 4.95 6.325 7.7]
[Input2]
Name='x_derivative'
Range=[-50 50]
NumMFs=7
MF1='NH':'trapmf',[-58.33 -50 -41.67 -33.33]
MF2='NM':'trimf',[-41.67 -33.33 -25]
MF3='NL':'trimf',[-33.33 -20 -8.333]
MF4='Z':'trimf',[-8.333 0 8.333]
MF5='PL':'trimf',[8.333 20 33.33]
MF6='PM':'trimf',[25 33.33 41.67]
MF7='PH':'trapmf',[33.33 41.67 50 58.33]
[Output1]
Name='output1'
Range=[-2e-06 2e-06]
NumMFs=7
MF1='NH':'trapmf',[-2.7e-06 -2.2e-06 -1.557e-06 -1.057e-06]
MF2='NM':'trimf',[-1.557e-06 -1.057e-06 -5.568e-07]
MF3='NL':'trimf',[-1.057e-06 -5.568e-07 -5.68e-08]
MF4='Z':'trimf',[-1.72e-08 0 3.6e-08]
MF5='PL':'trimf',[9e-08 5.9e-07 1.09e-06]
MF6='PM':'trimf',[5.9e-07 1.09e-06 1.59e-06]
MF7='PH':'trapmf',[1.09e-06 1.59e-06 2.088e-06 2.588e-06]
[Rules]
1 1, 7 (1) : 1
2 1, 7 (1) : 1
3 1, 7 (1) : 1
4 1, 7 (1) : 1
5 1, 6 (1) : 1
6 1, 5 (1) : 1
7 1, 4 (1) : 1
1 2, 7 (1) : 1
2 2, 7 (1) : 1
3 2, 7 (1) : 1
4 2, 6 (1) : 1
5 2, 5 (1) : 1
6 2, 4 (1) : 1
7 2, 3 (1) : 1
1 3, 7 (1) : 1
2 3, 7 (1) : 1
3 3, 6 (1) : 1
4 3, 5 (1) : 1
5 3, 4 (1) : 1
6 3, 3 (1) : 1
7 3, 3 (1) : 1
1 4, 7 (1) : 1
2 4, 6 (1) : 1
3 4, 5 (1) : 1
4 4, 4 (1) : 1
5 4, 3 (1) : 1
6 4, 3 (1) : 1
7 4, 2 (1) : 1
1 5, 6 (1) : 1
2 5, 5 (1) : 1
3 5, 4 (1) : 1
4 5, 3 (1) : 1
5 5, 3 (1) : 1
6 5, 2 (1) : 1
7 5, 2 (1) : 1
1 6, 5 (1) : 1
2 6, 4 (1) : 1
3 6, 3 (1) : 1
4 6, 3 (1) : 1
5 6, 2 (1) : 1
6 6, 2 (1) : 1
7 6, 1 (1) : 1
1 7, 4 (1) : 1
2 7, 3 (1) : 1
3 7, 3 (1) : 1
4 7, 2 (1) : 1
5 7, 1 (1) : 1
6 7, 1 (1) : 1
7 7, 1 (1) : 1

Answers (1)

Hi Rafi,
Based on your Simulink model, Input 2 refers to the time derivative of the error signal. In the fuzzy system, you have set the Range to [-50 50], but in your Simulink model, you did not limit the output of the derivative block.
For instance, if there is an ideal discontinuous jump in the error signal, the slope of the signal at the instantaneous jump would be infinity. In your case, the slope of the measured error signal is 1035.94. However, this value is outside of the specified range of [-50 50]. Consequently, it triggers the corresponding Warning message.
I would suggest addressing the first Warning message first, before moving on to the second Warning message.

8 Comments

I tried but putting a saturation block, turns out it works. But there's another warning :
Solver is encountering difficulty in simulating model 'bismillahfuzzysmc' at time 10.81564713896358. Simulink will continue to simulate with warnings. Please check the model for errors.
Caused by:
Solver was unable to reduce the step size without violating minimum step size of 3.84249E-14 for 1 consecutive times at time 10.8156. Solver will continue simulation with the step size restricted to 3.84249E-14 and using an effective relative error tolerance of 0.0167282, which is greater than the specified relative error tolerance of 0.001. This usually may be caused by the high stiffness of the system. Please check the system or increase the solver Number of consecutive min steps violation parameter.
Thank you for the additional information. Based on your latest update, the 3rd error suggests that your custom fuzzy SMC is unable to stabilize the system. This issue is likely caused by the newly added Saturation block in your Simulink model.
The actual time derivative of the error signal appears to be much higher than the range of [-50, 50] that you have set. However, by forcefully limiting the output to this range, you may have introduced further instability in the system.
From the block diagram above, your Controller equation looks like this:
Controller = m/U₁·{xᵣ" + 10·(2·e + de/dt) + 42.6468·de/dt + [ƒ(e, de/dt) + a₁]·sign(2·e + de/dt)}.
To prevent the sudden discontinuous jump in the error that causes the very high slope (> 1000), insert a low pass filter (50/amp)/(s + 50/amp) at the Desired reference input signal, where amp is the amplitude of the desired signal. The Saturation block is not needed.
The method will limit the amplitude of de/dt in the range [-50, 50]. Please refer to this example:
https://www.mathworks.com/matlabcentral/answers/2118566-fuzzy-control-problem-1-input-2-expects-a-value-in-range-1-5-1-5-but-has-a-value-of-4-36559e-24#answer_1458246
for the low pass filter that you suggested, does it mean that I have to add a transfer fnc block as the low pass filter?
I have another question, for the low pass filter, where do I have to put it? is it before the derivative block or after the derivative block?
According to the signal processing theory, placing the lowpass filters at the indicated locations should keep Input 2 to the Fuzzy Logic block in the designed range [-50, 50], as long as the desired position is within the range [-10, 10].
if the designed range is about [-20, 20], does it mean the H(s) would be 2/(s+2)? And if this problem also occur at the pitch controller, do I need to do the same thing?
If the designed range of the input time derivative of the error (de/dt) to the Fuzzy Logic block is reduced to [-20, 20] m/s, then the desired position must not exceed this range of [-4, 4] m. The transfer function of the lowpass filter remains .
If the designed range of the position error 'e' to the Fuzzy Logic block is increased to [-20, 20] m, then the range of the input time derivative of the error (de/dt) to the Fuzzy Logic block must be increased to [-100, 100] m/s.
If your pitch controller has a similar fuzzy system design as the X controller, then the same approach can be implemented.

Sign in to comment.

Categories

Products

Release

R2023b

Asked:

on 1 Jun 2024

Commented:

on 4 Jun 2024

Community Treasure Hunt

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

Start Hunting!