Lawn mower control method and device, controller, lawn mower and storage medium

CN122876902APending Publication Date: 2026-10-09YITUO OUTDOOR TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611333367.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0006]本申请的主要目的在于提供一种割草机控制方法、装置、控制器、割草机及存储介质,旨在解决如何在下坡场景中准确识别单通道编码器割草机的真实转向以输出反向力矩,实现低成本硬件下的高精度斜坡速度控制,降低速度失控的发生概率的技术问题

Benefits of technology

通过所述割草机的惯性测量单元IMU获取所述割草机的当前坡度角;接着通过所述编码器电机获取所述割草机的当前实际转速,并获取所述割草机对应的目标转速;而后基于所述当前坡度角、所述当前实际转速以及所述目标转速,确定所述割草机对应的目标PWM;然后基于所述目标PWM控制所述电机驱动器;通过获取割草机的当前坡度角、当前实际转速与目标转速,并根据基于当前坡度角、当前实际转速以及目标转速确定目标PWM,以根据当前坡度角准确识别割草机的真实转向,并通过目标PWM输出反向力矩,实现低成本硬件下的高精度斜坡速度控制,降低速度失控的发生概率,实现割草机在斜坡上平稳行驶。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122876902A_ABST
    Figure CN122876902A_ABST
Patent Text Reader

Abstract

The application discloses a mower control method and device, a controller, a mower and a storage medium, relates to the technical field of mowers, and comprises the following steps: acquiring a current slope angle of the mower through an inertial measurement unit (IMU) of the mower; acquiring a current actual rotating speed of the mower through an encoder motor, and acquiring a target rotating speed corresponding to the mower; determining a target PWM corresponding to the mower based on the current slope angle, the current actual rotating speed and the target rotating speed; and controlling the motor driver based on the target PWM. The application can output a reverse torque through the target PWM, realize high-precision slope speed control under low-cost hardware, reduce the occurrence probability of speed out-of-control, and realize smooth driving of the mower on a slope.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lawnmower technology, and in particular to a lawnmower control method, device, controller, lawnmower and storage medium. Background Technology

[0002] Currently, some low-cost lawnmowers (i.e., lawnmower robots) often use single-channel encoder motors for their front wheels to control material costs. In terms of control logic, the system defaults to "the actual direction of the motor is completely consistent with the direction of PWM (Pulse Width Modulation)". For example, when PWM is positive (0%~100%), the motor is determined to rotate forward (forward), and when PWM is negative (-100%~0%), the motor is determined to rotate backward (backward).

[0003] However, when the lawnmower is going downhill, gravity becomes one of the driving forces. Even if the motor PWM is 0% (the existing system considers it to have no power output), the lawnmower wheels will still be dragged by gravity and accelerate, and the actual speed of the lawnmower may far exceed the target speed. At this time, because the single-channel encoder cannot detect that the wheels are being "dragged in the opposite direction," the PID (Proportional-Integral-Derivative) controller can only output 0% PWM, causing the system to be unable to output reverse torque for braking, ultimately causing the machine to lose control of its downhill speed or even plunge into a collision.

[0004] Therefore, how to accurately identify the true steering direction of a single-channel encoder lawnmower in downhill scenarios to output reverse torque, achieve high-precision slope speed control with low-cost hardware, and reduce the probability of speed runaway is a problem that urgently needs to be solved.

[0005] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0006] The main objective of this application is to provide a lawnmower control method, device, controller, lawnmower, and storage medium, aiming to solve the technical problem of how to accurately identify the actual steering of a single-channel encoder lawnmower in downhill scenarios to output reverse torque, achieve high-precision slope speed control with low-cost hardware, and reduce the probability of speed runaway.

[0007] To achieve the above objectives, this application proposes a lawnmower control method, wherein the lawnmower includes an inertial measurement unit (IMU), a motor driver, and an encoder motor mounted on the front wheel of the lawnmower; the lawnmower control method includes: The current slope angle of the lawnmower is obtained through the inertial measurement unit (IMU). The encoder motor is used to obtain the current actual speed of the lawnmower and the corresponding target speed of the lawnmower. Based on the current slope angle, the current actual rotation speed, and the target rotation speed, determine the target PWM corresponding to the lawnmower; The motor driver is controlled based on the target PWM.

[0008] In one embodiment, the step of determining the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotation speed, and the target rotation speed includes: The reverse bias amount corresponding to the lawnmower is determined based on the current slope angle; Based on the target rotation speed and the current actual rotation speed, the control quantity corresponding to the lawnmower is determined; Based on the reverse bias and the control quantity, the target PWM corresponding to the lawnmower is determined.

[0009] In one embodiment, the step of determining the reverse bias amount corresponding to the lawnmower based on the current slope angle includes: Obtain the mapping relationship between the preset slope angle range and the preset reverse offset amount; Determine the target slope angle range corresponding to the current slope angle within each preset slope angle range; Based on the mapping relationship, the preset reverse offset amount corresponding to the target slope angle range is used as the reverse offset amount corresponding to the lawnmower.

