Simple Implementation of a Fuzzy Logic Speed Controller for a PMDC Motor with a Low Cost

Control of the permanent magnetic direct current PMDC motor is a common practice, hence the importance of the implementation of the PMDC motor speed controller. The results of a fuzzy logic speed controller for the PMDC motor rely on an appropriate base. As the dimension of the rules increases, its difficulty rises which affects computation time and memory requirements. Fuzzy Logic Controller (FLC) can be carried out by a low-cost Arduino Mega which has a small flash memory and a maximum clock speed of 16MHz. It is realized by three membership functions and each was divided into three memberships. The results of the FLC are satisfactory, revealing superior transient and steady-state performance. In addition, the controller is robust to speed mode variations. Keywords-fuzzy logic; PMDC motor; Arduino Mega

INTRODUCTION Permanent magnetic direct current PMDC motors have long been commonly used in the industry control area, due to their high performance and the fact that the torque is directly proportional to the field flux, which means that the speed can be adjusted by the terminal voltage [1]. In classical PID controllers, proportional, derivative, and integral control actions are applied together. They are simple in construction, and are appropriate to control the processes with well-defined mathematical models. Generally, the exact model is not available, so the conventional PID controller may not be the best choice [2][3][4][5]. To overcome this problem, FLC is proposed. The FLC does not rely on a mathematical model [6]. It can be successfully functional to control nonlinear systems using basic engineering logic [7][8]. With the rapid developments of microprocessors and semiconductor materials, many classical and intelligent control techniques can be applied to control the speed of the DC motor in order to achieve high performance. A minor overshoot and quicker response of motor speed signal were stated in the fuzzy PID control compared to the classic PID control [9]. The neuro-fuzzy controller performed better compared to the PID controller in different loads [10]. Compared H2 and H∞ control methods for a DC motor [11], adaptive robust control method for DC motor [12], and speed control of a DC motor used hybrid control methods [13]. These techniques offer a good instrument for the control of nonlinear systems that are hard to model. When choosing FLC parameters, several problems occur. Among the proposed solutions, adaptive controllers are able to adjust to reach optimum performance [14][15][16][17]. However, as the number of rules and large membership functions for fuzzy logic increase, calculation speed and memory storage become serious problems [18][19], so the need for excessive memory and high speed capacity materials for the implementation becomes necessary.
Fuzzy-logic controllers require more processing power to work in real time as the number of inputs/outputs of the controller increases. In this case, conventional microprocessors are not adequate for most real-time applications. In [20], in order to control the system, Quanser Q8 data acquisition card along with high performance computers were used for sending analog signals and getting encoder signals. In [21], the data exchange with the PC was provided by a NI USB-6812 DAQ card, which sent the signals that it received from the feedback tacho generator and control signals to the DC motor control module. In both cases vast resources were used for the control of DC motor. In this concern, the main contribution of the current work is the implementation of the proposed FLC controller on the conventional and low cost Arduino Mega board. The board uses the three membership functions and each membership function's inputs were divided to three memberships.
II. CONTROL STRATEGY The PMDC motor Simulink program given in Figure 1 was implemented by using the following structures. The inputs of FLC are the error speed E and its derivative dE by subtracting PMDC motor speed value ω from the reference speed value ω * . E (t) and dE (t) for each sampling time t are given as: The output dV is the change in armature voltage V is: The linguistic terms used to represent input and output are defined by three variables: Negative (N), Zero (Z) and Positive (P). Triangular and Gaussian membership functions are used. Agreeing to the rated speed of the PMDC motor, the interval of discourse of the speed error is between -3000rpm/mn and 3000rpm/mn. The supported rules are shown in Table I.   TABLE I After adjustments, the final membership functions are obtained ( Figure 2). The defuzzification method is used at the center of gravity of the membership function dV.

III. HARDWARE IMPLEMENTATION
The hardware block diagram is shown in Figure 3 and the hardware implementation in Figure 4. A Matlab program was used to transfer the FLC algorithm to the Arduino Mega card ( Figure 5) which received the feedback signal from the tachometer and sent signal in the form of PWM to the PMDC motor via DC-DC converter module. The motor specifications ares illustrated in Table II. The PMDC motor was set at noload, 30% load, and 95% load.  The aim was to make the PMDC motor operate at a constant speed for various loads. In order to test whether the system could remain at a constant speed under no-load, the motor was operated at 1000rpmm 2000rpm, and 2600rpm ( Figure 6(a), 6(b) and 6(c) respectively). It was observed that oscillations were low. Also it was shown that the motor achieves the desired speed in less than 5s for overshoot less than 30%. As a next step, the motor was operated at 1000rpm under 30% load at 24s (Figure 6(d)) and 1800rpm under 95% load at 22s (Figure 6(e)). In the latter case, even though the motor was almost loaded, the FLC controller keep the speed constant with no oscillations. The PMDC motor was regulated by the controller and still rotated at the desired speed. The fuzzy controller was capable to realize intelligent control for each speed. Explicitly, the speed overshoot and the swings were small.
V. CONCLUSION In this paper, a low cost FLC controller was designed to control the speed of a PMDC motor. The design extremely diminishes the necessary hardware to the simple conventional Arduino Mega and on the other hand, the used program was rather simple. In contrast with some distinct fuzzy controllers with several rules and membership functions running on computer systems, a simple FLC controller using a small number of rules and a simple implementation program were able to control the speed of the PMDC motor. The controller shows good performance in tracking the reference speed and in terms of reducing steady state error.