Tuning of PID Controller for Speed Control of DC-Motor by using Generalized Regression Neural Network and Invasive Weed Optimization

The Proportional Integral Derivative (PID) tuned by Generalized Regression Neural Network (GRNN) with Invasive Weed Optimization (IWO) algorithms are two powerful techniques that can be used to optimize motor drive speed. IWO is a metaheuristic optimization technique inspired by the behavior of invasive weed species. To optimize motor drive speed using GRNN-IWO algorithms to tuned PID, data on motor performance over time must be collected and used to train a GRNN model that can predict future motor performance based on past performance. By optimizing the parameters of the PID model, the optimal combination of parameters can be found to maximize motor efficiency and performance while minimizing energy consumption and wear and tear on the motor. The objective of this study is to regulate the speed of a Per Magnetic DC (PMDC) motor with high precision and rapid response using a PID controller. The PID controller tuned GRNN-IWO exhibits superior damping response and reduced overshoot in comparison to conventional PID controllers. Additionally, the drive current limiting mechanism ensures that the motor operates within its rated continuous current limit during continuous operation. The GRNN-IWO tuned single-loop PID controller outperforms the single-loop PID controller when manual tuned. The PID controller provides excellent damping response and minimal overshoot, enabling faster control response of the DC motor, with an accuracy of 98.85% compared to MATLAB-tuned GRNN-IWO


Introduction
The utilization of direct current (DC) machines traces its origins to the early 1900s, coinciding with the initial development of DC power supply.DC machines offer distinct advantages over AC machines, particularly in terms of flexibility and speed regulation capabilities.DC motors, known for their precise regulation, belong to a class of electrical actuators highly beneficial in diverse applications [1][2][3], spanning robotic manipulators, guided vehicles, steel rolling mills, cutting tools, and overhead cranes.Due to their favorable speed-torque characteristics and user-friendly operation, DC motors are frequently employed in various industries where variable speed is essential [4].
In the past two decades, the process control industry has witnessed numerous advancements in controller design and deployment.The commercial sector requires automatic controllers capable of prompt and accurate responses to effectively carry out operations.The Proportional-Integral-Derivative (PID) controller, a fundamental element in the feedback loop, stands out as one of the earliest and most wellknown controllers due to its remarkable effectiveness, high reliability, robustness, straightforward operation, and its ability to eliminate steady-state error [8][9].
The PID algorithm demonstrates favorable control dynamics, characterized by the absence of steady-state error, rapid response (rising time), minimal oscillation, and enhanced stability.Introducing a derivative gain component into the proportional-integral (PI) controller has the potential to alleviate oscillation and overshoot in the system's output response.The PID algorithm proves proficient in managing higher-order processes involving multiple energy storage elements [10][11][12].Its application is prevalent in regulating the revolutions per minute (rpm) and torque of a DC motor.However, optimizing and fine-tuning these controllers present substantial challenges and demand a considerable amount of time, especially when employed in various abnormal operating modes and subjected to diverse load situations and parameter changes.
This research aims to achieve the stabilization of speed control for a Permanent Magnet DC (PMDC) Machine within the specified target range using the PID controller tuned by GRNN-IWO.The process of modeling a DC motor involves solving the system's dynamic equation, as detailed in references [13,14].The system's response is simulated and analyzed using MATLAB/SIMULINK, with the PID controller being tuned and evaluated on the Simulink platform.This study addresses the tuning and operational principles of the PID controller, and the results of the experiments are detailed and analyzed in prior studies [15][16][17][18].The regulation of numerous systems is crucial for achieving the desired performance level and has been extensively explored in various control strategies, as discussed in references [5][6][7].
For precise and prompt speed regulation, integrating controls within the drive system is imperative.These controls should focus on minimizing steady-state error and overshoot concerning the desired reference speed.Accurate control techniques are essential for maintaining a consistent velocity in a DC motor.PID controllers are presently recognized as one of the most widely used control mechanisms due to their attributes of tenacity, precision, and the ability to achieve accurate speed control.The gain parameters associated with the proportional, integral, and derivative terms play a crucial role in determining the effectiveness of the PID controller.This discussion will examine and elaborate on contemporary tuning methodologies that have emerged in recent years.Reference [19] highlights the substantial time and effort dedicated to enhancing the accuracy and user-friendliness of the PID controller.The application of PID tuning using Generalized Regression Neural Network (GRNN) with Invasive Weed Optimization (IWO) techniques holds the potential to enhance motor driving velocity.The velocity of motor drive holds significant importance in various business domains, including robotics, manufacturing, and transportation.
To improve the speed control of the DC motor while minimizing power consumption, a PID controller was designed and tuned using a Regression Neural Network (GRNN) in conjunction with the Invasive Weed Optimization algorithm (IWO).The IWO algorithm was applied to adjust the spread factor ( ) of the regression neural network, ensuring precise determination of PID values by the GRNN.The proposed GRNN-IWO model provided accurate values to the PID controller, leading to precise control of the motor speed while improving efficiency by reducing overshoot, rise time, settling time, and zero error steady state values.