[0010] In one embodiment, the step of determining the target PWM corresponding to the lawnmower based on the reverse bias and the control quantity includes: Calculate the product between the reverse bias and the control quantity, and calculate the first sum between the product and the control quantity; If the target rotational speed is greater than or equal to a preset threshold, the difference between the first sum and the reverse bias is obtained, and the target PWM is obtained based on the difference.

[0011] In one embodiment, after the step of calculating the first sum between the product and the control quantity, the lawnmower control method further includes: If the target rotational speed is less than a preset threshold, calculate the second sum between the first sum and the reverse bias, and obtain the target PWM based on the second sum.

[0012] In one embodiment, the step of determining the control quantity corresponding to the lawnmower based on the target rotational speed and the current actual rotational speed includes: Obtain the speed error between the target rotational speed and the current actual rotational speed; The control quantity corresponding to the lawnmower is determined based on the speed error.

[0013] In one embodiment, the step of determining the control quantity corresponding to the lawnmower based on the speed error includes: The speed error is input into the PID controller of the lawnmower to obtain the corresponding control quantity of the lawnmower.

[0014] Furthermore, to achieve the above objectives, this application also proposes a lawnmower control device, wherein the lawnmower includes an inertial measurement unit (IMU), a motor driver, and an encoder motor disposed on the front wheel of the lawnmower; the lawnmower control device includes: The first acquisition module is used to acquire the current slope angle of the lawnmower through the inertial measurement unit (IMU); The second acquisition module is used to acquire the current actual speed of the lawnmower through the encoder motor, and to acquire the target speed corresponding to the lawnmower; The determination module is used to determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotation speed, and the target rotation speed; A control module is used to control the motor driver based on the target PWM.

[0015] In addition, to achieve the above objectives, this application also proposes a controller comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the lawnmower control method described above.

[0016] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the lawnmower control method described above.

[0017] Furthermore, to achieve the above objectives, this application also proposes a lawnmower, which includes: The aforementioned controller; An inertial measurement unit (IMU) and a motor driver are electrically connected to the controller, respectively. The controller includes an encoder motor connected to the motor driver and disposed on the front wheel of the lawnmower. The controller is configured to acquire the current slope angle of the lawnmower via an inertial measurement unit (IMU); acquire the current actual rotational speed of the lawnmower via the encoder motor, and acquire the target rotational speed corresponding to the lawnmower; determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotational speed, and the target rotational speed; and control the motor driver based on the target PWM.

[0018] One or more technical solutions proposed in this application have at least the following technical effects: The current slope angle of the lawnmower is obtained through the inertial measurement unit (IMU); then, the current actual speed of the lawnmower is obtained through the encoder motor, and the corresponding target speed is obtained; then, based on the current slope angle, the current actual speed, and the target speed, the target PWM corresponding to the lawnmower is determined; then, the motor driver is controlled based on the target PWM; by obtaining the current slope angle, the current actual speed, and the target speed of the lawnmower, and determining the target PWM based on the current slope angle, the true direction of the lawnmower can be accurately identified according to the current slope angle, and the reverse torque is output through the target PWM to achieve high-precision slope speed control with low-cost hardware, reduce the probability of speed runaway, and enable the lawnmower to drive smoothly on the slope. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating an embodiment of the lawnmower control method of this application. Figure 2 This is a schematic diagram of the module structure of the lawnmower control device according to an embodiment of this application; Figure 3 This is a schematic diagram of the lawnmower in the embodiments of this application.

[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0023] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0025] The main solution of this application embodiment is: to obtain the current slope angle of the lawnmower through the inertial measurement unit (IMU) of the lawnmower; to obtain the current actual speed of the lawnmower through the encoder motor, and to obtain the target speed corresponding to the lawnmower; to determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual speed and the target speed; and to control the motor driver based on the target PWM.

[0026] In this embodiment, for ease of description, the controller of the lawnmower will be used as the execution subject in the following description.

[0027] Currently, some low-cost lawnmowers often use single-channel encoder motors for their front wheels to control material costs. In terms of control logic, existing systems default to "the actual direction of the motor is completely consistent with the direction of PWM (Pulse Width Modulation)". For example, when PWM is positive (0%~100%), the motor is determined to be rotating forward (forward), and when PWM is negative (-100%~0%), the motor is determined to be rotating backward (backward).

[0028] However, when the lawnmower is going downhill, gravity becomes one of the driving forces. Even if the motor PWM is 0% (the existing system considers it to have no power output), the lawnmower wheels will still be dragged by gravity and accelerate, and the actual speed of the lawnmower may far exceed the target speed. At this time, because the single-channel encoder cannot detect that the wheels are being "dragged in the opposite direction," the PID (Proportional-Integral-Derivative) controller can only output 0% PWM, causing the system to be unable to output reverse torque for braking, ultimately causing the lawnmower to lose control of its downhill speed or even plunge into a collision.

