A method, device, equipment, medium and product for stabilizing an unmanned electric motorcycle

CN123010809APending Publication Date: 2026-10-30BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611428924.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]目前的无人摩托稳定控制技术多采用自行车模型结合比例-积分-微分控制(Proportional-Integral-Derivative,PID)、线性二次型调节器(Linear-QuadraticRegulator,LQR)等传统控制方法,该技术通常依赖路径分段线性化,路径跟踪效果不佳

Benefits of technology

本申请提供了一种无人电动摩托车稳定控制方法、装置、设备、介质及产品,在同一控制周期内,将纯跟踪算法、强化学习残差策略网络、基于二阶侧倾动力学的离散预测模型与执行器指令输出结合为完整的信息闭环,在无需额外协调层或强制上挂重规划器的前提下,能够对无人电动摩托车的离散参考路径实现强跟踪,并将侧倾角等关键状态约束在安全边界之内,从而在小转弯半径、高速、强非线性等复杂工况下同时兼顾路径跟踪精度与防侧翻能力;通过强化学习残差策略网络和离散预测模型实现控制,能够减少对单一模型的依赖,相对于传统的控制方法,鲁棒性更强,约束性与可验证性也更强。因此,本申请能保证无人电动摩托车在复杂环境下安全稳定行驶。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123010809A_ABST
    Figure CN123010809A_ABST
Patent Text Reader

Abstract

The application discloses a kind of unmanned electric motorcycle stable control method, device, equipment, medium and product, it is related to vehicle control engineering and stable safety field.The method comprises: determining desired front wheel rotation angle and reference roll angle;State vector is constructed according to current roll angle, roll angle velocity and path tracking error, and roll residual and steering residual are determined in combination with reinforcement learning residual strategy network;The reference roll angle is corrected using the roll residual, and according to the corrected roll angle and the discrete prediction model based on the second-order roll dynamics, the model predictive control is solved in the limited prediction time domain through the quadratic performance index, the control amount obtained is combined with the feedforward term determined by the desired front wheel rotation angle and is mapped as physical steering instruction;Physical steering instruction and steering residual are superimposed and smoothed after processing and output to steering actuator, and power instruction is generated according to target vehicle speed and output to drive motor.The application can guarantee that unmanned electric motorcycle safely and stably travels under complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of vehicle control engineering and stability and safety, and in particular to a method, device, equipment, medium and product for the stability control of an unmanned electric motorcycle. Background Technology

[0002] In remote mountainous terrain, narrow forest paths, and areas lacking paved roads, unmanned electric motorcycles with a high power-to-weight ratio demonstrate superior cross-terrain mobility compared to four-wheeled vehicles. Compared to tracked vehicles, they offer better fuel economy or range while maintaining high-speed maneuverability. In emergency rescue operations following earthquakes, forest fire reconnaissance, and the delivery of medical supplies to remote areas, unmanned motorcycles can utilize their tilting characteristics to quickly navigate curves, significantly reducing emergency response time. Therefore, highly maneuverable autonomous operations in unstructured and challenging environments place an urgent need on the stable driving capabilities of unmanned motorcycles.

[0003] Based on the aforementioned needs, research was conducted on safe path tracking technology for unmanned motorcycles. Unmanned electric motorcycles inherently possess static instability, and their dynamic balance relies entirely on real-time control intervention. At low speeds, the system faces significant risks of gravitational moment instability, requiring sophisticated balance compensation algorithms. At high speeds, a strong nonlinear coupling exists between steering control and body roll angle; any lateral deviation or disturbance can easily lead to attitude instability or even rollover. Therefore, safe path tracking control not only requires the vehicle to follow the desired path with high precision in complex dynamic environments but also necessitates strictly limiting critical states such as lateral deviation and roll angle within safe boundaries to prevent rollover accidents caused by road bumps, lateral wind disturbances, or human-machine interaction. Overall, safe path tracking technology is a crucial foundation for the reliable autonomous driving of unmanned motorcycles, directly determining whether the platform can move from theoretical verification to practical deployment.

[0004] Current unmanned motorcycle stability control technologies mostly employ a bicycle model combined with traditional control methods such as Proportional-Integral-Derivative (PID) and Linear-Quadratic Regulator (LQR). These technologies typically rely on piecewise linearization of the path, resulting in poor path tracking performance. Furthermore, under conditions of small turning radii, high speeds, and strong nonlinearity, path tracking accuracy and rollover prevention capabilities often deteriorate simultaneously, making tipping over and causing mission failure. Therefore, ensuring the safe and stable operation of unmanned electric motorcycles in complex environments has become a pressing issue that needs to be addressed. Summary of the Invention

[0005] The purpose of this application is to provide a method, device, equipment, medium, and product for the stable control of unmanned electric motorcycles, which can ensure the safe and stable operation of unmanned electric motorcycles in complex environments.

