#### Abstract

With the development and leap of artificial intelligence technology, more and more robots have penetrated into all walks of life. Today’s agriculture is changing in the direction of modernization and automation. On the one hand, because of rising labor costs, it cannot afford to consume a large amount of labor for agricultural operations. On the other hand, the population is growing rapidly, and traditional agricultural production, picking, and other links have been unable to keep pace with the development of the times. Therefore, it is very necessary to use artificial intelligence technology to transform traditional agriculture. The purpose of this paper is to use artificial intelligence technology to plan, track, and optimize the displacement trajectory of the agricultural picking robot, so as to improve the working efficiency of the picking robot. In this paper, the neural network, the D-H modeling method of the manipulator, and the forward and reverse motion of the manipulator are explained and analyzed, and based on the relevant algorithms of neural network, the manipulator is modeled, and then the, forward and reverse motion of the manipulator is analyzed in detail, and the digital model of the picking robot is constructed. Then, the angle and motion speed of each joint of the robot are analyzed to reduce the motion trajectory error caused by friction and other factors. Then, the simulation experiment of the displacement trajectory tracking control is carried out, and the linear trajectory motion and the arc trajectory motion are deeply analyzed, and the axis error is greatly reduced after 6 iterations. Finally, the displacement trajectory is optimized. The optimized total movement time is shortened by 6.84 seconds, which enables the picking robot to not only ensure work efficiency but also accurately complete the planned displacement trajectory. After continuous experiments on the algorithm model and the picking robot, the actual trajectory of the picking robot at 0.7 seconds can be expected. The trajectories are completely coincident, indicating that the neural network plays a very important role in the trajectory research of picking robots.

#### 1. Introduction

In recent years, the population has grown substantially, and traditional agricultural production has been unable to meet the growing demand for agricultural products. At present, the agricultural production, picking, and transportation technologies in many areas are relatively outdated. It requires a lot of manpower and material resources, which is time-consuming and labor-intensive. At the same time, it is accompanied by the pressure of agricultural resources and the shortage of labor resources. Modern agriculture urgently needs new technologies to transform and upgrade. At this time, artificial intelligence technology can play a great role in the agricultural field. Picking robots are playing an important role in intelligent agriculture. Picking robots can be programmed to achieve tasks such as picking, handling, and boxing of fruits and vegetables. It not only recognizes and locates crops quickly but also has high work efficiency and can complete high-intensity picking tasks. It plays a very important role in saving labor costs, reducing labor risks, realizing agricultural modernization, and increasing the total agricultural output value. At the same time, the development of picking robots provides theoretical support and practical experience for the improvement and application of artificial intelligence technology. Therefore, it is the general trend to promote the development of agriculture to study the displacement trajectory tracking control technology of agricultural picking robots.

Agricultural development is moving towards large-scale and intelligent modernization. The cost of agricultural labor is gradually rising, which will inevitably lead to a shortage of labor. Therefore, it is essential for artificial intelligence to enter the production and transportation links of agriculture. The planting, picking, transportation, and processing of crops are becoming automated and mechanized. Traditional agricultural picking is labor-intensive, expensive, and inefficient. The modern agricultural picking robot can greatly reduce the labor intensity of farmers, save costs, improve picking efficiency, ensure that fruits and vegetables are harvested within an appropriate time, and avoid spoilage and waste caused by too late picking. The development of picking robots not only adds power to agricultural production but also greatly promotes the reform and upgrading of agricultural management models. In the past, all links required labor, and now the whole machine can be operated, and labor costs have been greatly reduced. At the same time, the research on picking robot science and technology also provides practical experience for the improvement and development of artificial intelligence. This has far-reaching significance for improving the growth of agricultural output value and the development of artificial intelligence.

The innovations of this paper are as follows: (1) It uses artificial intelligence technology to track the displacement trajectory of the agricultural picking robot, control the moving direction and speed of the picking robot, and improve the picking efficiency. (2) The change matrix is used to describe the pose, which simplifies the process of robot displacement planning. (3) Combined with the theory of iterative operation, the axis error is used to mediate and improve the tracking of the displacement trajectory. The trajectory error obtained by the experiment is processed and transmitted to the controller, and the controller operates the robot to repeat the experimental operation continuously, and the error is reduced through continuous experiments, and the accuracy of the tracking control of the displacement trajectory is improved.