[0029] Therefore, how to accurately identify the true steering direction of a single-channel encoder lawnmower in downhill scenarios to output reverse torque, achieve high-precision slope speed control with low-cost hardware, and reduce the probability of speed runaway is a problem that urgently needs to be solved.

[0030] This application provides a solution that obtains the current slope angle, current actual speed and target speed of the lawnmower, and determines the target PWM based on the current slope angle, current actual speed and target speed. This allows for accurate identification of the lawnmower's true direction of rotation based on the current slope angle, and outputs a reverse torque through the target PWM. This achieves high-precision slope speed control with low-cost hardware, reduces the probability of speed runaway, and enables the lawnmower to drive smoothly on slopes.

[0031] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, or an electronic device or lawnmower controller capable of performing the above functions. The following description uses a lawnmower controller as an example to illustrate this embodiment and the subsequent embodiments.

[0032] Based on this, the embodiments of this application provide a lawnmower control method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the lawnmower control method of this application.

[0033] In this embodiment, the lawnmower control method includes steps S110~S140: Step S110: Obtain the current slope angle of the lawnmower through the inertial measurement unit (IMU) of the lawnmower; Step S120: Obtain the current actual speed of the lawnmower through the encoder motor, and obtain the target speed corresponding to the lawnmower; Step S130: Based on the current slope angle, the current actual rotation speed, and the target rotation speed, determine the target PWM corresponding to the lawnmower; Step S140: Control the motor driver based on the target PWM.

[0034] In this embodiment, the lawnmower includes a lawnmower body, a controller, an IMU (Inertial Measurement Unit), a motor driver, and an encoder motor mounted on the front wheel of the lawnmower.

[0035] The lawnmower body includes a frame, wheels (with the front wheels being the drive wheels), and a cutting disc. The encoder motor is a single-channel encoder motor, mounted on the front wheel, used to output a single-channel speed pulse. The IMU is fixed to the mainboard of the chassis; this IMU is used to measure the pitch angle in real time and calculate the slope based on the pitch angle. The motor driver receives PWM (Pulse Width Modulation) signals from the controller. The system uses PWM (Pulse Width Modulation) commands to drive the motor.

[0036] In this embodiment, when the lawnmower is going downhill, the current slope angle of the lawnmower can be obtained in real time or periodically through the inertial measurement unit (IMU) of the lawnmower. Specifically, the controller obtains the pitch angle measured by the IMU and calculates the current slope angle based on the pitch angle. Alternatively, the IMU calculates the current slope angle based on the real-time measured pitch angle and uploads the current slope angle to the controller.

[0037] Meanwhile, the current actual speed of the lawnmower is obtained through the encoder motor, and the target speed corresponding to the lawnmower is also obtained. Specifically, the controller determines the current actual speed in real time through the single-channel speed pulse output by the encoder motor, and at the same time obtains the target speed of the lawnmower, specifically from the path planning module of the lawnmower.

[0038] In this embodiment, when the current slope angle, the current actual speed, and the target speed are obtained, the controller determines the target PWM corresponding to the lawnmower based on the current slope angle, the current actual speed, and the target speed.

[0039] Specifically, multiple preset slope angle ranges, multiple preset actual speed ranges, and multiple preset target speed ranges can be preset, and a preset PWM value corresponding to each combination of preset slope angle range, preset actual speed range, and preset target speed range can be set. Then, when determining the target PWM, the controller determines the combination corresponding to the current slope angle, current actual speed, and target speed in the combination of preset slope angle range, preset actual speed range, and preset target speed range, and uses the preset PWM value corresponding to this combination as the target PWM.

[0040] Alternatively, the controller determines the reverse bias and control quantity corresponding to the lawnmower based on the current slope angle, the current actual speed, and the target speed, and determines the target PWM corresponding to the lawnmower based on the reverse bias and control quantity.

[0041] In one feasible implementation, step S130 may include steps A110~A130: Step A110: Determine the reverse offset amount corresponding to the lawnmower based on the current slope angle; Step A120: Based on the target rotation speed and the current actual rotation speed, determine the control quantity corresponding to the lawnmower; Step A130: Based on the reverse bias and the control quantity, determine the target PWM corresponding to the lawnmower.

[0042] In this embodiment, multiple slope thresholds can be preset, and the slope angle range to which the current slope angle belongs can be determined based on each slope threshold. The reverse bias amount corresponding to the lawnmower can be determined based on the slope angle range.

[0043] In another feasible implementation, step A110 may include steps A111 to A113: Step A111: Obtain the mapping relationship between the preset slope angle range and the preset reverse offset amount; Step A112: Determine the target slope angle range corresponding to the current slope angle within each preset slope angle range; Step A113: Based on the mapping relationship, the preset reverse offset amount corresponding to the target slope angle range is used as the reverse offset amount corresponding to the lawnmower.