[0006] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a method for stabilizing an unmanned electric motorcycle, including: The system acquires vehicle information, discrete reference path point sequence, and path equivalent curvature of the unmanned electric motorcycle; the vehicle information includes: current vehicle speed, current roll angle, and roll rate. On the discrete reference path point sequence, determine the nearest point of the unmanned electric motorcycle at its current position. Based on the nearest point, use a forward-looking pure tracking algorithm to obtain the desired front wheel steering angle, and determine the reference roll angle according to the current vehicle speed and the equivalent curvature of the path. A state vector is constructed based on the current roll angle, the roll angular velocity, and the path tracking error. The roll residual and steering residual are then determined based on the state vector and the reinforcement learning residual policy network. The reference roll angle is corrected using the roll residual. The corrected roll angle is used as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control is solved by quadratic performance index within the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the expected front wheel steering angle to obtain the equivalent control input quantity. The equivalent control input quantity is then mapped to a physical steering command. The physical steering command is superimposed with the steering residual and smoothed to produce the final steering command, which is then output to the steering actuator. A power command is generated based on the target vehicle speed and output to the drive motor to achieve control of the unmanned electric motorcycle.

[0007] In one embodiment, the reinforcement learning residual policy network is an entropy-regularized reinforcement learning policy network; the entropy-regularized reinforcement learning policy network is a soft actor-commenter structure with a dual commentator network.

[0008] In one embodiment, the reference roll angle is corrected using the roll residual, and the corrected roll angle is used as the roll tracking reference. Based on a discrete prediction model of second-order roll dynamics, predictive control is obtained by solving the model using a quadratic performance index within a finite prediction time domain. The obtained control quantity is then combined with the feedforward term determined by the desired front wheel steering angle to obtain an equivalent control input quantity, specifically including: After superimposing and limiting the roll residual with the reference roll angle, the corrected roll angle is obtained; The second-order roll dynamics model is linearized based on the vehicle's geometric parameters, mass parameters, and gravitational acceleration to obtain a discrete prediction model; Using the corrected roll angle as the roll tracking reference, the control quantity is obtained by analytically inverting the Hessian matrix under unconstrained conditions within the finite prediction time domain. The feedforward term is determined based on the desired front wheel steering angle, and the control quantity is used as the first term of the control sequence. The first term of the control sequence and the feedforward term are then combined to obtain the equivalent control input quantity.

[0009] In one embodiment, the expression for the physical steering command is: ; ; in, Indicates a physical turn command; Represents the amplitude limiting function; Represents the arctangent function; Indicates the equivalent control input quantity; Indicates the feedforward term; Indicates the control quantity; Indicates wheelbase; Indicates the upper limit of speed; Indicates the minimum front wheel steering angle; This indicates the maximum front wheel steering angle.

[0010] In one embodiment, the physical steering command and the steering residual are superimposed and smoothed before being output as the final steering command to the steering actuator, specifically including: The physical steering command is superimposed with the steering residual to obtain the corrected steering angle. The expression for the corrected steering angle is: ; in, This indicates the corrected steering angle; Indicates a physical turn command; Indicates the steering residual; The corrected steering angle is smoothed using a first-order process to obtain the final steering command; the expression for the final steering command is: ; in, For the current period The final turning instruction; For smoothing coefficients; For the previous cycle The final turning instruction.

[0011] In one embodiment, the reward of the reinforcement learning residual policy network during the training phase is determined based on the deviation of the roll angle from the reference roll angle, roll rate, lateral error, heading error, velocity error, action smoothing term, and index progress term along the reference path.

[0012] Secondly, this application provides a stability control device for an unmanned electric motorcycle, comprising: The data acquisition module is used to acquire vehicle information, discrete reference path point sequence, and path equivalent curvature of the unmanned electric motorcycle; the vehicle information includes: current vehicle speed, current roll angle, and roll angular velocity; The pure tracking module is used to determine the nearest point of the unmanned electric motorcycle at its current position on the discrete reference path point sequence, obtain the desired front wheel steering angle based on the nearest point using a forward-looking pure tracking algorithm, and determine the reference roll angle according to the current vehicle speed and the equivalent curvature of the path. The reinforcement learning residual module is used to construct a state vector based on the current roll angle, the roll angular velocity, and the path tracking error, and to determine the roll residual and steering residual based on the state vector and the reinforcement learning residual policy network. The model predictive control inner loop module is used to correct the reference roll angle using the roll residual, and to use the corrected roll angle as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control is solved by quadratic performance index in the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the expected front wheel steering angle to obtain the equivalent control input quantity, and the equivalent control input quantity is mapped to the physical steering command. The steering fusion and command issuance module is used to superimpose the physical steering command and the steering residual, and after smoothing, output the final steering command to the steering actuator. It generates a power command based on the target vehicle speed and outputs it to the drive motor to realize the control of the unmanned electric motorcycle.

[0013] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the unmanned electric motorcycle stability control method described in any one of the above.

[0014] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the unmanned electric motorcycle stability control method described in any one of the above descriptions.

[0015] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the unmanned electric motorcycle stability control method described above.