#### 2. Related Work

Many scholars have paid attention to the research on the control algorithm of robot displacement trajectory tracking. Ou et al. discussed the fixed-time tracking control of nonholonomic wheeled mobile robots based on visual servoing. They proposed a tracking error system between the mobile robot and the desired trajectory, enabling the robot to track the reference trajectory in a fixed time. However, this process is complicated and may result in inaccurate results [1]. Ma et al. introduced the U-model method to relieve the requirement of dynamic mathematical model and simplify the design of the trajectory tracking controller of the manipulator. However, there are certain errors in this method, resulting in insufficient accuracy [2]. Peng et al. proposed a controlled DAE-based optimal control (IOC) method. A series of IOC problems tend to be continuous trajectory tracking problems at each time step, and a Linear Complementarity Problem (LCP) is derived to solve the IOC problem. This method provides a unified framework for solving the trajectory tracking control problem of robotic multibody dynamic systems. However, this method is relatively old, the data obtained is slightly lacking, and there is a lack of innovation [3]. Khalilpour et al. proposed a novel feedback method. On the premise of dynamic visual recognition, the joint motion sensor is optimized to improve the performance of trajectory tracking, and the oscillation is reduced through the operation of the end effector. The authors derive kinetic formulations for large-scale deployable cable-driven robots. The model can better satisfy the stability condition [4]. Wang et al. proposed a wavelet neural network fuzzy sliding mode controller for the nonlinear problem of the manipulator system. The experimental results show that the proposed control scheme is suitable for 3-DOF robot displacement trajectory tracking control. But this method has higher requirements on the accuracy of the algorithm model [5]. Bensafia et al. utilize Fractional Model Reference Adaptive Controller (FMRAC) to achieve smooth trajectories and optimize the performance of the robotic arm of the SCARA robot. However, this operation has requirements on the data analysis environment and needs to be performed in a stable environment [6]. He et al. optimize the online computation of MPC using a model predictive control- (MPC-) based tracking controller. The method includes threshold curve-based event triggering and threshold band-based event triggering. However, this method is based on a large amount of historical data and requires an accurate database as support [7].

#### 3. Picking Robot Trajectory Tracking Control Algorithm

##### 3.1. Radial Basis Neural Network (RBF)

Radial basis neural network is a feed-forward neural network model without feedback. It is usually presented as a three-layer feedforward network: input layer, hidden layer, and output layer [8]. Input nodes can transmit a large amount of information from the outside world to the neural network. The hidden layer maps these input variables into a nonlinear space [9]. In the hidden layer space, the input variables will then be transmitted, and the activation function will be generated after the action. This activation function is the radial basis function, which corresponds to the hidden layer neurons one-to-one [10, 11]. If the number of hidden layer nodes in the radial basis neural network increases, the solving ability and approximation ability of the corresponding network will be stronger, and the structure will be more complex. The structure of the output layer is relatively simple. The linear weighted sum of the output of the hidden nodes obtained after continuous calculation is the output result [12]. Figure 1 is the basic structure of radial basis neural network.

Supposing represents the number of input nodes, represents the number of hidden layer nodes, and represents the number of output nodes. The input vector is denoted as , the output matrix is denoted as , is the node position, and the th hidden layer, , is presented. The output is the weight matrix, where , and the vector is .

There are the following three expressions of the activation function: (1)Multiple quadratic functions(2)Inverse multiple quadratic function(3)Gaussian function

The input value is set to , the center of the basis function is set to , and the th is presented. The smoothing factor is . l is the number of hidden layer centers, and is the norm. has a maximum value in , and there is one and only this one. If the value of increases, becomes zero.

The output layer is calculated by the hidden layer:

Among them, is represented as a weight value, which is between the th hidden layer node and the th output layer node.

As the variables of the input layer of the Gaussian function increase, the system does not become more complex. And the smoothness of the Gaussian function is good, which is convenient for theoretical analysis [13]. Therefore, the Gaussian function is a calculation function often used by the radial basis function.

##### 3.2. D-H Modeling Method of Robotic Arm

###### 3.2.1. Parameters