[0044] In this embodiment, a basic reverse bias value X (e.g., 2%~10%) can be preset. X is the absolute value of the motor PWM duty cycle, and its physical meaning is the minimum braking torque. Set slope thresholds: θ1 (gentle slope, such as 5°) and θ2 (steep slope, such as 15°), and set corresponding X values: X_small, X_medium, and X_large, for example, 2%, 5%, and 8% respectively.

[0045] Set the mapping relationship between the preset slope angle range and the preset reverse offset amount. For example, the preset slope angle range includes |θ|<θ1, θ1≤|θ|<θ2, and |θ|≥θ2. The mapping relationship is as follows: if |θ|<θ1, then X=X_small, at this time the lawnmower is in flat or gentle slope mode, with almost no reverse offset, and the energy efficiency of the lawnmower needs to be guaranteed; if θ1≤|θ|<θ2, then X=X_medium, at this time the lawnmower is in medium slope mode, and light braking needs to be added; if |θ|≥θ2, then X=X_large, at this time the lawnmower is in steep slope mode, and forced braking preparation is required.

[0046] It should be noted that X can be set to the minimum value or 0 when going uphill or on flat ground.

[0047] When the mapping relationship between the preset slope angle range and the preset reverse offset is obtained, the controller determines the target slope angle range corresponding to the current slope angle in each preset slope angle range, and uses the preset reverse offset corresponding to the target slope angle range as the reverse offset corresponding to the lawnmower based on the mapping relationship.

[0048] It should be noted that when the reverse bias is obtained, the controller determines the control quantity corresponding to the lawnmower based on the target speed and the current actual speed. Specifically, the control quantity can be determined based on the speed difference between the target speed and the current actual speed.

[0049] In one feasible implementation, step A120 may include steps A121-A122: Step A121: Obtain the speed error between the target rotational speed and the current actual rotational speed; Step A122: Determine the control quantity corresponding to the lawnmower based on the speed error.

[0050] In one feasible implementation, step A122 may include step A1221: Step A1221: Input the speed error into the PID (Proportional-Integral-Derivative) controller of the lawnmower to obtain the corresponding control quantity of the lawnmower.

[0051] In this embodiment, the controller can calculate the speed error between the target speed and the current actual speed. The formula for the speed error is: err = V_ref - V_act, where err is the speed error, V_ref is the target speed, and V_act is the current actual speed. If the target speed is greater than the preset speed, the current actual speed V_act takes a positive value; if the target speed is less than the preset speed, the current actual speed V_act takes a negative value. For example, the preset speed can be set to 0, so V_ref > 0 and V_act < 0.

[0052] When the speed error is obtained, the controller determines the corresponding control quantity for the lawnmower based on the speed error. Specifically, the speed error is input to the PID controller of the lawnmower, and the output of the PID controller is used as the corresponding control quantity for the lawnmower. Specifically, the speed error err is input to the PID controller to obtain the PID output, i.e., the control quantity u. The range of the control quantity u is [-1, 1], which corresponds to an ideal duty cycle of -100% to +100%. For example, when V_ref>0, the range of the control quantity u is [0, 1], and when V_ref<0, the range of the control quantity u is [-1, 0]. When u=0, it indicates that the required torque corresponding to the current lawnmower is 0. When u=1, it indicates that the required torque corresponding to the current lawnmower is the maximum forward torque. When u=-1, it indicates that the required torque corresponding to the current lawnmower is the maximum backward torque.

[0053] In this embodiment, when the controller obtains the reverse bias and control values, it determines the target PWM corresponding to the lawnmower based on the reverse bias and control values. Specifically, the calculation formula for the PWM value is preset, and the target PWM can be obtained by substituting the reverse bias and control values ​​into the calculation formula.

[0054] In one feasible implementation, step A130 may include steps A131 to A133: Step A131: Calculate the product between the reverse bias and the control quantity, and calculate the first sum between the product and the control quantity; Step A132: Determine whether the target rotational speed is greater than or equal to the preset rotational speed; Step A133: If the target speed is greater than or equal to the preset speed, then obtain the difference between the first sum and the reverse bias, and obtain the target PWM based on the difference.

[0055] In another feasible implementation, after step A132, the lawnmower control method may further include step A134: Step A134: If the target speed is less than the preset speed, calculate the second sum between the first sum and the reverse bias, and obtain the target PWM based on the second sum.

[0056] In this embodiment, when the reverse bias and control quantity are obtained, the controller calculates the product between the reverse bias and the control quantity, and calculates a first sum between the product and the control quantity, wherein the formula for the first sum is: (1 +x )· u ,in, u To control the quantity, x This is the reverse bias.

[0057] Upon obtaining the first sum value, the controller determines whether the target speed is greater than or equal to the preset speed, so as to perform piecewise linear mapping based on the determination result. For example, the control quantity... When the speed is greater than or equal to the preset speed, a positive control zone mapping is performed, and the control quantity... When the speed is less than the preset speed, reverse control zone mapping is performed, where the preset speed can be set to 0.