[0016] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a method, device, equipment, medium, and product for the stable control of unmanned electric motorcycles. Within the same control cycle, it combines a pure tracking algorithm, a reinforcement learning residual policy network, a discrete prediction model based on second-order roll dynamics, and actuator command output into a complete information closed loop. Without requiring an additional coordination layer or a forced load-bearing planner, it can achieve strong tracking of the discrete reference path of the unmanned electric motorcycle and constrain key states such as roll angle within safety boundaries. This allows for simultaneous consideration of path tracking accuracy and anti-rollover capability under complex conditions such as small turning radii, high speeds, and strong nonlinearity. Control achieved through a reinforcement learning residual policy network and a discrete prediction model reduces reliance on a single model, resulting in stronger robustness, constraint, and verifiability compared to traditional control methods. Therefore, this application ensures the safe and stable operation of unmanned electric motorcycles in complex environments. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating a method for stabilizing an unmanned electric motorcycle, as provided in an embodiment of this application. Figure 2 A more specific overall block diagram of the unmanned electric motorcycle stability control method provided in the embodiments of this application; Figure 3 This is a schematic diagram of the lifting matrix and prediction time domain construction in the MPC inner loop provided in an embodiment of this application; Figure 4 This is a schematic diagram of the SAC state and the position of the dual-channel residual action provided in the embodiments of this application; Figure 5 A schematic diagram of the control timing and recovery, warm-up, and main control phased state machine provided for embodiments of this application; Figure 6 Schematic diagrams illustrating simulation curves for reference / actual trajectory, tilt, reward, etc., provided for embodiments of this application; Figure 7 A schematic diagram of the functional modules of a stability control device for an unmanned electric motorcycle provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] In one exemplary embodiment, such as Figure 1 As shown, a method for stabilizing an unmanned electric motorcycle is provided, including: Step 101: Obtain vehicle information, discrete reference path point sequence, and path equivalent curvature of the unmanned electric motorcycle.

[0022] The vehicle information includes: current vehicle speed, current roll angle, and roll rate.

[0023] Step 102: Determine the nearest point of the unmanned electric motorcycle at its current position on the discrete reference path point sequence, obtain the desired front wheel steering angle based on the nearest point using a forward-looking pure tracking algorithm, and determine the reference roll angle according to the current vehicle speed and the equivalent curvature of the path.

[0024] Step 103: Construct a state vector based on the current roll angle, the roll angular velocity, and the path tracking error, and determine the roll residual and steering residual based on the state vector and the reinforcement learning residual policy network.

[0025] The path tracking error includes: lateral error and heading error.

[0026] Step 104: The reference roll angle is corrected using the roll residual. The corrected roll angle is used as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control (MPC) is solved by quadratic performance index within the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the desired front wheel steering angle to obtain the equivalent control input quantity. The equivalent control input quantity is then mapped to a physical steering command.

[0027] Step 105: The physical steering command and the steering residual are superimposed and smoothed to form the final steering command, which is then output to the steering actuator. A power command is generated based on the target vehicle speed and output to the drive motor to achieve control of the unmanned electric motorcycle.

[0028] The power command is either a drive command or a wheel speed command.

[0029] In another exemplary embodiment of this application, the roll angle and roll rate in the state vector are measured in real time by an inertial measurement unit, the path tracking error is calculated by comparing the vehicle pose with a discrete reference path, and the state vector is normalized by subtracting the mean and dividing the variance before being input into the reinforcement learning residual policy network.

[0030] In another exemplary embodiment of this application, the reinforcement learning residual policy network is an entropy-regularized reinforcement learning policy network; the entropy-regularized reinforcement learning policy network is a soft actor-critic (SAC) structure with a dual critic network, whose output action is mapped to a bounded interval by tanh and scaled according to the dimensional scale to obtain the tilt residual and the turning residual, respectively.

[0031] In another exemplary embodiment of this application, the state vector of the discrete prediction model is a two-dimensional vector composed of the roll angle and the roll angular velocity, and the equivalent control input is mapped into a physical steering command after being synthesized by the feedforward and model prediction correction terms.

[0032] In another exemplary embodiment of this application, the discrete prediction model is obtained by linearizing the vehicle's geometric parameters, mass parameters, and gravitational acceleration, and solves a small-scale quadratic programming problem in the form of an analytical inverse of the Hessian matrix under unconstrained conditions.

[0033] In another exemplary embodiment of this application, step 104 specifically includes: superimposing and limiting the roll residual with the reference roll angle to obtain a corrected roll angle; linearizing the second-order roll dynamics model according to vehicle geometric parameters, mass parameters, and gravitational acceleration to obtain a discrete prediction model; using the corrected roll angle as a roll tracking reference, analytically inverting the Hessian matrix under unconstrained conditions within a finite prediction time domain to obtain a control quantity; determining a feedforward term according to the desired front wheel steering angle, using the control quantity as the first term of the control sequence, and synthesizing the first term of the control sequence and the feedforward term to obtain an equivalent control input quantity; and mapping the equivalent control input quantity to a physical steering command.