The robotic arm D-H establishes a coordinate system on each link. The relationship between adjacent coordinate systems is represented by a matrix transformation [14–17]. After transformation, the pose of the end effector is obtained, and the pose is represented by base coordinates.

The adjacent coordinate systems and links are represented by the second transformation matrix. If the motion analysis of the manipulator is to be performed, each link must be analyzed and described [18–20]. is the rod length and is the torsion angle. In addition, is the offset distance, indicating the distance between the two links, and is the joint angle, indicating the number of angles formed by the normal lines of the two links. The resulting parameters are shown in Figure 2.

###### 3.2.2. Establish a Coordinate Axis

The pose relationship between each link is a coordinate system fixed on each link. The coordinate system is the coordinate system of the end of the manipulator, and is the coordinate system fixed to the link .

For a rotary joint, the joint parameters are , , and , and the joint variable is . For moving joints, the joint parameters are , , and , and the joint variable is .

From this, the relationship between the coordinate system and the coordinate system is

is a homogeneous transformation matrix between two adjacent coordinate systems and coordinate system .

The homogeneous transformation matrix of any coordinate system relative to the base coordinate system is the continuous product of each adjacent homogeneous transformation matrix , written as

The attitude matrix of the th coordinate system is , and the position vector of the th coordinate system is .

###### 3.2.3. Establish the Motion Equation of the Manipulator

A five-degree-of-freedom serial robot is established, and the five joints are rotatable, as shown in Figure 3.

Synthetically, the coordinate system is established, the base coordinate system {0} is taken, and the hand coordinate system is {5}, and Figure 4 is obtained.

According to the coordinate system, D-H is established as shown in Table 1.

It can be seen from Table 1 that among the five joints, the fifth robotic arm used for picking operations has the longest offset distance, and the second and third joints used to adjust the picking distance have the longest rod lengths. The first and fourth joints can be used to adjust the angle of picking.

##### 3.3. Picking Robot Solution

###### 3.3.1. The Robotic Arm Is Moving

The forward motion of the manipulator is the pose of the manipulator end effector in the coordinate system [21].

The total transformation matrix from the base coordinate system to the hand coordinate system is

Among them,

, , and so on.

From this, the pose of the hand coordinates in the base coordinate system can be obtained.

###### 3.3.2. Reverse Motion of the Robotic Arm

The inverse motion of the manipulator is the joint variable obtained based on the known pose of the manipulator end in the coordinate system [22]. Using the algebraic method, the joint variables , , , , and of the inverse motion are obtained.

Multiplying formula (7) by the left of yields

Both ends are represented as

Putting (3,4) on both sides of formula (10), it gets

With trigonometric transformation, it gets

Among them, .

It can be derived as follows:

Formula (7) both sides (1,3) and (2,3) get

By solving, it can get

Formula (7) on both sides (1,4) and (2,4), it can get

Letting and , get

Letting , then

has two solutions, which are represented by positive and negative signs.

Left-multiplying by formula (7), we get

Both ends get

Equating both ends (1,3) and (2,3) of formula (20), it gets

Letting and be substituted into formula (21) to get

Multiplying to the left by formula (7), it gets

Both ends are obtained as

Equating both ends (1,3) and (2,3) of formula (24), it can get

It combines formula (21) and formula (25) to get

Equating both sides (3,1) and (3,2) of formula (24), it gets

Letting and , get

To sum up, the inverse solution of the five-degree-of-freedom robot is obtained. In practical work, the most suitable solution can be selected based on the method that conforms to the shortest path, the shortest time-consuming, and the least energy-consuming method to improve the efficiency of the robot [23].

#### 4. Robot Displacement Trajectory Tracking Experiment

##### 4.1. Neural Network Control

The displacement trajectory tracking of the picking robot controlled by the neural network is shown in the following figure:

It can be concluded from Figure 5 that the actual trajectory of the picking robot can completely coincide with the expected trajectory in 0.7 seconds.

In the actual operation process, there may be errors in the joint operation of the robot, which will cause small fluctuations [24]. But this will not affect the tracking performance.

The angle and velocity changes of each joint are shown in Figure 6.

