PID-Type FLC Controller Design and Tuning for Sensorless Speed Control of DC Motor

A R T I C L E I N F O A B S T R A C T Article history: Received: 20 December, 2018 Accepted: 21 December, 2018 Online: 27 December, 2018 This article examines the use of non-ideal current and voltage sensors for sensorless speed control for a fixed field DC motor. A PID type speed controller with KF estimator was applied to control the DC motor and IAE, settling time, and peak overshoot were taken as performance indices. However, KF facilitated the noise reduction. After tuning controller gains through MATLAB yielded high peak overshoot as well as IAE with an extended settling time. When we applied, a PID-Type FLC tuned by means of GA (genetic algorithms) caused a 75.98%, 97.89% and 56.2% cut in settling time, maximum overshoot and IAE correspondingly. The FLC-PID fundamentally enhanced sudden load changes disturbance rejection and the reference command speed tracking for the dc motor design in comparison to the conventional PID with no KF. This study was also able to replace the designed FLCPID with linear lookup-table while achieving the same performance improvements.


Introduction
This paper is continuation for our work presented in [1]. DC motors are applied in one way or the other in factories, home appliances, computers to robots, airplanes, and cars. They are more widely used than the related machines, the AC motors, owing to their diverse favorable characteristics. These characteristics some of which are, linear speed control properties and high starting torque. There are more than one types DC motors and all these types have numerous benefits over AC motors which include: less heat production, simpler controllers used, have higher efficiency, can offer precise position control, can produce very close to constant torque and they are easily controllable [2][3][4][5][6][7][8][9][10][11]. For that reason, the adoption of DC motors will reduce the amount of energy consumed and improve the efficiency of the machines they are installed. The improvement of DC motors' control arrangement to enhance their response characteristics is one way of achieving these. Is so doing, they will be able to accomplish their work efficiently without the necessarily increasing the capacities of motors alongside their control circuits [12][13][14][15][16].
Researchers have previously done a lot of work to design DC motor control circuits with or without the use of Kalman Filter (KF) and/or Fuzzy Logic Controller (FLC). In [2] the researchers introduced a feedback and feedforward system controllers to control DC motor. While the feedforward loop was just a gain represented by K f , the feedback loop was PD controller with gains denoted by K d and K p . The gains were optimized using fuzzy logic and genetic algorithm and all were constant. A PC was used in [3] to implement a DC motor PID controller, it was configured by trial and error to attain the desired performance. This study also applied a photo sensor to estimate the motor speed and transmit it to the personal computer. In [17] the researchers came up with a torque estimator for DC motors by means of adaptive Kalman filter consisting of two sections; estimation and extraction. Each of these parts is a DC motor's mathematical model and the first one had one more PID controller to guarantee the accuracy of the estimation. Although it required current and speed sensors, this estimator was designed with no torque sensors. A state feedback controller was developed by the researchers in [4] with the use of Extended Kalman Filter (EKF) for induction motor and KF for DC motor to evaluate the states. A DC motor was controlled using a PID controller in [5], K p K i K d were dynamically modified online by three distinct FLC controllers, one for each gain. KF was utilized for tuning the Membership Functions (MFs) of such FLCs. The FLC controllers, in [7,10], were intended to control DC motors. Microcontrollers was used to implement both FLCs and both made use physical sensors ,that is, no estimators were introduced in these studies. In [9], the researchers made use of a Kalman filter, torque sensor and current sensor to measure the speed of a DC motor and thereafter fed it back to a PI controller to enhance the motor's speed estimation. In [11], the DC motor speed was estimated using Kalman filter and was controlled using both Linear-Quadratic Regulator (LQR) and PID controllers. In [18], the authors adjusted the widths of FLC membership functions by means of arithmetic averaging technique and feed forward to run the DC motor without the use of feedback to minimize online computational needs.
The objective of this study is to realize better transient and steady-state responses for a DC motor's speed control (separately excited brushed type) and efficient reference speed tracking irrespective of load and alteration of reference speed. The voltage will only be used as the output of the controller, while the current will not be controlled but restricted within the rated motor current. Then the results from the PID controller and conventional PID controller will be compared with the PID-type FLC controller (FLC-PID) and KF. In addition to the classical time response characteristics; the performance index of IAE is selected to illustrate the achievement in the motor speed response. IAE displays the total error for the entire run period of the simulation to increase the size of the built controller in tracking command speed, notwithstanding its variations and changes in load. In Section 2 below, the DC motor model is developed, Section 3 covers the KF design, Section 4 addresses the different controller designs, and Section 5 carries the conclusion.

