Keywords

1 Introduction

The term robot is basically a Czech word that means slaved laborers, and it came into existence in 1920. Robots acts like a machine and is dominated by a controller in a robot. Further, the structure of the robot is replicated as similar to human body parts like a head, two arms, and two legs, waist, and so on. Industry-specific robots play out a few tasks, for example, picking and fixing objects, and movement adjusted from seeing how comparable manual tasks are taken care of by a completely working human arm. Such automated arms are otherwise called robotic manipulators. The proposed work aims to have innovation is a multifaceted concept that includes modifications to products, alterations to organizational aspects dependent on innovations, strategies, rebuilding of organizational culture, and revisions to production processes. Accordingly, such optimized controlled robotic manipulator is appropriate for process innovation since they authorize organizations to concentrate on unique processes for the production of products and services. The second factor is the organizations today are confronted with expanding work costs and a deficiency of laborers, and are thus spending in robotics. Robots nevermore demand promotions and can work nonstop. The third factor is the pressure to increase the production rates to compete the market, and the fourth factor is the increased productivity. The fifth factor explains about the repeatability where the robot’s drive product quality or consistency and reduces waste. The last factor represents the speed in which the robotics assist in the increased production and hence reduction in the waiting time.

This controller can easily accomplish all these factors, where the controller is used for underwater controlling, etc. The proposed model can move and grip devices with guidance which can be operated through various programmed motions as it is both programmable and multifunctional devices [1]. Robotics is a combination of two branches [2, 3] that are electronics through the field of control, manufacturing, designing, and kinematics which help in positioning and orientation of the manipulator devices having multi-degree liberty can be positioned with the help of these manipulators. High and improved control strategies are required to achieve accuracy in the trajectory tracking of the manipulator, dynamic model of a robotic manipulator also play a very important role; it is responsible for the performance of a robotic manipulator. To achieve the desire performance and response of the system, a new design is needed for an accurate mathematical model, and after this, the various control strategies are applied to get precise trajectory tracking [4]. For industry purpose, the manipulators that are being used are highly non-linear and coupled; a second-order non-linear differential equation is being used to design a dynamic model for two links rigid robotic manipulator [5]. If the number of links increased simultaneously complexity also increased in terms of position and velocity of the manipulator. To overcome this challenging task, a control system is employed to monitor the manipulator [6]. Especially after designing a dynamic model, it is difficult to attach a precise and powerful controller to the plant that could be able to handle the non-linearities and many other unknown parameters. The controller is managed by adopting a tuning algorithm to have flexibility over the automation, where the entire world is searching for automatic processing in every aspect of life. Many different types of the algorithm are available in current trends such as particle swarm optimization (PSO), optimization method of ant colony [7], cuckoo search algorithm (CSA) [8, 9], genetic algorithm (GA), and so on. In the proposed system, genetic algorithm is used to produce high-quality solutions for optimization and search issues by depending on the process of natural selection such as crossover, mutation, crossover, and selection. The main aim is to reduce the amount of error. The controller will operate with the self-tuned fuzzy logic controller to have the least value of error and can also supervise the non-linearities [1012]. The limitations of the proposed work are that this controller could be able to control a two-link manipulator having a payload of 0.5 kg [13] (Fig. 1 and Table 1).

2 Dynamic Model for Manipulator

In this study, the configurations of the robotic manipulator is explained and dynamic model was designed by studying the equations of motions for manipulator arm which was given by Lin [14],

