Brief Analysis on the Application of Fuzzy Logic Algorithm Control Design for Brushless DC Motor

Publisher:西周以前的Latest update time:2012-01-04 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
More and more companies are turning to variable speed drive motors to reduce energy consumption. This requires simplifying the design, shortening development time, and eliminating complex mathematical formulas by moving from differential (PID) controllers to systems based on fuzzy logic algorithms.

However, this presents new challenges for the motor. Controlling the speed of a brushless DC (BLDC) motor is complex when using traditional integral and derivative (PID) controllers because they rely on complex mathematical models and are computationally intensive.

Using fuzzy logic (FL) algorithms can eliminate the design process's reliance on complex mathematical formulas and provide an easy-to-understand solution. Another advantage of fuzzy logic (FL) engine control over (PID) differential controllers is that the development cycle is shorter. This article discusses the process of using fuzzy logic algorithms to control brushless DC motors using the Texas Instruments c28xx fixed-point DPS series.

The implementation of the fuzzy logic controller is composed of three modules. They are fuzzification, rule deployment and defuzzification. The following sections discuss the implementation of the fuzzy logic BLDC motor related modules.

Fuzzification

Fuzzification is the process of converting data with clear numerical values ​​into fuzzy data. The resulting fuzzy data is converted based on the fuzzy membership of the input variables. For this application, the motor control input variables are the rotation error (Error) and the rotation error difference (Cerror). The rotation error (Error) is the absolute rotation speed difference from one sampling time to the next sampling time. Similarly, the rotation error difference (Cerror) is the change in rotation error between one sampling time and the next sampling time. The formula is as follows:

Rotation error (Error) = SetSpeed ​​(set speed) - CurrentSpeed ​​(current speed)

Rotation error difference (Cerror) = rotation error (Error) - Previous Error (previous error)

As mentioned earlier, five member sets are defined for the rotation error (Error) variable and the rotation error difference (Cerror) variable:

1.NM: medium negative

2.NS: small negative value

3. ZE: Zero

4.PS: small positive value

5.PM: Moderately positive

Figure 1 shows five sets of members defined for the rotation error (Error) variable and the rotation error difference (Cerror) variable. These sets are triangularly overlapped to provide a good response. Each set has a maximum value of 0×1AAA.

The fuzzification of the input variables produces a vector consisting of five components, which correspond to the medium negative value, small negative value, zero, small positive value, and medium positive value of the fuzzified membership set. The value of the Y axis corresponding to each component represents the membership of the explicit input value. The vector contains the rotation error (Error) and the rotation error difference (Cerror). The fuzzified values ​​are represented as arrays ×1[] and X2[].

Rotation error [Error) and rotation error difference (Cerror) fuzzy value

Figures 2 and 3 graphically show the rotation error [Error) and the rotation error difference (Cerror) fuzzy values.

Development of brushless DC motor control model

Before a fuzzy logic (FL) engine can be built, we must first build a model as a basis for the design. A fuzzy logic controller uses heuristic knowledge and uses a language to describe the model to express its design. Rather than developing a model from scratch, we will use the PID controller model as a starting point. Once developed and implemented, the fuzzy logic controller will be improved by adjusting its parameters.

Generally speaking, there are three design steps to develop a fuzzy logic BLDC controller:

1. Define the operating range of the input and output controllers.

2. Define the functions and rules of fuzzy membership sets.

3. Tune the engine.

The first step is to define the model-dependent inputs and outputs. The input is the error (E), which is the current error between the set speed (SS) and the current speed (CS); the other input is the change in error (CE), which is the difference between the current error and the previously calculated error (PE). The output is the change in armature voltage (CV), which is the difference between the existing armature voltage (CAV) and the previously saved value of the armature voltage (PAV). The resulting model equation is as follows:

E=SS-CS

CE=E-PE

CV=CAV-PAV

The unit of the engine speed is revolutions per minute (RPM), and E determines the degree of approach to the target speed. Therefore, when E>0, the engine speed is lower than the set speed; when E<0, the motor speed exceeds the set speed. CE determines the adjustment direction of the controller. CE is positive if and only if (iff) the current rotation speed is lower than the set speed; CE is negative if and only if the current rotation speed is greater than the set speed. When approaching the set speed, CE will adjust back and forth between positive and negative values. CV is the supply voltage of the armature. This voltage is expressed as a pulse width modulation (PWM) duty cycle.

The next step is to define the membership functions, variables and rules for the fuzzy sets. In order for this to work, the non-fuzzy (crisp) inputs and outputs must be converted to fuzzy ones. The conversion is done by using linguistic variables to represent the input and output ranges. These are also called fuzzy variables. Fuzzy variables are used to partition the range of membership values ​​for the membership functions. For example, five variables are used to map the inputs and outputs, which are medium negative (NM), small negative (NS), zero (z), small positive (PS), medium positive (PM).

It is not a mathematical formula, fuzzy controller uses fuzzy rules to make a decision and produce an output. Fuzzy rules are described in the form of IF-THEN statements. Fuzzy rules determine the behavior of the system instead of complex mathematical equations. For example, if the error (E) is equal to a medium negative value (NM) and the change in error (CE) is equal to a small positive value (PS), then the change in armature voltage (CV) is equal to a small negative value (NS). The number of rules used is set based on the designer's experience and knowledge of the system. Therefore, the number of rules used in our system is 25.