PID Controller
The PID algorithm has emerged as the prevailing method for control systems.In the majority of instances, employing this strategy or a slight modification thereof will be adequate for managing the feedback loop.The schematic representation of the PID regulator is depicted in Figure 2.1.The device has numerous prospective applications, including functioning as an autonomous controller within a personal computer, a programmable logic controller (PLC), a distributed control system (DCS), or a microcontroller.It can also be integrated as a component of a direct digital control (DDC) package or a hierarchical distributed process control system.There are various approaches available [19][20][21][22] for implementing the PID algorithm.The instrument in question possesses utility and may be effectively employed in accordance with established high-level criteria or subjected to rigorous analytical examination.Equation 1presents the generic version of the PID algorithm [2]: In the context of each time instant "t," the control variable is denoted as "U(t)," the control error is denoted as "E(t)," the set point is represented by "Ysp," and the feedback control signal is symbolized by "Y."The control variable comprises three components: the P-term, which is proportional to the error; the I-term, which is proportional to the integral of the error; and the D-term, which is proportional to the derivative of the error.The controller is equipped with three inputs, namely the proportional gain Kp, the integral time Ti, and the derivative time Td.The parameters of the PID are elaborated upon in more detail in reference [18].Figure 2.2 The flowchart presents a comprehensive framework for selecting an optimal controller technique that is suitable for a diverse range of precision-centric applications.

Generalized Regression Neural Network (GRNN)
The Generalized Regression Neural Network (GRNN) is a variant of the radial basis function network (RBFN) designed specifically for regression tasks.Developed by Donald F. Specht [23 ]

Invasive Weed Optimization (IWO)
Invasive Weed Optimization (IWO) is a nature-inspired algorithm proposed by Mehrabian and Lucas [25] in

Tuning GRNN Algorithm Parameters
After the plant modelling and choice of GRNN structure have been determined, the next step in setting up the controller (GRNN) is tuning the controller to get the system to behave in a desired fashion.To control the speed of a DC motor using two specific algorithms: General Regression Neural Network (GRNN) and Invasive Weed Optimization (IWO).Both are sophisticated methods that were used to optimize a DC motor's speed control.GRNN is used to learn the system behaviour, while IWO is used to fine-tune parameters.Here's a generalized approach of how this research work has been done to achieve the good performance: 1.Data Collection: Gathered data of the DC motor under different conditions.These conditions include different speeds, voltages, torques, etc.The data is then labelled with the correct speed.

Training the GRNN:
The GRNN is trained on the collected data.The GRNN learns the system's behaviour, understanding how inputs (voltages, torques, etc.) affect the output (speed).

Parameter Optimization using IWO:
The parameters of the GRNN are then optimized using the IWO algorithm.This algorithm simulates the behaviour of invasive weeds, a form of biological inspiration for optimization algorithms.It works by iteratively tweaking parameters, treating each potential solution as a "weed".The most successful "weeds" spread and reproduce, creating a population of solutions that steadily improve.4. Motor Speed Control: Now, with an optimized GRNN, the DC motor speed was controlled by feeding the desired speed into the GRNN, which can then suggest the necessary voltage/torque to achieve it.5. Validation & Verification: Finally, the system's performance is validated by comparing the GRNN's output with the actual speed of the motor.If the system is correctly optimized and trained, it should achieve a high level of accuracy (98.85% in my case) in predicting and controlling the motor speed.6. Feature Engineering: This was a crucial step, especially in this context, where the relation between the motor characteristics (voltage, current, temperature) and the speed might not be straightforward.

