A self-balancing and active route planning intelligent bicycle control method and device

Through the combination of the MPC path planning algorithm and the cascade PID controller, the problem of insufficient path planning accuracy and stability in automatic bicycle driving is solved, the automatic trajectory planning driving of the momentum wheel self-balancing bicycle is realized, and the multi-scenario performance of the system is improved. stability.

CN117471972BActive Publication Date: 2024-08-27SHANDONG JIANZHU UNIV
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311553355.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2024-08-27
Estimated Expiration
2043-11-20

AI Technical Summary

Technical Problem

In existing bicycle autonomous driving technology, traditional PID control is difficult to effectively consider the bicycle's vehicle dynamics model and trajectory planning decisions in complex multi-input scenarios, resulting in low path planning accuracy and insufficient system stability.

Method used

Using the MPC path planning algorithm controller combined with the cascade PID controller, based on the vehicle position and inclination information of the bicycle, the optimal trajectory decision is designed and the steering gear output torque and motor output speed are adjusted in real time to achieve automatic path planning for self-balancing bicycles. drive.

Benefits of technology

It improves the path planning accuracy and system stability, can better face disturbances under the time-varying system of multi-scenario input, and realizes the trajectory automatic planning and driving of the momentum wheeled self-balancing bicycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117471972B
    Figure CN117471972B
Patent Text Reader

Abstract

The present invention relates to the field of bicycle automatic driving, and provides a self-balancing active route planning intelligent bicycle control method and device. The method includes designing an MPC path planning algorithm controller according to a bicycle dynamics model; using an MPC path planning algorithm controller based on the yaw angle of the bicycle vehicle position and the speed of the vehicle body center to obtain an optimal trajectory decision from an initial point to a destination point; using a cascade PID controller based on the real-time vehicle body inclination angle and the real-time momentum wheel motor speed, combined with the real-time obtained steering gear foot value, to change the vehicle body inclination angle, and obtain the steering gear output torque and the motor output speed; based on the optimal trajectory decision, the vehicle yaw angle is controlled according to the steering gear output torque and the motor output speed, so that the bicycle performs automatic path planning driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatic bicycle driving, and in particular to a self-balancing, actively route-planning intelligent bicycle control method and device. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0004] Currently in the field of bicycle autonomous driving technology, many research results have established structural mechanics analysis and modeling of the overall frame of the bicycle. For the study of the static equilibrium state of the vehicle, only the relationship between the momentum wheel torque and the mechanical structure of the bicycle is considered. For the field of autonomous driving decision-making, the traditional PID control has lag and requires manual adjustment of parameters. It does not consider the vehicle dynamics model and trajectory planning decision of the bicycle in complex multi-input scenarios. Summary of the invention

[0005] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a self-balancing active route planning intelligent bicycle control method and device, and the present invention realizes the automatic trajectory planning driving of the momentum wheeled self-balancing bicycle.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides a method for controlling a self-balancing intelligent bicycle with active route planning.

[0008] A self-balancing and actively route-planning intelligent bicycle control method, comprising:

[0009] According to the structural characteristics of bicycles, a bicycle dynamics model is established;

[0010] According to the bicycle dynamics model, the MPC path planning algorithm controller is designed;

[0011] Obtain the real-time body inclination angle of the bicycle, the yaw angle of the vehicle position, the speed of the center of the vehicle body, and the real-time momentum wheel motor speed;

[0012] Based on the yaw angle of the bicycle's vehicle position and the speed of the center of the vehicle body, the MPC path planning algorithm controller is used to obtain the optimal trajectory decision from the initial point to the destination point;

[0013] Based on the real-time vehicle body inclination angle and real-time momentum wheel motor speed, a cascade PID controller is used, combined with the real-time obtained servo foot value, to change the vehicle body inclination angle, and obtain the servo output torque and motor output speed;

[0014] Based on the optimal trajectory decision, the vehicle yaw angle is controlled according to the output torque of the servo and the output speed of the motor, so that the bicycle can perform automatic path planning driving.

[0015] Furthermore, the process of establishing the bicycle dynamics model includes: taking the rear wheel as the origin, establishing a rectangular coordinate system, and obtaining the bicycle dynamics model.