[0058] If the target rotational speed is greater than or equal to the preset rotational speed, and it is necessary to control the lawnmower to move forward or maintain its speed, the controller calculates the difference between the first sum and the reverse bias, and obtains the target PWM based on this difference. The physical PWM domain of the target PWM is [- x [1], where the formula for the target PWM is: ; in, For the target PWM, u To control the quantity, x For the reverse bias, (1 +x )· u This is the first sum.

[0059] For example, when the lawnmower is moving forward uphill, if the target rotational speed is greater than or equal to the preset rotational speed, then u=0. At this point, the target PWM control motor driver can output a weak backward torque to provide basic reverse pulling force and prevent the lawnmower from slipping downhill during forward movement. If u=1, then At this point, the target PWM control motor driver outputs a PWM with a full duty cycle to enable the lawnmower to move forward at maximum acceleration and full speed. The actual motor output range can be from - x % (minimum braking) to +100% (maximum forward).

[0060] If the target rotational speed is less than the preset rotational speed, the lawnmower needs to be slowed down or reversed. The controller then calculates a second sum between the first sum and the reverse bias, and obtains the target PWM based on this second sum. The physical PWM domain of the target PWM is [-1, ...]. x ], where the formula for the target PWM is: ; in, For the target PWM, u x Reverse bias, (1 +x )· u This is the first sum.

[0061] Calculate a second sum between the first sum and the reverse bias, and use the second sum as the target PWM.

[0062] For example, when the lawnmower is reversing downhill, if the target rotational speed is less than the preset speed, u=0 (approaching 0 from the negative direction), then... At this point, the target PWM control motor driver can output a weak forward torque to provide resistance in the backward direction. In other words, during the lawnmower's backward movement, the motor outputs a forward force to prevent the lawnmower from reversing too quickly and to prevent it from rolling backward downhill. If u=-1, then... At this point, the target PWM can be used to control the motor driver to output a PWM with a full duty cycle for maximum speed reversal, so that the lawnmower can reverse at full speed with maximum deceleration, thereby realizing the actual output range of the motor from -100% (maximum reverse braking / reversal) to + x % (Slight forward braking).

[0063] In this embodiment, when the target PWM is obtained, the controller controls the motor driver based on the target PWM, that is, the controller outputs the target PWM to the motor driver, and the motor driver drives the lawnmower motor according to the target PWM.

[0064] For example, the target speed of the lawnmower is V_ref = 0.5 m / s, and the PID parameters have been tuned. Set θ1 = 5°, θ2 = 12°, X_small = 2%, X_medium = 5%, X_large = 8%. The PID controller includes a forward PID controller and a backward PID controller.

[0065] On level ground, the lawnmower maintains a constant speed, requiring the motor to continuously output positive torque to overcome resistance from tire rolling friction and transmission system mechanical friction. Assume, after calibration, the required physical PWM for this condition is +30%. When the lawnmower is traveling on level ground, the IMU detects the current slope angle as θ = 0°, and a reverse bias of x = 2% is selected. Detecting a constant speed of 0.5 m / s, the forward PID controller adjusts according to the speed error, resulting in a +30% physical PWM output. Based on this 30%, the PID controller obtains the output control quantity u, i.e., (1 + 0.02)·u. 0.02 = 30%, resulting in u ≈ 31.37%, which makes the motor output forward torque when the physical PWM is +30%, and the lawnmower moves forward at a constant speed of 0.5m / s.

[0066] When the lawnmower is traveling downhill, for example, the current slope angle θ = -15°, the target speed V_ref = +0.5m / s, and x = 8%.

[0067] As the lawnmower enters the ramp, gravity causes it to accelerate to V_act = 0.7 m / s, exceeding the speed limit by 0.2 m / s. The PID controller outputs a control quantity u = 20%, and the PWM controller... out =(1.08)×0.2-0.08=+13.6%. At this time, the corresponding physical PWM is positive and still outputs forward torque, but it is weaker than 30% on flat ground.

[0068] Because the lawnmower speed continues to exceed the limit, the PID controller reduces u, for example, u=10%, and the PWM... out =(1.08)×0.1-0.08=+2.8%, at this time the forward torque output by the lawnmower is close to zero, and the lawnmower maintains its speed by gravity.

[0069] As the target PWM decreases and the real-time detection shows that the lawnmower's current actual speed is still exceeding the speed limit, the PID controller needs to further reduce the control variable u, for example, u = 5%, PWM out =(1.08)×0.05-0.08=-2.6%. At this point, the target PWM turns negative, the motor starts to output reverse torque, generating electrical braking (reverse braking), further reducing the actual speed of the lawnmower.