[0034] The expression for the physical steering command is as follows: .

[0035] .

[0036] in, Indicates a physical turn command; Represents the amplitude limiting function; Represents the arctangent function; Indicates the equivalent control input quantity; Indicates the feedforward term; Indicates the control quantity; Indicates wheelbase; Indicates the upper limit of speed; Indicates the minimum front wheel steering angle; This indicates the maximum front wheel steering angle.

[0037] In another exemplary embodiment of this application, step 105, which involves superimposing the physical steering command and the steering residual and smoothing them, outputting the final steering command to the steering actuator, specifically includes: The physical steering command is superimposed with the steering residual to obtain the corrected steering angle. The expression for the corrected steering angle is: .

[0038] in, This indicates the corrected steering angle; Indicates a physical turn command; This indicates the reversal residual.

[0039] The corrected steering angle is smoothed using a first-order process to obtain the final steering command; the expression for the final steering command is: .

[0040] in, For the current period The final turning instruction; For smoothing coefficients; For the previous cycle The final turning instruction.

[0041] In another exemplary embodiment of this application, the reward of the reinforcement learning residual policy network during the training phase is determined based on the deviation of the roll angle relative to the reference roll angle, roll rate, lateral error, heading error, velocity error, action smoothing term, and index progress term along the reference path.

[0042] The unmanned electric motorcycle stability control method in this embodiment obtains the desired front wheel steering angle and the reference roll angle determined by vehicle speed and equivalent curvature based on the nearest point on the discrete reference path and forward-looking pure tracking. Using a state vector containing roll angle, roll angular velocity, path tracking error, and heading error as input, a reinforcement learning strategy with entropy regularization outputs a correction to the reference roll angle and a steering residual. Based on a discrete prediction model of second-order roll dynamics, within a finite prediction time domain, the equivalent model predictive control is solved using a quadratic performance index, and a physical steering command is synthesized. The steering obtained from the model predictive control is combined with the residual, smoothed, and then output to the steering actuator, generating drive or wheel speed commands based on the target vehicle speed. This embodiment ensures the safe and stable operation of the unmanned electric motorcycle in complex environments.

[0043] The following is a more specific embodiment to further explain the above-described unmanned electric motorcycle stability control method.

[0044] To address the challenges of existing single-level geometric tracking methods in simultaneously ensuring roll dynamic constraints and the difficulty in guaranteeing steady-state accuracy and safety of pure reinforcement learning controllers, this embodiment implements stable control of an unmanned electric motorcycle based on learning model predictive control. First, a pure tracking algorithm calculates the desired front wheel steering angle and reference roll angle on a discrete reference path, serving as tracking targets at the geometric and kinematic levels. Based on this, a soft actor-commenter (SAC) policy network infers the normalized vehicle state, outputting bounded dual-channel residual actions after tanh mapping, which are used to correct the reference roll angle and MPC steering output, respectively. The corrected reference roll angle is input into the MPC inner loop established based on a second-order linearized roll model. Within the finite prediction time domain, an optimal control sequence is obtained by analytically solving an unconstrained quadratic programming problem. The first-step control quantity is combined with the feedforward to synthesize the equivalent steering angle. Finally, the MPC steering and SAC steering residuals are superimposed, smoothed by a first-order low-pass filter, and output as the front wheel steering command. A longitudinal PI controller then completes the vehicle speed closed-loop. The training phase employs a multi-component reward function that includes roll deviation, lateral heading error, velocity deviation, motion smoothness, and path progression. A phased safety state machine is used to ensure the learnability of the strategy and the safety of the simulation reset process.

[0045] This embodiment combines Model Predictive Control (MPC) with model-free reinforcement learning residuals to achieve stable control of unmanned electric motorcycle trajectory tracking under a discrete reference path. The controlled object is an unmanned electric motorcycle with front-axle steering and rear-axle drive. Within the same control cycle, geometric reference calculation, learning residual correction, model predictive control, and actuator command output form a complete information closed loop, eliminating the need for cross-cycle scheduling or additional coordination layers. If the upper-layer module needs to provide dynamic path replanning or path point rolling updates, this embodiment can be directly connected as a sub-controller, as long as the same discrete point interface (position coordinates, reference heading, path curvature) is still provided when refreshing the path, the core control law does not need to be modified.

[0046] like Figure 2 As shown, this embodiment may include the following main steps within each control cycle.

[0047] (1) Construction of discrete reference path and pure tracking, path tracking quantity. The path can also be refreshed in real time by the external planning module: ① On the discrete reference path point sequence, search for the nearest Euclidean point in the time / space window of the current index to obtain the reference pose and curvature, and obtain the lateral error and heading error according to Frenet or equivalent projection; ② Determine the foresight point according to the foresight distance (related to vehicle speed, constant foresight, and path step length), obtain the expected front wheel angle by the pure tracking algorithm, and obtain the reference roll angle and limit the amplitude by the equivalent curvature and vehicle speed.

