An automatic steering method, system, and agricultural machinery for wheeled agricultural machinery based on STM32
By combining the STM32 main control chip and the gyroscope, non-contact measurement is performed using attitude calculation and Kalman filtering, and combined with feedforward-PID control, the error and stability problems of the steering system in the automatic driving of agricultural machinery are solved, and high-precision steering control is achieved.
Patent Information
- Application Number
- CN202310493685.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-04-26
AI Technical Summary
In existing agricultural machinery automatic driving systems, the steering control system suffers from large errors and poor stability, especially in terms of insufficient accuracy during large-angle adjustments and turns. Furthermore, the cumulative error of the gyroscope increases over time, affecting the closed-loop control accuracy of the steering system.
Using an STM32 main control chip and a gyroscope combination, non-contact wheel deflection angle measurement is performed through attitude calculation and Kalman optimal estimation. Combined with a feedforward-PID control algorithm, closed-loop control of the electric steering wheel is achieved, reducing the installation threshold and enhancing adaptability.
It has achieved the maximum elimination of wheel steering error, improved the steering accuracy and stability of agricultural machinery automatic driving, and reduced the difficulty of debugging different agricultural machines.
Smart Images

Figure CN116395027B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of agricultural machinery automatic driving assistance devices, specifically relating to an automatic steering method, system, and agricultural machinery for wheeled agricultural machinery based on STM32. Background Technology
[0002] As agriculture becomes more large-scale and intensive, the demand for precision agriculture continues to grow. Automatic driving technology for agricultural machinery is a core area of precision agriculture, and the steering system is the foundation of automatic driving. Research on technologies related to automatic driving operations of wheeled agricultural machinery is crucial. During automatic driving operations, agricultural machinery frequently needs to make large-angle adjustments or turn around, which places high demands on the steering control system. As the direct actuator for steering, the steering wheels directly affect the actual operating performance of the agricultural machinery.
[0003] When using electric steering wheels to electrify traditional agricultural machinery, the open-loop control error of the steering wheel is significant due to the free travel in the transmission structure. To eliminate this error, angle sensors are typically used to measure the wheel angle for closed-loop control. However, these sensors require custom-designed mounting brackets for specific machine models and are prone to damage and instability during actual operation. Therefore, a measurement method using a dual-gyroscope array to replace angle sensors has been developed. These arrays are horizontally mounted on the chassis and steering knuckle, maintaining consistency between the wheel gyroscope coordinate system and the vehicle's basic coordinate system. The difference in heading angle is used to estimate the wheel's deflection angle relative to the vehicle body. However, this method requires horizontal calibration in practice and demands high technical skills from the installers. Furthermore, during the movement of the agricultural machinery, the cumulative error of the gyroscopes increases over time, reducing measurement accuracy and causing the output steering angle to drift, thus decreasing the closed-loop control accuracy of the steering system.
[0004] Therefore, based on the above technical problems, it is necessary to design a new automatic steering method, system, and agricultural machinery for wheeled agricultural machinery based on STM32. Summary of the Invention
[0005] The purpose of this invention is to provide an automatic steering method, system, and agricultural machinery for wheeled agricultural machinery based on STM32.
[0006] To address the aforementioned technical problems, this invention provides an automatic steering method for wheeled agricultural machinery based on STM32, comprising:
[0007] During initial installation, maintenance, or debugging, the agricultural machinery should be left stationary while the initialization program is run.
[0008] Non-contact measurement of wheel deflection angle is performed using attitude calculation and Kalman optimal estimation.
[0009] Obtain the target wheel deflection angle, calculate the deflection angle, and control the electric steering wheel to rotate.
[0010] Furthermore, during the initial installation or maintenance and debugging, the agricultural machinery is left stationary, and the initialization program is run, including:
[0011] Run the initialization program, with the steering wheel in the straight-line center position as the input zero point, input the rotation angle of the electric steering wheel, and output the rotation angle of the steering wheel collected by the agricultural machinery wheel deflection angle measurement module to measure the response dead zone on both sides of the horizontal axis zero point.
[0012] Furthermore, the PID parameter K is tuned using the critical proportional gain method. P ,K i ,K d .
[0013] Furthermore, the non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation includes:
[0014] When the agricultural machinery is running, the wheel deflection angle measurement module is initialized, and the three-axis angular velocity data ω of gyroscope A is sampled at preset time intervals. X ω Y ω Z ;
[0015] Set the yaw angle and angular velocity threshold for gyroscope A, when ω Z When the angular velocity exceeds the threshold, the main controller performs attitude calculation on the sampled angular velocity.
[0016] The transformation matrix from the carrier coordinate system to the base coordinate system is represented by attitude angle transformation and quaternions, respectively. The heading angle ψ of gyroscope A relative to the agricultural machinery base coordinate system OXYZ is obtained by inverse kinematics. A .
[0017] Furthermore, if the wheel rotation speed When the value is not zero, the main controller obtains the acceleration 'a' in the y-axis direction through attitude sensor B. y The yaw angle ψ of the vehicle body rotation B Using the Ackerman steering model, the steering angle of agricultural machinery wheels is predicted.
[0018] Furthermore, according to and Obtain the steering angular velocity of the right front wheel of the agricultural machinery relative to the vehicle body.
[0019] The cumulative error of the gyroscope is β k The steering angular velocity of the right front wheel relative to the vehicle body With β k Integrating the difference, we obtain the estimated value of the right front wheel steering angle.
[0020] Furthermore, the main controller uses the estimated steering angle of the right front wheel. The state quantity of the angle measurement system is the steering angle of the agricultural machinery wheel. For the angle measurement system's observations, the actual steering angle θ is measured using a Kalman filter unit. final Perform the optimal estimate.
[0021] Furthermore, the steering angle deviation is calculated in real time based on the target wheel deflection angle to adjust the electric steering wheel rotation angle, including:
[0022] The actual steering angle θ final The value is transmitted to the main controller, which calculates the steering angle deviation based on the target wheel deflection angle. Then, through a feedforward-PID control algorithm, the target wheel rotation angle value u is adjusted in real time. k .
[0023] Secondly, the present invention also provides a steering system employing the above-mentioned automatic steering method for wheeled agricultural machinery based on STM32, comprising:
[0024] The initialization module is used when the agricultural machinery is stationary during initial installation or maintenance and debugging.
[0025] The measurement module performs non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation;
[0026] The adjustment module obtains the target wheel deflection angle, calculates the angle deviation, and controls the rotation of the electric steering wheel.
[0027] Thirdly, the present invention also provides an agricultural machine employing the above-mentioned automatic steering method for wheeled agricultural machinery based on STM32, comprising:
[0028] Main controller, attitude sensor, gyroscope, and electric steering wheel;
[0029] The electric steering wheel is mounted on the steering shaft of the agricultural machinery body;
[0030] The attitude sensor is mounted on the steel frame of the agricultural machinery.
[0031] The gyroscope is installed on the wheel at any position that rotates with the wheel.
[0032] The main controller is adapted to control the electric steering wheel using the above-mentioned automatic steering method for wheeled agricultural machinery based on STM32.
[0033] The beneficial effects of this invention are as follows: It comprises a control cabinet, an electric steering wheel, a gyroscope, and an attitude sensor. The STM32 main control chip industrial control board (main controller) is placed in the control cabinet. The electric steering wheel replaces the original steering wheel and is mounted on the steering shaft. The attitude sensor is mounted at any position on the vehicle's steel frame, and the gyroscope is mounted at any position on the wheel that rotates with it. The system operation includes the following steps: When the agricultural machinery is stationary, the dead zone of the steering system response is measured through an initialization program, and the PID parameters are tuned using the critical proportional gain method. When the agricultural machinery is operating, after acquiring the target wheel angle, the steering control system performs non-contact measurement of the wheel deflection angle through attitude calculation and Kalman filtering. The electric steering wheel is then controlled to rotate using a feedforward-PID control algorithm, achieving closed-loop control of the agricultural machinery's steering system. This invention allows for arbitrary installation of the wheel angle sensor, lowers the debugging threshold of the steering device, enhances adaptability to different agricultural machinery, and minimizes steering errors in wheeled agricultural machinery during operation.
[0034] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. Attached Figure Description
[0036] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0037] Figure 1 This is a flowchart of the automatic steering method for wheeled agricultural machinery based on STM32 according to the present invention;
[0038] Figure 2 This is a block diagram illustrating the principle of the automatic steering method for wheeled agricultural machinery based on STM32 according to the present invention.
[0039] Figure 3 This is a schematic diagram of the critical oscillation of the angle AD value of the present invention;
[0040] Figure 4 This is a schematic diagram of the structure of the agricultural machinery of the present invention;
[0041] Figure 5This is a detailed flowchart of the automatic steering method for wheeled agricultural machinery based on STM32 according to the present invention;
[0042] Figure 6 This is a top view of the wheel deflection angle measurement module for wheeled agricultural machinery of the present invention.
[0043] Figure 7 This is a flowchart of the Kalman filter operation method of the present invention.
[0044] In the picture:
[0045] 1. Control cabinet, 2. Electric steering wheel, 3. Attitude sensor B, 4. Gyroscope A. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0047] Example 1
[0048] like Figures 1 to 7 As shown, this embodiment 1 provides an automatic steering method for wheeled agricultural machinery based on STM32, including: Step 1, running an initialization program when the agricultural machinery is stationary; Step 2, non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation when the agricultural machinery is running; Step 3, obtaining the target wheel deflection angle to adjust the rotation angle of the electric steering wheel 2; The system consists of a control cabinet 1, an electric steering wheel 2, a gyroscope, and an attitude sensor. The STM32 main control chip industrial control board (main controller) is placed in the control cabinet 1. The electric steering wheel 2 replaces the original steering wheel and is installed on the steering shaft. The attitude sensor is installed at any position on the steel frame of the vehicle body, and the gyroscope is installed at any position on the wheel that rotates with the wheel. The system operates through the following steps: During initial installation or maintenance and debugging, the agricultural machinery is stationary. The dead zone of the steering system response is measured through the initialization program, and the PID parameters are tuned using the critical proportional method. During agricultural machinery operation (when the machinery is running), after acquiring the target wheel angle, the steering control system performs non-contact measurement of the wheel deflection angle through attitude calculation and Kalman filtering. The electric steering wheel 2 is then rotated using a feedforward-PID control algorithm, achieving closed-loop control of the agricultural machinery's steering system. This allows for arbitrary installation of the wheel angle sensor, lowers the debugging threshold of the steering device, enhances adaptability to different agricultural machinery, and minimizes steering errors in wheeled agricultural machinery during operation.
[0049] In this embodiment, the control cabinet 1 is installed on the right side of the cab, with an embedded industrial control board (main controller) containing an STM32 main control chip, and is connected to the sensors via an I2C interface; the electric steering wheel 2 replaces the original steering wheel and is installed on the steering shaft; the attitude sensor B3 is installed at any position on the vehicle frame; and the gyroscope A4 is installed on the wheel at any position that rotates with the wheel.
[0050] In this embodiment, the initialization program when the agricultural machinery is stationary includes: when the agricultural machinery is stationary, the initialization program is run, with the steering wheel straight center position as the input zero point, the rotation angle of the electric steering wheel 2 is input (in 10° increments), and the rotation angle of the steering wheel (steady-state value, and subject to left and right limits due to mechanical structure limitations) is output through the agricultural machinery wheel deflection angle measurement module to measure the response dead zone on both sides of the horizontal axis zero point;
[0051] Set up conditional feedforward control:
[0052]
[0053] In the formula, F(s) is the conditional feedforward control function; Δθ is the expected rotation angle of the steering wheel; and k is the sampling sequence number of the PID control.
[0054] In this embodiment, the PID parameter K is tuned using the critical proportional gain method. p ,K i ,K d In the above experiment, a disturbance Δθ was introduced, and only the proportional gain K of the controller was adjusted. p The proportional gain that causes the closed-loop system to undergo critical constant-amplitude periodic oscillations under disturbance is called the critical gain K. u The oscillation period at this point is called the critical oscillation period T. u :
[0055] For example, when Δθ = 30, K u =4.9, the critical oscillation of the acquired angle AD value is as follows Figure 3 As shown; selecting the interval t = [6, 7], the critical oscillation period T is obtained. u =0.6, then the tuning parameters of the PID controller are:
[0056]
[0057] In this embodiment, during agricultural machinery operation, non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation includes: during agricultural machinery operation, the vehicle wheel deflection angle measurement module is initialized, and the three-axis angular velocity data ω of gyroscope A4 is sampled every preset time interval (e.g., 0.01s). X ω Y ω ZSet the yaw angle and angular velocity threshold for gyroscope A4. When ω Z When the angular velocity exceeds the threshold, the main control chip performs attitude calculation on the sampled angular velocity. Specifically, the coordinate system of gyroscope A4 itself is OX′Y′Z′, with the center of the right front wheel tire as the origin O. The X-axis is parallel to the transverse axis of the vehicle and points to the right, the Y-axis is parallel to the longitudinal axis of the vehicle and points forward, and the Z-axis is parallel to the vertical axis and points upward, establishing a basic coordinate system OXYZ. To update the steering angle information of the front wheels of the agricultural machinery in real time, attitude updates are performed with the vehicle's basic coordinate system as a reference. The angular velocity read from the gyroscope's carrier coordinate system OX′Y′Z′ is converted into angle data in the OXYZ coordinate system. The OXYZ coordinate system is obtained by rotating Z→Y→X to obtain the OX′Y′Z′ coordinate system. The transformation matrix from the carrier coordinate system to the basic coordinate system is represented using attitude angle transformation and quaternions. The heading angle ψ of sensor A relative to the agricultural machinery's basic coordinate system OXYZ can be calculated through inverse kinematics. A :
[0058]
[0059] Among them, the quaternions q0, q1, q2, q3 are 0 at time zero, and ω x ,ω y ,ω z The quaternion is the three-axis angular velocity output by gyroscope A4 to the main control chip; the quaternion is iteratively updated by continuously outputting the angular velocity from the gyroscope.
[0060] In this embodiment, if the wheel rotation speed When the value is not zero, the main control chip obtains the acceleration 'a' in the y-axis direction through the attitude sensor B3. y The yaw angle ψ of the vehicle body rotation B Using the Ackerman steering model, the steering angle of agricultural machinery wheels is predicted.
[0061]
[0062] In the formula: L is the wheelbase of the agricultural machinery; V k It is the speed of the agricultural machinery at time k; a y It is the acceleration in the y-axis direction output by attitude sensor B3.
[0063] In this embodiment, according to and The difference is used to obtain the steering angular velocity of the right front wheel of the agricultural machinery relative to the vehicle body. The cumulative error of the gyroscope is β k ,right With β k Integrating the difference, we obtain the estimated value of the right front wheel steering angle. To find the derivative of the heading angles of the vehicle body and wheels, i.e., the angular velocity, the difference between the two is the relative angular velocity;
[0064]
[0065]
[0066] In the formula, dt is the sampling time period of the gyroscope; k represents time k; β k This indicates the error of the gyroscope; the measurement value of the gyroscope has an error, which increases with the increase of the integration time.
[0067] In this embodiment, the main control chip uses the estimated steering angle of the right front wheel as the state variable of the angle measurement system, and the steering angle of the agricultural machinery wheel is used as the state variable. For the angle measurement system's observations, the actual steering angle θ is measured using a Kalman filter unit. final Perform the optimal estimate.
[0068] Assume that the gyroscope angular rate error generated by the measuring device within 0.01s can be considered constant, i.e., β. k =β k-1 Combining the integral formula from step two, we obtain the state matrix equation:
[0069]
[0070] Pick The system state equations are obtained as follows:
[0071] The expected angle of the angle measurement system at time k is: The observation equation is established as follows:
[0072]
[0073] Among them, H k V is the observation matrix; k To observe the noise, V k ~(0,R k The dynamic measurement accuracy of attitude sensor B3 is 0.1 m / s. 2 Take R k =0.1.
[0074] Let the initial state variables of the Kalman filter unit be...
[0075] Assuming the sampling interval is dt = 0.01s, the initial parameters are:
[0076]
[0077] The system outputs the estimated right front wheel steering angle to the Kalman filter unit. Wheel steering angle estimated by kinematic equations When the value is set, the unit begins initialization and starts optimal estimation of the wheel heading angle. The specific implementation steps are as follows:
[0078] The one-step prediction equation is:
[0079] State recurrence equation: x k =x k,k-1 +K K (Z k -H K x k,k-1 );
[0080] The gain equation is:
[0081] Mean squared error update matrix: P k =(IK k H)P k,k-1 ;P k,k-1 =AP (k-1) A T +Q; where Q is the system noise covariance matrix, Q=E(xx T ).
[0082] Waiting for a 0.01s sampling interval, return to step one to begin execution. The number of iterations of the Kalman filter unit in this heading angle measurement device varies slightly depending on the specific agricultural machinery. The conditional feedforward controller eliminates the response dead zone of the electric steering wheel 2, improving the system response speed. Next, the wheel deflection angle measurement module eliminates the steering angle measurement error caused by the sensitive axis of the gyroscope on the steering wheel not being perpendicular to the ground during installation and agricultural machinery movement. The Kalman filter unit directly performs optimal estimation of the heading angle θ of the agricultural machinery wheels, eliminating the accumulation of gyroscope errors over time.
[0083] In this embodiment, the step of calculating the steering angle deviation in real time based on the actual steering angle and the target wheel deflection angle to adjust the rotation angle of the electric steering wheel 2 includes: the main controller obtains the target wheel deflection angle, calculates the steering angle deviation in real time based on the actual steering angle, and adjusts the target wheel rotation angle value u in real time through the feedforward-PID control algorithm. k ;
[0084] Δθ k =Δθ k-1 -θ final,k ;
[0085]
[0086] Where k is the sampling sequence number, k = 0, 1, 2, ...; u k The value of the wheel rotation angle output by the main control chip at the k-th sampling time;
[0087] Δθ k The target wheel rotation angle value input by the main control chip at the k-th sampling time;
[0088] Δθ k-1 This represents the target wheel rotation angle value input to the main control chip at the k-th sampling time. By reducing modifications to agricultural machinery and hydraulic circuits and simplifying sensor positioning and orientation installation methods, it is universally applicable to various agricultural machines, achieving full compatibility between manual and automatic operation. Secondly, the conditional feedforward controller eliminates the response dead zone of the electric steering wheel 2, improving system response speed. Next, the wheel deflection angle measurement module eliminates the steering angle measurement error caused by the gyroscope on the steering wheel not being perpendicular to the ground during installation and agricultural machinery movement. Furthermore, the Kalman filter unit directly and optimally estimates the heading angle of the agricultural machinery wheels, eliminating the accumulation of gyroscope errors over time. Finally, PID control provides real-time correction of the wheel deflection angle, ensuring steering accuracy and meeting the wheel steering requirements of agricultural machinery during automatic driving.
[0089] Example 2
[0090] Based on Example 1, Example 2 further provides a steering system that adopts the automatic steering method for wheeled agricultural machinery based on STM32 in Example 1, including: an initialization module, which runs the initialization program when the agricultural machinery is stationary during initial installation or maintenance and debugging; a measurement module, which performs non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation; and an adjustment module, which calculates the steering angle deviation in real time according to the actual steering angle to adjust the rotation angle of the electric steering wheel. The specific functions of each module have been described in detail in Example 1 and will not be repeated here.
[0091] Example 3
[0092] Based on Embodiment 1, Embodiment 3 further provides an agricultural machine employing the STM32-based automatic steering method for wheeled agricultural machinery in Embodiment 1, comprising: a main controller, an attitude sensor, a gyroscope, and an electric steering wheel 2; the electric steering wheel 2 is mounted on the steering shaft of the agricultural machine body; the attitude sensor is mounted on the steel frame of the agricultural machine body; the gyroscope is mounted on the wheel at any position that rotates with the wheel; the main controller is adapted to control the electric steering wheel 2 using the aforementioned STM32-based automatic steering method for wheeled agricultural machinery.
[0093] In summary, this invention comprises a control cabinet 1, an electric steering wheel 2, a gyroscope, and an attitude sensor. The STM32 main control chip industrial control board is placed in the control cabinet 1. The electric steering wheel 2 replaces the original steering wheel and is mounted on the steering shaft. The attitude sensor is mounted at any position on the vehicle's steel frame, and the gyroscope is mounted at any position on the wheel that rotates with it. The system operation includes the following steps: When the agricultural machinery is stationary, the dead zone of the steering system response is measured through an initialization program, and the PID parameters are tuned using the critical proportional gain method. When the agricultural machinery is operating, after acquiring the target wheel angle, the steering control system performs non-contact measurement of the wheel deflection angle through attitude calculation and Kalman filtering. The electric steering wheel 2 is then controlled to rotate using a feedforward-PID control algorithm, achieving closed-loop control of the agricultural machinery's steering system. This invention allows for arbitrary installation of the wheel angle sensor, lowers the debugging threshold of the steering device, enhances adaptability to different agricultural machinery, and minimizes steering errors in wheeled agricultural machinery during operation.
[0094] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0095] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0096] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0097] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. An automatic steering method for wheeled agricultural machinery based on STM32, characterized in that, include: During initial installation, maintenance, or debugging, the agricultural machinery should be left stationary while the initialization program is run. Non-contact measurement of wheel deflection angle is performed using attitude calculation and Kalman optimal estimation. Obtain the target wheel deflection angle, calculate the angle deviation, and control the electric steering wheel rotation; During the initial installation, maintenance, or debugging, the agricultural machinery is left stationary, and the initialization program is run, including: Run the initialization program, with the steering wheel straight center position as the input zero point, input the rotation angle of the electric steering wheel, and output the rotation angle of the steering wheel collected by the agricultural machinery wheel deflection angle measurement module to measure the response dead zone on both sides of the horizontal axis zero point; Tuning the PID parameter K using the critical proportionality method p K i K d ; The non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation includes: When the agricultural machinery is running, the wheel deflection angle measurement module is initialized, and the three-axis angular velocity data ω of gyroscope A is sampled at preset time intervals. X ω Y ω Z ; Set the yaw angle and angular velocity threshold for gyroscope A, when ω Z When the angular velocity exceeds the threshold, the main controller performs attitude calculation on the sampled angular velocity at that time; The transformation matrix from the carrier coordinate system to the base coordinate system is represented by attitude angle transformation and quaternions, respectively. The heading angle ψ of gyroscope A relative to the agricultural machinery base coordinate system OXYZ is obtained by inverse kinematics. A ; If the wheel rotation speed When the value is not zero, the main controller obtains the acceleration 'a' in the y-axis direction through attitude sensor B. y The yaw angle ψ of the vehicle body rotation B Using the Ackerman steering model, the steering angle of agricultural machinery wheels is predicted. according to and Obtain the steering angular velocity of the right front wheel of the agricultural machinery relative to the vehicle body. The cumulative error of the gyroscope is β k The steering angular velocity of the right front wheel relative to the vehicle body With β k Integrating the difference, we obtain the estimated value of the right front wheel steering angle. The main controller uses the estimated steering angle of the right front wheel. The state quantity of the angle measurement system is the steering angle of the agricultural machinery wheel. For the angle measurement system's observations, the actual steering angle θ is measured using a Kalman filter unit. final Perform optimal estimation; The steering angle deviation is calculated in real time based on the target wheel deflection angle to adjust the electric steering wheel rotation angle, including: The actual steering angle θ final The value is transmitted to the main controller, which calculates the steering angle deviation based on the target wheel deflection angle. Then, through a feedforward-PID control algorithm, the target wheel rotation angle value u is adjusted in real time. k .
2. A steering system employing the STM32-based automatic steering method for wheeled agricultural machinery as described in claim 1, characterized in that, include: The initialization module is used when the agricultural machinery is stationary during initial installation or maintenance and debugging. The measurement module performs non-contact measurement of wheel deflection angle through attitude calculation and Kalman optimal estimation; The adjustment module obtains the target wheel deflection angle, calculates the angle deviation, and controls the rotation of the electric steering wheel.
3. An agricultural machine employing the STM32-based automatic steering method for wheeled agricultural machinery as described in claim 1, characterized in that, include: Main controller, attitude sensor, gyroscope, and electric steering wheel; The electric steering wheel is mounted on the steering shaft of the agricultural machinery body; The attitude sensor is mounted on the steel frame of the agricultural machinery. The gyroscope is installed on the wheel at any position that rotates with the wheel. The main controller is adapted to control the electric steering wheel using the STM32-based automatic steering method for wheeled agricultural machinery as described in claim 1.
Citation Information
Patent Citations
Attitude calculation method applied to plant protection operation of agricultural unmanned aerial vehicle
CN114608517A