Fuzzy Logic for Embedded Microcontrollers

Fuzzy logic doesn’t necessarily need lots of horsepower. Many embedded applications that use more traditional control schemes can benefit from the use of fuzzy logic. Back in 1995, Jim Sibigtroth explained how to keep things simple and speedy.

In Circuit Cellar 56, Sibigtroth writes:

After describing basic fuzzy logic concepts, this article explains how to implement fuzzy-inference algorithms in a general-purpose embedded controller. The examples, written in assembly language, are for an MC68HC11, but the algorithms could be adapted for any general-purpose microcontroller. Code size is surprisingly small and execution time is fast enough to make fuzzy logic practical even in small embedded applications.

Perhaps because of its strange sounding name, fuzzy logic is still having trouble getting accepted as a serious engineering tool in the United States. In Japan and Europe, the story is quite different. The Japanese culture seems to respect ambiguity, so it is considered an honor to have a product which includes fuzzy logic. Japanese consumers understand fuzzy logic as intelligence similar to that used in human decisions.

In the US, engineers typically take the position that any control methodology without precise mathematical models is unworthy of serious consideration. In light of all the fuzzy success stories, this position is getting hard to defend.

I think the European attitude is more appropriate. It recognizes fuzzy logic as a helpful tool and uses it. They regard the difficulties of the nomenclature as a separate problem. Since the term “fuzzy” has negative connotations, they simply don’t advertise that products include fuzzy logic.

Figure l--Traditional sets are simply defined by their endpoints. Fuzzy sets add a second dimension to express fhe degree of truth (on the y-axis), which allows sets to be defined with gradual boundaries between false and true.

Figure l: Traditional sets are simply defined by their endpoints. Fuzzy sets add a second dimension to express the degree of truth (on the y-axis), which allows sets to be defined with gradual boundaries between false and true.

Curiously, the results produced by fuzzy-logic systems are as precise and repeatable as those produced by respected traditional methods. Instead of indicating lack of precision, the term “fuzzy” more accurately refers to the way real-world sets have gradual boundaries.

When we say “the temperature is warm,” there is not a specific temperature at which this expression goes from completely false to completely true. Instead, there is a gradual or fuzzy boundary, which requires a nonbinary description of truth. In fact, the fuzzy logic definition for a set contains more information than the conventional binary definition of a set.

In conventional systems, the range of an input parameter is broken into sets that begin and end at specific values. For example, a temperature range described as warm might include the temperatures 56-84°F (see Figure la). The trouble with this thinking is that the temperature 84.01”F suddenly stops being considered warm. This abrupt change is not the way humans think of concepts like “temperature is warm.”

Read the entire article, which appeared in Circuit Cellar 56, 1995.

Member Profile: Scott Weber

Scott Weber

Scott Weber

Arlington, Texas, USA

Scott said he started his Circuit Cellar subscription late in the last century. He chose the magazine because it had the right mix of MCU programming and electronics.

He has always enjoyed mixing discrete electronic projects with MCUs. In the early 1980s, he built a MCU board based on an RCA CDP1802 with wirewrap and programmed it with eight switches and a load button.

Back in the 1990s, Scott purchased a Microchip Technology PICStart Plus. “I was thrilled at how powerful and comprehensive the chip and tools were compared to the i8085 and CDP1802 devices I tinkered with years before,” he said.

Scott said he recently treated himself to a brand-new Fluke 77-IV multimeter.

Scott is building devices that can communicate through USB to MS Windows programs. “I don’t have in mind any specific system to control, it is something to learn and have fun with,” he said. “This means learning not only an embedded USB software framework, but also Microsoft Windows device drivers.”

“Embedded devices are popping up everywhere—in places most people don’t even realize they are being used. It’s fun discovering where they are being applied. It is so much easier to change the microcode of an MCU or FPGA as the unit is coming off the assembly line than it is to rewire a complex circuit design,” Scott said.

“I also like Member Profile Joe Pfeiffer’s final comment in Circuit Cellar 276: Surface-mount and ASIC devices are making a ‘barrier to entry’ for the hobbyist. You can’t breadboard those things! I gotta learn a good way to make my own PCBs!”

Client Profile: Imagineering, Inc.

Imagineering, Inc.
2425 Touhy Avenue
Elk Grove Village, IL 60007


Contact: Khurrum Dhanji, KDhanji@PCBnet.com

Embedded Products/Services: Multilayer rigid and flex printed circuit boards, high-mix mixed-volume printed circuit board assembly

Join the quoting revolution happening now at PCBnet.com. No longer do you have to wait days for full turnkey quotes. Imagineering’s online systems take just minutes to give you quotes for PCBs, components, and assembly all in one place and all online!

Exclusive Offer: Place a full turnkey order with Imagineering for PCBs, components, and assembly labor and receive 25% off your bare boards and 10% off your labor! Imagineering also has daily specials online as well as a new customer promotion. PCBs for $10 per piece! See all the company’s offers at PCBnet.com.