[0048] (2) Reinforcement learning residual strategy: The output of the normalized state (such as 9 dimensions, including roll, roll rate, lateral heading error, curvature, pure tracking quantity, etc.) constructed in step (1) is bounded in (-1, 1). After two-dimensional actions with scale scaling, it is used to calculate the reference roll correction and steering residual respectively.

[0049] (3) Roll / steering inner loop based on model predictive control: The roll / roll ratio is written as a second-order discrete predictive model; in the prediction step size Sampling period The following stacked lifting equation, with block matrix , The cost is a quadratic form; under unconstrained conditions, the first term of the control sequence is obtained by Hessian analytical inverse, and it is combined with the feedforward given by the desired front wheel angle and vehicle speed to form an equivalent control, which is then inversely solved to obtain the limited physical front wheel angle (MPC steering command).

[0050] (4) Execution layer fusion, vehicle speed loop and command release: After learning correction of the reference roll, it is sent to step (3); the MPC steering and steering residual are algebraically superimposed under the agreed sign and passed through the first-order low-pass filter; the normalized drive / wheel speed command is calculated for the target vehicle speed using PI or equivalent control law and released to the outside world through the ROS2 topic; if it is in training mode, the experience is written and the network parameters are updated at intervals.

[0051] (5) Training and safety, turn-based state machine: After simulation or real vehicle reset, it goes through non-blocking recovery, incremental drive, warm-up straight line stage, and then enters main hybrid control; a fall is determined by large roll angle, and termination is determined by path completion, step limit, etc.; the reward integrates indicators such as roll, lateral heading, speed, motion smoothness, path progress, etc., and the total reward for a single step is truncated when necessary.

[0052] The formulas involved in the above process are explained below.

[0053] ① Discrete prediction model for the inner tilt ring.

[0054] The equivalent geometric quantity is: .

[0055] Continuous-time linearization is as follows: .

[0056] in, It is an equivalent geometric quantity; This refers to the wheelbase; For quality; Equivalent mass of the wheel; Where is the wheel radius; The roll angle; This refers to the roll angular velocity; It is the acceleration due to gravity; The height of the center of mass; For the equivalent control input, in this embodiment, it is synthesized from the feedforward and MPC correction terms and then mapped to... , This is the equivalent steering angle of the front wheels.

[0057] The discretized state equations are: .

[0058] (2×1 column vector).

[0059] in It is a two-dimensional column vector, with the first component being the roll angle and the second component being the roll angular velocity. The index is the discrete time step.

[0060] System Matrix for: .

[0061] Input matrix for: .

[0062] ② Pure tracking and reference roll.

[0063] lateral error for: .

[0064] Heading error for: .

[0065] in This is the vehicle's actual heading. For vehicle reference heading, Use the vehicle's reference lateral coordinates. For the vehicle's reference longitudinal coordinate, The actual lateral coordinates of the vehicle. This represents the vehicle's actual longitudinal coordinates.

[0066] Forward speed Forward sight distance range Index of forward-looking target points for: .

[0067] .

[0068] .

[0069] in, The path step size, As the lower limit of speed, For vehicle speed, To control the cycle, For MPC prediction steps, This is the forward velocity coefficient.

[0070] Geometric curvature command With expected front wheel angle for: .

[0071] .

[0072] The vehicle system's longitudinal and transverse coordinates , It is calculated from the forward viewpoint and the vehicle's pose.

[0073] Equivalent curvature Compared with reference roll angle for: .

[0074] .

[0075] ③ Unconstrained linear MPC.

[0076] Cumulative forecast With error matrix for: .

[0077] .

[0078] Control input matrix The component of the tilt angle for each sub-block of the reference sequence R is... form, The state transition promotion matrix, To control the input lifting matrix.

[0079] The objective of the quadratic form is: .

[0080] .

[0081] The unconstrained first-order optimal solution is: .

[0082] Take the first term With the feedforward control input given by vehicle speed Final control quantity The upper speed limit of the embodiment .

[0083] The front wheel steering angle output is: .

[0084] The Two rows of sub-blocks are , of block is .

[0085] The process of constructing the lifting matrix and prediction time domain in the inner loop of MPC is as follows: Figure 3 As shown. Figure 3 This reflects the complete rolling optimization process of Model Predictive Control (MPC): First, taking the current time... Second-order roll state Starting from the state transition boosting matrix and control input boosting matrix The system will predict the future time domain The internal state is expanded into a linear prediction model. Thus, the control sequence to be determined Stacked vectors with predicted states Directly correlate them; then calculate the predicted state and the reference sequence. Error matrix between And construct a system consisting of a tracking error penalty term. With control quantity penalty item The quadratic cost function Under the premise of satisfying system constraints, the solution is obtained by quadratic programming. The smallest optimal control sequence; finally, only the first term of this optimal sequence is taken. As the actual control quantity The output is applied to the system, and the state is remeasured at the next sampling time, repeating the above prediction and optimization process, thus forming a closed-loop rolling optimization control mechanism of "prediction-optimization-execution-feedback".

