Fuzzy Tuned PID Controller for Envisioned Agricultural Manipulator

The implementation of image-based phenotyping systems has become an important aspect of crop and plant science research which has shown tremendous growth over the years. Accurate determination of features using images requires stable imaging and very precise processing. By installing a camera on a mechanical arm driven by motor, the maintenance of accuracy and stability becomes non-trivial. As per the state-of-the-art, the issue of external camera shake incurred due to vibration is a great concern in capturing accurate images, which may be induced by the driving motor of the manipulator. So, there is a requirement for a stable active controller for sufficient vibration attenuation of the manipulator. However, there are very few reports in agricultural practices which use control algorithms. Although, many control strategies have been utilized to control the vibration in manipulators associated to various applications, no control strategy with validated stability has been provided to control the vibration in such envisioned agricultural manipulator with simple low-cost hardware devices with the compensation of non-linearities. So, in this work, the combination of proportional-integral-differential (PID) control with type-2 fuzzy logic (T2-F-PID) is implemented for vibration control. The validation of the controller stability using Lyapunov analysis is established. A torsional actuator (TA) is applied for mitigating torsional vibration, which is a new contribution in the area of agricultural manipulators. Also, to prove the effectiveness of the controller, the vibration attenuation results with T2-F-PID is compared with conventional PD/PID controllers, and a type-1 fuzzy PID (T1-F-PID) controller.


