Method and apparatus for controlling intelligent self-balancing bicycle capable of actively planning path
By using the MPC path planning algorithm controller and cascade PID controller in the bicycle autonomous driving system, a bicycle dynamic model is established, which solves the lag in the field of bicycle autonomous driving decision-making in the prior art and the stability problems in complex scenarios, and achieves high-precision and real-time trajectory planning and self-balancing control.
Patent Information
- Application Number
- PCT/CN2024/129447
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-20
- Filing Date
- 2024-11-01
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art has failed to effectively solve the relationship between momentum wheel torque and bicycle mechanical structure in the field of bicycle autonomous driving, and traditional PID control has lag and parameter adjustment difficulties in multiple input complex scenarios, and failed to consider the vehicle dynamic model and trajectory planning decisions of bicycles.
The MPC path planning algorithm controller and cascade PID controller are used to establish a bicycle dynamic model, obtain real-time body inclination angle and momentum wheel motor speed, calculate the optimal trajectory decision through the MPC algorithm, and combine the cascade PID controller to achieve self-balancing and path planning.
It improves the accuracy of path planning, is more real-time and stable than cascade PID control, and can maintain the stability of the system when facing disturbances in multiple scenarios.
Smart Images

Figure CN2024129447_30052025_PF_FP_ABST
Abstract
Description
A self-balancing, active route-planning intelligent bicycle control method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This invention claims priority to Chinese patent application No. 202311553355.9 filed with the State Intellectual Property Office of China on November 20, 2023, entitled “A method and device for controlling a self-balancing intelligent bicycle with active route planning”, the entire contents of which are incorporated by reference into this invention and constitute a part of this invention for all purposes. Technical Field
[0003] The present invention relates to the field of automatic bicycle driving, and in particular to a control method and device for a self-balancing intelligent bicycle with active route planning. Background Art
[0004] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0005] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0006] 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.
[0007] Summary of the Invention
[0008] 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 wheel self-balancing bicycle.
[0009] In order to achieve the above object, the present invention adopts the following technical solutions:
[0010] A first aspect of the present invention provides a method for controlling a self-balancing intelligent bicycle with active route planning.
[0011] A self-balancing, active route planning intelligent bicycle control method comprising:
[0012] According to the structural characteristics of bicycle, a bicycle dynamics model is established;
[0013] Design an MPC path planning algorithm controller based on the bicycle dynamics model;
[0014] Obtain the real-time body tilt angle of the bicycle, the yaw angle of the vehicle position, the speed of the center of the body, and the real-time momentum wheel motor speed;
[0015] 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;
[0016] 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 servo pedal value, to change the vehicle body inclination angle to obtain the servo output torque and motor output speed;
[0017] Based on the optimal trajectory decision, the vehicle's yaw angle is controlled according to the servo output torque and the motor's output speed, allowing the bicycle to perform automatic path planning and driving.
[0018] Furthermore, the process of establishing the bicycle dynamics model includes: establishing a rectangular coordinate system with the rear wheel as the origin to obtain the bicycle dynamics model.
[0019] 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: w(k+i)=α i Y(k)+(1-α i )Y ref
[0020] Among them, w(k+i) is the target tracking function, α i The slope of the function is larger, the faster the curve increases, and vice versa. ref is the target expectation, and Y(k) is the current value.
[0021] Furthermore, the process of adopting the MPC path planning algorithm controller also includes: designing a total cost function, and adjusting the weight coefficient of the desired target output by the MPC path planning algorithm controller according to the total cost function.
[0022] Furthermore, the total cost function is: J = J1q + J2r
[0023] Wherein, J1 represents the first cost function, J2 represents the second cost function, q is the weight coefficient of the first cost function, and r is the weight coefficient of the second cost function.
[0024] 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.
[0025] Furthermore, the steering gear position PID controller adopts the following formula:
[0026] Where 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, K i Indicates the integral coefficient, K d represents the differential coefficient.
[0027] 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:
[0028] 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 considered to be the angular velocity of the vehicle's turning angle, and a(k) is the trajectory.
[0029] A second aspect of the present invention provides a self-balancing intelligent bicycle control device with active route planning.
[0030] A self-balancing intelligent bicycle control device with active route planning, comprising:
[0031] The model building module is configured to: build a bicycle dynamics model according to the bicycle structural characteristics;
[0032] The design module is configured to: design an MPC path planning algorithm controller according to a bicycle dynamics model;
[0033] a data acquisition module configured to: acquire a real-time body tilt angle, a yaw angle of the vehicle position, a speed of the center of the body, and a real-time momentum wheel motor speed of the bicycle;
[0034] A path planning module is configured to: obtain an optimal trajectory decision from an initial point to a destination point using an MPC path planning algorithm controller based on a yaw angle of a vehicle position and a speed of a vehicle body center of the bicycle;
[0035] The self-balancing module is configured to: based on the real-time vehicle body inclination angle and the real-time momentum wheel motor speed, use a cascade PID controller, combined with the real-time obtained servo pedal value, to change the vehicle body inclination angle to obtain the servo output torque and the motor output speed;
[0036] 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 and driving.
[0037] A third aspect of the present invention provides a computer device.
[0038] 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 of the self-balancing, active route planning, intelligent bicycle control method as described in the first aspect are implemented.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] The present invention uses the yaw angle of the bicycle's vehicle position and the speed of the vehicle body center 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 size 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. In a time-varying system with multi-scenario input, the system improves stability in the face of disturbances.
[0041] The present invention adopts an MPC path planning algorithm controller and a cascade PID controller to plan the bicycle path while ensuring the self-balancing of the bicycle, thereby realizing automatic trajectory planning and driving of the momentum-wheeled self-balancing bicycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, 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.
[0043] FIG1 is a flow chart of a method for controlling a self-balancing intelligent bicycle with active route planning according to the present invention;
[0044] FIG. 2 is a diagram showing a bicycle after a coordinate system is established according to the present invention. DETAILED DESCRIPTION
[0045] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0046] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0047] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0048] 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 the various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code can include one or more executable instructions for implementing the logical functions specified in the various embodiments. 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 the boxes in the flowchart and / or block diagram, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0049] Example 1
[0050] As shown in Figure 1, this embodiment provides a self-balancing and actively route-planning intelligent bicycle control method. 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, a server, and a terminal, 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, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected by wired or wireless communication, and this application does not limit this. In this embodiment, the method includes the following steps:
[0051] According to the structural characteristics of bicycle, a bicycle dynamics model is established;
[0052] Design an MPC path planning algorithm controller based on the bicycle dynamics model;
[0053] Obtain the real-time body tilt angle of the bicycle, the yaw angle of the vehicle position, the speed of the center of the body, and the real-time momentum wheel motor speed;
[0054] 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;
[0055] 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 servo pedal value, to change the vehicle body inclination angle to obtain the servo output torque and motor output speed;
[0056] Based on the optimal trajectory decision, the vehicle's yaw angle is controlled according to the servo output torque and the motor's output speed, allowing the bicycle to perform automatic path planning and driving.
[0057] The present embodiment is described in detail below with reference to the accompanying drawings, including two parts: bicycle automatic driving trajectory planning and bicycle momentum wheel self-balancing control.
[0058] The process of bicycle autonomous driving trajectory planning includes:
[0059] According to the structural characteristics of bicycle vehicles, a bicycle vehicle dynamics model is established;
[0060] Design an MPC path planning algorithm controller based on the bicycle vehicle dynamics model;
[0061] The yaw angle of the bicycle's vehicle position and the speed of the vehicle body center are obtained, and the yaw angle of the vehicle position and the speed of the vehicle body center 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's yaw angle according to the servo output torque, so that the bicycle can perform automatic path planning driving.
[0062] The process of establishing a bicycle vehicle dynamics model based on the structural characteristics of the bicycle vehicle includes: the rear wheel is taken as point B, and a rectangular coordinate system is established, and its longitudinal velocity, lateral velocity and heading angular velocity are shown in Figure 2. When modeling the vehicle kinematics, only the front wheel, rear wheel and wheelbase are used to represent it. 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 doing circular motion 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 medium and low speeds, the rear wheel steering angle δ r Approaches 0, here the rear wheel steering angle is considered to be 0. In the instantaneous state, point O of the vehicle is the instantaneous center of rotation of the vehicle, OB is perpendicular to AB, and OC is connected. OC is the radius R of the vehicle trajectory. At this time, the vehicle body speed direction v is the tangent direction of the circle with radius R.
[0063] The bicycle's yaw angle and center-of-body speed are used as inputs to the MPC path planning algorithm controller. The controller calculates the optimal path based on the initial and final points, using a finite-step rolling optimization approach. This improves path planning accuracy compared to cascade PID control and saves computational power compared to LQR, enabling real-time computational results. This improves the system's stability in the face of disturbances in time-varying systems with multiple input scenarios. 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 motor torques and brake control thresholds, and selects finite-step control for the future from 0 to positive infinity.
[0064] Based on the decision, a fusion equation is output, which contains a detailed path, velocity information, and heading deviation. The trajectory is generated based on the fusion equation and sent to the controller for tracking. This controller is processed and connected by the central chip MCU. The trajectory output to the controller is the final output of the MPC path planning algorithm controller, namely the path information. The execution cycle is the same as the decision, 10Hz. This is a reasonable frequency for a relatively stable output of the MPC path planning algorithm controller.
[0065] Wherein, the fusion equation is:
[0066] 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 vehicle's yaw angle change rate can be regarded as the angular velocity of the vehicle's turning angle, and a(k) is the trajectory.
[0067] The present invention can make the output result more ideal for 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.
[0068] At the initial moment, the yaw angle of the vehicle position and the velocity of the vehicle body center are collected, and the yaw angle of the vehicle position and the velocity parameters of the vehicle body center are integrated into a function of the yaw angle x, y, and angular velocity:
[0069] 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 data deviation between the previous and the next data.
[0070] Create a new matrix based on the parameter input value to achieve a new prediction output for:
[0071] 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.
[0072] 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: w(k+i)=α i Y(k)+(1-α i )Y ref
[0073] Among them, w(k+i) is the target tracking function, α i The slope of the function is larger, the faster the curve increases, and vice versa. ref is the target expectation, and Y(k) is the current value.
[0074] Setting the cost function means that the actual value of the system is expected to be tracked quickly by the control expectation. 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.
[0075] The first cost function is:
[0076] The second cost function is:
[0077] The comprehensive cost function is:
[0078] Where q is the weight coefficient of the first cost function, r is the weight coefficient 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 coefficient of the desired target output by the MPC path planning algorithm controller is adjusted based on the selected comprehensive cost function. By adjusting the weight coefficient, the direction of the cost function is selected. For example, if q>r, the function will focus more on achieving the target value faster and tracking the path. If q<r, the function will have less energy, increasing energy utilization, and further solving the optimal path solution.
[0079] The partial derivative of the J cost function with respect to Δu is equal to 0, and the optimal solution of the overall system is obtained when Δu is what value. The formula is as follows:
[0080] That is, Δu=(A T QA+p i ) -1 ·A T (w-Y0)
[0081] Get the predicted value of the next p moments at time k, and take the predicted value at time k+1 At time k+1, the true output value of the system is obtained, Y(k+1), and the error is obtained.
[0082] Calculate the output y of the last feedback of a single time cor (k+1): y cor (k+1)=Y0(k+1)+h i ×e(k+1)
[0083] Among them, Y0(k+1) is the true output value of the system at time k+1, e(k+1) is the error, h i is the variable coefficient (h i Takes 0 to 1).
[0084] The output (trajectory) of the last single feedback is calculated according to the above formula 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 vehicle yaw angle is controlled according to the output torque of the servo, so that the bicycle can achieve automatic path planning driving.
[0085] At the end of a single cycle, the motor value output last time needs to be updated as the input of the next system MPC path planning algorithm controller, and rolling optimization is performed at time k and time k+1.
[0086] The process of the bicycle momentum wheel self-balancing control includes:
[0087] According to the mechanical system of a bicycle with momentum wheel integrated with steering gear control, a physical model of a bicycle with momentum wheel integrated with steering gear control is established;
[0088] Based on the physical model of a bicycle with momentum wheel and servo control, a cascade PID controller for upright posture is designed and integrated with servo-assisted balance control.
[0089] 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 pedal 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 obtain the momentum wheel motor torque. The output torque of the momentum wheel motor is controlled according to the momentum wheel motor torque, and the magnitude of the force is changed by continuously changing the magnitude of the acceleration, so that the momentum wheel fusion servo control type bicycle maintains balance.
[0090] Among them, the piecewise function is: C=K p ×(S1-S0)+K d ×v
[0091] Among them, C is the final change, K p , K d is the control parameter, S1 is the current servo pedal value, S0 is the servo median value, and v is the current bicycle body speed. C is added to the current body inclination value and then input into the cascade PID controller to finally obtain the momentum wheel motor torque.
[0092] Enter the servo PID control function, the control function is:
[0093] The steering angle of the servo is obtained, and the steering of the momentum wheel fusion servo-controlled bicycle is achieved through the change of the servo angle.
[0094] 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.
[0095] 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 this data into quaternion data. With the help of DMP solution, the pitch angle X, roll angle Y and heading angle Z can be obtained.) is used to detect the error between the real-time Z-axis value and the centerline Z-axis value through the gyroscope, and the error is multiplied by the coefficient K. p The result is integrated into the first-order complementary filter for calculation, and finally the servo pedal value is changed. The momentum wheel fusion servo control type bicycle can maintain stable straight line driving.
[0096] The final change in the servo engagement value is based on the following formula: C = K × (Z1-Z) + (1-K) × C1
[0097] Among them, C is the difference in servo engagement, K is a parameter, Z1 is the heading angle value calculated in real time, Z is the median heading angle, C1 is the servo engagement difference calculated last time, and the application of K and (1-K) is a first-order complementary filter.
[0098] In a cascade PID controller, the outermost loop is the velocity loop. This loop controls the momentum wheel's output angular momentum to achieve self-balancing, while maintaining the target velocity of the momentum wheel at zero when the bicycle is balanced. The motor speed, captured in real time by an encoder, serves as the input to the velocity loop, and its target is to maintain zero motor speed. The final output of the velocity loop is the desired lean angle.
[0099] The inner loop is the angle loop. Its input is the real-time body roll angular velocity, collected by the gyroscope after DMP calculation (the gyroscope needs to be left alone for 1-3 minutes for the values to stabilize). Its target value is the mechanical zero point, which is the zero point of the bicycle's X-axis at equilibrium, as calculated by the gyroscope. Ultimately, the output of the angle loop is the desired body roll angular velocity.
[0100] The angular velocity loop has the fastest response speed and is therefore the innermost loop. It operates as a closed loop based on the real-time acquisition of left and right offset velocities. Any offset is immediately generated, making the angular velocity loop's response faster than the first two loops. As the innermost loop, its input is the vehicle's pitch angular velocity, acquired in real time by the gyroscope. Its target value is the output of the angle loop—the desired vehicle pitch angular velocity. Ultimately, the output of the angular velocity loop represents the motor's output torque.
[0101] In the closed-loop speed control system, the speed loop calculates the output value of a momentum-wheel-integrated servo-controlled smart balancing bike. At the mechanical zero angle, the gyroscope calculates the X-axis angle. This output value must be added to the mechanical zero angle to convert speed control into angle control. This is accomplished by simply collecting X-axis data from the attitude sensor. The speed loop loops once every 100ms, the angle loop once every 10ms, and the angular velocity loop once every 2ms. A limiter is applied to the outer loop output before it is passed to the inner loop. Field measurements show that the output is very stable, with no oscillation or noticeable response lag.
[0102] Balance control is achieved through cascaded PID control, which converts the resulting angular velocity and speed into control. The final angular velocity loop output within the entire control system is fed into the motor control, which in turn controls the momentum wheel's rotation to maintain balance. The cascaded PID algorithm is implemented using different control cycles for the angular velocity, angle, and speed loops. After the initialization program is complete, a timer interrupt with a 2ms period is initiated. The PIT interrupt provides the algorithm within the loop with a timing flag to control program execution. This flag is used to execute different control steps at different cycles. This structure helps improve the algorithm's execution efficiency and real-time performance, resulting in a more stable bicycle with momentum wheel integrated servo control.
[0103] Positional PID control is commonly used for servo control. First, the integral term is eliminated. Because servos operate differently from DC motors, they only require a PWM signal with a certain duty cycle to rotate the servo to the corresponding angle. Therefore, the servo system does not require continuous output; instead, the servo only updates its output once per cycle, eliminating static errors. Eliminating the integral term also eliminates the complex integral calculations in positional PID control. Second, the differential term is retained. Because the servo controls the entire vehicle's steering ring, the steering ring must be turned in advance, meaning it must be rotated before reaching a curve. This function is primarily regulated by GPS tracking, and secondarily by the controller's differential term. The differential term adjusts the controller output based on the deviation between the current and previous moments. When the vehicle is about to enter a curve, the differential term takes a positive adjustment effect due to path deviation, forcing the vehicle to turn in advance. When the vehicle exits the curve, the deviation tends to decrease, and the differential term takes a negative adjustment effect, forcing the vehicle to make a smaller turn before exiting the curve. This results in fast cornering and stable exit—the ideal cornering and balancing aid for a bicycle controlled by a momentum-wheel fusion servo. Each servo's control variable output value is largely unrelated to the previous output value; it's dependent only on the past state. The servo needs to quickly turn to a certain angle. Position-based PID control, on the other hand, eliminates the need to memorize the control variable and instead directly calculates the desired control variable based on the deviation. Furthermore, in actual measurements, a bicycle controlled by a momentum-wheel fusion servo at high speeds can easily roll over if the instantaneous turn angle is too large. Therefore, when large turns are required, a delay is required to increase the turning time to prevent the bicycle from rolling over and ensure a smooth ride.
[0104] Position-type PID can be derived by discretizing the PID formula. Discretization is necessary because computer control is a sampling control method. It can only calculate the control variable based on the deviation at the sampling moment, rather than continuously outputting the control variable like analog control. Due to this characteristic, the integral and differential terms in the PID formula cannot be used directly and must be discretized.
[0105] After discretization, we get position PID, also known as full-scale PID:
[0106] Where 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, K i Indicates the integral coefficient, K d represents the differential coefficient.
[0107] 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 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.
[0108] Example 2
[0109] This embodiment provides a self-balancing intelligent bicycle control device with active route planning.
[0110] A self-balancing intelligent bicycle control device with active route planning, comprising:
[0111] The model building module is configured to: build a bicycle dynamics model according to the bicycle structural characteristics;
[0112] The design module is configured to: design an MPC path planning algorithm controller according to a bicycle dynamics model;
[0113] a data acquisition module configured to: acquire a real-time body tilt angle, a yaw angle of the vehicle position, a speed of the center of the body, and a real-time momentum wheel motor speed of the bicycle;
[0114] A path planning module is configured to: obtain an optimal trajectory decision from an initial point to a destination point using an MPC path planning algorithm controller based on a yaw angle of a vehicle position and a speed of a vehicle body center of the bicycle;
[0115] The self-balancing module is configured to: based on the real-time vehicle body inclination angle and the real-time momentum wheel motor speed, use a cascade PID controller, combined with the real-time obtained servo pedal value, to change the vehicle body inclination angle to obtain the servo output torque and the motor output speed;
[0116] 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 and driving.
[0117] It should be noted that the above-mentioned model building module, design module, data acquisition module, path planning module, self-balancing module, and autonomous driving module implement the same examples and application scenarios as those in the steps of Example 1, but are not limited to the contents disclosed in the above-mentioned Example 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.
[0118] Example 3
[0119] 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.
[0120] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, 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 magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0121] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes 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 produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0122] These computer program instructions may also be stored in a computer-readable memory that can direct 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 a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0123] 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, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0124] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0125] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection 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)=α i Y(k)+(1-α 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 coefficient 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 coefficient of the first cost function, r is the weight coefficient 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: Where k is the sampling number, u(k) is the computer output value at the kth sampling time; e(k) is the deviation value input at the kth sampling time; e(k-1) represents the deviation value input at the k-1th sampling time, K i Indicates the integral coefficient, K d 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
Method for tracking and controlling locus of unmanned bicycle
CN105320129A
Weight-improved particle swarm optimization-based unmanned bicycle path planning method
CN106843236A
Vehicle obstacle avoidance trajectory planning and tracking control method
CN110377039A
Self-balancing bicycle and control method thereof
CN111284629A
Trajectory optimization method based on vehicle kinematic model predictive control
CN115447615A
Cited By
Intelligent rescue robot trolley and control method
CN121132590A