An autonomous upright automatic driving system for a self-balancing scooter
By combining a retractable forward-looking bracket with electromagnetic sensors and cameras, and utilizing PID control and distance feedback compensation, the direction of the unmanned bicycle is controlled in a coordinated manner. This solves the problems of electromagnetic tracking being easily damaged and camera tracking being affected by light, improving the path adaptability and speed limit of the unmanned bicycle, and realizing the stability and flexibility of autonomous upright driving.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
- Filing Date
- 2022-03-17
- Publication Date
- 2026-04-24
AI Technical Summary
Existing unmanned bicycles suffer from problems such as easily damaged electromagnetic tracking, inconvenience in carrying, poor aesthetics, and camera tracking being greatly affected by light. Uneven weight distribution on the left and right sides leads to different steering angles, resulting in low speed limits and insufficient tracking stability and path adaptability.
A retractable forward-looking bracket is used in conjunction with electromagnetic sensors and cameras. Through PID control and distance feedback compensation, the direction of the bicycle is controlled in a coordinated manner, realizing the coordinated work of electromagnetic tracking and camera tracking. The difference ratio algorithm and edge detection algorithm are used to improve path adaptability and stability.
It solves the problems of easy damage and aesthetics of electromagnetic tracking, overcomes the light influence of camera tracking, balances the left and right turning range, improves the adaptability of the tracking path and the speed limit, and realizes the stability and flexibility of autonomous upright driving.
Smart Images

