Identification and Speed Control of DC Motor Using Fractional Order PID : Microcontroller Implementation

DOI: http://dx.doi.org/10.24018/ejece.2020.4.1.170 1 Abstract—This paper uses Fractional-order PID control (FOPID) to control the speed of the DC motor. FOPID is more flexible and confident in controlling control higher-order systems compared to classical PID. In this work, the FOPID controller tuning is carried out using different methods ranging from classical techniques to most recent heuristic methods are Fractional Grey wolf Optimization and Nelder-Mead. Moreover, parameter estimation of real-world DC motor is carried out experimentally using Matlab/Simulink interfaced to an Arduino Uno board. The feasibility of FOPID is demonstrated through applications to well-known DC motor case study and the estimated DC motor. Based on ISE, ITE, and ISTE performance measures, the proposed approach provide less settling time, rise time and comparable overshoot compared with existing literature approaches. A robustness assessment with differences in the DC motor components is performed. Simulation finding provide validation of the suggested work and the FOPID controller effectiveness as compared to classical PID controller in terms of robustness and control effect.


I. INTRODUCTION
Most of the DC motors preferred for industrial applications. It is dependable, simple to use and having low cost [1]. System identification is the science to construct a mathematical model able of showing the basic properties of a provided system beginning from watched input-output or output-only data [2]. In the past decades, process control has been developed rapidly in the industrial field, and the controller proportional integral derivative (PID) was the most typical one because of its simple structure and strong robustness. However, it is difficult to achieve the expected performance because of its long adjustment time, large overshoot, especially in multiinput multi-output (MIMO) systems. Three parameters Kp, Ki and Kd are adjusted to meet the preset performance functions which are usually composed of adjusting time, overshoot, and steady-state error. The parameter settings of the PID controller are the key to the PID controller design because they directly affect the control performance of the system. In the past few years, the heuristic algorithms are used to tune the initial parameters' values of the PID controller. A considerable amount of literature has been are not limited to classical techniques for detecting the best value of the three parameters Kp, Ki and Kd. Ziegler Nichols (Z-N) [3] presented a method to best tune these parameter. In many areas of industrial control, it is hard to get the ideal value using the ZN method. The Nelder-Mead (NM) simplex algorithm [4] is intended to solve the traditional unrestricted optimization issues to reduce a provided nonlinear function such as PID tuning. Over the past two decades, much of the current literature on PID tuning payed particular attention to heuristic methods. There has been a growing trend in recent year's amount of literature on applying these methods to get the ideal values of the PID components. These methods include; Neural Network (NN) [5], Genetic Algorithms (GA) [6], Particle Swarm Optimization (PSO) [7], Grey wolf Optimization (GWO) [8].
From many optimization techniques which is inspired by evolutionary biology to use for optimizing the controller parameter such as Genetic Algorithm and GWO. They will be discussed in details as follows: GA [9] is a worldwide stochastic technique for optimizing adaptive searches depended on the natural selection mechanisms. GA has recently been acknowledged as an effective and efficient method for solving issues of optimization compared to other methods of optimization [10].
The main steps of GA include: (1) randomly create a set of chromosomes, (2) evaluate fitness function, (3) based on fitness function, select the most promising candidates, (4) Repeat the previous steps till reaching the optimal solution, perform crossover, and mutation then determine fitness value. PID Tuner provides a fast and widespread single-loop PID approach for blocks of the Simulink PID Controller [11]. The computer program naturally computes from the Simulink linearized plant demonstrates input and output for submission to the controller. The tuning points to balance performance and robustness whereas accomplishing the control bandwidth and phase margin. Single -loop control is utilized for exact controlling of different linear/nonlinear forms, its simple to settle, alter, and execution misfortune compared to multivariable control. Single-loop control has either independent design which uses when small interactions or consecutive design which begins with quick loop, the most part way better execution, but the external loop is slow, and loops depend on each other. GWO algorithm is an optimization technique that is utilized to solve optimization issues of diverse changes [12]. Like other heuristic algorithms in the region of developmental computation, GWO need not to the gradient of the function in its optimization prepare. GWO is an optimization method that mimics the authority hierarchy and grey wolves hunting mechanism in nature. This algorithm needs to set a number of parameters, specifically, initialize alpha, beta, and delta, Identification and Speed Control of DC Motor Using Fractional Order PID: Microcontroller Implementation Magdi M. El-Saadawi, Eid Abdelbaqi Gouda, Mustafa A. Elhosseini, and Mohamed Said Essa number of look operators, the greatest number of iterations, number of locales chosen for a look (out of n gone by locales) and the halting basis. The main steps of GWO include (1) following, chasing, and deal with victim, (2) the victim is chased, surround, and harass until the movement stops, (3) attacks on the victim. Recent research has provided a better showing of the fractional calculus, and thus a control strategy known as fractional control was showed proposing apply of non-integer operators to the model and design control systems. Some fractional control applications have good performance against external disturbances and parametric uncertainties, with good findings in industrial processes control [13]. Podlubny [14] replaced the conventional PID controller by an advanced controller which called FOPID which contented a fractional order in the calculations, symbolized by (PIλDμ) "where (λ, μ) correspond fractional order". Not all the conventional and advanced methods used for tuning the conventional PID controller can be applied for the proposed FOPID due to the existence of fractional orders components. So, the applied optimization techniques (such as Nelder-Mead) should take into considerations the complicity of the FOPID controller parameters especially the (λ) and (μ) ones. These parameters increase the flexibility and system robustness and better results than the conventional PID controller. This study will explore different aspects of FOPID, different tuning methods, and parameter estimation approaches. The fundamental purpose of the paper is determine the extent to which FOPID is applicable and whether it would be perfect compared to PID controllers. It is expected that the obtained results can make an important contribution to the field of parameter estimation and controlling motors using FOPID. The primary contributions of this research paper are: ▪ A novel method for estimating the parameter of DC Motor by applying Matlab/Simulink interfaced with Arduino kit. ▪ DC motor Speed control by applying FOPID. ▪ Comparing FOPID to most well-known controllers.
The rest of this paper is arranged as follows; part 2 covers the mathematical DC motor model, while the DC motor experiment setup and estimation of the motor transfer function are presented in sections III and IV. Part V demonstrates the suggested FOPID controller. Computer results and simulations are presented in section VI. Finally, work done and results are summarized in the conclusion section.