Precision agriculture system & role of phenotyping
Plants life plays a crucial role serving the conduit of energy into the biosphere, providing food, and shaping our environment. With the growth of new technologies plant science which has seen tremendous transformation, Ehrhardt and Frommer [1] identify the role of technologies to address the challenges of new biology. But, with climate change being a major concern, outdoor farming is CO2 more threatened than before, and further fertile land is now a limited resource globally. Approximately, a quarter of world emission comes from food production, and the global climate impact of agriculture is increasing dayby-day. The irony is that agriculture itself is the main contributor to climate change, which in-turn is severely affected by it. Scaling the food production to meet the future human demands, without compromising the quality, while also targeting sustainability, is non-trivial. One can just imagine the magnitude, like over the next 40 years, mankind must produce as much food as man has done in total over the past several 100 years. This brings the need for significant increase of the yield production. The United Nations estimates that the world population will rise from around 7.8 billion today to around 10 billion by 2050. The world will need lot more food, and the farmer community will face serious threats and challenges to keep up with demand with mounting pressure majorly due to climate change. So, this brings us to the need for food cultivation change, i.e., cyber agriculture/vertical farming/urban farming, while aiming sustainability over time. Certainly, the trend is towards indoor cultivation [2−4] . But, then just remote indoor farming is not the ultimate solution. There is always a need for organized indoor cultivation for maximizing the harvest on a smaller compatible surface with optimized usage of resources, thereby preparing us today for the global needs of a better tomorrow. We discuss one such prototype (LOMAS++) (Fig. 1.) aimed for autonomous precision cultivation [5] . A large pool of different sensors (pH sensor, temperature sensor, environmental sensor, soil moisture sensor, soil temperature & humidity sensor, lux sensor, array of MOX gas sensors, and quantum sensor) are interfaced as an Internet of things (IoT) facility [6] monitoring the environmental conditions round-the-clock to maintain a controlled growing environment. Autonomous computer numerical control (CNC) cultivation test-bed [7] The project is carried out in collaboration between Alfred Nobel Science Park, and AASS, Orebro University, Sweden. LOMAS++ is an autonomous multifunctional farming cultivation bed, aimed for high quality indoor growth and monitoring of plants, with an aim to optimize the cultivation, while producing high quality yields.
It opens a new research dimension at Orebro University. Furthermore, it also provides a unique opportunity for students to use the prototype for academic purposes.
In general, plant phenotyping refers to the use of digital and non-invasive technologies to interpret the physical properties observed in plants. Examples include appearance, development, and reciprocal behavior, etc. Practise and understanding of agriculture has seen wide use of vision-based technologies. Plant phenotyping methods based on image processing have received much attention in recent years [7,8] . Plant phenotyping systems have been developed as a result of technology advancement, and the advent of various types of low-cost devices. The advantage of such approaches have key important aspects such as being non-destructive in nature, gaining high-throughput data continuously, etc. Everything from traditional to advanced traits, are obtained from images [9] which provide crucial information revealing the plant health and stress status.
Agricultural robots are becoming a common part of modern farming methods. Nowadays, many operations of sorting, sorting and packing, spraying pests and controlling pests and weeds, detecting harvest time and existing diseases are done automatically with the intervention of agricultural robots [10] . Further, these robots have been used in different magnitudes from small scale to heavy duty applications [11] . The agricultural robots market is roughly expected to reach around 12 billion USD within the next 5 years. Articulated robotic arms have been widely used in most of these applications. The robot arm typically has different connections that can move at greater angles and move up or down. This is while the human arm can move (upwards) only in one direction by taking the reference of the straight arm. As an example, we can mention the articulated arm in [12].
The vulnerability of cameras mounted on such articulated robot arms is greater. Also, as a result of camera movement, camera shake and poor focus during exposure, the image loses its quality dramatically. Therefore, camera shake resulting from the running of the motors causes serious concerns in such image acquisitions, Oh et al. [13] study the blur originating from the camera shake using the statistics of acquired images of the shaken camera in order to predict perceptual blur.
Industrial manipulators have been widely used in the past and are known as the robotic arm. Controlling and stabilizing such manipulations is still a topic of current researches. The robustness of proportional-integral-differential (PID) controllers against noise and other vibrationrelated parameters facilitates and justifies its application for practical control issues. Nguyen et al. [14] study the motion of a 6-DOF (DOF represents degrees of freedom) robot, regardless of its cause such as force and torque. Control algorithms are widely used in many industries. One of them is structural vibration control. Leugering [15] shows that a uniform exponential stability can be achieved by using a mechanically implemented damping device. But, then the active control becomes a non-trivial task, when it is non-linear in nature [16] . Etxebarria et al. [17] proposed a scheme that benefits from smooth function (instead of using the sign function) and uses a sliding-mode controller in order to alleviate the uncertainty and also disturbances for flexible link robotic manipulators. Neural networks have also been applied to various control problems. A neuro-controller to stabilize inverted arms is proposed in [18], where the validation of their method was done using Simulink simulations. In the work [19], a neural network (NN) controller is developed to minimize the vibration forces on the flexible robotic manipulator system associated with the input deadzone. A distinguishing model on the basis of nonlinear golden section adaptive control techniques is developed for vibra-S. Paul et al. / Fuzzy Tuned PID Controller for Envisioned Agricultural Manipulator tion minimization of a flexible Cartesian smart material manipulator which is initiated with the help of a ballscrew mechanism combined with an alternating current (AC) servomotor [20] . A combined fuzzy+PI technique for active vibration attenuation of a flexible manipulator combined with lead zirconate titanate (PZT) patches was presented by Wei et al. [21] A dynamic modeling and an innovative vibration control strategy for a nonlinear threedimensional flexible manipulator was presented in [22]. Yavuz and Karagulle [23] presented the vibration control of a single-link flexible composite manipulator using motion profiles. The trapezoidal and triangular velocity profiles are considered for the motion commands. Matsumori et al. [24] proposed an operator based nonlinear vibration attenuation technology utilizing a flexible arm in combination with shape memory alloy. The effectiveness of the proposed methodology is validated by simulations and experiments. An improvised quantum-inspired differential evolution termed as improved quantum-inspired differential evolution (MSIQDE) algorithm on the basis of Mexh wavelet function, standard normal distribution, adaptive quantum state update as well as quantum non-gate mutation is suggested by Deng et al. [25] for the avoidance of premature convergence and to upgrade global search capability. The abilities of the MSIQDE-DBN (DBN represents deep belief network) technique is verified by using the vibration data of rolling bearings from Case Western Reserve University, USA.
The concept of fuzzy logic has become extremely popular due to its non-linear mapping capability and can be used in various systems while maintaining robustness and simplicity. Therefore, due to the nature of robust and effective nonlinear mapping, fuzzy logic has found wide and increasing applications. Tong et al. [26] provided an investigation on the adaptive fuzzy output feedback backstepping control design problem associated with uncertain strict-feedback nonlinear systems in the presence of unknown virtual as well as actual control gain functions with non measurable states. A novel adaptive fuzzy output feedback control methodology on the basis of backstepping design is illustrated by Tong and Li [27] for a class of single-input and single-output (SISO) strict feedback nonlinear systems with unmeasured states, nonlinear uncertainties, unmodeled dynamics, as well as dynamical disturbances. The technique of fuzzy logic is implemented for the approximation of the nonlinear uncertainties. The state estimation is carried using an adaptive fuzzy state observer. Liu et al. [28] proposed a fuzzy PID control technique in order to initiate the space manipulator and track the required trajectories in different gravity environments. The combination of fuzzy methodology with PID control is implemented to develop the novel methodology. PID controller parameters are tuned on line based on the fuzzy controller. An innovative control strategy of a two-wheeled machine with two-directions handling mechanism in combination with PID and PD-FLC (FLC represents fuzzy logic controller) algorithms was presen-ted by Goher and Fadlallah [29] . The use of an additional DOF embedded in type-2 fuzzy logic as a footprint of uncertainty makes it perform better than a type-1 fuzzy logic system [30,31] . The main concept and the technical content of fuzzy logic type-2 is shown in [32]. Due to the fact that fuzzy logic type-2 has better performance capacity than fuzzy logic type-1, it is then used as one of the efficient methods of compensating the uncertainty [33] . In the work of Paul et al. [34] , it was demonstrated that in the control of vibration of the structure, the type-2 fuzzy PD/PID controller performs better than the classical fuzzy PD/PID controller. Combining type-1 and type-2 fuzzy logic systems, an innovative method has been proposed and the performance of the proposed method is also demonstrated in pitch angle controlled wind energy systems. The results show that the type-2 fuzzy logic system offers better performance in comparison to type-1 fuzzy logic systems [35] . There is another comparison between the performance of the two types which is implemented in the laser tracking system by Bai and Wang [36] . Sun et al. [37] used the type-2 fuzzy model to control the overall stability of the multilateral tele-operation system, where the uncertainties are compensated with the fuzzymodel-based state observer.