[0016] Furthermore, the process of using the MPC path planning algorithm controller includes: using the following formula to make the output value of the MPC path planning algorithm controller meet the expected target as soon as possible:

[0017] w(k+i)=α i Y(k)+(1-α i )Y ref

[0018] In the formula, α i is the function slope. The larger the value, the faster the curve increases. Conversely, Y ref is the target expectation, and Y(k) is the current value.

[0019] Furthermore, the process of using the MPC path planning algorithm controller also includes: designing a total cost function, and adjusting the weight parameter of the desired target output by the MPC path planning algorithm controller according to the total cost function.

[0020] Furthermore, the total cost function is:

[0021] J=J1q+J2r

[0022]

[0023]

[0024] Among them, J1 represents the first cost function, J2 represents the second cost function, q is the weight of the first cost function, and r is the weight of the second cost function.

[0025] Furthermore, the process of obtaining the real-time vehicle body inclination angle and the real-time momentum wheel motor speed includes: using a servo position PID controller and a cascade PID controller to obtain the bicycle inclination angle; based on the bicycle inclination angle, using a cascade PID control function to control the size of the mechanical zero point to obtain the real-time vehicle body inclination angle and the real-time momentum wheel motor speed.

[0026] Furthermore, the steering gear position PID controller adopts the following formula:

[0027] u(k)=Kp×e(k)+Ki×∑i=0ke(i)+Kd×[e(k)-e(k-1)]

[0028] In the formula, k is the sampling number, u(k) is the computer output value at the kth sampling moment; e(k) is the deviation value input at the kth sampling moment; e(k-1) represents the deviation value input at the k-1th sampling moment, Ki represents the integral coefficient, and Kd represents the differential coefficient.

[0029] Furthermore, the process of using the MPC path planning algorithm controller includes: using a fusion equation to obtain a trajectory, and the fusion equation is:

[0030]

[0031] in, is the vehicle's body speed in the X-axis direction of the coordinate system, y is the vehicle's body speed in the Y-axis direction of the coordinate system, At low speeds, the rate of change of the vehicle's yaw angle is regarded as the angular velocity of the vehicle's turning angle, and a(k) is the trajectory.

[0032] A second aspect of the present invention provides a self-balancing intelligent bicycle control device with active route planning.

[0033] A self-balancing and actively route-planning intelligent bicycle control device, comprising:

[0034] A model building module is configured to: build a bicycle dynamics model according to the structural characteristics of the bicycle;

[0035] The design module is configured to: design an MPC path planning algorithm controller according to a bicycle dynamics model;

[0036] A data acquisition module, which is configured to: acquire a real-time body inclination angle of the bicycle, a yaw angle of the vehicle position, a speed of the center of the body, and a real-time momentum wheel motor speed;

[0037] A path planning module is configured to: based on the yaw angle of the vehicle position of the bicycle and the speed of the center of the vehicle body, use an MPC path planning algorithm controller to obtain an optimal trajectory decision from an initial point to a destination point;

[0038] The self-balancing module is configured to: based on the real-time vehicle body inclination angle and the real-time momentum wheel motor speed, adopt a cascade PID controller, combined with the real-time obtained servo foot value, change the vehicle body inclination angle, and obtain the servo output torque and the motor output speed;

[0039] The automatic driving module is configured to: based on the optimal trajectory decision, control the vehicle yaw angle according to the output torque of the servo and the output speed of the motor, so that the bicycle can perform automatic path planning driving.

[0040] A third aspect of the present invention provides a computer device.

[0041] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the self-balancing active route planning intelligent bicycle control method as described in the first aspect are implemented.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] The present invention uses the yaw angle of the vehicle position of the bicycle and the speed of the center of the vehicle body as the input of the MPC path planning algorithm controller. The controller calculates the optimal path according to the initial point and the end point, and adopts a finite step size for rolling optimization. Compared with cascade PID control, the path planning accuracy is improved, and compared with LQR, some computing power is saved, so that the calculation result has real-time performance. In a time-varying system with multi-scenario input, the system improves the stability in the face of disturbances.