$$ \left[ {\begin{array}{*{20}l} {S_{11} } & {S_{12} } \\ {S_{21} } & {S_{22} } \\ \end{array} } \right]\left[ {\mathop {\begin{array}{*{20}c} {\theta_{11} } \\ {\mathop {\theta_{22} }\limits } \\ \end{array} }\limits } \right] + \left[ {\begin{array}{*{20}c} {P_{11} } \\ {P_{21} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {f_{r1} } \\ {f_{r2} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {fn_{1p} } \\ {fn_{2p} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\tau f_{1p} } \\ {\tau f_{2p} } \\ \end{array} } \right] $$

where

$$ \begin{aligned} S_{{11}} & = I_{{1p}} + I_{{1p}} + m_{{11}} l_{{c1}}^{2} + m_{{22}} l_{{c2}}^{2} + 2m_{{22}} l_{{11}} l_{{c2}} \cos \theta _{{22}} \\ & \quad + m_{{vp}} l_{{11}}^{2} + m_{{vp}} l_{{22}}^{2} \\ & \quad + 2m_{{vp}} l_{{11}} l_{{22}} \cos \theta _{{22}} \\ \end{aligned} $$
(1)
$$ S_{12} = I_{2P} + m_{22} l_{c2}^{2} + m_{22} l_{11} l_{c2} \cos \theta_{22} + m_{vp} l_{22}^{2} + m_{vp} l_{11} l_{22} \cos \theta_{22 } $$
(2)
$$ S_{21} = S_{12} $$
(3)
$$ S_{22} = I_{2P} + m_{22} l_{c2}^{2} + m_{vp} l_{22}^{2} $$
(4)
$$ P_{11} = - m_{22} l_{11} l_{c2} \left( {2\theta_{11} + \theta_{22} } \right)\theta_{22} {\text{Sin}} \theta_{22} - m_{vp} l_{11} l_{22} \left( {2\theta_{11} + \theta_{22} } \right)\theta_{22} \sin \theta_{22} $$
(5)
$$ P_{21} = m_{22} l_{11} \mathop {\theta_{11}^{2} l_{c2} }\limits \sin \theta_{22} + m_{vp} l_{11} \mathop {\theta^{2} }\limits_{11} l_{2} \sin \theta_{22} $$
(6)
$$ f_{r1 = } b_{1vp} \mathop {\theta_{11 } }\limits $$
(7)
$$f_{r1 = } b_{1vp} \mathop {\theta_{22} }\limits $$
(8)
$$ \begin{aligned} fn_{{1p}} & = m_{{11}} l_{{c1}} g\cos \theta _{{11}} + m_{{22}} g(l_{{c2}} \cos (\theta _{{11}} + \theta _{{22}} ) \\ & \quad + l_{{11}} \cos \theta _{{11}} + m_{{vp}} g(l_{{22}} \cos (\theta _{{11}} + \theta _{{22}} ) \\ & \quad + l_{{11}} \cos \theta _{{11}} ~\left( 9 \right) \\ \end{aligned} $$
(9)
$$ fn_{{2p}} = m_{{22}} l_{{c2}} g\cos (\theta _{{11}} + \theta _{{22}} ) + m_{{vp}} l_{2} g\cos ~\left( {~\theta _{{11}} + \theta _{{22}} } \right)~ $$
(10)
$$ \mathop {\theta _{{11}} }\limits^{} = \frac{{\tau f_{{1p}} - f_{{n1p}} - f_{{r1}} - P_{{11}} - S_{{12}} *\mathop {\theta _{{22}} }\limits^{} }}{{S_{{11}} }} $$
(11)
$$ \mathop {\theta _{{22}} }\limits^{} = \frac{{\left( {\tau f_{{2p}} - f_{{n2p}} - f_{{r2}} - P_{{21}} - S_{{12}} *\mathop {\theta _{{11}} }\limits^{} } \right)}}{{S_{{22}} }} $$
(12)

where \({\theta _{{11}} } \) and \( {\theta _{{22}} } \) shows the links position; \(\tau f_{1p}\) and \(\tau f_{2p}\) are the generated torque; \(f_{r1}\) and \(f_{r2}\) are the dynamic friction coefficients; \(m_{11}\) and \(m_{22}\) shows the masses. \(l_{11}\) and \(l_{22}\) shows the length, \(I_{1p}\), \(I_{2P}\) shows inactivity.

Initially, the mathematical model for each equation is constructed as \(S_{11}\),\(S_{12}\),\(S_{21}\),\(S_{22}\),\(P_{11}\),\(P_{21}\),\(f_{r1}\),\(f_{r2}\),\(fn_{1p}\),\(fn_{2p} .\) Further, the mathematical model is again converted into a dynamic model for further processing. On the MATLAB SIMULINK, a subsystem for these equations is created and appended with the equations shown in no 11 and 12. This whole mathematical model accommodates various controllers named subsystem 2 that are given in Fig. 2 (Figs. 3, 4, 5 and 6).

Fig. 1
figure 1

Diagram of two link robotic manipulator

Fig. 2
figure 2

PID structure

Fig. 3
figure 3

Optimized PID structure

Fig. 4
figure 4

Fuzzy PD structure

Fig. 5
figure 5

Membership function plot

Fig. 6
figure 6

Fuzzy PI structure

2.1 Various Controller Structure

2.1.1 PID Controller Structure

This controller structure is designed using the MATLAB SIMULINK. The design of the simple PID controller is constructed by connecting link 1 and link 2. These links reflect the operations of the equations defined in the mathematical model. Subsequently, a subsystem is being created of the model. The control boundaries of the PID structure are namely, proportional term, integral term, and derivative term. The proportional term refers to a general control activity proportional to the error signal through the steady gain factor. The integral term aims to decrease consistent state errors through low-frequency remuneration by an integrator. The derivative term aid to improve transient reaction through high-frequency remuneration by a differentiator. Each link has its own PID controller connected for generating the optimal output. The inputs supplied for each link are in terms of the sine wave, and the controller supports in all sorts of processing, and the final output is matched with the mathematical model equations. If any mismatch occurs between the corresponding desired value and the actual value, then the controller is again fine-tuned towards the gain factor. The genetic algorithm is employed to enhance time and achieve higher precision accuracy.

3 Genetic Algorithm for Optimization

Nature has consistently been an incredible wellspring of motivation for all humankind. The genetic algorithm is associated with search calculations based on the ideas of selection and genetics. In GAs, a pool or a populace of potential clarifications are given for the specified issue. These clarifications at that point go through recombination and transformation (like in genetics), delivering new solutions, and the cycle is rehashed over different circumstances. Every value is specified as a fitness value, and the fitter is given a higher opportunity to yield more fitter. An optimistic approach such as integral absolute error (IAE) is determined to eradicate the number of errors. To operate with the IAE functionality, a small piece of code is written in the command window. The next process is to assign a sim function inside the MATLAB, which is being inbuilt under the optimization tool. By executing the command as optimtool in the command window a pop-up window gets activated, and inside the textbox type the term solver. Finally, run the GA commands with the number of variables associated with the gains. The sequence of steps involved in the genetic algorithm is (1) Population, (2) Fitness scaling, (3) Selection, (4) Reproduction, (5) Mutation, (6) Crossover, and (7) Migration. The population comprises of all the data. The scaling function converts raw fitness scored returned by the fitness function in a given range. The selection function determines parents for next-generation based on their scaled values. The reproduction essentially demonstrates the functionality of creating children for each new generation then progressed by the mutation function, which makes a small random change in the individual which provides genetic diversity. The crossover consolidates two individuals or parents to form a new individual for the next-generation. The values for each operation are assigned using the two commands such as assignin and sim assignin which are defined inside the workspace. The sim function returns a single simulink (simulation output object) that contains all the simulation output. The obtain results aids to plot the output signal value against the time.

3.1 PID Optimized Controller Structure

The genetic algorithm technique that is discussed in the previous section is being used in this model for optimization. This is the reason for the optimized PID controller design; IAE is being attached to the controller input. The rest of the whole structure is the same as the PID controller structure, where it contains only two blocks, and the initial block consists of absolute, and the other is integrator over time. The IAE integrates absolute error value and provides the least value of error.

3.2 Fuzzy PD Controller Optimized Structure

PID controller is alone insufficient to handle all the non-linearities, so there exists a need for adding the fuzzy logic functionalities. The fuzzy controller or logic consists of membership functions which are described in Fig. 7. The membership functions are being shown each has their respective ranges as fuzzy only accept 0 or 1; so accordingly, the range is being decided with the help of a rule base a fuzzy logic. The design is created by typing fuzzy in the command window, a fuzzy logic appears and it is possible to call this logic to the workspace where our structure has been designed. Further, the fuzzy logic is being combined with PD controller and termed as fuzzy PD controller (Fig. 8).

Fig. 7
figure 7

Optimized self-tuned (FUZZY PID) model in SIMULINK

3.3 Fuzzy PI Optimized Structured

This structure is the same as the above one the main difference here is the PD controller is being integrated which results in PI controller, and fuzzy logic is also being attached between PD and integrator. The whole structure as a sum give origin to fuzzy PI controller for optimization, again genetic algorithm is being used with the help of inbuilt optimtool function.

3.4 Optimized Self-Tuned Fuzzy PID (STFPID) structure

Here, two fuzzy layer are utilized, the output of fuzzy layer 1 is being multiplied by the product of gains and output of fuzzy layer 2, then fed to the plant. The fuzzy logic self-tuning structure is being represented below is termed as a self-tuned fuzzy PID controller (STFPID). This controller gives the lesser error value after optimizing the genetic algorithm.

Fig. 8
figure 8

Structure of self tuned fuzzy PID controller

4 Results and Discussions

For tracking the trajectory, the two-link robotic manipulator and the controller are optimized on its own with the help of a self-tuned fuzzy PID controller. The controller structure as discussed above, these controllers is working efficiently and fulfilling all their aims for which they have been designed. To check all this, a simulator is needed and MATLAB is used to compare each optimized controller. Figure 9 represents the tracking, the reference, and the output wave is perfectly matched. If it does not match, differentiate it between these two waves with the guidance of color-coding. The dynamic model is designed with the equations, and the controllers, which are being attached to it, are perfect and working precisely. Figure 10 describes a self-tuned fuzzy PID controller when operating through the genetic algorithm process as a simulation result, it shows the minimum error value. In comparison to all the other controllers which are being used, this controller contains many features. The self-tuned structure is allowing the controller to automatically tune itself depending upon the presence of non-linearities. The fuzzy has many advantages and can deal with multiple-links non-linearities, increased time, overshoot, and many more. The base for the fuzzy is PID in which all the three control parameters such as proportional, integral, and derivative are combined and serves in reducing error and providing stability to the system. Figure 11 showing the simulation result after working through a genetic algorithm all the five controllers are being individually simulated up to 100 generations. The self-tuned fuzzy PID controller has the least value of error as compared to any other. Table 2 represents the mathematical value of error for each controller in descending order and the self-tuned fuzzy logic has an error value of 0.03665 which is like next to perfection in the third graph all the controller’s error. These are identified by separate graphs that are being differentiated with different color coding. This controller can work as an adaptable controller and can self-tuned and optimized itself according to the surrounding parameters and non-linearities.

Fig. 9
figure 9

Representing accurate tracking

Fig. 10
figure 10

Self-tuned fuzzy PID after optimization

Fig. 11
figure 11

IAE values of various controllers

5 Conclusion

In today’s world of automation, the need for developing an adaptable controller is essential. This controller is working as a self-adaptable controller that can be tuned and adjusted on its own with the help of a self-tuned fuzzy PID controller and genetic algorithm. With the optimized simulation results, it is found that this controller has the least value of error when compared to other controllers that are also being designed and simulated. The proposed controller not only helps to control the two link manipulator but also has the application for controlling the underwater robot, to control an adaptable gripper, and many more.

Table 1 Parameters of the dynamic model
Table 2 Tabulated form of IAE value in descending order