Motivation of this work
As a part of the ongoing research project, a low-cost multi-spectral camera setup was designed as shown in Fig. 2, which is mounted over a mechanical manipulator arm as seen in Fig. 3. The manipulator arm under consideration has 2-DOF as highlighted in Fig. 4. Currently, the present setup (as seen in Fig. 3) is manual, where the camera field of view (FOV) is adjusted by the human operator according to the crop/plant species being inspected to get best view of the entire testbed. With vision to automate the present setup, where the arm will be motor driven, that aims to capture images, while either in continuous motion or discrete motion to get a closer view of To alleviate the near associated problems, we presumed with a theoretical analysis [38] inspecting the application of PID controller in this direction.
While, on the contrary using any industrial state-ofthe-art robot arm like Panda 7-DOF from Franka Emika [39] that is widely used by the robotics community will work perfectly for achieving an position-based visual servoing as the feedback information extracted from the vision sensor is used to control the motion of the robot. But, then the trade-off becomes the cost of acquiring one such commercial setup (Avg. 10 500 USD). If the external camera block is shaken because of such movements, it will lead to poor image quality. Such vulnerabilities can generally be controlled offline or online [40] . In the past, researchers have focused on the first method, which required the use of sophisticated algorithms to perform various steps to create, enhance images, remove noise, and calibrate the camera offline. On the other hand, the second method for instant applications was and is more suitable. The work done in the past for online processing focused more on the use of sophisticated online algorithms. They were computationally overloaded. Therefore, given that our goal is to move towards mechanization of the current settings, we decided to study this issue in terms of hardware where control algorithms can be used to eliminate vibrations caused by the motor. For real-time applications or scenarios, an effective controller should be simplistic, robust, and resilient. Proportional derivative (PD) control as well as PID control is implemented widely in different domains as it is the best control strategy, because it demonstrates its effectiveness without knowledge of the model.
While several control techniques were used to control the vibration in the manipulator in different applications, no validated stability control technique was given to control the vibration in such envisaged agricultural manipulators with simple low-cost hardware systems with nonlinearity compensation. So, this is the main motivation of this research. Based on the motivation, the main contributions of this work are: 1) The combination of PID control with type-2 fuzzy logic (T2-F-PID) is an innovative method, and first of its kind for this application for vibration control. 2) The controller stability for the agricultural application is validated using Lyapunov analysis.
3) The implementation of a torsional actuator (TA) for mitigating torsional vibration is a new contribution in the area of agricultural manipulators. Also, to prove the effectiveness of the controller, the vibration attenuation results with T2-F-PID is compared with conventional PD/PID controllers and a type-1 fuzzy PID (T1-F-PID) controller. The entire vibration control scheme is represented by Fig. 5.
The paper is organized as follows. Section 2 describes the way the manipulator arm is controlled using the PID controller. The same is justified with mathematical analysis in Section 3. In Section 4, the proposed model is validated. Related works are enlisted in Section 5. And, finally, we conclude the paper in Section 6.

Type-fuzzy modeling of manipulator
The polar moment of inertia of a direct current (DC) motor as shown in Fig. 6 is given by signifies motor mass and signifies motor radius. Generated motor torque is represented as where the motor angular acceleration is represented by and is the frictional torque. The mathematical model of the manipulator having rotational motion due to the motor is where is the angular position, is the polar moment of inertia, is the damping force is the stiffness force vector, and is the external force on the manipulator. The manipulator with motor arrangements is shown in Fig. 7. u θ Now let be the control force required to attenuate the torsional vibration. For minimization of vibration along the theta direction, a TA, is positioned at the physical center of the motor box arrangement which can be seen in Fig. 8. The TA is a rotating disc like structure combined with a DC motor.