[0044] The present invention adopts an MPC path planning algorithm controller and a cascade PID controller to ensure the self-balancing of the bicycle while planning the bicycle path, thereby realizing automatic trajectory planning and driving of the momentum wheeled self-balancing bicycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0046] Figure 1 is a flow chart of a self-balancing active route planning intelligent bicycle control method shown in the present invention;

[0047] Figure 2 This is a diagram showing the bicycle coordinate system established according to the present invention. DETAILED DESCRIPTION

[0048] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0049] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0050] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0051] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the flowchart and / or block diagram, and the combination of boxes in the flowchart and / or block diagram can be implemented using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.

[0052] Embodiment 1

[0053] like Figure 1 As shown, this embodiment provides a self-balancing intelligent bicycle control method with active route planning. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps:

[0054] According to the structural characteristics of bicycles, a bicycle dynamics model is established;

[0055] According to the bicycle dynamics model, the MPC path planning algorithm controller is designed;

[0056] Obtain the real-time body inclination angle of the bicycle, the yaw angle of the vehicle position, the speed of the center of the vehicle body, and the real-time momentum wheel motor speed;

[0057] Based on the yaw angle of the bicycle's vehicle position and the speed of the center of the vehicle body, the MPC path planning algorithm controller is used to obtain the optimal trajectory decision from the initial point to the destination point;

[0058] Based on the real-time vehicle body inclination angle and real-time momentum wheel motor speed, a cascade PID controller is used, combined with the real-time obtained servo foot value, to change the vehicle body inclination angle, and obtain the servo output torque and motor output speed;

[0059] Based on the optimal trajectory decision, the vehicle yaw angle is controlled according to the output torque of the servo and the output speed of the motor, so that the bicycle can perform automatic path planning driving.

[0060] The present embodiment is described in detail below with reference to the accompanying drawings, and includes two parts: bicycle automatic driving trajectory planning and bicycle momentum wheel self-balancing control.

[0061] The process of bicycle automatic driving trajectory planning includes:

[0062] According to the structural characteristics of bicycle vehicles, a bicycle vehicle dynamics model is established;

[0063] According to the bicycle vehicle dynamics model, the MPC path planning algorithm controller is designed;

[0064] The yaw angle of the vehicle position and the speed of the center of the vehicle body of the bicycle are obtained, and the yaw angle of the vehicle position and the speed of the center of the vehicle body are input into the MPC path planning algorithm controller for processing to obtain the optimal trajectory decision from the initial point to the destination point, so as to control the vehicle yaw angle according to the output torque of the servo, so that the bicycle can perform automatic path planning driving.

[0065] The process of establishing the bicycle vehicle dynamics model according to the structural characteristics of the bicycle vehicle includes: the rear wheel is taken as point B, a rectangular coordinate system is established, and its longitudinal velocity, lateral velocity and heading angular velocity are as follows: Figure 2 When modeling the vehicle kinematics, only the front wheel, rear wheel and wheelbase are used. The vehicle's slip angle is β, which is the angle with the X axis. The axle length is L1+L2. The bicycle turning kinematics model can be regarded as the rear wheel moving in a circle around a point. The turning radius is R, O represents the instantaneous velocity center of the vehicle, Ψ is the yaw angle, and the vehicle state can be represented by X, Y, β+Ψ. At low and medium speeds, the rear wheel steering angle δ rTends to 0, here the rear wheel steering angle is regarded as 0. In the instantaneous state, the vehicle point O is the instantaneous rotation center of the vehicle, OB is perpendicular to AB, and OC is connected. OC is the trajectory radius R of the vehicle. At this time, the vehicle body speed direction V is the tangent direction of the circle with radius R.

[0066] The yaw angle of the bicycle's vehicle position and the speed of the center of the vehicle body are used as inputs to the MPC path planning algorithm controller. The controller calculates the optimal path based on the initial point and the end point, and adopts a finite step length for rolling optimization. Compared with cascade PID control, the path planning accuracy is improved, and compared with LQR, some computing power is saved, making the calculation results real-time. The system improves the stability in the face of disturbances in a time-varying system with multiple scene inputs. The MPC path planning algorithm controller processes constraints, using brake linear control as a hard constraint and rear wheel motor torque as a soft constraint. It uses a finite time domain algorithm to specify the maximum and minimum torque of the motor and the maximum and minimum control thresholds of the brake, and selects finite step length control for the future 0 to positive infinity time and space.