It can be seen from Figure 6 that the joints of the picking robot move independently. In the process of moving, whether the speed suddenly changes will have a greater impact on the working effect and performance of the robotic arm. If there is a sudden change in speed, the robotic arm will be impacted and vibrated accordingly. This will affect the stability of the manipulator and reduce the efficiency [25–27]. The change curve of each joint angle and velocity reflected in Figure 6 is continuous and smooth. The speed of the start node and the stop node is both 0, and there is no sudden change. This shows that the robot under the control of neural network runs smoothly and has good performance. It is feasible to use neural network control to plan and track the displacement of the robot.

##### 4.2. Displacement Trajectory Tracking Control Experiment

The experiment was divided into two phases. In the first stage, the line segment connecting and in the planning space is the desired trajectory of the end of the third axis of the picking robot. Assuming that the motion time is 0.83 seconds, the parameters of the controller are and , and the iterative process selects a round trip between and .

The arc connecting and in the second-stage planning plane is the expected trajectory of the end of the second axis of the picking robot. Assuming that the movement time is 5.28 seconds, the parameters of the controller are also and , and the back and forth between and is used as an iterative process. Then, the trajectory error information is obtained, and the error is substituted into the control law for calculation, and the iteration coefficient and compensation torque of the first iteration process are obtained. It is then transmitted to the controller, which operates the robot for a second movement [28]. Repeating the above operations continuously can obtain the error data of each movement, as shown in Figure 7.

The variation of each axis error of the picking robot trajectory movement is shown in Figure 7. It can be seen from the figure that the error fluctuates with the increase of time. In the first axis, when the time is 300 s and 500 s, the error is the largest; in the second axis, when the time is 100 s, 300 s, 500 s, and 700 s, respectively, the error is maximum. Because of the leading term of the first iteration, the first iteration curve can be viewed as a trajectory error curve without algorithmic guidance. However, the axis error of the subsequent iteration curves decreases with the increase of the number of iterations. The axis error is greatly reduced after 6 iterations, as shown in Tables 2 and 3.

In the test, the reducer of the first axis used a harmonic reducer, which made the friction torque smaller [29]. Therefore, the curve of the first axis is gentler than that of the second axis. The second axis is a linear motion that is transmitted to the ball screw through a multistage gear train reducer and a synchronous belt. However, the gear train reducer has the disadvantage of uneven friction, so it shows a trend of fluctuation.

Figure 8 shows the error curve of each axis of the picking robot’s arc trajectory motion. It can be seen from the figure that the data shows a fluctuating trend. Both the first axis and the second axis reach the maximum error when the time is 2000 s, and the error of the second axis reaches a small peak at 1000 s. Since the arc motion is limited by the centripetal acceleration, the convergence speed of the arc orbit is slower than that of the linear orbit. So the running speed will drop, which makes the iterative effect less obvious than the linear motion [30]. The specific data table is shown in Table 3. The circular arc trajectory movement has a sudden change at 2000 ms, which corresponds to the corner of the trajectory.

The experimental results show that the adaptive iterative learning control algorithm can well complete the trajectory tracking task. With the increase of the number of iterations, the trajectory error can be reduced to a certain range and has better tracking effect for the case of large initial error.

##### 4.3. Displacement Trajectory Optimization of Picking Robot

In order to improve the operating efficiency of the robot and ensure that the robot can complete the task in a short time, the trajectory of the robot can be optimized to reduce the impact force the robot receives during operation [31].

It starts from the initial population and selects the best individual in the current cluster based on the evaluation function values of all corresponding individuals. It uses intersection and mutation to generate new subclusters [32], which evolve the clusters into better regions to find the optimal solution. The main calculation process is as follows: (1)First, assign all parameters, including the number of individuals, the number of variables, the frequency of crossover, the probability of mutation that may occur, and the algebra used to end the operation(2)It creates an area scanner and determines the interval to which it belongs. The interval to which a variable belongs is determined by the constraints of finding the variable for a particular problem(3)In the interval to which the variable belongs, convert all individual codes that exist in the solution space, so that the solution space is transformed into a genetic space(4)It determines the initial cluster, randomly generates a parent cluster containing individuals, and sets the individuals as the starting point, and uses the neural network and D-H modeling method to start the operation. Then, let be the last terminated genetic algebra(5)The initial cluster is brought into the calculation, each fitness function value is obtained, and the individual with relatively excellent fitness value is selected after comparison(6)The cluster is subjected to genetic operations, such as selection, mutation, crossover, and recombination, so that the cluster p(e) is transformed into the next generation cluster p(e+1)(7)After a series of operations, the individual fitness values in the optimal solutions of all clusters are obtained, and the optimal solutions of each cluster are judged. The operation is terminated if the termination condition is met