[0070] As the actual speed of the lawnmower approaches the target speed, the PID controller continues to reduce the control input u, for example, u = 2%, and the PWM controller... out =(1.08)×0.02-0.08=-5.84%, the lawnmower is pulled by a stable reverse torque output by the motor, and the lawnmower is driven downhill at a constant speed by a stable reverse brake.

[0071] In this embodiment, as the control quantity u continuously decreases from 20% to 2%, the target PWM smoothly transitions from +13.6% to -5.84%, and the motor torque seamlessly switches from forward drive to reverse braking without any impact or jump. Through the translation of the mapping function, the continuous adjustment of the PID controller in the u domain is transformed into the continuous crossing of the target PWM on both sides of the zero point.

[0072] When the lawnmower starts and accelerates on flat ground, for example, when the target speed accelerates from 0 to V_ref=+0.8 m / s and x=2%, the output control quantity u of the PID controller gradually increases from 0.

[0073] At the moment the lawnmower starts, the control quantity u output by the PID controller is 0, and the PWM controller output is 0. out =(1.02)×0-0.02=-2%. At this time, the motor outputs a very weak reverse torque to eliminate the transmission gap.

[0074] After starting, the PID controller increases the output control quantity, for example, u=5%, PWM out =(1.02)×0.05-0.02=+3.1%, driven by the positive torque output of the motor.

[0075] Next, the PID controller increases the output control quantity, for example, u=40%, and the PWM controller... out =(1.02)×0.4-0.02=+38.8%, which means that the lawnmower can accelerate rapidly by outputting a strong positive torque through the motor.

[0076] When the lawnmower reaches the target speed + 0.8 m / s, the PID controller reduces the output control quantity, for example, u = 30%, and the PWM controller... out =(1.02)×0.3-0.02=+28.6%, through the motor to output a stable positive torque to overcome friction and keep the lawnmower running at a constant speed.

[0077] When the lawnmower is backing downhill, for example, the current slope angle θ = 15°, the target speed V_ref = -0.3 m / s, and x = 8%.

[0078] Upon entering the slope, gravity causes the lawnmower to accelerate backward to V_act = -0.6 m / s, putting it in an overspeed state. The PID controller outputs a control quantity u = -20%, and the PWM controller... out =(1.08)×(-0.2)+0.08=-13.6%. At this point, the motor still outputs a backward torque, but the force has weakened.

[0079] Next, the PID controller reduces the output control quantity, for example, u = -10%, and the PWM controller... out=(1.08)×(-0.1)+0.08=-2.8%, the motor outputs a weak backward torque, which is close to zero torque.

[0080] Afterwards, the PID controller continues to reduce the output control quantity, for example, u = -5%, and the PWM controller... out =(1.08)×(-0.05)+0.08=+2.6%. At this time, the motor outputs a weak positive torque, and the forward torque is used to brake, so as to reduce the backward speed of the lawnmower.

[0081] When the lawnmower reaches the target speed of -0.3 m / s, the PID controller continues to reduce the output control quantity, for example, u = -2%, and the PWM controller... out =(1.08)×(-0.02)+0.08=+5.84%, the motor outputs a stable positive torque to pull the lawnmower, overcome gravity and make the lawnmower maintain a constant speed while reversing downhill.

[0082] It should be noted that X_minimum ranges from 2-3%, which eliminates transmission backlash and motor dead zone, suitable for flat ground or slight slopes (<5°). X_medium ranges from 5-6%, providing noticeable but gentle downhill resistance, suitable for common medium slopes (5°~12°) up to 10°. X_maximum ranges from 8-10%, providing strong braking, suitable for steep slopes exceeding 12°.

[0083] Additionally, it should be noted that the X value should not exceed 12%. Otherwise, during a forward start on flat ground, the controller only needs to output an equivalent PWM value exceeding 12% to overcome the -X% bias, which may lead to sluggish response or motor overheating. The optimal value of X should be determined through actual measurement: the minimum reverse bias corresponding to the machine being able to travel stably at the target speed on the target slope.

[0084] It should be noted that this embodiment enables low-cost slope speed control without the need to upgrade to a dual-channel encoder; effective electronic braking can be provided solely through the algorithm. It eliminates speed runaway, ensuring the machine maintains a stable target speed on any slope without the risk of lurching, thus improving safety. A balance between smoothness and energy efficiency is achieved through IMU adaptive adjustment of the X value, resulting in almost no additional energy consumption on flat ground and smooth braking on slopes without abrupt jerking.

[0085] This embodiment provides a lawnmower control method. The method acquires the current slope angle of the lawnmower using an inertial measurement unit (IMU); then, it acquires the current actual rotational speed of the lawnmower using an encoder motor, and obtains the corresponding target rotational speed; then, based on the current slope angle, the current actual rotational speed, and the target rotational speed, it determines the target PWM (Pulse Width Modulation) for the lawnmower; finally, it controls the motor driver based on the target PWM. By acquiring the current slope angle, current actual rotational speed, and target rotational speed of the lawnmower, and determining the target PWM based on these parameters, the method accurately identifies the lawnmower's true direction of travel based on the current slope angle, and outputs a reverse torque through the target PWM. This achieves high-precision slope speed control with low-cost hardware, reduces the probability of speed loss, and enables the lawnmower to travel smoothly on slopes.