[0067] According to the decision, the fusion equation with detailed path, speed information, and heading angle deviation value trajectory is output. The trajectory is obtained according to the fusion equation and sent to the controller for tracking. The controller is processed by the central chip MCU. The trajectory output to the controller is the final output of the MPC path planning algorithm controller, that is, the path information. The execution cycle is the same as the decision, which is 10Hz. This is a reasonable frequency for the MPC path planning algorithm controller to output more stably.

[0068] Wherein, the fusion equation is:

[0069]

[0070] in, is the vehicle's body speed in the X-axis direction of the coordinate system, is the vehicle's body speed in the Y-axis direction of the coordinate system, At low speeds, the rate of change of the vehicle's yaw angle can be regarded as the angular velocity of the vehicle's turning angle, and a(k) is the trajectory.

[0071] The present invention can make the output result more ideal for the 10%-20% step length prediction within the complete trajectory prediction control range, while ensuring the MCU processing frequency and the anti-interference ability of the model.

[0072] At the initial moment, the yaw angle of the vehicle position and the speed of the vehicle body center are collected, and the yaw angle of the vehicle position and the speed parameters of the vehicle body center are combined into a function of the yaw angle x, y, and angular velocity:

[0073]

[0074] Among them, a is a(k) in the fusion equation, p is the prediction step, Y0(k+1) is the predicted output of the system at time k+1, u is the control step, and Δu(k) is the deviation between the previous and next data.

[0075] Create a new matrix based on the parameter input value to achieve the new prediction output:

[0076] Y0=A·Δu+Y0

[0077] Among them, A is the input value of a(k), Δu is the data deviation between the previous and the next data, and Y0 is the original predicted output.

[0078] The above formula uses the first-order filtering method to make the actual value reach the expected value. Using the MPC path planning algorithm, the output value of the controller output reaches the expected target as soon as possible. The formula is as follows:

[0079] w(k+i)=α i Y(k)+(1-α i )Y ref

[0080] Among them, w(k+i) is the target tracking function, α i The slope of the function. The larger the value, the faster the curve increases, and vice versa. ref is the target expectation, and Y(k) is the current value.

[0081] The cost function is set so that the actual value of the system is expected to be tracked quickly. In the discussion of practical problems, it is set in two target directions. The first is to quickly track the target in a finite number of steps. Second, the system aims to increase energy utilization as much as possible with lower energy consumption.

[0082] The first cost function is:

[0083]

[0084] The second cost function is:

[0085]

[0086] The comprehensive cost function is:

[0087]

[0088] In the formula, q is the weight of the first cost function, r is the weight of the second cost function, w(k+i) is the target tracking function, y(k+i) is the system predicted output, and u is the control step size. The weight parameters of the expected target output by the MPC path planning algorithm controller are adjusted according to the selected comprehensive cost function. By changing the magnitude of the weight coefficient, the direction of the cost function is preferentially selected. For example, when q>r, the function focuses more on obtaining the target value faster and tracking the path; when q<r, the function has less energy consumption and increases the energy utilization rate, and further calculates the optimal path solution.

[0089] Take the partial derivative of the J cost function with respect to Δu and set it equal to 0 to find the value of Δu when the overall system is in the optimal solution. The formula is as follows:

[0090] That is, Δu = (A T QA + p i ) -1 ·A T ·(W - Y0)

[0091] At time K, the predicted values for the next P time instants are obtained. Take the predicted value Y k+ 1 at time K + 1. At time K + 1, the true output value Y(k + 1) of the system is obtained. Then the error e(k + 1) = Y(k + 1) - Y k+1

[0092] Calculate the output y cor (k + 1) of the last single feedback:

[0093] y cor (k + 1) = Y0(k + 1) + hi * e(k + 1)

[0094] Among them, Y0(k + 1) is the true output value of the system at time k + 1, e(k + 1) is the error, and hi is a variable coefficient (hi ranges from 0 to 1).

