Microcontrollers in Practice

This chapter contains an introduction to the principles of fuzzy control and the description of a simple temperature controller based on these principles.
Tuning a PID controller, i.e. adjusting the values of K p, T i, and K d, to obtain the desired response of the controlled process, can be a difficult task. The mathematical solution to this problem requires that the transfer function of the controlled process is known. In practice, real-world systems are seldom described by a simple and obvious transfer function. It would be much more convenient to define the behavior of the control system through simple sentences like this: "If the temperature is higher than the set-point and rising fast, then the output of the controller must be very low".
Fuzzy controllers work this way. Basically, a fuzzy controller is a control system that operates according to fuzzy logic. In fuzzy logic, the sentence "the element x is member of the set A" can be true to a degree of y%, which is equivalent to "the element x has a y% degree of membership to the set A". For example, when speaking about temperatures, the domain from 0 to 100 C can be divided in two subsets: cold, and warm. An object having a temperature of 15 C could be considered to be 60% cold and 40% warm.