[0086] ④SAC residuals are fused with the first-order execution layer.

[0087] After the policy action is mapped to (-1,1) using tanh, the steering angle correction is obtained by multiplying the residual scale by the dimension. Roll angle correction amount Corrected roll angle With steering angle for: .

[0088] .

[0089] The steering angle after first-order smoothing is as follows: .

[0090] in, For smoothing coefficients, This is the actuator front wheel steering angle command for this cycle.

[0091] Speed The controller and drive command limits are as follows: .

[0092] .

[0093] .

[0094] in, For speed error, For the target vehicle speed, The current actual vehicle speed, For integration, For driver instructions, For proportional gain, This is the integral gain.

[0095] ⑤ State normalization.

[0096] .

[0097] in, The original state vector, The mean, Standard deviation It is a very small positive number greater than zero. This represents the normalized state.

[0098] ⑥ Rewards and punishments.

[0099] .

[0100] The sub-items are: survival bonus, roll angle bonus, lateral error penalty, heading error penalty, speed bonus, motion smoothness bonus, and progress bonus, which are specifically in the following forms: .

[0101] .

[0102] .

[0103] .

[0104] .

[0105] .

[0106] .

[0107] in , , , , , and For each item, the corresponding weight coefficient, The coefficient for the roll angle acceleration term, For this step, This refers to the previous action.

[0108] ⑥ SAC Soft Bellman and Loss.

[0109] The TD objective is: .

[0110] in, For instant rewards, As a termination marker, As a discount factor, Representing two network, Representative takes two The one with the smaller value in the network, For the next step, For the next step, For the first indivual The value of the network, The entropy temperature coefficient Let be the logarithmic probability of the action.