[0095] y cor (k + 1) = Y0(k + 1) + hi * e(k + 1)

[0096] The output quantity (trajectory) of the single feedback is obtained and output to the servo. The torque of the servo is increased to achieve the optimal trajectory decision from the initial point to the destination point. The yaw angle of the vehicle is controlled according to the output torque of the servo, so that the bicycle achieves automatic path planning driving.

[0097] At the end of a single cycle, the motor value output last time needs to be updated as the input quantity of the system MPC path planning algorithm controller for the next time, and rolling optimization is performed for time instants K and K + 1.

[0098] Among them, the process of the momentum wheel type self-balancing control of the bicycle includes:

[0099] According to the mechanical system of a bicycle with momentum wheel fused with steering gear control, a physical model of a bicycle with momentum wheel fused with steering gear control is established;

[0100] According to the physical model of the bicycle controlled by momentum wheel and steering gear, the upright posture cascade PID controller is designed and integrated with steering gear assisted balance control;

[0101] The real-time vehicle body inclination angle and the real-time momentum wheel motor speed are obtained, and the real-time vehicle body inclination angle and the real-time momentum wheel motor speed are input into the cascade PID controller for processing. At the same time, the servo foot value is continuously obtained, and the obtained value is brought into the piecewise function for calculation, so as to change the inclination angle of the vehicle body, and finally the momentum wheel motor torque is obtained, so as to control the output torque of the momentum wheel motor according to the momentum wheel motor torque, and the momentum wheel fusion servo control type bicycle is kept balanced by continuously changing the magnitude of acceleration and thus the magnitude of force.

[0102] The piecewise function is:

[0103] C=Kp×(S1-S0)+Kd×V

[0104] Among them, C is the final change, Kp and Kd are parameters, S1 is the current servo pedal value, S0 is the servo median value, and V is the current speed of the bicycle. C is added to the current body inclination value and input into the cascade PID controller together to finally obtain the momentum wheel motor torque.

[0105] Enter the servo PID control function, the control function is:

[0106] u(k)=Kp×e(k)+Ki×∑i=0ke(i)+Kd×[e(k)-e(k-1)]

[0107] The steering angle of the servo is obtained, and the steering of the bicycle controlled by the momentum wheel and servo is realized by changing the steering angle of the servo.

[0108] The inclination angle of the momentum wheeled unmanned bicycle is obtained and input into the upright posture cascade PID controller to control the mechanical zero point.

[0109] When the momentum wheel fusion servo-controlled bicycle needs to travel in a straight line, DMP (DMP stands for digital motion processor, which is an embedded processor integrated into the MPU6050 module. DMP obtains data from accelerometers, gyroscopes and other third-party sensors. DMP fuses and processes these data into quaternion data. Relying on DMP solution, the pitch angle X, roll angle Y and heading angle Z can be obtained). The gyroscope detects the error between the real-time Z-axis value and the centerline Z-axis value, multiplies the error by the coefficient KP, and integrates the result into the first-order complementary filter for calculation, and finally changes the servo foot value. The momentum wheel fusion servo-controlled bicycle can stably maintain straight-line travel.

[0110] The final change of the servo foot value adopts the following formula:

[0111] C=K×(Z1-Z)+(1-k)×C1

[0112] Among them, C is the difference of the servo foot, K is a parameter, Z1 is the heading angle value calculated in real time, Z is the median heading angle, C1 is the servo foot difference calculated last time, and the application of K and (1-k) is a first-order complementary filter.

[0113] In the cascade PID controller, the outermost loop is the speed loop, which allows the momentum wheel to output angular momentum to make the bicycle self-balanced. At the same time, when the bicycle reaches balance, the target value of the bicycle, that is, the rotation speed of the momentum wheel, is kept at 0. The motor speed collected in real time by the encoder is used as the input value of the speed loop, and its target value is to make the motor speed 0. The final output value of the speed loop is the expected value of the body inclination angle.

[0114] The inner loop is the angle loop. The input of the angle loop is the real-time body tilt angular velocity collected by the gyroscope after DMP solution (the gyroscope needs to be left still for 1-3 minutes to wait for the value to stabilize), and the target value of the angle loop is the mechanical zero point, which is the zero point of the X-axis of the bicycle at the balance point solved by the gyroscope. Finally, the output value of the angle loop is the expected value of the body tilt angular velocity.