Figure CN114609897B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of autonomous driving technology for unmanned bicycles, and particularly relates to an autonomous upright driving system for unmanned bicycles. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] The inventors discovered that current autonomous driving systems for unmanned bicycles still suffer from the following problems: electromagnetic tracking results in excessively long look-ahead distances, making them prone to damage, inconvenient to carry, and significantly reducing their aesthetic appeal; camera-based tracking is greatly affected by light conditions, significantly reducing tracking stability; the bicycle's left and right weight distribution cannot be perfectly balanced, leading to different left and right turn angles, greatly reducing the bicycle's adaptability to tracking paths; the limited look-ahead distance of unmanned bicycles results in a significantly reduced speed limit; and tracking bicycles can only track but cannot drive autonomously. Summary of the Invention
[0004] To address the aforementioned problems, this invention provides an autonomous upright autopilot system for unmanned bicycles. The system utilizes a retractable forward-looking support to effectively solve the issues of easy damage, inconvenience in carrying, and significantly reduced aesthetics associated with electromagnetic tracking due to excessive forward travel. Furthermore, it calculates the distance between the bicycle and the electromagnetic line based on a difference ratio and algorithm, greatly improving the bicycle's path adaptability. When using camera tracking, a data compensation method perfectly overcomes the influence of varying ambient light on the camera, addressing the issue of significantly reduced tracking stability caused by light conditions. Simultaneously, for both tracking methods, data feedback during bicycle steering solves the common problem of uneven left and right turns due to incomplete weight balance, greatly improving the bicycle's adaptability to tracking paths. Furthermore, based on the above configuration, a collaborative control scheme based on electromagnetic tracking and camera tracking is provided.
[0005] According to a first aspect of the present invention, an autonomous upright driving system for an unmanned bicycle is provided, comprising an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. An electromagnetic sensor module for tracking is provided at the end of the forward-looking support, the electromagnetic sensor module including a horizontal inductor and a vertical inductor; the controller is connected to the servo motor and the electromagnetic sensor respectively.
[0006] The controller receives the electromotive force generated by the horizontal and vertical inductors and obtains the distance between the vehicle body and the electromagnetic line based on the electromotive force. At the same time, it performs PID control of the direction loop based on the deviation value of the distance between the vehicle body and the electromagnetic line, and uses the PID control output to control the steering motor to achieve autonomous upright driving of the unmanned bicycle.
[0007] Furthermore, the step of obtaining the distance between the vehicle body and the electromagnetic line based on the electromotive force specifically involves: the controller periodically acquiring the electromotive force from the electromagnetic sensor and performing filtering processing; obtaining the maximum and minimum values of the electromotive force from the filtering results; and obtaining the distance between the vehicle body and the electromagnetic line based on the maximum and minimum values of the electromotive force using a difference ratio algorithm.
[0008] Furthermore, the PID control output is used to control the steering of the servo motor, specifically employing the following control logic:
[0009]
[0010] Where u(t) is the output value of the PID control, e(t) is the proportion of the deviation between the vehicle body and the electromagnetic line, and k p This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; T is the integration parameter, used to reduce the error under static conditions. D The differential parameter is used to reduce k. p Over-adjusting the parameters makes the control faster and more stable.
[0011] or,
[0012] The distance feedback compensation method is adopted. Infrared rangefinders are installed on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the distance detected on the left and right sides of the vehicle body. The specific control logic is as follows:
[0013]
[0014] in, X1 is the detection distance on the left side of the vehicle; X2 is the detection distance on the right side of the vehicle; B is the scaling parameter.
[0015] Furthermore, the unmanned bicycle travels on a dedicated road, which is equipped with electromagnetic lines;
[0016] Furthermore, the unmanned bicycle is also equipped with a power unit;
[0017] or,
[0018] The controller uses a microcontroller.
[0019] According to a second aspect of the present invention, an autonomous upright automatic driving system for an unmanned bicycle is provided, comprising an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The end of the forward-looking support is provided with an image acquisition module for tracking, and the controller is connected to the servo motor and the image acquisition module respectively.
[0020] The controller receives images acquired by the image acquisition module and obtains the distance from the vehicle body to the center of the road based on the images. Simultaneously, it performs PID control of the direction loop based on the deviation value of the distance between the vehicle body and the center of the road, and uses the PID control output to control the steering motor to achieve autonomous upright driving of the unmanned bicycle.
[0021] Furthermore, obtaining the distance from the vehicle body to the center of the road based on the image specifically involves: performing corresponding preprocessing on the obtained image, and simultaneously obtaining the road center from the preprocessed image based on edge extraction and edge detection algorithms, and calculating the distance from the vehicle body to the center of the road based on the road center.
[0022] Furthermore, the PID control output is used to control the steering of the servo motor, specifically employing the following control logic:
[0023]
[0024] Where u(t) is the output value of the PID control, e(t) is the proportion of the vehicle body to the center of the road, and k p This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; T is the integration parameter, used to reduce the error under static conditions. D The differential parameter is used to reduce k. p Over-adjusting the parameters makes the control faster and more stable.
[0025] Furthermore, the steering control of the servo motor using the PID control output can also employ the following control logic: A distance feedback compensation method is used, by installing infrared rangefinders on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the detected distances on the left and right sides of the vehicle body. The control logic is as follows:
[0026]
[0027] in, X1 is the detection distance on the left side of the vehicle; X2 is the detection distance on the right side of the vehicle; B is the scaling parameter.
[0028] Furthermore, the unmanned bicycle is also equipped with a power unit;
[0029] or,
[0030] The controller uses a microcontroller.
[0031] According to a third aspect of the present disclosure, an autonomous upright driving system for an unmanned bicycle is provided, including an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The forward-looking support is provided with an electromagnetic sensor module for tracking and an image acquisition module. The electromagnetic sensor module includes a horizontal inductor and a vertical inductor. The controller is connected to the servo motor, the electromagnetic sensor, and the image acquisition module respectively.
[0032] The controller receives the electromotive force generated by the horizontal and vertical inductors, and obtains the distance between the vehicle body and the electromagnetic line based on the electromotive force. Simultaneously, it performs PID control of the steering loop based on the deviation value of the distance between the vehicle body and the electromagnetic line, and uses the PID control output to control the steering of the servo motor.
[0033] The controller receives images acquired by the image acquisition module and obtains the distance from the vehicle body to the center of the road based on the images; simultaneously, it performs PID control of the steering loop based on the deviation value of the distance between the vehicle body and the center of the road, and uses the PID control output to control the steering of the servo motor.
[0034] Based on the coordinated tracking control of electromagnetic tracking and image acquisition modules, autonomous upright driving of unmanned bicycles is achieved.
[0035] Compared with the prior art, the beneficial effects of the present invention are:
[0036] (1) This disclosure provides an autonomous upright automatic driving system for unmanned bicycles based on electromagnetic tracking. The solution effectively solves the problems of easy damage, inconvenience of carrying, and greatly reduced aesthetics caused by excessive forward look-ahead when using electromagnetic tracking. At the same time, the distance between the bicycle body and the electromagnetic line is calculated by using the difference ratio algorithm, which greatly reduces the shaking phenomenon on straight roads, significantly improves the bicycle's sensitivity to curves, and improves the bicycle's path adaptability.
[0037] (2) This disclosure provides an autonomous upright driving system for unmanned bicycles based on camera tracking. When using camera tracking, the solution uses data compensation to perfectly overcome the influence of different lighting conditions on the camera, thus overcoming the problem that the tracking stability of bicycles is greatly affected by lighting conditions.
[0038] (3) This disclosure addresses the common phenomenon that the left and right weight distribution of a bicycle cannot be completely balanced, resulting in different left and right turning amplitudes, by using data feedback when the bicycle body turns, for two tracking methods, and greatly improves the bicycle's adaptability to tracking paths.
[0039] (4) The proposed scheme enables the track-following bicycle to not only follow the track but also remember the path for automatic driving.
[0040] (5) Based on the coordinated control of electromagnetic tracking and camera tracking, this disclosure provides an autonomous upright driving system for unmanned bicycles. The camera tracking can greatly improve the speed limit of the bicycle tracking system, and the inductive tracking can compensate for the "misidentification phenomenon" caused by light influence when the camera tracks. In the tracking of this disclosure, the dual sensor systems work together, each taking advantage of its strengths, which greatly improves the stability and speed limit of the system tracking.
[0041] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0042] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0043] Figure 1 This is a schematic diagram illustrating the workflow of an autonomous upright automatic driving system for an unmanned bicycle, as described in an embodiment of the present invention.
[0044] Figure 2 This is a schematic diagram of the structure of the forward-looking support and inductor in an embodiment of the present invention, wherein 1 is an inductor; 2 is a first telescopic rod; 3 is a second telescopic rod; and 4 is an image acquisition module. Detailed Implementation
[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 exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0047] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0048] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0049] Terminology Explanation:
[0050] Forward-looking / forward-looking bracket: A support device for mounting inductive sensors and / or image acquisition modules.
[0051] Example 1:
[0052] The purpose of this embodiment is to provide an autonomous upright automatic driving system for unmanned bicycles.
[0053] An autonomous upright driving system for unmanned bicycles includes an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The end of the forward-looking support is provided with an electromagnetic sensor module for tracking, and the electromagnetic sensor module includes a horizontal inductor and a vertical inductor. The controller is connected to the servo motor and the electromagnetic sensor respectively.
[0054] The controller receives the electromotive force generated by the horizontal and vertical inductors and obtains the distance between the vehicle body and the electromagnetic line based on the electromotive force. At the same time, it performs PID control of the direction loop based on the deviation value of the distance between the vehicle body and the electromagnetic line, and uses the PID control output to control the steering motor to achieve autonomous upright driving of the unmanned bicycle.
[0055] Furthermore, the step of obtaining the distance between the vehicle body and the electromagnetic line based on the electromotive force specifically involves: the controller periodically acquiring the electromotive force from the electromagnetic sensor and performing filtering processing; obtaining the maximum and minimum values of the electromotive force from the filtering results; and obtaining the distance between the vehicle body and the electromagnetic line based on the maximum and minimum values of the electromotive force using a difference ratio algorithm.
[0056] Furthermore, the PID control output is used to control the steering of the servo motor, specifically employing the following control logic:
[0057]
[0058] Where u(t) is the output value of the PID control, e(t) is the proportion of the deviation between the vehicle body and the electromagnetic line, and k p This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; The integral parameter T is used to reduce errors under static conditions, allowing the controlled vehicle body to get as close as possible to the path center; D The differential parameter is used to alleviate k. p Over-adjusting the parameters makes the control faster and more stable.
[0059] or,
[0060] The distance feedback compensation method is adopted. Infrared rangefinders are installed on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the distance detected on the left and right sides of the vehicle body. The specific control logic is as follows:
[0061]
[0062] in, X1 is the detection distance on the left side of the vehicle; X2 is the detection distance on the right side of the vehicle; B is the scaling parameter.
[0063] Furthermore, the unmanned bicycle travels on a dedicated road, which is equipped with electromagnetic lines;
[0064] Furthermore, the unmanned bicycle is also equipped with a power unit;
[0065] or,
[0066] The controller uses a microcontroller.
[0067] Specifically, for ease of understanding, the solution described in this disclosure will be explained in detail below with reference to the accompanying drawings:
[0068] The present disclosure provides an autonomous upright driving system for unmanned bicycles, including an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The end of the forward-looking support is provided with an electromagnetic sensor module for tracking, and the electromagnetic sensor module includes a horizontal inductor and a vertical inductor. The controller is connected to the servo motor and the electromagnetic sensor respectively.
[0069] The forward-looking support includes: four inductors (two horizontal inductors and two vertical inductors), a first telescopic rod, and a second telescopic rod. Both the first and second telescopic rods include a core rod and a sleeve rod, with the core rod and sleeve rod being telescopically connected. The first telescopic rod has a core rod at both ends, and the outer ends of the two core rods of the first telescopic rod are each provided with a horizontal inductor for collecting horizontal electromagnetic signals. The sleeve rod of the first telescopic rod is provided with a vertical inductor for collecting vertical electromagnetic signals. The end of the core rod of the telescopic second telescopic rod is fixedly connected to the middle of the first telescopic rod.
[0070] The electromagnetic sensor module employs a four-inductor detection system. Two horizontal inductors provide good line following, while two vertical inductors are used to identify track elements. The electromotive force generated by the inductors is amplified by the operational amplifier module and then acquired by the four ADC channels of the microcontroller. After multiple acquisitions and filtering, the maximum and minimum values are obtained, and then normalized to a range of 0–100. The normalization formula is as follows:
[0071]
[0072] Where Z is a relative value, U h For the highest voltage, U l C represents the minimum voltage, and C is the measured value.
[0073] Finally, the distance between the vehicle body and the electromagnetic line is obtained using the difference ratio sum method (formula below). Difference ratio sum formula:
[0074]
[0075] Where A represents the value collected by the left inductor and B represents the value collected by the right inductor.
[0076] Advantages of the inductance ratio and sum algorithm: The inductance ratio and sum algorithm has good adaptability to straight road patterns and greatly reduces the shaking phenomenon on straight roads; in addition, compared with the difference ratio algorithm, the inductance ratio and sum algorithm significantly improves the bicycle's sensitivity to curves. This algorithm gives the bicycle good turning characteristics and greatly improves the bicycle's path adaptability.
[0077] The deviation between the vehicle body and the electromagnetic wire is calculated using a PID control in the steering loop, i.e.:
[0078]
[0079] Where e(t) is the proportion of the deviation between the vehicle body and the electromagnetic line, corresponding to Err;k p This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle tilts to the left and right when it tilts to the right; T D The differential parameter is used to reduce k. p Overshooting the parameters makes the control faster and more stable, because when only k p When the vehicle is in equilibrium, it has a speed that cannot be reduced. Therefore, this disclosure uses T. D Eliminate vehicle body vibration. The integral parameter is used to reduce errors under static conditions, allowing the controlled vehicle body to get as close as possible to the center of the path.
[0080] The ideal tilt angle is obtained through control calculation. The ideal tilt angle acts on the balance ring to change the single vehicle's route, thereby achieving the purpose of line following.
[0081] For the derivative term in the PID control of Formula 3, if a discrete first-order derivative is used, significant noise signals emerge as the sampling time decreases. To eliminate noise, we sample the second-order linear derivative, effectively suppressing the noise. Furthermore, regarding the issue of excessive turning angles and vehicles running off the track, the solution described in this disclosure improves vehicle stability by installing a gyroscope on the vehicle body and reading the angular velocity of the gyroscope's steering direction in the derivative part of the PID control algorithm, thereby suppressing the vehicle's turning angle.
[0082] Furthermore, to address the issue of uneven weight distribution on the left and right sides of the bicycle, which leads to different left and right turn amplitudes and significantly reduces the adaptability of the bicycle's tracking path, a "distance feedback compensation method" was adopted. Infrared rangefinders were added to the left and right sides of the bicycle. When the bicycle turns, the data is processed by algorithms based on the bicycle's tilt angle and the distance between the rangefinders and the ground to perform steering compensation, perfectly solving the problem of different left and right turn amplitudes and greatly improving the bicycle's adaptability to multiple left and right turning paths.
[0083] Compensation feedback implementation:
[0084]
[0085] Where X1: Detection distance on the left side of the vehicle; X2: Detection distance on the left side of the vehicle; B: Scale
[0086]
[0087] Among them, u(t) is fed back to the servo motor's angle-shifting PWM control to achieve feedback compensation.
[0088] Example 2:
[0089] The purpose of this embodiment is to provide another autonomous upright automatic driving system for unmanned bicycles.
[0090] An autonomous upright driving system for unmanned bicycles includes an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The end of the forward-looking support is provided with an image acquisition module for tracking. The controller is connected to the servo motor and the image acquisition module respectively.
[0091] The controller receives images acquired by the image acquisition module and obtains the distance from the vehicle body to the center of the road based on the images. Simultaneously, it performs PID control of the direction loop based on the deviation value of the distance between the vehicle body and the center of the road, and uses the PID control output to control the steering motor to achieve autonomous upright driving of the unmanned bicycle.
[0092] The forward-looking support includes a core rod and a sleeve rod, wherein the core rod and the sleeve rod are telescopically connected; an image acquisition module is provided at the end of the core rod.
[0093] Furthermore, obtaining the distance from the vehicle body to the center of the road based on the image specifically involves: performing corresponding preprocessing on the obtained image, and simultaneously obtaining the road center from the preprocessed image based on edge extraction and edge detection algorithms, and calculating the distance from the vehicle body to the center of the road based on the road center.
[0094] Furthermore, the PID control output is used to control the steering of the servo motor, specifically employing the following control logic:
[0095]
[0096] Where u(t) is the output value of the PID control, e(t) is the proportion of the vehicle body to the center of the road, and k p This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; The integral parameter T is used to reduce errors under static conditions, allowing the controlled vehicle body to get as close as possible to the path center; D The differential parameter is used to reduce k. p Over-adjusting the parameters makes the control faster and more stable.
[0097] Furthermore, the steering control of the servo motor using the PID control output can also employ the following control logic: A distance feedback compensation method is used, by installing infrared rangefinders on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the detected distances on the left and right sides of the vehicle body. The control logic is as follows:
[0098]
[0099] in, X1 is the detection distance on the left side of the vehicle; X2 is the detection distance on the right side of the vehicle; B is the scaling parameter.
[0100] Furthermore, the unmanned bicycle is also equipped with a power unit;
[0101] or,
[0102] The controller uses a microcontroller.
[0103] Specifically, for ease of understanding, the solution described in this disclosure will be explained in detail below with reference to the accompanying drawings:
[0104] This disclosure provides an autonomous upright driving system for unmanned bicycles, including an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The end of the forward-looking support is provided with an image acquisition module for tracking, and the controller is connected to the servo motor and the image acquisition module respectively.
[0105] The controller performs the following operations: receiving images acquired by the image acquisition module, obtaining the distance from the vehicle body to the center of the road based on the images; simultaneously, performing PID control of the direction loop based on the deviation value of the distance between the vehicle body and the road center, and using the PID control output to control the steering motor, thereby achieving autonomous upright driving of the unmanned bicycle. Specifically, its image processing includes the following steps:
[0106] (I) Data Acquisition
[0107] (1) Interruption handling (used for real-time detection of various vehicle body data)
[0108] pclk generates one value for each pixel output; href generates one value after each line is output; vsync generates one value for each frame output.
[0109] FCLK is the clock provided to the ARM920T; HCLK is the clock provided to the AHB bus used by the ARM920T, memory controller, interrupt controller, LCD controller, DMA, and USB host module; PCLK is the clock provided to the APB bus used by peripherals such as WDT, IIS, I2C, PWM timer, MMC / SD interface, ADC, UART, GPIO, RTC, and SPI.
[0110] (2) DMA (Direct Memory Access) transfer (used for efficient transfer of data captured by the camera)
[0111] The DMA acquisition is initialized in the camera initialization function.
[0112] (II) Camera Image Processing
[0113] (1) Image binarization
[0114] (a) Set a fixed threshold: 255 for white if the value is greater than the threshold, and 0 for black if the value is less than the threshold. (2) Adjust the threshold using buttons via OLED printing. (3) Use Otsu's method (iterate through each threshold and maximize the difference between black and white through variance).
[0115] (b) Perspective transformation (transforming into a top view, stretching a rectangular image into a trapezoid)
[0116] 1. Obtain the camera's field of view angle, horizontal tilt angle, and height; 2. Calculate the correspondence between the X and Y coordinates of the actual image and the acquired image; 3. Supplement any missing values.
[0117] (c) Error analysis using least-bin fitting, slope, and curvature.
[0118] (2) Track edge extraction
[0119] (a) Capture the coordinates of the left and right edges of the track. (b) Other special cases can be optimized according to actual needs. (c) Calculate the center of the track.
[0120] (3) Canny edge detection: gradient (color difference direction) direction, find edge direction.
[0121] Specifically: (a) Calculate the gradient magnitude and direction; (b) Retain the points with the largest local gradients to obtain the refined edges; (c) Verify using the double threshold method.
[0122] (III) Route planning and special handling: crossroads, roundabout recognition and detection, zebra crossing parking block recognition, parking in parking garage, etc.
[0123] (iv) Tracking Control
[0124] The deviation value transmitted from the camera is processed, and the PID algorithm is used to control the steering of the servo motor, thereby achieving tracking.
[0125] Specifically, PID control of the steering loop is performed based on the deviation value of the distance between the vehicle body and the center of the road. The PID control output is used to control the steering of the servo motor, thereby realizing the autonomous upright driving of the unmanned bicycle.
[0126] Furthermore, the PID control output is used to control the steering of the servo motor, specifically employing the following control logic:
[0127]
[0128] Where u(t) is the output value of the PID control, e(t) is the proportion of the vehicle body to the center of the road, and k p The proportional parameter is used to provide the initial restoring force, controlling the servo to turn left when the vehicle tilts to the left and right when it tilts to the right; T is... D for.
[0129] Furthermore, the steering control of the servo motor using the PID control output can also employ the following control logic: A distance feedback compensation method is used, by installing infrared rangefinders on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the detected distances on the left and right sides of the vehicle body. The control logic is as follows:
[0130]
[0131] in, X1 is the detection distance on the left side of the vehicle; X2 is the detection distance on the right side of the vehicle; B is the scaling parameter.
[0132] Furthermore, to address the challenges of speed enhancement and memory-based driving, a CCD sensor was used for path memory. After processing the track memory data using Kalman filtering and sunlight algorithms, the stability, accuracy, and speed of driving were significantly improved without substantially increasing the MCU's resource consumption, while also supporting complex control strategies. This solution is highly versatile and applicable to intelligent vehicle designs using different sensor solutions and control algorithms. Specifically:
[0133] (1) Path memory implementation: The camera data is stored in the RAM as a data matrix, thus realizing memory storage. The path is followed based on the matrix data content in the ROM.
[0134] (2) Implementation of Kalman filter algorithm:
[0135] State prediction: X` k =aX` k-1 +w k (6)
[0136] Where 'a' represents the process model, commonly using a physical model; w k This is process noise, which can be ignored for the sake of simplifying calculations; X k-1 The observed vector value at time k-1;
[0137] Calculate the prediction error: p` k =ap k a T (7)
[0138] Calculate the Kalman gain: K k =P` k / (P` K +r) (8)
[0139] Among them, K k P' represents the Kalman gain; K denoted by k, the prediction error at time k is represented; r represents the measurement noise, which usually follows a Gaussian distribution (r, σ). r can be measured or obtained directly from the sensor manufacturer.
[0140] Calculate the optimal estimate: X k = (1-K) K )x` k +K k z k (9)
[0141] Calculate the optimal estimation error: p k = (1-K) K )p` k (10)
[0142] Where, p k The error of the optimal estimate at time k is given.
[0143] Kalman filtering is implemented by coding the above formulas.
[0144] (3) Implementation of the Sunshine Algorithm: Let t be the threshold of the whole image, L be the gray level of the image, and N be the total number of pixels in the image. Therefore, the image can be divided into two regions [0.t] and [t+1,L-1], named region 1 and region 2, and n is the number of pixels with gray value i. Region 1 and region 2 occupy the area of the whole image as θ1 and θ2, respectively.
[0145] Pixel area ratio of region 1:
[0146] Pixel area ratio of region 2:
[0147] Average gray level of the entire image:
[0148] Average gray level of region 1:
[0149] Average gray level of region 2:
[0150] The variance of a region can be expressed as: σ 2 =θ1(t)θ2(t)[u1(t)-u2(t)] 2 (16)
[0151] Make σ 2 The largest value is the optimal threshold. Typically, smart cars use images with a pixel size of 60*80, and L is 256, which is also known.
[0152] Table 1. Thresholds obtained under different light intensities
[0153]
[0154] Example 3:
[0155] The purpose of this embodiment is to provide another autonomous upright automatic driving system for unmanned bicycles.
[0156] An autonomous upright driving system for unmanned bicycles includes an unmanned bicycle body, a retractable forward-looking support located at the front end of the bicycle body, a servo motor for controlling the direction of the bicycle, and a controller. The forward-looking support is equipped with an electromagnetic sensor module for tracking and an image acquisition module. The electromagnetic sensor module includes a horizontal inductor and a vertical inductor. The controller is connected to the servo motor, the electromagnetic sensor, and the image acquisition module respectively.
[0157] The controller receives the electromotive force generated by the horizontal and vertical inductors, and obtains the distance between the vehicle body and the electromagnetic line based on the electromotive force. Simultaneously, it performs PID control of the steering loop based on the deviation value of the distance between the vehicle body and the electromagnetic line, and uses the PID control output to control the steering of the servo motor.
[0158] The controller receives images acquired by the image acquisition module and obtains the distance from the vehicle body to the center of the road based on the images; simultaneously, it performs PID control of the steering loop based on the deviation value of the distance between the vehicle body and the center of the road, and uses the PID control output to control the steering of the servo motor.
[0159] Based on the coordinated tracking control of electromagnetic tracking and image acquisition modules, autonomous upright driving of unmanned bicycles is achieved.
[0160] Furthermore, this solution combines electromagnetic tracking and camera tracking to achieve unmanned bicycle tracking control. The technical details are described in detail in Embodiments 1 and 2, respectively, and will not be repeated here.
[0161] Furthermore, such as Figure 1 The diagram illustrates the workflow of an autonomous upright self-driving system for unmanned bicycles; as shown. Figure 2 The diagram shows a schematic representation of the forward-looking support and inductor setup.
[0162] The autonomous upright automatic driving system for unmanned bicycles provided in the above embodiments can be realized and has broad application prospects.
[0163] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An autonomous upright automatic driving system for unmanned bicycles, characterized in that, The system includes an unmanned bicycle body, a retractable forward-looking support at the front end of the bicycle body, a servo motor for controlling the bicycle's direction, and a controller. The end of the forward-looking support is equipped with an electromagnetic sensor module for tracking, which includes a horizontal inductor and a vertical inductor. The controller is connected to both the servo motor and the electromagnetic sensor. Specifically, the forward-looking support includes two horizontal inductors, two vertical inductors, a first telescopic rod, and a second telescopic rod. Both the first and second telescopic rods include a core rod and a sleeve rod, which are telescopically connected. The first telescopic rod has core rods at both ends, and the outer ends of the two core rods have horizontal inductors for collecting horizontal electromagnetic signals. The sleeve rod of the first telescopic rod has a vertical inductor for collecting vertical electromagnetic signals. The end of the core rod of the second telescopic rod is fixedly connected to the middle of the first telescopic rod. The controller receives the electromotive force generated by the horizontal and vertical inductors and obtains the distance between the vehicle body and the electromagnetic line based on the electromotive force. At the same time, it performs PID control of the direction loop based on the deviation value of the distance between the vehicle body and the electromagnetic line, and uses the PID control output to control the steering motor to achieve autonomous upright driving of the unmanned bicycle. The distance feedback compensation method is adopted. Infrared rangefinders are installed on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the distance detected on the left and right sides of the vehicle body. The specific control logic is as follows: in, , The detection distance is on the left side of the vehicle body; B represents the detection distance on the right side of the vehicle body; B is the scaling parameter. The output value of PID control. The ratio of the vehicle body to the center of the road. This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; This is the integration parameter, used to reduce the error under static conditions; These are differential parameters used to reduce Over-adjusting the parameters makes the control faster and more stable.
2. The autonomous upright automatic driving system for unmanned bicycles as described in claim 1, characterized in that, The method of obtaining the distance between the vehicle body and the electromagnetic line based on the electromotive force specifically involves: the controller periodically acquiring the electromotive force from the electromagnetic sensor and performing filtering processing; obtaining the maximum and minimum values of the electromotive force from the filtering results; and obtaining the distance between the vehicle body and the electromagnetic line based on the maximum and minimum values of the electromotive force using a difference ratio algorithm.
3. The autonomous upright automatic driving system for unmanned bicycles as described in claim 1, characterized in that, The steering control of the servo motor is performed using the PID control output, specifically employing the following control logic: in, u(t) The output value of PID control. e(t) This is the proportion of the deviation between the vehicle body and the electromagnetic line. This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; These are integration parameters used to reduce errors under static conditions. These are differential parameters used to reduce Over-tuning of parameters makes control faster and more stable.
4. The autonomous upright automatic driving system for unmanned bicycles as described in claim 1, characterized in that, The unmanned bicycle travels on a dedicated road, which is equipped with electromagnetic lines.
5. The autonomous upright automatic driving system for unmanned bicycles as described in claim 1, characterized in that, The unmanned bicycle is also equipped with a power unit; or, The controller uses a microcontroller.
6. An autonomous upright automatic driving system for unmanned bicycles, characterized in that, The system includes an unmanned bicycle body, a retractable forward-looking support at the front end of the bicycle body, a servo motor for controlling the bicycle's direction, and a controller. The forward-looking support has an image acquisition module for tracking at its end. The controller is connected to both the servo motor and the image acquisition module. Specifically, the forward-looking support includes two horizontal inductors, two vertical inductors, a first telescopic rod, and a second telescopic rod. Both the first and second telescopic rods include a core rod and a sleeve rod, which are retractably connected. The first telescopic rod has core rods at both ends, and the outer ends of the two core rods have horizontal inductors for acquiring horizontal electromagnetic signals. The sleeve rod of the first telescopic rod has a vertical inductor for acquiring vertical electromagnetic signals. The end of the core rod of the second telescopic rod is fixedly connected to the middle of the first telescopic rod. The controller receives images acquired by the image acquisition module and obtains the distance from the vehicle body to the center of the road based on the images. Simultaneously, it performs PID control of the direction loop based on the deviation value of the distance between the vehicle body and the center of the road, and uses the PID control output to control the steering motor to achieve autonomous upright driving of the unmanned bicycle. The distance feedback compensation method is adopted. Infrared rangefinders are installed on the left and right sides of the vehicle body respectively. Steering compensation is performed based on the distance detected on the left and right sides of the vehicle body. The specific control logic is as follows: in, , The detection distance is on the left side of the vehicle body; B represents the detection distance on the right side of the vehicle body; B is the scaling parameter. The output value of PID control. The ratio of the vehicle body to the center of the road. This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; This is the integration parameter, used to reduce the error under static conditions; These are differential parameters used to reduce Over-tuning of parameters makes control faster and more stable.
7. The autonomous upright automatic driving system for unmanned bicycles as described in claim 6, characterized in that, The step of obtaining the distance from the vehicle body to the center of the road based on the image specifically involves: performing corresponding preprocessing on the obtained image, and simultaneously obtaining the center of the road from the preprocessed image based on edge extraction and edge detection algorithms, and calculating the distance from the vehicle body to the center of the road based on the center of the road.
8. The autonomous upright automatic driving system for unmanned bicycles as described in claim 6, characterized in that, The steering control of the servo motor is performed using the PID control output, specifically employing the following control logic: in, u(t) The output value of PID control. e(t) The ratio of the vehicle body to the center of the road. This is a proportional parameter used to provide the initial restoring force, controlling the servo to turn left when the vehicle body tilts to the left and right when it tilts to the right; These are integration parameters used to reduce errors under static conditions. These are differential parameters used to reduce Over-tuning of parameters makes control faster and more stable.
9. The autonomous upright automatic driving system for unmanned bicycles as described in claim 6, characterized in that, The unmanned bicycle is also equipped with a power unit; or, The controller uses a microcontroller.
Citation Information
Patent Citations
Two-wheeled vertical type self balancing robot based on infrared posture detection and control method thereof
CN101537615A