II. DC MOTOR MODELING
To test the applicability, and the effectiveness of the suggested controller and the methods of controller tuning, an appropriate electrical application; namely, DC motor was selected, which is a motor for its simplicity and knowledge of its performance. The block diagram of a conventional DC motor with and without PID/FOPID controller is shown in Figs. 1 and 2. The general transfer function of motor can be described as follows: If the motor components are provided such as in Table 1 the corresponding transfer function for this motor can be defined as: However, in case that there is a difficulty to find the motor parameter due to any practical reasons the authors proposed a new method for estimating the motor transfer function based on Matlab toolbox which will be discussed in the following section.

III. ESTIMATION OF THE MOTOR TRANSFER FUNCTION
This section presents a new proposed method for estimating the motor transfer function based on Matlab toolbox. The proposed method can be used in case that there is a difficulty to find the motor parameter due to any practical reasons. The proposed method depends on using Arduino kit interfaced to Matlab/Simulink. The general motor transfer function was previously given by (1). If the motor parameters (kt, kb, J, B, L, and R) are not known, then an approximate method to estimate the motor equivalent is proposed. This can be done through toolbox for system identification which is supported by Matlab as shown in Fig. 5.

A. Verification of the estimation method
To verify the proposed technique, a well-defined dc motor with the components given in Table1 is utilized. The exact transfer function of this motor is defined and given in (2). In case that an input voltage of 5 V is supplied to the motor as shown in Fig. 6, the corresponding output speed can be calculated and drawn as shown in Fig. 7.
The proposed method is then used to estimate the transfer function for the same motor assuming that the motor parameters are unknown. Given the input voltage and the output speed curve (Figs. 6 and 7), the estimated transfer function can be obtained from toolbox for system identification. The estimated transfer function for this motor by is defined as follows: G ( ) = 2.001 2 +12 +20.03 (3) Fig.6 The input supply voltage Fig. 7 The output motor angular velocity for the real data By comparison between the exact transfer function in (2) and the obtained estimated one (3), the two equations are very close. The obtained error between the real and estimated data is less than 2% which can be accepted. So, the proposed estimation method can be used with acceptable accuracy in case that any parameters motor is unknown. Figure 8 shows the speed error signal between the exact and estimated method.  Figure 3 shows the assembly of the used DC motor and its driver. The setups mainly consist of a DC motor, its driver board, Arduino Uno and personal computer (PC). The setup components will be discussed as follows.

Arduino Uno Kit
It is an Atmega328 microcontroller unit that has been used as a digital controller. There are 14 pins for digital inputs and outputs: 6 of them can be used as PWM output pins. It also has 6 analog inputs; its clock crystal is 16MHz, a USB connection that is used to connect it to the PC. Operating Voltage is 5 Volts and Board model is Uno R3 [16].

Incremental Optical Encoder
Incremental encoder gives a specific number of pulses per revolution (PPR). Incremental encoder comprises of three fundamental components: a dual light detector, an illumination source, and a slotted disc. The light source sends illumination on the slotted disc, and receives them on a dual light detector. The dual light sensor measures the illumination numbers from the slotted disc and produces two pulse signals of quadrature output. The signals increase and decrease are numbered as measurement of pulses per revolution On the DC motor [17].