[0115] The angular velocity loop has the fastest response speed, so it is the innermost loop. The angular velocity loop is a closed loop of the left and right offset speeds collected in real time. If there is an offset, a value will be generated immediately. The response speed of the angular velocity loop is faster than that of the first two loops. As the innermost loop, the angular velocity loop takes as its input the body tilt angular velocity collected in real time by the gyroscope, and the target value of the angular velocity loop is the output value of the angle loop, that is, the expected value of the body tilt angular velocity. Finally, the output value of the angular velocity loop is the output torque of the motor.

[0116] In the closed loop of driving speed, the value of the speed loop calculation output is the momentum wheel fusion steering gear control type intelligent balance bicycle. At the mechanical zero angle, the angle of the X axis calculated by the gyroscope is required. This output value needs to be added to the mechanical zero angle to convert the speed control into angle control. It only needs to collect the X axis data through the attitude sensor. The speed loop cycles once every 100ms, the angle loop cycles once every 10ms, and the angular velocity loop cycles once every 2ms. The output of the outer loop needs to add a limiter before passing it to the inner loop. After actual measurement, the effect is very stable, without vibration or obvious reaction lag.

[0117] For balance control, the cascade PID is used to convert the control into angle, angular velocity and speed. The output of the final angular velocity loop in the entire control system is given to the motor control, which in turn controls the momentum wheel to rotate and maintain balance. The implementation of the cascade PID algorithm lies in the different cycles of the angular velocity loop, angle loop and speed loop control. After the initialization program is completed, a timer interrupt with a cycle of 2ms is started. The PIT interrupt provides the algorithm in the loop with a timing flag control for program execution, and different control links are executed in different cycles according to the flag. This structure helps to improve the execution efficiency and real-time performance of the algorithm, thereby making the momentum wheel fusion servo control bicycle more stable.

[0118] In the servo PID control, the servo control generally uses the position PID. First, the integral term is abandoned. Since the working principle of the servo is different from that of the DC motor, only a certain duty cycle PWM signal needs to be input, and the servo can rotate to the corresponding angle. Therefore, the servo system does not need to output continuously. The servo only needs to update the output once every cycle, and there will be no static error. Abandoning the integral term will not have any impact, and it can also avoid various complex integral operations in the position formula; second, the differential term is retained. Since the servo controls the steering ring of the entire car model, and the steering ring of the car model needs to turn in advance, that is, it needs to turn in advance before reaching the curve, this function mainly relies on GPS tracking to adjust, and secondly, it relies on the differential term of the controller. The differential term adjusts the output of the controller according to the deviation between the current moment and the previous moment. When the car model is about to enter the curve, due to the deviation of the path, the differential term plays a positive adjustment role, that is, turning in advance before entering the curve; when the car model ends turning, the site deviation will tend to decrease, and the differential term plays a negative adjustment role, that is, making a small angle before exiting the curve. This will achieve the effect of fast cornering and stable exiting, which is the ideal situation for turning and auxiliary balance of a momentum wheel fusion servo-controlled bicycle. The control quantity output value of the servo each time has little to do with the previous control quantity output value, and it is only related to the past state. What the servo needs is to quickly turn to a certain angle. The position PID does not need to memorize the control quantity, but directly calculates the deviation value to obtain the desired control quantity. At the same time, in actual measurements, when the momentum wheel fusion servo-controlled bicycle is tracking at high speed, it is very easy to roll over if the instantaneous turning angle is too large. Therefore, when a large-angle turn is required, a delay must be performed to increase the turning time to prevent the momentum wheel fusion servo-controlled bicycle from rolling over and ensure smooth driving.

[0119] Position PID can be obtained by discretizing the PID formula. Discretization is performed because computer control is a sampling control, which can only calculate the control quantity based on the deviation at the sampling time, and cannot continuously output the control quantity and perform continuous control like analog control. Due to this feature, the integral term and differential term in the PID formula cannot be used directly and must be discretized.

[0120] After discretization, we get the position PID, also called the full PID:

[0121] u(k)=Kp×e(k)+Ki×∑i=0ke(i)+Kd×[e(k)-e(k-1)]

[0122] Wherein, k is the sampling number, u(k) is the computer output value at the kth sampling moment, e(k) is the deviation value input at the kth sampling moment, e(k-1) represents the deviation value input at the k-1th sampling moment, Ki represents the integral coefficient, and Kd represents the differential coefficient.

[0123] The inclination angle of the momentum wheel fusion servo-controlled bicycle controlled by the servo position PID control and cascade PID control is input into the cascade PID control function to control the size of the mechanical zero point, and obtain the real-time body inclination angle, angular velocity value and real-time speed of the momentum wheel motor of the momentum wheel unmanned bicycle. The real-time body inclination angle and the real-time speed of the momentum wheel motor are input into the cascade PID controller for processing to obtain the momentum wheel motor torque, so as to control the output torque of the momentum wheel motor according to the momentum wheel motor torque, and cooperate with the position PID control servo to assist in balancing, so that the momentum wheel fusion servo-controlled bicycle can maintain balance and travel smoothly.

[0124] Embodiment 2

[0125] This embodiment provides a self-balancing intelligent bicycle control device with active route planning.

[0126] A self-balancing and actively route-planning intelligent bicycle control device, comprising:

[0127] A model building module is configured to: build a bicycle dynamics model according to the structural characteristics of the bicycle;

[0128] The design module is configured to: design an MPC path planning algorithm controller according to a bicycle dynamics model;

[0129] A data acquisition module, which is configured to: acquire a real-time body inclination angle of the bicycle, a yaw angle of the vehicle position, a speed of the center of the body, and a real-time momentum wheel motor speed;

[0130] A path planning module is configured to: based on the yaw angle of the vehicle position of the bicycle and the speed of the center of the vehicle body, use an MPC path planning algorithm controller to obtain an optimal trajectory decision from an initial point to a destination point;

[0131] The self-balancing module is configured to: based on the real-time vehicle body inclination angle and the real-time momentum wheel motor speed, adopt a cascade PID controller, combined with the real-time obtained servo foot value, change the vehicle body inclination angle, and obtain the servo output torque and the motor output speed;

[0132] The automatic driving module is configured to: based on the optimal trajectory decision, control the vehicle yaw angle according to the output torque of the servo and the output speed of the motor, so that the bicycle can perform automatic path planning driving.

[0133] It should be noted that the above-mentioned model building module, design module, data acquisition module, path planning module, self-balancing module and automatic driving module are the same as the examples and application scenarios implemented by the steps in Embodiment 1, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above-mentioned modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0134] Embodiment 3

[0135] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the self-balancing active route planning smart bicycle control method as described in the first embodiment are implemented.

[0136] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0137] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0138] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0140] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0141] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A self-balancing and active route planning intelligent bicycle control method, characterized in that: include: According to the structural characteristics of the bicycle, a bicycle dynamics model is established; According to the bicycle dynamics model, the MPC path planning algorithm controller is designed; Obtain the real-time body inclination angle of the bicycle, the yaw angle of the vehicle position, the speed of the center of the vehicle body, and the real-time momentum wheel motor speed; Based on the yaw angle of the bicycle's vehicle position and the speed of the center of the vehicle body, the MPC path planning algorithm controller is used to obtain the optimal trajectory decision from the initial point to the destination point; Based on the real-time vehicle body inclination angle and real-time momentum wheel motor speed, a cascade PID controller is used, combined with the real-time obtained servo foot value, to change the vehicle body inclination angle, and obtain the servo output torque and motor output speed; Based on the optimal trajectory decision, the vehicle yaw angle is controlled according to the output torque of the servo and the output speed of the motor, so that the bicycle can perform automatic path planning driving.

2. The self-balancing active route planning intelligent bicycle control method according to claim 1 is characterized in that: The process of establishing the bicycle dynamics model includes: taking the rear wheel as the origin, establishing a rectangular coordinate system, and obtaining the bicycle dynamics model.