In order to activate the armature, the CV fuzzy output must be converted back to a sharp output. This process is called defuzzification. A popular defuzzification method is called the centroid method.

The final step of the design is to tune the membership functions and rules. This phase is also called the optimization phase. Optimization is used to improve the performance of the fuzzy controller. Once the design is complete, the controller is ready for implementation.

Fuzzy Inference Rules

Fuzzy inference rules operate on fuzzified data to determine the behavior of the system. Specifically, the fuzzified data is applied against the rule table. In terms of language, this is the comparison of the input data Error, Cerror with the rule table. The rule table contains the member sets NM, NS, ZE, PS, and PM, and operates according to the control surface. The output is a valid "inferred" or "given" rule. The description of the inference process is shown in the following pseudo code listing:

Description of the reasoning process

Defuzzification

Defuzzification is the process of converting fuzzy data into crisp data. For the purpose of this application, the defuzzified value determines the duty cycle of the PWM signal used to drive the motor. The duty cycle is determined by using a modified centroid calculation function. The defuzzification method used here is to multiply the centroid calculation function by a coefficient. The modified calculation is also called the centroid point calculation function. The centroid point calculation formula is:

Defuzzified VaLue=∑-Y[i]XmultCoeff[l]/∑Y[i]

The i in Y[i] is the output vector element, which is the coefficient by which the output member set of multCoeff[i] should be multiplied. i can be 1 to 5. The result of the formula calculation is the defuzzified result.

FIG. 4 graphically shows the output member set used by the application with the coefficients [-0x10, -0x8, 0x0, 0x8, 0x10].

The output member set used by this application is [-0x10, -0x8, 0x0, 0x8, 0x10] coefficients

Assume that y[] = [0x0, 0x13F, 0x196A, 0x0, 0x0], then the defuzzified output value is as follows:

Defuz=0×(-16)+319×(-8)+6506×(0)+0×(8)+0×(16)/0+319+6506+0+0=-2552/6825=” -0.37391

FIG5 shows the calculation result of the centroid of the output vector y[].

Hardware Description

The eZDSP2812 board is used in this motor control application. The core of the eZdsp board is the TMS320F2812 digital signal processor. The board uses timer T1, a 20kHz clock, to generate the PWM1-6 signals and uses timer T2 to execute the interrupt service routine (ISR). In addition, the input capture pins CAP1-3 are used to collect high-speed data from the Hall effect sensor.

The motor is driven by PWM signals generated by the DSP. These six PWM signals are used as sources for the three-phase power converter. The power converter converts these six signals into three-phase signals and directly uses them as power sources for the motor. The function of the three-phase power converter is handled by an auxiliary motor control board. Spectrum Digital provides two boards that can provide this function: DMC550 and DMC1500. Either of them can be directly plugged into the eZdsp28xx board for use.

Hall effect sensors are used for fuzzy logic control loop feedback. The switching of the three-phase power converter switches is determined by detecting the signal received from the Hall effect sensor. The signal is fed into the acquisition pin of the TMS320F2812. The actual motor speed is counted by a software module.

Software Introduction

The motor control software is composed of the Digital Microcircuit (DMC) library modules and the FL motor control program. There are seven modules in the Digital Microcircuit (DMC) library that are used in this application. They are:

Datalog data recording

BLDC3PWM

·tall3_Drv

Mod6_Cnt

·Rmp2Cntl

·Rarnp_Cntl

Speed_PR

Additionally, fuzzy logic motor control is handled by a main FuzzyCtl() routine; for brushless DC motors this is Fuzzy-BLDC().

The software starts with a first run configuration followed by application specific setup. Specifically, the GPIO pins are configured as CAPture and PWM pins.

The next step is to initialize the timer and module parameters, and set the ISR. When all peripherals are set, the interrupt is activated and the main control system is entered. The main control system calls the fuzzy controller every 8.7 milliseconds.

The error values ​​are converted into fuzzy values ​​through fuzzification and stored in X1[] and X2[]. Once converted, the fuzzy values ​​are applied to the fuzzy inference rules.

The result from the inference module is stored in Y[]. The output from Y[] is converted to a crisp value in the defuzzification module. The resulting crisp value is a PWM offset that is added to the current PWM duty cycle. The updated PWM value is checked to see if the new value is within a certain range, and if not, appropriate action is taken. Finally, the fuzzy controller returns the updated PWM duty cycle to the calling routine.

Figure 6 shows the demo application debugging session.

Demo application debugging session

Channels 1 and 2 (in the upper right display window) show the PWM counter and the captured Hall Effect sensor, respectively. Channels 3 and 4 (below channels 1 and 2) show edge-triggered versions of the PWM counter and Hall Effect sensor display windows. The important variables are shown in the watch window, the most important of which are SetSpeed ​​and CurrentSpeed. These values ​​are close enough that the output of the fuzzy logic controller is zero.

This session shows the engine running under no-load conditions. The behavior may be slightly different than under load. Also, if finer granularity is desired, it may be necessary to tune the controller.

Reference address:Brief Analysis on the Application of Fuzzy Logic Algorithm Control Design for Brushless DC Motor

Previous article:Using TVS to protect automotive electronic devices
Next article:Design of vehicle monitoring system based on anisotropic magnetoresistive sensor

Latest Automotive Electronics 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号