[0086] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the lawnmower control method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0087] This application also provides a lawnmower control device, please refer to... Figure 2 The lawnmower includes an inertial measurement unit (IMU), a motor driver, and an encoder motor mounted on the front wheel of the lawnmower; the lawnmower control device includes: The first acquisition module 10 is used to acquire the current slope angle of the lawnmower through the inertial measurement unit (IMU); The second acquisition module 20 is used to acquire the current actual speed of the lawnmower through the encoder motor, and to acquire the target speed corresponding to the lawnmower; The determining module 30 is used to determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotation speed, and the target rotation speed; Control module 40 is used to control the motor driver based on the target PWM.

[0088] Furthermore, module 30 is also used for: The reverse bias amount corresponding to the lawnmower is determined based on the current slope angle; Based on the target rotation speed and the current actual rotation speed, the control quantity corresponding to the lawnmower is determined; Based on the reverse bias and the control quantity, the target PWM corresponding to the lawnmower is determined.

[0089] Furthermore, module 30 is also used for: Calculate the product between the reverse bias and the control quantity, and calculate the first sum between the product and the control quantity; Determine whether the target rotational speed is greater than or equal to the preset rotational speed; If the target speed is greater than or equal to the preset speed, the difference between the first sum and the reverse bias is obtained, and the target PWM is obtained based on the difference.

[0090] Furthermore, module 30 is also used for: If the target speed is less than the preset speed, calculate the second sum between the first sum and the reverse bias, and obtain the target PWM based on the second sum.

[0091] Furthermore, module 30 is also used for: Obtain the mapping relationship between the preset slope angle range and the preset reverse offset amount; Determine the target slope angle range corresponding to the current slope angle within each preset slope angle range; Based on the mapping relationship, the preset reverse offset amount corresponding to the target slope angle range is used as the reverse offset amount corresponding to the lawnmower.

[0092] Furthermore, module 30 is also used for: Obtain the speed error between the target rotational speed and the current actual rotational speed; The control quantity corresponding to the lawnmower is determined based on the speed error.

[0093] Furthermore, module 30 is also used for: The speed error is input into the PID controller of the lawnmower to obtain the corresponding control quantity of the lawnmower.

[0094] The lawnmower control device provided in this application, employing the lawnmower control method described in the above embodiments, can solve the technical problem of how to accurately identify the true steering direction of a single-channel encoder lawnmower in downhill scenarios to output reverse torque, achieving high-precision slope speed control with low-cost hardware, and reducing the probability of speed runaway. Compared with the prior art, the beneficial effects of the lawnmower control device provided in this application are the same as those of the lawnmower control method provided in the above embodiments, and other technical features in the lawnmower control device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0095] This application provides a controller, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the lawnmower control method in Embodiment 1 above.

[0096] The following is for reference. Figure 3It shows a structural schematic diagram of a lawnmower suitable for implementing embodiments of this application. For example... Figure 3 As shown, the lawnmower includes: the controller described above; An inertial measurement unit (IMU) and a motor driver are electrically connected to the controller, respectively. The lawnmower also includes an encoder motor connected to the motor driver and located on the front wheel of the lawnmower, wherein the motor driver and the encoder motor are in one-to-one correspondence, and the specific number is determined according to the number of front wheels.

[0097] The controller is used to acquire the current slope angle of the lawnmower through the inertial measurement unit (IMU); acquire the current actual speed of the lawnmower through the encoder motor, and acquire the target speed corresponding to the lawnmower; determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual speed, and the target speed; and control the motor driver based on the target PWM. Figure 3 The lawnmower shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this application.

[0098] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. When the computer program is executed by a processor, it performs the functions defined above in the methods of the embodiments disclosed in this application.

[0099] The lawnmower provided in this application, employing the lawnmower control method described in the above embodiments, solves the technical problem of how to accurately identify the true steering direction of a single-channel encoder lawnmower in downhill scenarios to output reverse torque, achieving high-precision slope speed control with low-cost hardware, and reducing the probability of speed runaway. Compared with the prior art, the beneficial effects of the lawnmower provided in this application are the same as those of the lawnmower control method provided in the above embodiments, and other technical features of this lawnmower are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0100] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0101] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0102] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the lawnmower control method in the above embodiments.

[0103] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0104] The aforementioned computer-readable storage medium may be included in the controller; or it may exist independently and not be assembled into the controller.

[0105] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the controller, cause the controller to: acquire the current slope angle of the lawnmower via the inertial measurement unit (IMU) of the lawnmower; acquire the current actual rotational speed of the lawnmower via the encoder motor, and acquire the target rotational speed corresponding to the lawnmower; determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotational speed, and the target rotational speed; and control the motor driver based on the target PWM.