3. The self-balancing active route planning intelligent bicycle control method according to claim 1, characterized in that: The process of using the MPC path planning algorithm controller includes: using the following formula to make the output value of the MPC path planning algorithm controller meet the expected target as soon as possible: w(k+i)=a i Y(k)+(1-a i )Y ref Where w(k+i) is the target tracking function, α i is the function slope. The larger the value, the faster the curve increases. Conversely, Y ref is the target expectation, and Y(k) is the current value.

4. The self-balancing active route planning intelligent bicycle control method according to claim 1, characterized in that: The process of using the MPC path planning algorithm controller also includes: designing a total cost function, and adjusting the weight parameters of the desired target output by the MPC path planning algorithm controller according to the total cost function.

5. The self-balancing active route planning intelligent bicycle control method according to claim 4 is characterized in that: The total cost function is: J=J1q+J2r Among them, J1 represents the first cost function, J2 represents the second cost function, q is the weight of the first cost function, r is the weight of the second cost function, w(k+i) is the target tracking function, y(k+i) is the system prediction output, p is the prediction step size, and u is the control step size.

6. The self-balancing active route planning intelligent bicycle control method according to claim 1, characterized in that: The process of obtaining the real-time vehicle body inclination angle and the real-time momentum wheel motor speed includes: using a steering gear position PID controller and a cascade PID controller to obtain the bicycle inclination angle; based on the bicycle inclination angle, using a cascade PID control function to control the size of the mechanical zero point to obtain the real-time vehicle body inclination angle and the real-time momentum wheel motor speed.

7. The self-balancing active route planning intelligent bicycle control method according to claim 1, characterized in that: The servo position PID controller adopts the following formula: u(k)=Kp×e(k)+Ki×∑i=0ke(i)+Kd×[e(k)-e(k-1)] In the formula, k is the sampling number, u(k) is the computer output value at the kth sampling moment; e(k) is the deviation value input at the kth sampling moment; e(k-1) represents the deviation value input at the k-1th sampling moment, Ki represents the integral coefficient, and Kd represents the differential coefficient.

8. The self-balancing active route planning intelligent bicycle control method according to claim 1, characterized in that: The process of using the MPC path planning algorithm controller includes: using a fusion equation to obtain a trajectory, and the fusion equation is: in, is the vehicle's body speed in the X-axis direction of the coordinate system, is the vehicle's body speed in the Y-axis direction of the coordinate system, At low speeds, the rate of change of the vehicle's yaw angle is regarded as the angular velocity of the vehicle's turning angle, and a(k) is the trajectory.

9. A self-balancing intelligent bicycle control device with active route planning, characterized in that: include: A model building module is configured to: build a bicycle dynamics model according to the structural characteristics of the bicycle; The design module is configured to: design an MPC path planning algorithm controller according to a bicycle dynamics model; A data acquisition module, which is configured to: acquire a real-time body inclination angle of the bicycle, a yaw angle of the vehicle position, a speed of the center of the body, and a real-time momentum wheel motor speed; A path planning module is configured to: based on the yaw angle of the vehicle position of the bicycle and the speed of the center of the vehicle body, use an MPC path planning algorithm controller to obtain an optimal trajectory decision from an initial point to a destination point; The self-balancing module is configured to: based on the real-time vehicle body inclination angle and the real-time momentum wheel motor speed, adopt a cascade PID controller, combined with the real-time obtained servo foot value, change the vehicle body inclination angle, and obtain the servo output torque and the motor output speed; The automatic driving module is configured to: based on the optimal trajectory decision, control the vehicle yaw angle according to the output torque of the servo and the output speed of the motor, so that the bicycle can perform automatic path planning driving.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the self-balancing active route planning smart bicycle control method as described in any one of claims 1-8 are implemented.

Citation Information

Patent Citations

  • Adaptive pedal assist systems and control logic for intelligent e-bikes

    CN110389549A

  • Navigation obstacle avoidance control method, system and model combining path planning and reinforcement learning

    CN114564016A

  • Robot driving vehicle obstacle avoidance method based on improved artificial potential field and MPC

    CN114879698A

  • Balance control method, device and system for momentum wheel type unmanned bicycle

    CN115991211A

  • Image recognition handles unmanned intelligent car

    CN207301793U