Playing Control with STM32F407 - Compound Fuzzy Control

Publisher:keiss2018Latest update time:2018-10-20 Source: eefocusKeywords:STM32F407 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Personally, I think that control theory is all mathematics, and it is a specialized kind of mathematics, or an applied mathematics. Fuzzy control is no exception. It is based on fuzzy set theory. Fuzzy sets can be seen as an extension of ordinary sets. So what is a set? Sorry, there is no definition. Sets are initial concepts, undefined concepts. The understanding of undefined concepts can be aided by axioms, which can be seen as the definition of initial concepts. Now that we have gone too far, let's go back to sets. How do we understand sets? Sets can be roughly seen as the sum of things with the same attributes. What is a fuzzy set? Let's put it this way. For example, when we describe a person, his attributes can include beauty, ugliness, temperament, height, fatness, etc. Old age, etc., how good is the appearance, how good is the temperament, in fuzzy sets, the membership is used to express it, for example, define a fat set A, the big fat person a1, the membership degree of A is 1.0, the medium fat person a2, the membership degree of A is 0.8, the little fat person a3, the membership degree of A is 0.65, the normal weight person a4, the membership degree of A is 0.5, ..., the super thin person an, the membership degree of A is 0, so the fuzzy set A can be expressed as: A=1.0/a1+0.8/a2+0.65/a3+0.5/a4+...+0.0/an, on the basis of fuzzy sets, fuzzy relations, fuzzy reasoning and other operations are developed.

The principle of fuzzy control is shown in Figure 1 (see Yi Jikai's "Intelligent Control Technology"). The general working process is: calculate the deviation change rate, transform the deviation and the deviation change rate into fuzzy quantity, infer the fuzzy control quantity according to certain fuzzy rules, and clarify the fuzzy control quantity as the actual output to control the controlled object. The details of the whole process are shown in Figure 2 (see Sun Zengqi's "Intelligent Control").

The steps to implement fuzzy control are as follows:

1. Determine the membership function of the language variables x, y and z, which is generally expressed in a table.

2. Determine the fuzzy control rule table.

3. Calculate the control table based on 1 and 2. For details of 1-3, please refer to the previous blog post "Using MATLAB to Play Control - Fuzzy Control Output Table".

4. Determine the values ​​of quantization factors k1, k2, and k3 based on prior knowledge or experience of the controlled object. However, it should be noted that the adjustment of k1, k2, and k3 values ​​is like the PID parameter setting, which is not an easy task. If the optimization theory is applied, the best parameters can be obtained, and even the fuzzy control output table can be optimized using the optimization theory. In the future, I may write a special article on the application of optimization theory in control, so I will not discuss it here.

5. In C language, the fuzzy control output table can be represented by a two-dimensional array Fuzzy. There is enough (variable) memory space available in STM32F407, so it can be directly defined as float or double type, x0 and y0 are defined as int type, and then the fuzzy control output can be obtained by Fuzzy[x0][y0]. This value is multiplied by k3 to get the actual control value u, where u is a real number.

The composite fuzzy control is based on fuzzy control with a PID controller, as shown in Figure 3. When the deviation is large, fuzzy control is used, while when the deviation is small, PID control is used. The composite fuzzy control we implemented on STM32F407 has a control effect as shown in Figure 4. It can be seen from the figure that the controlled object is a large pure lag system, and the control effect is quite good, which is achieved without carefully adjusting the quantization factors k1, k2, k3 and PID parameters.

 

Playing Control with STM32F407 - Compound Fuzzy Control

 

 

 

 

Playing Control with STM32F407 - Compound Fuzzy Control

 

 

 

Playing Control with STM32F407 - Compound Fuzzy Control

 

 

Playing Control with STM32F407 - Compound Fuzzy Control


Keywords:STM32F407 Reference address:Playing Control with STM32F407 - Compound Fuzzy Control

Previous article:Playing Control with STM32F407 - Adaptive Fuzzy PID Control
Next article:Playing control with STM32F407 - PID parameter automatic tuning by mode identification method

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号