[0111] The loss function is: Critic ( Q Loss function of the network: .

[0112] The loss function of the Actor (policy network): .

[0113] in Mean square error, For the first indivual The network value, y is the TD target, and the entropy temperature. Adaptable to target entropy .

[0114] , It can be calibrated according to vehicle model.

[0115] SAC state and dual-channel residuals and Location of action, such as Figure 4 As shown.

[0116] In another exemplary embodiment of this application, the process of state acquisition and reference path determination is as follows.

[0117] ① Status acquisition.

[0118] The roll and angular velocities around the lateral axis are obtained via IMU; the planar pose and resultant velocity are obtained via Gazebo ModelStates or real vehicle positioning; a 9-dimensional state vector is constructed and normalized by subtracting the mean and dividing by the variance.

[0119] ② Reference path.

[0120] This example represents the planar reference path as a discrete two-dimensional point array of N points, denoted by indices i=0,…,N-1. Each discrete point contains four scalars: global planar coordinates X and Y; the reference heading ψ; and the geometric curvature κ of the path. In software implementation, these four items are stored in columns 0-3 of the reference matrix for nearest-point search and look-ahead index retrieval. The specific geometric path in this embodiment is a playground shape (straight line—arc—straight line—arc splicing); the arc length sampling interval is approximately 0.2m, which is a reproducible discrete engineering parameter. In wider implementation, the point array can be refreshed at a fixed frequency by the rolling planner; only the aforementioned four-element interface needs to be provided, and the core control law does not need to be modified. When the length of the look-ahead path is insufficient to cover the inner loop prediction step length or look-ahead distance, the path can be recalculated on the periphery or a deceleration / stop can be triggered.

[0121] When vehicle platooning or upper-level collaborative optimization only issues envelope speeds or sparse path points, the single-vehicle hybrid control subsystem in this embodiment completes stable control within the envelope.

[0122] In another exemplary embodiment of this application, the training of the reinforcement learning residual policy network is controlled by a phased safety state machine. The state machine sequentially includes a recovery phase, a warm-up phase, and a master control phase. The recovery phase switches to the warm-up phase when the attitude is acceptable and the observation is stable. The warm-up phase switches to the master control phase when the policy is ready and the system is stable. The master control phase executes closed-loop control using pure tracking, reinforcement learning residuals, and model predictive control. When the roll exceeds limits, instability occurs, or a sensor malfunctions, the system returns to the recovery phase. The control timing and the phased state machine for recovery, warm-up, and master control are as follows: Figure 5 As shown.

[0123] Examples of simulation curves for reference / actual trajectory, tilt, reward, etc. Figure 6 As shown. Figure 6 Overall, the strategy has been well-trained and has good control effects. Figure 6 Section (f) shows that the cumulative reward steadily increases with the number of rounds and successfully converges to a high level; Figure 6 Part (e) shows that the immediate reward quickly enters a steady state and remains stable in a low-fluctuation range; Figure 6 Part (a) shows that the actual trajectory and the reference trajectory are highly coincident, and the entire closed loop path is closely followed; Figure 6 Part (b) shows that the roll angle closely follows the reference value and fluctuates smoothly, and the vehicle body posture remains stable at all times; Figure 6 Part (c) shows that the vehicle speed converges rapidly and stabilizes near the target value of 3 m / s; Figure 6 Section (d) shows the responsiveness of steering and braking corrections.

[0124] The unmanned electric motorcycle stability control method in this embodiment first obtains the desired front wheel steering angle and the reference roll angle determined by vehicle speed and equivalent curvature based on the discrete reference path through forward-looking pure tracking and nearest-point neighborhood search. Then, using normalized multi-source states as input, the method outputs the correction for the reference roll and the residual for steering through soft actor-commentator reinforcement learning. Furthermore, the roll channel is linearized and discretized, and the equivalent control is solved based on quadratic performance indices within a finite prediction time domain to obtain the model-predicted steering command. This command is then fused with the residual, smoothed, and applied to the motorcycle actuators. In implementation, the geometric reference, learned residuals, predictive control, and execution can be closed-loop within a single control cycle, supplemented by training a safety state machine. This embodiment achieves integrated control between explicit rollover prevention (roll / roll rate) and path tracking, utilizing model prediction to provide an interpretable stability basis, using reinforcement learning to compensate for unmodeled and disturbed events, and facilitating interfacing with sensors and actuators in systems such as ROS 2.

[0125] This embodiment of the unmanned electric motorcycle stability control method addresses the common problems of layered and independent path geometry and dynamics control, which struggle to simultaneously ensure rollover prevention and path accuracy under tight turns / high speeds. Within the same cycle, it strings together pure tracking, residual learning, the MPC inner loop, and execution into a deployable closed loop. Without forcibly adding a replanner, it still achieves strong tracking and roll constraints on the available discrete references. If rolling time-domain replanning is added, it can be extended to "automatically injecting new references into this closed loop" based on the planning-control time-domain matching concept. To address nonlinearity, disturbances, and parameter drift issues, this embodiment, based on the interpretable and bounded nature of MPC, uses SAC residual learning of unmodeled terms to reduce over-reliance on a single model. This is more robust than a single PID / LQR method and provides stronger constraints and easier safety verification than a single end-to-end strategy. The control law in this embodiment can be calculated in real-time on embedded systems using small-scale matrix inversion and shallow networks, and loosely coupled interfaces such as ROS2 are provided for easy migration to the Gazebo ModelStates real-world environment.

[0126] Based on the same inventive concept, this application also provides an unmanned electric motorcycle stability control device for implementing the unmanned electric motorcycle stability control method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations of one or more unmanned electric motorcycle stability control device embodiments provided below can be found in the limitations of the unmanned electric motorcycle stability control method described above, and will not be repeated here.

[0127] In one exemplary embodiment, such as Figure 7 As shown, a stability control device for an unmanned electric motorcycle is provided, comprising: The data acquisition module is used to acquire vehicle information, discrete reference path point sequence, and path equivalent curvature of the unmanned electric motorcycle; the vehicle information includes: current vehicle speed, current roll angle, and roll angular velocity.

[0128] The pure tracking module is used to determine the nearest point of the unmanned electric motorcycle at its current position on the discrete reference path point sequence, obtain the desired front wheel steering angle based on the nearest point using a forward-looking pure tracking algorithm, and determine the reference roll angle according to the current vehicle speed and the equivalent curvature of the path.

[0129] The reinforcement learning residual module is used to construct a state vector based on the current roll angle, the roll angular velocity, and the path tracking error, and to determine the roll residual and steering residual based on the state vector and the reinforcement learning residual policy network.

[0130] The model predictive control inner loop module is used to correct the reference roll angle using the roll residual, and to use the corrected roll angle as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control is solved by quadratic performance index in the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the expected front wheel steering angle to obtain the equivalent control input quantity, and the equivalent control input quantity is mapped to the physical steering command.

[0131] The steering fusion and command issuance module is used to superimpose the physical steering command and the steering residual, and after smoothing, output the final steering command to the steering actuator. It generates a power command based on the target vehicle speed and outputs it to the drive motor to realize the control of the unmanned electric motorcycle.

[0132] As an optional implementation, the unmanned electric motorcycle stability control device further includes: an inertial measurement unit, a pose / velocity sensing unit, and a data interface. The inertial measurement unit is used to measure the roll angle and roll angular velocity in the state vector in real time; the pose / velocity sensing unit is used to calculate the path tracking error by comparing the vehicle pose with a discrete reference path.

[0133] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 8As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores final steering and power commands. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for stable control of an unmanned electric motorcycle.

[0134] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment to which the present application is applied. Specific computer equipment may include, for example, [the following is a list of possible additional structures]. Figure 8 The embodiments show more or fewer components, combinations of certain components, or different component arrangements. In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, which the processor executes to implement the steps in the above-described method embodiments.

[0135] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0136] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0139] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, etc., and are not limited to these.