Fta Tτ
where is the damping and friction force vector associated with the torsional actuator. The torque generated by the torsional actuator is [41] Tτ − Fta = Pta(θta +θ) Ptaθta where is the polar moment of inertia of the TA, is the angular acceleration of the TA. The friction in the torsional actuator is u θ Pta(θta +θ). (5), is the control force to be fed to the torsional actuator for the vibration control which is equivalent to the torque force Cθ + (Fc + Fcssech(Hθ)) tanh(Bθ) − fe The term involves nonlinearity and has to be dealt with an effective manner. Now the nonlinear term can be expressed as follows:

Now in
So, (5) is For handling the nonlinearities, a type-2 fuzzy logic system is implemented. The type-2 fuzzy sets can model The type-2 fuzzy sets has advantages over type-1 fuzzy sets as type-2 fuzzy involves less fuzzy rules in dealing with uncertainty effectively. Here denotes the type-2 fuzzy set, where the characterization occurs by the type-2 membership function [32,33] : , where is considered as the primary membership of . One of the crucial parts is the footprint of uncertainty (FOU) termed to be the union of associated primary memberships: l The IF-THEN rules implemented for type-2 fuzzy logic bears the same structure as the type-1 fuzzy logic counterpart. This technique demands that the antecedents as well as the consequents are described by implementing interval type-2 Fuzzy sets. Hence, the -th rule is [42] R l : where and represent fuzzy sets. For the implementation of the centroid methodology when combined with the center-of-sets type reduction technique, the fuzzy sets associated with the type-2 technique can be converted to an interval type-1 fuzzy set by taking into consideration each rule of The deduced interval type-1 fuzzy set is represented as denote the firing strengths linked to and of rule . In the first instance, the extraction of the type-reduced set is achieved by utilizing the left most and the right most points and . Once the above step is accomplished, the defuzzification occurs by utilizing interval set type average formula in order to extract the crisp output. The output associated with the fuzzy technique can be expressed by using a singleton fuzzifier as [43]

Manipulator control
PID controllers use the feedback technique approach, which has three interconnected actions: P : To increase the response velocity; D : For the purpose of damping; I : To achieve a required steady-state response. A PID control is illustrated as where the gains of the PID controller are represented by and , and they are positive definite in nature. is the error stated as For the reference, Therefore, e = θ,ė =θ.
When the type-2 fuzzy technique is combined with the PID controller, then the outcome is The closed loop equation can be extracted from (7) and (13): Ki is the auxiliary variable. In matrix form, (15) is . Using the Stone-Weierstrass theorem, can be estimated as where the model error is represented by and Using (14) and (17), The lower bound of which is nonlinear in nature is illustrated as (20) The lower bounds are and Also, the Gaussian functions are represented by and , so λ θ a, b Now the modeling error is Lipschitz over such that: where is the Lipschitz constant. So, using (20) and (22): Also to prove the stability of the T2-F-PID control, the property of the eigen value should be considered and stated as where the min and max eigenvalues of the matrix are represented by and respectively, also is the upper bound. The following theorem gives the stability analysis of T2-F-PID controller (13). Theorem 1. If the T2-F-PID controller (13) is used to control a closed loop manipulator system (4), then the asymptotic stability of the system is assured when the fuzzy laws are ] T (24) and the PID control gains are within the range as where and are the minimum and maximum eigenvalues of the matrices Proof. Here, the Lyapunov candidate is defined as It is obvious that For validating , is distributed in three separate parts in such a manner that , The above condition is true because and and V θ3 = 1 12 Utilizing the inequality equations,
Using the Lipschitz condition (22) and the property Using (23) and (39) in (38): The stability conditions are justified (40), if □ So the controller will generate stable control forces when the gains are selected from the stability zones as represented by (43).