The specific process is shown in Figure 9.

Letting the time interval be , the obtained time series comparison table before and after optimization is shown in Table 4.

The optimized picking robot can reach the set point of the movement trajectory in a short time. The total exercise time was shortened by 6.84 seconds from 14.19 seconds to 7.35 seconds. There is no deviation between the must-pass points after optimization and those before optimization. The picking robot can complete the motion trajectory accurately and without error. The optimized robot can also better cope with the impact on the movement, reduce the impact of the impact on the movement and picking operations, and improve the operation and work efficiency [33].

#### 5. Discussion

This paper is dedicated to the application of artificial intelligence technology to study the displacement trajectory tracking control of agricultural picking robots. It not only roughly describes the neural network, D-H modeling method and the forward and reverse motion of the manipulator, and combining artificial intelligence with the research of displacement trajectory tracking control of picking robot, radial basis function neural network is used to guide the establishment of algorithm model, but also is a new attempt to track and control the displacement trajectory of the picking robot. By modeling the robotic arm and analyzing the movement trajectory of the robot, the displacement trajectory of the robot can be tracked and controlled, and the operation and work efficiency of the picking robot can be improved.

Through the analysis of this paper, it shows that artificial intelligence has profound significance in the trajectory tracking control of robots. The use of agricultural picking robots under the guidance of artificial intelligence technology to carry out operations such as picking, handling, and packaging of agricultural products can save labor costs, realize agricultural modernization, and improve the total output value of agriculture and the entire social economy, thereby promoting the rapid development of society and economy. In this paper, the motion simulation model of the robot is established through the neural network method, the D-H modeling method, and the forward and reverse motion analysis of the manipulator. It plans, tracks, and optimizes the motion trajectory of the robot, and the running error of the robot is greatly reduced through experimental analysis. And the total time of the optimized robot movement is shortened by 6.84 seconds, which can better cope with the impact during operation, improve work efficiency, and complete work tasks.

#### 6. Conclusions

Through the analysis of this paper, the following conclusions are drawn: (1) The actual trajectory of the picking robot under the control of the neural network can completely coincide with the expected trajectory in 0.7 seconds. The running process of the robot is relatively stable, and the performance is better. The neural network has a good effect on the tracking control of the displacement trajectory. (2) It applies the D-H modeling method to the modeling of the manipulator and solves and analyzes the forward and inverse motion equations of the manipulator. Then, the displacement trajectory of the robot is planned, and experiments are carried out to simulate the displacement trajectory of the robot, and the tracking and control are carried out. The experimental results verify that the forward and reverse motion of the manipulator under the guidance of artificial intelligence technology is reasonable. The position and velocity of the end of the robotic arm changes smoothly. And the axis error is greatly reduced after 6 iterations. (3) The displacement trajectory optimization under the guidance of artificial intelligence can improve the operation efficiency of the robot and ensure the completion rate of the robot in a short time. And the optimized total motion time is shortened by 6.84 seconds, which ensures high efficiency and ensures that the displacement trajectory will not be deviated. (4) This paper makes a certain contribution to the research on the algorithm of the tracking control of the displacement trajectory of the agricultural picking robot. But there are also shortcomings. The robot will generate friction during the movement process, and this friction force is more complicated. It is very important to conduct an in-depth analysis of the friction force of the robot in the future research. In the actual operation process, the robot will encounter some obstacles such as branches and trunks during the operation. The situation and displacement changes that will occur when encountering obstacles also need further study.

#### Data Availability

The data that support the findings of this study are available from the corresponding author upon reasonable request.

#### Conflicts of Interest

The authors declared no potential conflicts of interest with respect to the research, author- ship, and/or publication of this article.

#### Acknowledgments

This work was supported by the Special Fund Project for Rural Revitalization Strategy of Bureau of Science and Technology of Huizhou Municipality (No. 2021SC040202005).