[0140] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0141] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for stabilizing an unmanned electric motorcycle, characterized in that, include: The system acquires vehicle information, discrete reference path point sequence, and path equivalent curvature of the unmanned electric motorcycle; the vehicle information includes: current vehicle speed, current roll angle, and roll rate. On the discrete reference path point sequence, determine the nearest point of the unmanned electric motorcycle at its current position. Based on the nearest point, use a forward-looking pure tracking algorithm to obtain the desired front wheel steering angle, and determine the reference roll angle according to the current vehicle speed and the equivalent curvature of the path. A state vector is constructed based on the current roll angle, the roll angular velocity, and the path tracking error. The roll residual and steering residual are determined based on the state vector and the reinforcement learning residual policy network. The reference roll angle is corrected using the roll residual. The corrected roll angle is used as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control is solved by quadratic performance index within the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the expected front wheel steering angle to obtain the equivalent control input quantity. The equivalent control input quantity is then mapped to a physical steering command. The physical steering command is superimposed with the steering residual and smoothed to produce the final steering command, which is then output to the steering actuator. A power command is generated based on the target vehicle speed and output to the drive motor to achieve control of the unmanned electric motorcycle.

2. The method for stable control of unmanned electric motorcycles according to claim 1, characterized in that, The reinforcement learning residual policy network is an entropy-regularized reinforcement learning policy network; the entropy-regularized reinforcement learning policy network is a soft actor-commenter structure with a dual commentator network.

3. The method for stable control of unmanned electric motorcycles according to claim 1, characterized in that, The reference roll angle is corrected using the roll residual, and the corrected roll angle is used as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control is solved by quadratic performance index within the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the desired front wheel steering angle to obtain the equivalent control input quantity, specifically including: After superimposing and limiting the roll residual with the reference roll angle, the corrected roll angle is obtained; The second-order roll dynamics model is linearized based on the vehicle's geometric parameters, mass parameters, and gravitational acceleration to obtain a discrete prediction model; Using the corrected roll angle as the roll tracking reference, the control quantity is obtained by analytically inverting the Hessian matrix under unconstrained conditions within the finite prediction time domain. The feedforward term is determined based on the desired front wheel steering angle, and the control quantity is used as the first term of the control sequence. The first term of the control sequence and the feedforward term are then combined to obtain the equivalent control input quantity.

4. The method for stable control of unmanned electric motorcycles according to claim 1, characterized in that, The expression for the physical steering command is: ; ; in, Indicates a physical turn command; Represents the amplitude limiting function; Represents the arctangent function; Indicates the equivalent control input quantity; Indicates the feedforward term; Indicates the control quantity; Indicates wheelbase; Indicates the upper limit of speed; Indicates the minimum front wheel steering angle; This indicates the maximum front wheel steering angle.

5. The method for stabilizing unmanned electric motorcycles according to claim 1, characterized in that, The physical steering command is superimposed with the steering residual and smoothed before being output as the final steering command to the steering actuator. Specifically, this includes: The physical steering command is superimposed with the steering residual to obtain the corrected steering angle. The expression for the corrected steering angle is: ; in, This indicates the corrected steering angle; Indicates a physical turn command; Indicates the steering residual; The corrected steering angle is smoothed using a first-order process to obtain the final steering command; the expression for the final steering command is: ; in, For the current period The final turning instruction; For smoothing coefficients; For the previous cycle The final turning instruction.

6. The method for stabilizing unmanned electric motorcycles according to claim 1, characterized in that, The reward for the reinforcement learning residual policy network during the training phase is determined based on the deviation of the roll angle from the reference roll angle, roll rate, lateral error, heading error, velocity error, motion smoothing term, and index progress term along the reference path.

7. A stability control device for an unmanned electric motorcycle, characterized in that, include: The data acquisition module is used to acquire vehicle information, discrete reference path point sequence, and path equivalent curvature of the unmanned electric motorcycle; the vehicle information includes: current vehicle speed, current roll angle, and roll angular velocity; The pure tracking module is used to determine the nearest point of the unmanned electric motorcycle at its current position on the discrete reference path point sequence, obtain the desired front wheel steering angle based on the nearest point using a forward-looking pure tracking algorithm, and determine the reference roll angle according to the current vehicle speed and the equivalent curvature of the path. The reinforcement learning residual module is used to construct a state vector based on the current roll angle, the roll angular velocity, and the path tracking error, and to determine the roll residual and steering residual based on the state vector and the reinforcement learning residual policy network. The model predictive control inner loop module is used to correct the reference roll angle using the roll residual, and to use the corrected roll angle as the roll tracking reference. Based on the discrete prediction model of second-order roll dynamics, the model predictive control is solved by quadratic performance index in the finite prediction time domain. The solved control quantity is combined with the feedforward term determined by the expected front wheel steering angle to obtain the equivalent control input quantity, and the equivalent control input quantity is mapped to the physical steering command. The steering fusion and command issuance module is used to superimpose the physical steering command and the steering residual, and after smoothing, output the final steering command to the steering actuator. It generates a power command based on the target vehicle speed and outputs it to the drive motor to realize the control of the unmanned electric motorcycle.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the unmanned electric motorcycle stability control method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the unmanned electric motorcycle stability control method according to any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the unmanned electric motorcycle stability control method according to any one of claims 1-6.