DC Motor Model
The most common type of DC motors which are broadly applied in robotic and industrial functions is the separately excited DC motor with constant excitation field can be represented by state-space model [4,13]. This model comprises two differential equations representing the mechanical and electrical responses of the DC motor in both static and active operating states. Equations (1) and (2) illustrate this model [4,19].
[ i a (t) Where (t) represents the current sample, and (t+1) denote the next sample.

Kalman Filter Observer
As mentioned in [21,22] Kalman filter is considered as optimum observer for the state variables and the outputs of linear time-invariant (LTI) systems. It has two significant characteristics which made it our choice to estimate the states of the DC motor under study; one it is able to exploit the already known state-space model of the DC motor, and the second reason because it has the capacity to filter diverse sensor noises [23]. The Kalman filter system discrete equations can be broken into two categories and are illustrated in (5)-(10) [23].

A. Time update equations
y t = C KF • x m t + z k (8) In which x t is the estimated current state vector; P t is the estimated process error covariance matrix; W t is the estimated noise matrix; Q t is the system noise covariance matrix; K t is Kalman gain; H: is the transformation matrix; R is sensor noise covariance matrix; y t is measurement of the state; C KF is Kalman filter C matrix for state-space model of the system under study (in this case the DC motor); x m t is the measured states vector; z k is measurement noise; x t is corrected state vector; and, P t is corrected process error covariance matrix Kalman filter estimates the states of present system and the error in such estimates by means of the time update equations. It then rectifies these errors using the measurement update calculations based on the Kalman gain and the actual inaccurate measurement. This done in a repetitive way for all sample times (T s ) or time steps [23]. Let Δω and ΔI a represent the error in speed and current calculation/measurement correspondingly.
Then accurate T load computation needs the integration of ω and dω/dt as illustrated in (11), which is solving the second row of (1) for T load : Equation (13) is derived by solving the first row of (3) for ω, is used to calculate the motor speed: | , ω can be calculated with high enough accuracy using (14) below: The sensors and process noise covariance matrices are articulated in terms of the stochastic characteristics of their respective noises and they can be either static or dynamic [24]. Q elements were found to be directly proportional to the inverse of the estimated armature current and motor speed and therefore was chosen to be dynamic as shown in (15). Since the sensor error is fixed by the manufacturer in its datasheet, R was selected to be static. In (16) the calculations of R are shown and the datasheet of a sample current sensor is found in [25].

Controller Design, Simulation and Results
In this section, three potential designs of a controller for DC motor speed control are discussed. Figure 1 shows the general system architecture under study.

Discrete PID Controller
Initially, discrete PID was used to control the DC motor. The transfer function of the controller is presented in (17). Figure 2 shows the command speed signal to the motor, the motor will experience an uncontrolled torque load variation illustrated in Figure 3. In the rest of this work, Figure 2 and Figure 3 will be considered as the running conditions for the DC motor under study.
Using MATLAB/Simulink PID tuner with "design focus" option set to "Reference tracking", a discrete PID controller was tuned to control the motor's speed by means of changing its supply voltage. The gains after MATLAB/Simulink PID tuner are: To simulate current and voltage sensors precision tolerances, arbitrary noise of 2% was added to voltage and current [25]. The voltage (controller output) was kept at or below the nameplate voltage that is 220 V, and this limitation is kept for the FLC PID in part C and throughout this work. The measurement of current was restricted certain upper limit to mimic the current sensor magnetic limitation characteristics. In the measurement block, the speed is determined using (13) only and no more conditioning is required. Figure 4 demonstrate the system response in which the system experienced an IAE of 47.52, settling time ( ) of 1.08 second and peak overshoot of 25.7%. Using (14) to obtain ω in the subsequent run lowered the peak overshoot to 23.7% and lowered the IAE a little making it 45.89. The settling time experienced a slight fall to 1.07 seconds. Such a small enhancement in system response is associated to the cancelation of the noisy derivative section in (13). The measured and actual motor speed using (13) and with no Kalman filter are displayed in Figure 5.

PID with KF
Kalman filter was applied in the next run in an effort to predict the motor's speed, Figure 6 shows the whole system. When Kalman filter was used and everything else as from the previous run was unchanged, Figure 7    While it showed some improvement in the system response, the PID with the help of Kalman filter was unable to fully remove the overshoot of the motor's speed response which introduced unwanted ringing in the motor's speed. This limitation can be overcome by designing a PID-type fuzzy logic controller with PID properties and the additional variable gains throughout the full range of the controller's operation [26,27].

FLC-PID Controller
A Takagi-Sugeno type FLC-PID controller is chosen in this work as it is "more diverse in gain variation characteristics" than the Mamdani type FLC-PID controller [26]. Aside from few changes in the rule base; the main difference in design between Takagi-Sugeno type FLC-PID controller developed in this work and the one utilized in [28,29] is the different and distinct gains for PI and PD controllers, offering an additional degree of design freedom. Figure 9 represents the block diagram of the FLC-PID developed for this work.
For both controllers (FLC-PI and FLC-PD), the input and output signal ranges were normalized to [-1,1]. Doing so will enable this FLC-PID controller to be applied for various motor sizes by just tuning its gains. Figure 10 shows the MF's for error as well as rate of change of error, Gaussian type was chosen to guarantee smooth control action. The MF's for the controller's output are presented in Figure 11 which are uni-valued MF's. one benefit of using FLC controller is that we can make all the equivalent MF's similar for both FLC-PD and FLC-PI, and the unique action variation between the controllers is achieved only by altering their rule base. Which is what we did in this work. Where GE_PI is FLC-PD speed error gain; GCE_PI is FLC-PD change of rate of speed error gain; GU_PI is FLC-PD output gain; GE_PD is FLC-PD speed error gain; GCE_PD is FLC-PD change of rate of speed error gain; and, GU_PD is FLC-PD output gain.  Tables 2  and 3 respectively. The FLC-PID applies these rules in the arrangement illustrated in (17) [30]to produce the control surfaces presented in Figure 12 and 13. Such rules simulates the performance of the common PI and PD controllers to develop FLC-PI and FLC-PD controllers in that order.   (17), Tables 2 and 3, Figure 10, 11, 12 and 13 into perspective; it would be obvious that both FLC have more than 49 equations and more than 10 parameters (comprising membership functions parameters) to adapt its output. These add to diverse design flexibility for the preferred control surface that the common PID controller simply cannot provide. where: u: is FLC output μ rule n : is the firing degree for each rule (step 2 above) U rule n : is the consequent of rule n .
The selection of FLC-PID gains was informed by the following: because the rated speed of the motor is 157.08 rad/sec, speed error gains were calculated as 1 157.08 = 0.006367. A range of [-1000,1000] was taken for derivative of error to neutralize high values due to the derivative term; consequently, it's gain was chosen to be 1 1000 = 0.001. Lastly, the output gains is set to be 1.5 * rated voltage to put an accelerated control action to the motor's speed. FLC-PID gains first estimation may as well be acquired from an adjusted PID as stated in [28].

Gains' Value Optimization Using GA
Genetic algorithm (GA) is an evolutionary algorithm; it uses the process of natural selection to solve optimization problems; it works to find the fittest value in the range of search regardless of that range's nonlinearity. Simple GA can be summarized in the following steps [33]  MATLAB optimization tool with built-in GA optimizer has been used in this project to fine tune the FLC-PID gains. The selected fitness function was the IAE of the speed, to ensure that the tuning is aimed at faster and improved speed command tracking with an all-round load change rejection. Because GA is a stochastic search tool, various runs may produce varying results, but each result must satisfy a minimum of one stopping condition. Indeed, the remaining runs with various gains can result in similar system response. Table 4 shows the FLC-PID gains upon tuning.
The FLC-PID successfully removed the peak overshoot (less than 0.5%), decreased the settling time to 0.257 seconds and reduced the IAE to only 20.1. To make this clearer, Table 4 illustrates a percentage contrast between FLC-PID with KF, common PID without KF and PID with KF, choosing common PID without KF as a 100% base. Figure 14 is a graph of the motor speed response for all scenarios mentioned above versus the desired speed. It is worth noting that lower value for every performance index used in this paper means improved system response.

Converting FLC-PID to lookup Table
In order to reduce the computational requirement of FCL-PID to a real word controller e.g. microcontroller or field programmable gate array (FPGA), thus making it easier for the controller to response in real time, the FLC-PI and FLC-PID control surfaces will be stored in a linear lookup- Table format. This can be done by dividing the two inputs of both FLC controllers (FLC-PI and FLC-PD) into 21 breakpoints (since both inputs range is normalized to [−1,1], 21 breakpoints mean 0.1 spacing) and evaluate the FLC controllers at each of the breakpoints. The total evaluations will be 21 * 21 = 441 for each FLC controller. A linear interpolation based lookup Table was put in place of each FLC controller in the controller block as shown in Figure 15, and they were loaded with the corresponding 441 evaluations. The motor speed response with FLC-PID and lookup Table FLC-PID are shown in Figure 16. Both responses are actually overlapping as the difference between them is minimal. A zoomed view of the speed response from the time 0.3to 0.7 seconds is shown in Figure 17 to magnify the difference between these responses, which has a maximum value of less than 1%. As a result, the DC motor with the lookup Table had almost identical performance indices (the difference is less than 0.1%) as compared to the response with the actual FLC-PID controller.

Conclusion
This work investigated the sensorless speed control of fixed field DC motor in a noisy environment mimicking real-live operating environment. As a result of noise in this environment, a common PID controller yielded high peak overshoot from the reference and took significate time to settle. That was true even after removing the noisy derivative terms in T load and ω in their respective estimation equations. When using Kalman filter, the PID controller was able to lower the peak overshoot by good margin, nonetheless it stayed there with long ringing in the speed response. To minimize these undesirable system behaviors , an FLC-PID controller was applied to the motor. This controller was tuned by GA. This new controller design end up reducing the peak overshoot to less than 1% and the settling time by 75.98%. The IAE was also reduced to only 56.2% of what it was. Finally, the FLC-PID was converted into linear interpolation-based lookup-Table to reduce the computational complexity of the FLC-PID and make it easier to realize in real world applications while maintaining the same response as with the actual FLC-PID. Achieving these enhanced time response and speed tracking improvement will ensure smoother, more robust and more power saving operation of the motor. The FLC-PID gave the DC motor "immunity" to reference speed and load changes as long as these changes are within its operating capacity.
In the future we intend to implement the lookup-Table by using a specialized lookup-Table Integrated Circuit (IC) or a generic Field Programmable Gate Array (FPGA) IC and to connect it to a physical separately excited DC motor in an experimental setup. Variable load, variable reference speed and current limiting protection must be included in this setup. This implementation will require retuning the FLC-PID gains, but in return it will solidly verify the proposed controller.