PID controller Tuning by GRNN-IWO
PID tuning using GRNN-IWO to control the speed of a DC motor involves finding the optimal set of parameters for the PID model to achieve the desired speed control performance.This process is carried out by experiments using a DC drive setup for data acquisition.Collect sets of input-output pairs, where the inputs are the PID controller parameters (P, I, D) along with the desired engine speed, and the outputs are the actual engine speed reactions.It is important to include a variety of operational scenarios to ensure comprehensive coverage.Utilize the gathered data to train a GRNN.Construct the network's input layer to accommodate both the PID parameters and the desired speed as inputs.The output layer should be configured to forecast the real motor speed.Train the GRNN with the objective of approximating the relationship between the controller parameters and the motor speed.Performance is affected by the value of the diffusion coefficient to GRNN, so we will use an algorithm IWO to determine the appropriate value for it.The IWO algorithm by initializing it.Generate an initial population of spread factor values for GRNN, which can be likened to weed seeds, and these values can be either randomly assigned or predefined.The value of the best spread factor is determined by the fitness function by the IWO algorithm, which is the best possible value of the spread factor of GRNN from which the best values are determined for the PID controller that gives the best response characteristics of the DC motor that are with the lowest value of the root mean square error.The figure 2.5 shows the structure of proposed control system, and the table 3. shows the number of samples used and the number of iterations to obtain the best value for the spread factor for GRNN through which it is possible to determine the PID controller values.The feedback system's inherent transient response serves as the foundation for the second fitness function.IWO enhancement routine attempts to find the arrangement of regulator gain that limits these undesired drifters.The overall block diagram of a single loop controller tuned using GRNN-IWO is shown in Figure 2.5.

Parameters Values
Weeding Population Size 100

Results and Discussion
This section organization presents the response of the controllers designed in the previous chapter.Two controllers were realized, Single loop PID algorithm (tuned with MATLAB and IWO) and a Cascaded loop PI controller (tuned with a Model-Based method).The PID Single loop controller was done as preliminary step in showing the effectiveness of the tuning methods used (MATLAB automatic tuning and Invasive Weed Optimization).The cascaded PI controller was then used for the proper DC Machine drive simulation using PWM on Simulink software.The cascaded PI controller was tuned using a model based method which offers quick determination of the PI controller gain with respect to the desired bandwidth of the system.The DC motor used in the experiment is a driven permanent magnet DC (PMDC) motor.The structure details and motor parameters of the PMDC motor are taken from the 24V DC motor datasheet, as shown in Figure 2.6 below.The electrical and mechanical parameters of the motor are shown in Table 4.After studying the structure of the single-loop PID algorithm, the cascaded PI controller is used to design the DC motor speed drive.The results obtained are presented and discussed in this section.Before presenting and discussing the results of the developed DC motor drive simulation, we provide a validation result showing that the DC motor model used in the simulation matches the behavior of the DC motor that is the subject of the study, as shown in the motor's datasheet.The DC motor is connected to rated voltage of 24 V, and a load torque equal in magnitude to the continuous stall torque (0.28 Nm) given in the motor's data sheet is applied to the motor.The open-loop speed, current, and torque response is shown in Figure 2.7. Figure 8 shows that the motor speed gradually increases to approximately the rated speed given in the motor data sheet (3600 RPM).When continuous stall torque is applied as load torque, the speed is reduced to approximately 3000 RPM.The motor draws a current approximately equal to the maximum continuous current (4.5A) in the datasheet.This current is required to maintain the load within safe limits.Therefore, considering all necessary motor ratings and safety limits, the speed driver is developed to drive the DC motor correctly.The data sheet of the motor shows that the continuous stall torque is 0.28 Nm.To investigate the load disturbance suppression capability of the DC motor speed control drive, a load torque of 0.25 Nm is introduced to the DC motor at 0.1s moment at a motor speed of 1000 RPM, and its speed response is shown in Figure 8, which is enlarged to show the effect of the load torque on the motor speed.Figure 2 Load Rejection Capacity of Speed Drive to Load Torque of 0.25 Nm from Simulink Scope Output.
The y-axis and x-axis in Figure 5 represent speed (RPM) and time (seconds), respectively.The load causes the motor shaft speed to drop to approximately 994 RPM, and then the speed driver ensures that the motor recovers its reference set speed of 1000 RPM in 0.004 seconds.
The results are simulated with the motor running clockwise and counterclockwise.The full-bridge DC-DC converter used to power the motor enables four-quadrant operation, allowing the motor to operate in both directions.The simulation uses a reference speed of 1000 RPM and -1000 RPM, and the motor's speed response and current response are shown in Figure 2.9.When a reference speed of 1000RPM is set, the motor drive causes the motor speed to rise quickly to its set reference value.This is performed without a small speed response overshoot, a much-needed feature in a precision servo drive.The action of the feedback active dampers in the velocity loop of the multistage controller causes a minimal overshoot.The transient response characteristIcs are given in Table 5.