[0106] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. 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 indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated 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 the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0108] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0109] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described lawnmower control method. This solves the technical problem of accurately identifying the true steering direction of a single-channel encoder lawnmower in downhill scenarios to output a reverse torque, achieving high-precision slope speed control with low-cost hardware, and reducing the probability of speed runaway. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the lawnmower control method provided in the above embodiments, and will not be repeated here.

[0110] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the lawnmower control method described above.

[0111] The computer program product provided in this application solves the technical problem of how to accurately identify the actual steering direction of a single-channel encoder lawnmower in downhill scenarios to output reverse torque, achieving high-precision slope speed control with low-cost hardware and reducing the probability of speed runaway. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the lawnmower control method provided in the above embodiments, and will not be repeated here.

[0112] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A lawnmower control method, characterized in that, The lawnmower includes an inertial measurement unit (IMU), a motor driver, and an encoder motor mounted on the front wheel of the lawnmower; the lawnmower control method includes: The current slope angle of the lawnmower is obtained through the inertial measurement unit (IMU). The encoder motor is used to obtain the current actual speed of the lawnmower and the corresponding target speed of the lawnmower. Based on the current slope angle, the current actual rotation speed, and the target rotation speed, the target PWM corresponding to the lawnmower is determined; The motor driver is controlled based on the target PWM.

2. The lawnmower control method as described in claim 1, characterized in that, The step of determining the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotation speed, and the target rotation speed includes: The reverse bias amount corresponding to the lawnmower is determined based on the current slope angle; Based on the target rotation speed and the current actual rotation speed, the control quantity corresponding to the lawnmower is determined; Based on the reverse bias and the control quantity, the target PWM corresponding to the lawnmower is determined.

3. The lawnmower control method as described in claim 2, characterized in that, The step of determining the target PWM corresponding to the lawnmower based on the reverse bias and the control quantity includes: Calculate the product between the reverse bias and the control quantity, and calculate the first sum between the product and the control quantity; Determine whether the target rotational speed is greater than or equal to the preset rotational speed; If the target speed is greater than or equal to the preset speed, the difference between the first sum and the reverse bias is obtained, and the target PWM is obtained based on the difference.

4. The lawnmower control method as described in claim 3, characterized in that, After the step of determining whether the target rotational speed is greater than or equal to the preset rotational speed, the lawnmower control method further includes: If the target speed is less than the preset speed, calculate the second sum between the first sum and the reverse bias, and obtain the target PWM based on the second sum.

5. The lawnmower control method as described in claim 2, characterized in that, The step of determining the reverse bias amount corresponding to the lawnmower based on the current slope angle includes: Obtain the mapping relationship between the preset slope angle range and the preset reverse offset amount; Determine the target slope angle range corresponding to the current slope angle within each preset slope angle range; Based on the mapping relationship, the preset reverse offset amount corresponding to the target slope angle range is used as the reverse offset amount corresponding to the lawnmower.

6. The lawnmower control method according to any one of claims 2 to 5, characterized in that, The step of determining the control quantity corresponding to the lawnmower based on the target rotation speed and the current actual rotation speed includes: Obtain the speed error between the target rotational speed and the current actual rotational speed; The control quantity corresponding to the lawnmower is determined based on the speed error.

7. The lawnmower control method as described in claim 6, characterized in that, The step of determining the control quantity corresponding to the lawnmower based on the speed error includes: The speed error is input into the PID controller of the lawnmower to obtain the corresponding control quantity of the lawnmower.

8. A lawnmower control device, characterized in that, The lawnmower includes an inertial measurement unit (IMU), a motor driver, and an encoder motor mounted on the front wheel of the lawnmower; the lawnmower control device includes: The first acquisition module is used to acquire the current slope angle of the lawnmower through the inertial measurement unit (IMU); The second acquisition module is used to acquire the current actual speed of the lawnmower through the encoder motor, and to acquire the target speed corresponding to the lawnmower; The determination module is used to determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotation speed, and the target rotation speed; A control module is used to control the motor driver based on the target PWM.

9. A controller, characterized in that, The controller includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the lawnmower control method as described in any one of claims 1 to 7.

10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the lawnmower control method as described in any one of claims 1 to 7.

11. A lawnmower, characterized in that, The lawnmower includes: The controller as described in claim 9; An inertial measurement unit (IMU) and a motor driver are electrically connected to the controller, respectively. The controller includes an encoder motor connected to the motor driver and disposed on the front wheel of the lawnmower. The controller is configured to acquire the current slope angle of the lawnmower via an inertial measurement unit (IMU); acquire the current actual rotational speed of the lawnmower via the encoder motor, and acquire the target rotational speed corresponding to the lawnmower; determine the target PWM corresponding to the lawnmower based on the current slope angle, the current actual rotational speed, and the target rotational speed; and control the motor driver based on the target PWM.