Analysis and validation
Manipulator parameters are obtained from [24,44] in order to confirm the capability and performance of the proposed fuzzy PID controller. These parameters are used to simulate the manipulator process and to achieve the motion with vibration control. Such parameters are used to model the process of the manipulator. They are also used to obtain the motion with a controlled vibration. The various parameters linked to the system are illustrated in Table 1. Table 1 Simulation parameters Values The input nonlinearity for the purpose of the simulation is the Coulomb friction [45] associated with the manipulator's torsional motion. The friction of the Coulomb is of a nonlinear type: α0, α1,α2θ where are the friction constants and is the velocity of the manipulator. The simulation of the manipulator is done using the Matlab/Simulink platform. The Simulink program is used to create different simulations to show the adequate vibration attenuation of the agricultural manipulator can be accomplished by using the T2-F-PID controller. The vibration attenuation capabilities of the indicated controller are contrasted with the basic PD/PID and T1-F-PID controllers to check the efficiency of the T2-F-PID controller. A PD controller is of the form: where and are the gains as stated earlier. The error is illustrated as For the reference, The simulations for generating vibration control plots are carried out for the period of 6 s. For the simulation purpose, the weight of the TA is taken as 5% of the manipulator weight. For comparing the results depicting vibration attenuation, dual subsystem simulink blocks for manipulator dynamics are created. One block is developed without the control system and the other with the control system. The inputs for the manipulator dynamics are the sinusoidal signal and the Coulomb friction which is nonlinear in nature as stated in (44). The frequency value associated with the simulation is set to 300 rad/s. The acceleration signals generated from the manipulator dynamics blocks are fed to the series of numerical integrators to extract velocity signals and position signals respectively. Overall four tests are performed in Simulink: 1) PD control, 2) PID control, 3) T1-F-PID control and 4) T2-F-PID control. For T1-F-PID control, the integrated type-1 fuzzy toolbox for Matlab/Simulink is utilized, whereas for T2-F-PID control, the open source type-2 fuzzy toolbox [46] is utilized for accomplishing fuzzy techniques. The generated control signals from the controller block is transmitted to TA for the vibration control in the manipulator. The inputs: position error and velocity error, are considered to be Gaussian membership functions. Four membership functions are allocated for position error whereas three membership functions are allocated for velocity error. Normalization is set as [−1, 1]. The type-2 fuzzy system is defuzzified using the Karnik-Mendel technique [32] . For the type-2 fuzzy system, six IF-THEN rules are sufficient to maintain the regulation error. Ten IF-THEN rules suffice for the maintenance of minimal regulation error in the case of type-1 fuzzy systems. The technique of Gaussian functions is introduced for type-1 fuzzy logic. Both type-1/type-2 fuzzy systems are based on IF-THEN rules illustrated by: where is the position error, is the velocity error, and is the required control force. , and are the fuzzy sets. The design parameters are . From Theorem 1, it is evident that the ranges of the gains can be identified. So, based on the ranges of PID gains and substituting the parameters from Table 1 to (25), the following ranges of gains are extracted: After attempting several trials with the gains based on (47), it is observed that for PD, PID, T1-F-PID and T2-F-PID controller, the most suited gains for efficient vibration attenuation as well as stability are Also, some tests were carried out by selecting the values from the ranges different from the ones extracted by the Theorem 1. For validation, we selected the gains from the ranges: proportional gain less than 219, derivative gain less than 69 and proportional gain greater than 2500. It is observed that for each and every test with the increasing gains from that zone, the results were unstable adding more vibration to the manipulator. So, all the result were discarded from the unstable zones.
To validate the performance of the controllers, the vibration attenuation comparisons are carried out among PD, PID, T1-F-PID and T2-F-PID controllers which are displayed in Figs. 9−12. The outcomes of the average vibration attenuation is computed by implementing mean squared error illustrated as , where the chatter vibration is depicted by . The total data is illustrated by . The data of the average vibration attenuation is shown in Table 2.
From Table 2, it is validated that T2-F-PID is the superior among all the controllers in vibration attenuation. Fig. 13 depicts the control signal plot of T2-F-PID controller. In Fig. 14, the plot of TA control force is illustrated.

Conclusion and future work
In this work, the stabilization and the control of the   No control PD control Fig. 9 Manipulator vibration control using PD controller vibration related to the mechanical manipulator arm is verified and validated, when the present configuration is meant to be automated as needed for agricultural applications & tasks. The camera setup, when mounted with such motorized arms, will incur tremendous vibrations. This sort of vibration hinders the quality of the acquired data. To minimize such effect, we propose an vibration control approach that uses PID controller in combination with the type-2 fuzzy logic (T2-F-PID). The PID controller produces the key control operation, while the nonlinear compensation is dealt with by means of the fuzzy logic of type-2. For active vibration control, the torsion actuator (TA) movement is simulated. The result obtained by the simulation of T2-F-PID is compared with both a simple PD/PID controller and T1-F-PID controller. The consequence of the study validates that T2 F-PID is the best of all the controllers in achieving proper vibration attenuation. The future work is intended towards the effective design of TA for better efficiency. Also, we aim to compare the effectiveness of T2-F-PID with sliding mode controllers (SMC).