Motor driver
The L298N H-bridge module (Figure 4) can be used as a driver to control the velocity by effective voltage change on the armature voltage. H-bridge module can be operated under an electric voltage not exceed 35V DC and current not exceed 2A. There is also on-board regulator to get volt =5V. Table 3 presents the used truth table for this controller. The motor is connected between output1 (OUT1) and output2 (OUT2).

B. Estimation of the unknown parameters
The motor used in this research (Fig. 3) has some unknown parameters, so the aforementioned estimation method will be used to obtain its transfer function. The input voltage and the output speed for this motor are practically measured and plotted as appeared in Figs. 9 and 10. By using the suggested method, the corresponding transfer function is obtained as:  The fractional-order PID (FOPID) controller is the extension of the general control loop feedback mechanism (PID controller) that is commonly applied in industrial systems of control. The FOPID Controller tries to correct the mistake between a measured value and a desired value by calculating and then producing a corrective action that may alter the process accordingly. The FOPID controller transfer function is defined in (5): Gc(s) = KP + ℷ + K d s μ (5) The FOPID equation contains five obscure elements, where is the proportional factor, is the integral factor, is the derivative factor, is the integral of fractional-order and μ is the derivative of fractional-order and λ, μ are positive real numbers. Putting λ=1 and μ=1, a conventional PID controller is gotten. Hence, FOPID controller popularization the conventional PID controller and extends it from point to plane as appeared in Fig.11. This extension gives much more adaptability in planning the PID controller and offers a chance to better alter the control system dynamics. This improves the power of the system and makes it steadier. In spite of the better results of the fractional controller with modifiable elements (λ) and (μ). The controller's elements are difficult to be modified as the nonlinear transcendental equations obtained by the control theory's design criteria are difficult to fix, leading in limitations on the fractional-order controller's practical applications. The primary problem with the fractional-order controller development is how to solve transcendental nonlinear equations. In this paper, the tuning of the conventional PID parameters is optimized by using GA and single loop PID. FOPID parameters are optimized by using GWO and NM [19].

VI. COMPUTER RESULTS AND SIMULATION
It has been provided clear presentations of three cases are prepared for discussion and the simulations performed by means of the MATLAB/Simulink software. for the first case is an analysis of controllers in DC motor velocity control that show the performance of the types of controller with the change of some parameters of DC motor. For the second and third cases are used to Optimize of controllers which appears the performance of the types of controller and which is better. In the following subsections, the significant findings of this research are displayed.

A. Case No. 1:
The parameters of DC motor are changed for making sure that has it been effect or no on the performance with fixed controller components values for the use of different types of controller. The DC motor transfer function [20] is considered. The most striking outcome of the information is that Single-loop PID algorithm-based speed control gives rise time and settling time response equal to zero that means speed of response and it is apparent from this Table 6 that FOPID algorithm is given overshot equal to zero. In addition, when changing some values such as armature resistor and motor torque constant with the same values of the controller parameters almost no change in performance response. The response of this system using Nelder-Mead, Single-loop PID tuning, and Genetic Algorithm as shown in figure 5 and the response specification is given in Tables 4. The DC motor transfer function [21] is considered. The response of the GP2 using Grey Wolf Optimizer as shown in Figure 17 and the response specification is given in Table 8. Together these results provide important insights into Singleloop PID algorithm-based speed control gives rise time and settling time response equal to zero that means speed of response and FOPID algorithm is given overshot equal to zero. From the data in Figure 11, it is apparent that the output of DC motor for GP3(s) "obtained by system identification" without a PID controller is slow response and disturbance. To overcome these problems, controllers which are used PID and FOPID controllers. The controller of PID is tuned by the algorithms GA and Single-loop PID. These algorithms are used in MATLAB® 2016a.
• Fig. 12 display the output of the DC motor using GA and Fig. 13 Single-loop PID by using MATLAB® 2016a. Fig.  14 shows the DC motor response using FOPID. From these plots the variation can be observed between GA, Single-loop PID tuning, NM and the response sharpness in the NM is more than Single-loop PID. This increases the response rise time by using GA. The most surprising aspect of the data is in the overshot is equal to zero. Additionally, the steady-state of this motor is given better performance by NM algorithm. • The outcomes acquired from the above algorithms are tabulated in table 9. It is evident from Table 9 that apply of controller will increase the velocity control performance by increasing the response velocity and stability of steady-state. Together these results provide an important insight into FOPID algorithm in the steadystate response is more efficient than the PID.  This paper presents a parameter estimation method of DC motor. The paper covers the pros and cons of PID and recent FOPID controllers. To judge the performance of FOPID against PID, more than two case studies were presented and discussed along with different tuning methods ranging from Nelder Mead, GA, and Grey wolf. Based on performance metrics used, it is concluded that the best response is provided by the NM algorithm based FOPID DC motor speed control. Where the corresponding rising time, settling time and maximum overshoot are 0.02, 0.022, zero seconds respectively .the obtained results ensured the high quality of the proposed methods.