1. Introduction
Greenhouse production can prevent crops from being exposed to uncontrolled external factors [
1], enhance crop yields, and alleviate farmers’ labor burdens. This method has steadily gained traction as a preferred model of facility-based agricultural production [
2]. In addition, greenhouses can control and regulate parameters such as solar radiation, air temperature, relative humidity, and carbon dioxide concentration inside the greenhouse through shading, cooling, heating, fogging, ventilation, and other systems to provide growth conditions for crops [
3]. In tropical regions, high temperatures, intense solar radiation, low precipitation, and relatively low humidity are the primary characteristics of arid ecosystems, rendering them unsuitable for the growth and development of vegetable crops [
4]. However, with the continuous growth of the global population, these regions face increasing pressure to meet rising food demands. Greenhouse cultivation offers a viable solution by expanding vegetable production while mitigating the adverse effects of climatic conditions. In recent years, greenhouse cultivation has gained significant momentum in tropical areas, as it can alleviate the negative impacts of hot and dry environments on vegetable crops. Moreover, it enables high resource-use efficiency even under resource-constrained conditions [
5]. However, many operational aspects of greenhouse production, such as greenhouse material handling, fruit and vegetable picking, fertilization, and irrigation, still rely on manual operations, which are not only labor-intensive and less efficient but also prone to fatigue of personnel, thus affecting the quality of long-term operation. Traditional greenhouse management relies on experience and is intermittent; thus, it cannot effectively deal with environmental disturbances and spatial variations. These inefficiencies result in the needless depletion of resources and the emergence of environmental challenges [
6]. With the aggravation of agricultural labor shortage, relying on traditional human methods to complete greenhouse operations is facing increasing challenges. Therefore, the development of autonomous following robots suitable for facility agriculture is crucial to the development of modern facility agriculture.
As a kind of intelligent agricultural equipment, autonomous following greenhouse operation robots can recognize targets autonomously, adjust the traveling speed automatically, and execute the operation task precisely, thus effectively improving the intelligence level of greenhouse operations [
7]. As agricultural automation progresses, integrating intelligent algorithms into the navigation control of field robots is highly valuable for boosting their navigational precision and operational efficiency [
8]. Currently, Ben-Gurion University of the Negev in Israel, in conjunction with Wageningen University and Research Center in the Netherlands, has developed a SWEEPER robot that can harvest mature crops, allowing for the adjustment of the robot’s operating height [
9]. In 2020, at Sungkyunkwan University in South Korea, Algabri et al. conducted a study on indoor human body following in mobile robots based on color features to achieve target person recognition and obstacle avoidance using simultaneous localization of LIDAR sensors and map algorithms [
10]. In 2012, at Meiji University in Japan, Morioka et al. proposed a method to correct the position and heading data of a mobile robot in a smart space through collaboration between the mobile robot and a laser range scanner in a smart space. In addition, the following of a human body was realized by proposing a method to update the position data by evaluating the uncertainty of the robot’s recognized position and sending a position request to the smart space; moreover, experiments were conducted to verify the effectiveness of this method for mobile robot following when the followed target is walking [
11].
Path tracking control is a crucial part of automatic following motion, mainly through the combination of speed control and direction control; thus, the device can adjust the motion state in real time in different scenarios to reduce the error of deviation from the path so that the robot can accurately travel along the preset path and maintain a stable following effect [
12]. In 2018, A model predictive control (MPC) method for differentially driven mobile robots was proposed by Bouzoualegh et al. at the French Institute of Technology. Simulation results showed that the method achieves a good balance between convergence time and energy consumption [
13]. In 2016, Ammar et al. of IMSIU University in Saudi Arabia proposed two improved time linear algorithms, i.e., the relaxed version of Dijkstra’s algorithm and the relaxed version of A-algorithm, for the path planning problem in large-scale grid environments, which provide a more efficient solution to the large-scale path planning problem [
14]. In 2016, Rudra et al. of Jadapur University in India proposed a block backstepping-based control algorithm for optimizing trajectory tracking and stability of differentially driven wheeled mobile robots [
15]. In 2024, a path planning method based on an improved A* algorithm + low-order multisegment Bezier curve splicing algorithm was proposed by Zhang et al. from Shandong Agricultural University [
16]. In the same year, Pan et al. from Tianjin Urban Construction University proposed a dynamic extended neighborhood ant colony optimization algorithm to improve the overall quality of paths further [
17]. In 2023, Shih et al. from Dalian Jiaotong University proposed a hybrid path planning strategy integrating the global ant colony algorithm and the local artificial potential field method. The hybrid algorithm was verified to have high adaptability and planning efficiency in complex static and dynamic environments [
18]. In 2022, Cui et al. from Northwest Agriculture and Forestry University proposed an improved randomized tree expansion method (i.e., Straight-RRT), whose core idea lies in the use of sampling state to guide the expansion process in real time, thus reducing path complexity [
19]. A series of path planning algorithms can effectively facilitate the accurate navigation and walking of indoor robots, but the application of greenhouse autonomous following robots based on LQR–Pure Pursuit in greenhouses has not been reported.
The key to the autonomous following greenhouse robot lies in the localization problem of the followed target, the path tracking problem during the following process, and the traveling speed control problem [
20]. The greenhouse operation robot path tracking has the following aims: (1) plan rationally the optimal traveling trajectory for the robot to follow according to the position information of the target to be followed and the environmental layout in the greenhouse; (2) ensure that the robot maintains a stable following state while avoiding obstacles so that it can adapt to the target speed change, path curvature, or environmental complexity, etc.; (3) ensure the stability and accuracy of the following [
21]. Therefore, this study proposes a path tracking method based on an LQR-optimized pure tracking algorithm and develops an autonomous greenhouse following robot. First, the design and selection of the tracked chassis were conducted in accordance with different working conditions in a complex environment in a greenhouse, and the key components of the chassis were calibrated with finite elements. Subsequently, the chassis kinematic model was established in accordance with the robot structure, and the following strategy using the LQR-optimized pure tracking algorithm was proposed and verified through simulation in MATLAB R2024a. Finally, the stability of the robot and the reliability of the LQR-optimized pure tracking algorithm were verified indoors.
2. Materials and Methods
2.1. Structure and Working Principle of Tracked Chassis
The tracked chassis is a key component of the greenhouse operation robot, and the design of a reasonable chassis, along with the selection of an appropriate drive system, directly affects the stability of the robot in different terrains and working environments. The robot operates in a tropical greenhouse where temperatures range from 30 to 40 °C and relative humidity ranges from 60 to 80%. The soil floor is a moist, friable loam with shallow furrows and occasional water pooling, creating a soft, uneven surface. Owing to irregular terrain features such as furrows and gullies, the greenhouse operation robot must also possess adequate climbing ability to negotiate varying slope gradients, as illustrated in
Figure 1. These conditions led us to choose a low-ground-pressure tracked chassis. The tracked chassis mainly consists of two independently driven permanent magnet DC brushless motors (Zhejiang UNITE Motor Co., Ltd., Zhejiang Province, China), track wheels (Sangpu Agricultural Machinery Co., Ltd., Changzhou, China), control system, Ultra Wide Band (UWB) receiving base station (Dalian Haoru Technology Co., Ltd., Dalian, China), hydraulic actuator (Nanjing Liyixun Electronics Co., Ltd., Nanjing, China), and frame. The control system includes an upper computer (Shenzhen Langbang Industrial Control Technology Co., Ltd., Shenzhen, China), a lower computer (Arduino, Italy), a motor driver (Chengdu Akelc Electronic Technology Co., Ltd., Chengdu, China), and an angle sensor (Shenzhen WITMotion Technology Co., Ltd., Shenzhen, China). An industrial computer is used as the upper computer to receive and process the data from the UWB positioning sensors, ensure the accuracy of the positioning information, integrate the data from various sensors, and finally send motion control commands to the lower computer. An Arduino motherboard is used as the lower computer, which is responsible for tasks such as motor control, data exchange, and motion control. As shown in
Figure 2 (the control system), the hydraulic actuator is powered by the power supply box battery.
The chassis is powered by DC brushless motors that drive the track wheels via sprockets. The main parameters of the robot are shown in
Table 1.
2.2. Crawler Chassis Traveling Resistance Analysis and Drive System Design
The complex working environment of greenhouse operation robots requires the tracked chassis to have high terrain adaptability and driving stability. To ensure that the chassis can operate normally under different working conditions and complete the transfer, its driving resistance must be analyzed in detail. Moreover, the driving power of the chassis must be calculated and analyzed to clarify the specifications and power required by the drive motor and lay a theoretical foundation for the subsequent power system design.
2.2.1. Crawler Chassis Traveling Resistance Analysis
During driving, the greenhouse following robot faces different operation scenes such as straight-line driving, steering, climbing, etc. To meet the needs of normal operation and transfer in the process of operation, the driving resistance of the crawler chassis must be analyzed for these different operation scenes. The following is an analysis of the linear driving resistance, steering driving resistance, and slope driving resistance of the crawler chassis during driving.
2.2.2. Straight-Line Driving Resistance Analysis
In straight-line driving, the greenhouse following robot is affected by the ground friction resistance, especially when traveling on the soft road surface, where the force can best reflect the real force of the tracked chassis in the complex environment. By theoretically analyzing the soil resistance and ground adhesion of the tracked chassis, their relationship with soil physical parameters, track grounding length, and width can be derived [
22]. Soil resistance and adhesion are important factors affecting the resistance of straight-line driving, while the track grounding length and width directly affect the contact area with the ground and the size of the friction, which in turn determines the resistance that the tracked chassis needs to overcome when traveling. The combined effect of these factors determines the efficiency and stability of the greenhouse following robot in the straight-line traveling process.
The resistance
experienced by the greenhouse following robot during its linear trajectory is primarily attributed to the vertical deformation of the road surface. When the greenhouse following robot exerts a pressure that generates a vehicle trail characterized by a length of
, a width of
, and a depth of
, the required work is represented by Equation (2). The resistance
experienced by the greenhouse following robot during its linear trajectory on the ground is given by
In Equation by the Bekker pressurization model [
23],
is the amount of soil subsidence in the pavement,
is the track load in the vertical direction,
is the soil cohesion deformation modulus,
is the soil friction deformation modulus,
is the track grounding length, and
is the track width.
The above analysis reveals that when the vertical direction load acting on the track from the road surface remains unchanged, increasing the width and grounding length of the track can effectively reduce the resistance in the process of traveling in a straight line, among which, increasing the grounding length of the track has a more considerable effect on reducing the soil resistance.
2.2.3. Steering Ride Resistance Analysis
The resistance of greenhouse following robots in steering traveling is relatively complex, mainly originating from the friction resistance between the tracks and the ground, scraping resistance, and the resistance of the tracks squeezing and shearing the soil. When steering, the contact point between the track and the ground will have relative sliding, generating friction, which leads to the increase in steering resistance; when the track is in contact with the ground, it may also drive the soil or road material to be scraped up, which generates additional scraping resistance; and the squeezing and shearing effect of the track will lead to deformation of the soil, which also generates resistance to steering. One of the biggest influences on the traveling performance of the tracked chassis is the frictional resistance between the track and the ground. A sketch of the steering motion of the tracked chassis is shown in
Figure 3.
Under the assumption that the support surface of the track is in full contact with the ground during the steering of the greenhouse following robot and that the specific pressure of the track on the ground is uniformly distributed [
24], the steering resistance
for a unilateral rubber track is calculated as follows:
In the equation,
is the coefficient of additional resistance of track side scraping, of which the value is estimated to be 1.15.
is the coefficient of steering resistance generated by the friction between the track and the ground, and the steering resistance coefficients of different ground surfaces are shown in
Table 2.
L is the track grounding length, and B is the rubber track pitch.
According to Equation (4), when the mass of the tracked chassis is kept constant and traveling on the same road surface, the additional resistance coefficient and ground friction resistance coefficient are considered constant. By reasonably controlling the ratio of track grounding length and pitch, the resistance during steering can be effectively reduced. In the actual driving process, the resistance coefficient suffered by the tracked chassis in the steering process is closely related to the ground parameters, turning radius, specific pressure distribution of the chassis to the ground, and the grounding width of the tracks. The steering drag coefficient
can be calculated by using Equation (5):
In the equation,
is the maximum drag coefficient when braking a single track, as shown in
Table 2;
is the relative turning radius,
, where
is the steering radius.
2.2.4. Ramp Driving Resistance Analysis
The grade resistance refers to the resistive force experienced by the greenhouse following robot during uphill movement along a slope, resulting from the component of the robot’s own gravitational force acting in the direction of the slope. A force analysis of the tracked chassis during the robot’s uphill traversal is illustrated in
Figure 4.
The greenhouse following robot ramp traveling resistance
is
In the equation, is the quality of the greenhouse following robot, and is the ramp angle.
The analysis of , , in the process of driving reveals that the increase in body weight directly leads to an increase in resistance, thus requiring an increased driving force to overcome the resistance. Through reasonable lightweight design, such as the use of high-strength materials and optimization of structural design, the deadweight of the body can be reduced without reducing the load capacity, thus reducing the energy consumption and resistance when driving. Therefore, improving the operating performance of greenhouse following robots in complex environments is crucial.
2.2.5. Crawler Chassis Driving Power Analysis
According to the operational requirements of the greenhouse following robot, under normal operation and transfer, it has three basic working conditions: straight-line driving, steering driving, and climbing. When selecting the power system of the traveling device, the driving force required under these three working conditions must be considered to determine the power of the motor and thus ensure that the greenhouse following robot can operate stably and efficiently under different working conditions. Therefore, this section analyzes the driving power under different working conditions of greenhouse following robots.
2.2.6. Straight-Line Driving Force Analysis
The force analysis of the tracked chassis of the greenhouse following robot when traveling in a straight line is shown in
Figure 5, where
is the self-weight of the greenhouse following robot,
is the inertial resistance, and
is the traction force of the tracked chassis. Air resistance is not considered because greenhouse following robots travel at low speeds.
When the crawler chassis is in force equilibrium during straight-line driving, the total traction force
of the machine is
The rolling resistance
is related to the total mass
of the greenhouse following robot and can be calculated using the empirical formula [
25]:
From Equations (3), (7) and (8), when the greenhouse following robot is fully loaded with a mass of 480 kg and moves in a straight line, the maximum required traction force of the crawler chassis is approximately 1175 N.
2.2.7. Steering Driving Force Analysis
When the crawler chassis turns on level ground, in addition to the turning resistance
, it is affected by the straight driving resistance; that is, the soil adhesion resistance
and the rolling resistance
, and the total traction force required during turning
is
From Equations (3), (4), (8) and (9), when the greenhouse following robot is fully loaded with 480 kg and turns, the maximum required traction force is approximately 4508 N.
2.2.8. Ramp Driving Force Analysis
When the crawler chassis drives uphill, in addition to the slope resistance
generated by gravity, it is affected by the straight driving resistance; that is, the soil adhesion resistance
and the rolling resistance
. The total traction force required when the crawler chassis climbs a slope
is
From Equations (3), (6), (8) and (10), when the temperature-controlled following robot is fully loaded with 480 kg and drives on a slope with a 15° incline, the maximum required traction force is approximately 2850 N.
According to the calculations of the maximum traction force required for the temperature-controlled following robot under the above three driving conditions, the largest value is 4508 N. When the temperature-controlled following robot is fully loaded with 480 kg and drives at a speed of 3.6 km/h, the driving power requirement is [
26]
In the equation,
is transmission efficiency, the value of
is estimated to be 0.9, and the required drive power is approximately 5009 W. The power required for a single-side drive motor is
2.2.9. Crawler Chassis Drive Motor Adaptation Analysis
When selecting the drive motor for the greenhouse following robot, whether the output power and torque of the motor meet the requirements for starting, accelerating, climbing, and loading must be comprehensively considered, and the motor must have good speed regulation and response performance to realize precise control. In combination with the actual working environment of the chassis, economy, and design margin, the DC brushless motor model YP100B3/5-48V3.0-1500 is selected, and the specific parameters are shown in
Table 3. The model has good speed regulation performance and thermal management capability, can keep the temperature stable under long-time operation, and adapts to the needs of indoor, greenhouse, and other complex environments.
Given the limitations of the operating environment, the power of the motor cannot be transmitted to the drive wheel through the shaft; thus, this study uses the chain drive in the mechanical transmission. In combination with the actual working requirements of the greenhouse following robot and GB/T 10855-2016 [
27], the number of teeth on the driving sprocket
is chosen to be 14. Generally, the transmission ratio
should not exceed 7. The number of teeth on the driven sprocket
is thus chosen to be 41. The transmission ratio
is
2.3. Finite Element Analysis and Preprocessing of Tracked Chassis
To ensure that the structural performance of the following robot meets the requirements in the stationary state, this section mainly uses ANSYS Workbench 19.2 to analyze the key load-bearing parts of the robot statically. The specific analysis objects include the upper structure (the upper retractable robot), the lower structure (the structure that connects the track chassis and supports the upper part), and the bottom structure (the structure that connects the load wheels and carries the retractable device). In consideration of the symmetry of the following robot, only one side of the lower structure and the bottom structure are analyzed. In accordance with the designed working conditions of the following robot, two typical scenarios are emphasized: one is the force state when the robot is stationary on the horizontal ground, and the other is the force state when the robot is stationary on the 15° ramp. Through the static analysis under these two working conditions, the strength, stiffness, and stability of each key component are verified, and the safety check of the overall structural design of the robot is completed.
2.3.1. Model Simplification
Before the static analysis of the key components of the following robot, the model that has been created to remove some geometric details must be simplified to avoid the phenomenon of stress concentration. The materials of the key components are all 45 steel with a modulus of elasticity of 209 GPa, Poisson’s ratio of 0.269, and density of 7850 kg/m
3. The simplified model is shown in
Figure 6.
2.3.2. Grid Division
Adaptive sizing is used when meshing, and resolution is set to 7. Transition is set to “slow” to produce a slow mesh transition. The span angle center is set to “fine” to refine the edge mesh of the bolt holes. In terms of quality, smoothing is set to “high” to obtain a more uniform mesh. The final mesh obtained is shown in
Figure 7, and the grid properties are presented in
Table 4.
2.3.3. Boundary Conditions and Load Application
For the superstructure, fixing constraints are applied at the eight bolt holes where it is fixed to the hydraulic rod. For the substructure, fixing constraints are applied at the 16 bolt holes where it is fixed to the bottom structure. For the bottom structure, fixing constraints are applied at the eight axle holes where it is fixed to the load wheel.
The robot at rest is mainly subjected to the force of gravity and the pressure of the carrier on it; here, the dead weight of the robot is ignored, and only the pressure of the carrier is applied to the part. The maximum load of the machine is 600 kg; thus, a force of at least 6000 N must be applied. To ensure the safety of the machine during actual operation, a safety factor of 1.2 has been chosen, which gives a total force of 7200 N to be applied to the machine.
For the superstructure, a force of 7200 N is applied to the upper surface of the telescopic rod in a direction down the
Y-axis. For the substructure, a force of 3600 N is applied at the four holes where it is attached to the hydraulic rod, in a direction down the
Y-axis. For the substructure, a force of 3600 N is applied in the direction of the
Y-axis downwards at the 16 bolt holes where it is fixed to the substructure. For the case of following the robot stationary on a 15° ramp, the direction of load application must be offset by 15° from the
Y-axis. The specific load application is shown in
Figure 8.
2.4. Tracked Chassis Kinematics Modeling
The greenhouse following robot’s track chassis adopts the principle of differential steering, which enables the greenhouse following robot to steer by controlling the speed difference between the left and right tracks. In this study, under the assumption that the greenhouse following robot’s track chassis has no skidding phenomenon during driving, the track differential kinematics model is established [
28], as shown in
Figure 9.
In
Figure 9, C (
,
) is the geometric center of the greenhouse following robot, where
and
are the left and right track angular velocity, and the left and right track linear velocities are
and
;
is the center distance between the two sides of the tracks. The relationship between the linear and angular velocities of the left and right tracks is
In the equation,
is the radius of the track driving wheel. With the ground taken as the reference system, the plane right-angle coordinate system XOY is established; the position information of the greenhouse following robot at the current moment
can be obtained from the 2D coordinates, and the angle between the axis in the greenhouse following robot and the
X-axis
to denote that the current position is
. The linear velocity of the center point C of the greenhouse following robot can be found from the linear velocities of the tracks on both sides
and the angular velocity
, and the specific formula is
As shown in Equation (15), when the left and right track speeds are in the same direction and the size of the speed is equal, the greenhouse following robot moves forward in a straight line; when the left track speed and the right track speed are in the opposite direction and the size of the speed is equal, the greenhouse following robot steers in the same place; when the speed of left track is greater than that of right track, the greenhouse following robot moves in a circular arc in the clockwise direction. In contrast, when the speed of the right track is greater than that of the left track, the greenhouse following robot moves in a circular arc in the counterclockwise direction. On the contrary, when the speed of the right track is greater than the speed of the left track, the greenhouse following robot makes a circular motion in the counterclockwise direction.
On the basis of the above analysis, the greenhouse following robot state
can be expressed by the velocities of the left and right track wheels, i.e.,
Assume that the coordinates of the current greenhouse following robot location are known to be
; then, the position information of the greenhouse following robot at the next moment
can be obtained, i.e.,
In the equation, is the time difference between the previous moment and the current moment. is generally a fixed value; the smaller is, the more accurate the kinematic model is. When the greenhouse following robot travel must be controlled, the target position of the greenhouse following robot at the next moment must be determined, the speed of the left and right tracks must be solved by using the inverse of Equation (17), and the master controller controls the left and right track drive motors according to the calculated target speed. Thus, autonomous following traveling is realized. The master controller controls the left and right track drive motors according to the calculated target speed to realize the autonomous following driving of the greenhouse following robot.
2.5. Straight-Line Driving Following Strategy Between Ridges
In the ridge greenhouse, the greenhouse following robot does not need to steer frequently and only needs to complete the inter-row straight-line driving to the target to be followed because of the characteristics of the operating environment. In this study, the design of the greenhouse following robot adopts the gantry chassis structure, which can realize cross-row driving in the ridge greenhouse, and the greenhouse workers are usually located in the inter-row path to pick the crops on both sides of the rows or other agricultural activities; thus, the target to be followed in the ridge environment is not located directly in front of the greenhouse following robot [
29]. Therefore, the greenhouse following robot does not consider the travel path problem of the followed target when traveling between ridges, and the greenhouse following robot must travel in a straight line between ridges. The situation of following between ridges in a straight line is shown in
Figure 10.
In the intermonopoly linear following process, the following distance between the two must be maintained at a certain level because the followed target is located in front of the side of the greenhouse following robot. Therefore, the positional relationship between the followed target and the positioning base station must be analyzed. As shown in
Figure 11, the positioning base station is set as the coordinate origin O (0, 0), while the label coordinates (
x,
y) represent the position of the target to be followed,
r is the distance between the target to be followed and the positioning base station, and
α is the offset angle of the target to be followed with respect to the centerline of the greenhouse following robot. The
y coordinate value of the followed target is selected as a reference to ensure that the distance between the greenhouse following robot and the followed target remains stable when working between the ridges, thereby realizing stable following driving between the ridges.
2.6. Curve Driving Following Strategy Based on LQR-Optimized Pure Tracking Algorithm
When the greenhouse following robot does not perform intermonopoly following work, it must follow the travel along the travel paths of the followed target, which include straight and curved parts. Thus, an appropriate path tracking control algorithm must be chosen to achieve stable following performance. Currently, common path following algorithms include the Pure Pursuit (PP) algorithm, the MPC algorithm, and the Stanley algorithm. Among them, the PP algorithm realizes path tracking by setting a fixed target point and controlling the robot to move along the direction of the target point, which is simple in structure, easy to implement, and especially suitable for real-time application scenarios [
30]. By contrast, the MPC algorithm is based on the kinematic model of the system, minimizes path tracking error by optimizing the control inputs, and selects the most appropriate control strategy through roll optimization, which is capable of handling multiple constraints and adapting to complex dynamic environments [
31]. Stanley’s algorithm ensures that the robot travels along a predetermined path by correcting the robot’s direction based on the error between the current position and the target path, which is particularly suitable for smoother paths [
32].
For the greenhouse following robot researched in this study, the pure tracking algorithm can be well combined with its differential steering principle. By adjusting the speed difference between the left and right tracks, the greenhouse following robot can precisely and quickly adjust the motion direction to follow the target path smoothly. Therefore, this study chooses to adopt the pure tracking algorithm for motion control and optimizes and improves the traditional algorithm to further improve the precision and stability of path tracking.
2.6.1. Principle of PP Algorithm
The core idea of a pure tracking algorithm is to select a fixed goal point on the path and have the robot travel in the direction of that point. The target point is usually located at some fixed distance (or some tracking distance) ahead of the robot’s current travel path, and the robot adjusts its motion direction based on the relative position of this target point to its current position [
33]. Its path trace is shown in
Figure 12.
In the pure tracking algorithm, the front view point is a point on the path that is a certain distance away from the current position of the greenhouse following robot. The position of the front viewpoint is calculated by the path tracking system based on the current path and the target distance. Choosing the front viewpoint is critical for the Pure Pursuit algorithm, as it governs the steering direction and velocity of the greenhouse following robot [
34].
Assume that the current greenhouse following robot has position (
x,
y) and the facing angle
, the coordinates of a point on the target path are (
xt,
yt), and the front viewpoint is located at the current position of the greenhouse following robot at a distance of
. On the basis of the current greenhouse following robot location (
x,
y) and the front viewpoint position (
xt,
yt), the distance between the greenhouse following robot and the front viewpoint can be calculated as
L, and the yaw angle error
α. Forward-looking distance
L for
The yaw angle error is the current greenhouse following robot facing angle
θ, the angular difference between the direction of the front viewpoint, and the yaw angle error
α for
After calculating the distance between the greenhouse following robot and the target point
L and the yaw angle error
α, the key step of the pure tracking algorithm is to calculate the steering angle based on this information
δ that enables the greenhouse following robot to move toward the target point. The steering angle of the greenhouse following robot is
In the equation, is the desired tracking distance between the greenhouse following robot and the front view point, which is usually related to the size and wheelbase of the greenhouse following robot itself. Equation (20) describes how to calculate the steering angle to be adjusted on the basis of the direction of the target point and the current position of the greenhouse following robot. On the basis of the calculated steering angle, the greenhouse following robot adjusts the direction of movement and travels toward the forward viewpoint, and after reaching that target point, the algorithm reselects the next target point based on the current position and continues to perform path tracking.
2.6.2. LQR-Optimized Pure Tracking Algorithm
The pure tracking algorithm is a geometry-based path tracking method in which the robot determines a forward-looking point by choosing a fixed forward-looking distance and adjusts the traveling direction on the basis of the deviation between the current position and the forward-looking point. For close-range operational tasks, the controller’s objective is to drive the machine’s state to the specified desired state within a given time and to achieve the precision required by the scenario [
35]. The algorithm relies only on the deviation of the current position from the target point to control the robot’s speed and steering and therefore cannot consider changes in the current and future states or optimize the effect of control inputs on the error. Therefore, the algorithm requires a prescribed-time prescribed-bound (PTPB) controller to ensure that the system state converges within a specified error bound, thereby simultaneously satisfying both convergence precision and regional constraints [
36]. This means that in complex paths or turns with large curvature, the greenhouse following robot may deviate from the target trajectory and suffer from oversteering or slow response, especially at high speeds [
37]. To cope with these problems, path tracking can be optimized by introducing LQR. LQR not only reduces the error in path tracking but also smoothly adjusts the steering and speed to optimize the influence of control inputs by optimizing the cost function of the error and control inputs. LQR can smoothly adjust the control inputs according to the current dynamic state of the greenhouse following robot through a feedback mechanism to reduce the influence of external perturbations to ensure the stability and accuracy of the system. Therefore, the introduction of LQR provides a more stable and smooth path tracking strategy for the pure tracking algorithm, which effectively avoids sudden turning and unstable trajectory deviation.
LQR is an optimal control method based on a state-space model to optimize the performance of a system by minimizing the weighted sum of the state error and the control inputs. The core idea of LQR is to minimize the cost function by optimizing the control inputs to achieve the optimal performance of robot path tracking [
38]. The LQR is particularly well suited for linear systems and provides stable control inputs to ensure that the robot tracks its path smoothly.
The goal of LQR is to find a control input
to minimize the following cost function:
In the equation,
is the state error vector of the system (positional and angular errors),
denotes the control inputs (velocity and angular velocity), and
Q and
R are weighting matrices used to weigh the state error and the cost of the control inputs, respectively, so that the system is stabilized while minimizing the energy consumption of the control inputs. The LQR controller obtains the optimal feedback gain matrix by solving the Riccati equation
K; the control input is
In the equation, the gain matrix K is calculated by the LQR method and the state error vector so that the control input error is minimized.
Given that the LQR algorithm is applicable to linear systems, according to the analysis of the kinematic model of the greenhouse following robot in
Section 2.4 of this paper, the current state can be represented by the vector
, and the state equation of the system can be expressed as
The deviation of the current path of the greenhouse following robot from the target path can be represented by the following state error vector:
The error derived from Equation (24) is used as an input to the LQR controller by controlling the gain matrix K to adjust the control input , thus minimizing the error.
More stable and precise path tracking can be achieved by combining the LQR controller used to optimize the pure tracking algorithm, which is used to select the target point and calculate the target direction, and the LQR controller, which is responsible for accurately adjusting the control inputs to minimize deviations in the motion of the greenhouse following robot. The specific workflow is as follows:
- (1)
Path planning and front viewpoint selection: The greenhouse following robot travels along the target path, and a forward view point located at a fixed or dynamic forward view distance is selected. The angular error between the front view point and the current position of the greenhouse following robot is calculated as the heading error of the greenhouse following robot.
- (2)
State error calculation: The current state error vector of the greenhouse following robot , including lateral and heading errors, is calculated.
- (3)
LQR controller optimization: The LQR controller is used to calculate the gain matrix by solving the Riccati equation K to obtain the control input . The LQR controller regulates the speed of the greenhouse following robot by adjusting and the angular velocity to optimize path tracking and reduce lateral and heading errors.
- (4)
Control system execution: The speed of the greenhouse following robot is adjusted in accordance with the control input given by LQR and the angular velocity , thereby moving the greenhouse following robot toward the forward viewpoint.
- (5)
Front viewpoint update and path tracking: As the greenhouse following robot travels, the front viewpoint is constantly updated, and the LQR controller optimizes the control inputs in real time to ensure that the greenhouse following robot follows the path smoothly.
The pseudocode of the LQR-optimized Pure Pursuit algorithm, as shown in Algorithm 1, more clearly illustrates the underlying logic and procedural steps of the algorithm. All simulation parameters and their selected values used in this study are presented in
Table 5.
Algorithm 1: Pseudocode of the LQR–Pure Pursuit algorithm |
Input: Reference path points: path_x, path_y, path_theta, path_omega, Lookahead distance L_f, Wheel separation f, Time step dt, Maximum linear velocity v_c_max, LQR weight matrices Q, R, Initial state (x0, y0, theta0), Simulation steps N_sim |
Output: Trajectory (x_traj, y_traj, theta_traj) |
- 1.
Initialize: x ← x0, y ← y0, theta ← theta0 - 2.
Allocate x_traj[1..N_sim], y_traj[1..N_sim], theta_traj[1..N_sim] - 3.
for i = 1 to N_sim do - 4.
Store current state: x_traj[i] ← x y_traj[i] ← y theta_traj[i] ← theta - 5.
Find closest path point: idx ← argmin_j sqrt( (path_x[j] − x)^2 + (path_y[j] − y)^2 ) - 6.
Select lookahead target: look_idx ← idx while look_idx < length(path_x) and sqrt( (path_x[look_idx] − x)^2 + (path_y[look_idx] − y)^2 ) < L_f do look_idx ← look_idx + 1 end while x_t ← path_x[look_idx] y_t ← path_y[look_idx] theta_t ← path_theta[look_idx] omega_ref ← path_omega[look_idx] - 7.
Calculate tracking errors: e_x ← x - x_t e_y ← y - y_t e_theta ← wrapToPi(theta - theta_t) x_err ← [e_x, e_y, e_theta]^T - 8.
Compute reference velocity: v_c_ref ← v_c_max * exp( −0.5 * (e_x^2 + e_y^2 + e_theta^2) ) - 9.
Construct linearized model: A ← [ 0, 0, −v_c_ref * sin(theta_t); 0, 0, v_c_ref * cos(theta_t); 0, 0, 0 ] B ← [ cos(theta_t), 0; sin(theta_t), 0; 0, 1 ] - 10.
Compute LQR gain: K ← lqr(A, B, Q, R) - 11.
Calculate control inputs: u ← -K * x_err v_c ← v_c_ref + u[1] omega ← omega_ref + u[2] - 12.
Apply control saturation: v_c ← min( max(v_c, -v_c_max), v_c_max) omega ← min( max(omega, -v_c_max/(0.5*f)), v_c_max/(0.5*f)) - 13.
Compute wheel velocities: v_R ← v_c + omega * f/2 v_L ← v_c - omega * f/2 v_c_actual ← (v_R + v_L)/2 omega_actual ← (v_R − v_L)/f - 14.
Update robot state: x ← x + v_c_actual * cos(theta) * dt y ← y + v_c_actual * sin(theta) * dt theta ← wrapToPi(theta + omega_actual * dt) - 15.
end for - 16.
return x_traj, y_traj, theta_traj - 17.
Function wrapToPi(phi): - 18.
phi ← mod(phi + pi, 2*pi) - 19.
if phi < 0, then phi ← phi + 2*pi - 20.
end if - 21.
phi ← phi − pi - 22.
return phi
|
The greenhouse following robot employs an ultra-wideband (UWB) sensor combined with a phase-difference of arrival (PDOA) algorithm to achieve precise target localization. It is further equipped with an angular sensor to monitor its attitude and heading in real time and a Hall-effect sensor to provide continuous motor-speed feedback, while a LiDAR unit performs real-time environmental scanning for emergency obstacle avoidance. The control system fuses attitude and speed data with scenario-specific following strategies and path-tracking algorithms to dynamically adjust the left and right track velocities, ensuring stable motion and accurate tracking. Based on the target’s position and motion state derived from these sensors, the system computes and executes the required maneuvers—forward motion, turning, acceleration, and deceleration—via differential track actuation. The complete autonomous following workflow is depicted in
Figure 13.