Conclusion
This research project demonstrates that PID/PI controllers play an important role in the design of speed drives for DC motors.The implemented PID control helps to provide an effective control signal to respond quickly and robustly to changing reference speeds and improve load disturbance rejection of DC motors.The current limiting feature implemented in the motor speed driver has proven effective in always driving the motor under safe conditions.Motor speed in current transformers increases with voltage amplitude and paper and fuel insulation deterioration.The number and distribution of motor speeds and the magnitude of motor speeds were sufficient to evaluate the performance of the current transformer, where 98.85% accuracy was achieved using GRNN and IWO.This approach provides a relatively cost-effective way to implement DC motor speed drives with features such as current limiting

Figure 2 . 1
Figure 2.1 Diagram of a PID Control System.
in 1991 as an extension of RBFN, GRNN has four layers: input, pattern, summation, and output.Input Layer: Receives input features for regression.Pattern Layer: Contains prototype vectors representing training examples, associated with input features and corresponding output values.Summation Layer: Calculates weighted sum of output values from the pattern layer using a kernel function based on distances between input and prototype vectors (typically a Gaussian function).Output Layer: Provides the final regression prediction based on the weighted sum obtained from the summation layer.During training, GRNN stores data by calculating distances and adjusting weights to minimize prediction error.In testing, input data passes through the network, and the output is produce based on the weighted sum, offering advantages like fast training, good generalization, and handling noisy data.GRNN is especially suitable for regression tasks predicting continuous output based on input features.
2006 for population-based optimization.It simulates the invasive behavior of weeds in a search space to find optimal solutions.The algorithm includes: Initialization: Randomly generates a population of potential solutions (weed individuals) within the search space.Weed Colonization: Individuals compete based on fitness evaluated by the objective function.Reproduction: Fittest individuals (seeds) reproduce to create new weed individuals.Dispersal: Newly generated individuals replace the least fit, emulating seed dispersal.Elimination and Local Search: Some individuals are removed to maintain population size; local search improves exploration-exploitation balance.Termination: Iterates steps until a termination condition (e.g., max iterations, desired fitness) is met.IWO's core idea is that fit individuals propagate and disperse characteristics to effectively explore and exploit the solution space.It's applied to various optimization problems, offering simplicity, diversity, and scalability.Notably, IWO, inspired by weed behavior, doesn't endorse actual plant invasion; it's a concept used for optimization purposes.

Figure 2 . 9 .
Figure 2.9.Response of velocity and current to changes in reference velocity direction.

Table - 2
7. Training Strategy: Used an appropriate GRNN/IWO training strategy for dealing with imbalanced data, setting an appropriate learning rate, batch size, number of training epochs, etc. 8. Evaluation Metric: Accuracy is a common evaluation metric, but it might not always be the most appropriate, especially if my data is imbalanced.So I also ensured that I am using the right metric to evaluate my model's performance.9.Regularization: Regularization techniques helped me to prevent overfitting, helping my model to generalize better to unseen data, which can improve accuracy.10.Cross-validation: Cross-validation can give me a better idea of my model's expected performance and can help prevent overfitting.11.Ensemble Methods: Combining multiple models can often yield better results than using a single model.This was very useful as I was struggling to increase result accuracy.Steps involved using the GRNN/IWO to predict the correct voltage/torque for a desired motor speed explained by table below: : output tuning control signal from the PID GRNN-IWO at desired speed

Table 4 .
Data of a DC Electric Motor.

Table 5 .
Transient Response Characteristics of the motor at 1000 RPM Reference Speed.

Table 6 .
The comparison of proposed method with existing articles on DC motor speed controlling.