Tracking robot operation parameter open source control system and method based on working scene
By combining Arduino main controller and sensors, and dynamically adjusting PID parameters, the problems of trajectory deviation and instability in complex scenarios of traditional PID control are solved, and stable path tracking of robots in multiple scenarios is realized.
Patent Information
- Application Number
- CN202511882345.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-06
AI Technical Summary
Traditional PID control methods struggle to adapt to sudden load changes and variations in ground material when faced with complex working scenarios, resulting in trajectory deviation and insufficient stability, and a lack of comprehensive perception of environmental changes.
The system employs an Arduino main controller as its core hardware architecture, combined with an ACS712 current sensor and a tracking sensor, to detect motor current and ground material in real time. By fitting a preset set of PID parameter correction coefficients with historical trajectory data, the system dynamically adjusts the PID parameters to achieve stability and adaptability in path tracking.
It achieves stability and adaptability in path tracking under different loads and ground materials, avoids the instability problem of traditional PID control, reduces hardware modification costs, and improves the robot's adaptability in complex environments.
Smart Images

Figure CN121613894A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of robot control technology, specifically an open-source control system and method for the operating parameters of a tracking robot based on a work scenario. Background Technology
[0002] With the development of robotics technology, line-following robots are widely used in industrial inspection, logistics distribution, and other fields. However, traditional PID control methods rely on accurate dynamic models, which have significant limitations when facing complex working scenarios. On the one hand, sudden load changes (such as moving heavy objects) can cause fluctuations in motor output power, leading to trajectory deviation. On the other hand, the differences in the coefficient of friction of different ground materials (such as tiles, carpets, and cement) can affect wheel speed and steering response, making it difficult for traditional single PID parameters to meet the needs of multiple scenarios. In addition, existing solutions often use a single sensor (such as relying solely on a tracking sensor), lacking comprehensive perception capabilities of environmental changes and making it difficult to achieve adaptive adjustment.
[0003] There is an urgent need for an open-source control solution that can dynamically adapt to changes in load and ground material and has forward-looking path planning capabilities to improve the stability and versatility of robots in practical applications.
[0004] To this end, the present invention provides an open-source control system and method for the operating parameters of a tracking robot based on a working scenario. Summary of the Invention
[0005] In order to overcome the shortcomings of the prior art, at least one technical problem raised in the background art is solved.
[0006] The technical solution adopted by this invention to solve its technical problem is: On the one hand, this invention provides an open-source control method for the operating parameters of a tracking robot based on a work scenario, including: S1: Build a hardware infrastructure with Arduino as the core as the motor current detection unit to collect the motor operating current in real time and indirectly determine the load change. S2: The infrared reflectivity of the tracking sensor is used to detect different ground materials to determine whether the robot has deviated from the path and generate ground material characteristic values. The load characteristic values are collected through the motor current detection unit. S3: Based on the robot's trajectory tracking requirements, pre-set basic PID parameters and control the output of the basic PID according to the basic PID parameters. Through the preset ground material-load characteristic value interval library, and matching the basic PID parameter correction coefficient set for different ground material-load characteristic value interval libraries, combined with the robot's real-time running data, dynamically correct the basic PID parameters and output the final basic PID, thereby improving the stability and adaptability of the robot's path trajectory tracking requirements under different load characteristics and different ground materials. S4: By using the computing unit of the Arduino main control board, the historical trajectory data is linearly fitted to obtain the trend equation of trajectory offset over time, thereby predicting the future path of the robot.
[0007] As a further improvement, the specific process of building the hardware infrastructure with the Arduino main controller as the core is as follows: Connect the power supply pin of the ACS712 current sensor to the 5V power supply terminal of the Arduino main control board, connect the ground pin to the GND terminal, and connect the signal output pin to the analog input pin of the Arduino main control board. The ACS712 current sensor is connected in series in the power supply circuit of the motor drive module to detect the motor operating current.
[0008] As a further improvement, the specific process for indirectly determining load changes is as follows: Motor operating current detected by ACS712 current sensor It linearly converts current signals into voltage signals. The transformation relationship satisfies: ;in, This is the operating voltage of the current sensor. The sensitivity of the current sensor; The Arduino main board uses its built-in 10-bit analog-to-digital converter (ADC) to convert the voltage signal from the ACS712 current sensor. Converting to a digital quantity D, the conversion relationship is as follows: ,in, 1023 is the reference voltage for the Arduino main control board, and 1023 is the maximum quantization value of the 10-bit ADC. By combining the formulas and , eliminate To obtain the motor operating current The calculation relationship with the digital quantity D: ; The threshold motor current of the robot during no-load operation was determined in advance through experiments. And set the minimum detection current for load changes. ; When calculated At that time, it is determined that the robot is in a state of increased load.
[0009] As a further improvement, the specific process of determining whether the robot has deviated from the path and generating ground material feature values is as follows: Using the basic data acquisition function of the tracking sensor to obtain ground trajectory lines, the digital signals output by the tracking sensor are read through control pins 2, 3, 4, 7, and 8 of the Arduino main control board. Digital signals Divided into: high-level digital signals and low-level digital signals; Among them, a high-level digital signal corresponds to a detected trajectory line, and a low-level digital signal corresponds to a non-detected trajectory line; Based on the digital signals from multiple tracking sensors The system combines data to determine the robot's position relative to the trajectory line, thereby identifying whether the robot has deviated from the path. By utilizing the infrared reflectivity detection function of the tracking sensor, the characteristic values of the ground material are generated based on the differences in infrared light reflectivity of different ground materials. The specific calculation relationship is as follows: ;in, The analog voltage value received by the tracking sensor is read from the analog input pin of the Arduino main control board. This represents the maximum output voltage of the tracking sensor on a high-reflectivity standard surface. This is the material characteristic normalization coefficient, with a value range of... This is used to map feature values to quantifiable and comparable intervals, making... The range is 0-100; The experiment pre-calibrated the corresponding values for different ground materials. The range allows for the differentiation of ground materials.
[0010] As a further improvement, the specific process for collecting load characteristic values is as follows: The motor current detection unit collects the real-time operating current of the motor and generates load characteristic values based on the positive correlation between current and load. The specific calculation relationship is as follows: ;in, This is the real-time operating current of the motor. This refers to the motor operating current of the robot under no-load conditions. This is the load characteristic normalization coefficient; when season ;when season This ensures that the eigenvalues are within the valid range.
[0011] As a further improvement, the specific process of pre-setting the basic PID parameters is as follows: To meet the robot's trajectory tracking requirements, basic PID control parameters are pre-set, including: proportional coefficient. Integral coefficient Differential coefficients Based on the basic PID parameters, the output of the basic PID controller is controlled, and the output of the basic PID controller is... Satisfying the formula: ; in, This represents the trajectory deviation at the current moment (i.e., the difference between the robot's actual position and the desired trajectory position). For time variables, It is the integral variable.
[0012] As a further improvement, the specific process of outputting the final basic PID is as follows: The experiment pre-divided the load characteristic value range and the ground material characteristic value range, and matched a corresponding set of basic PID parameter correction coefficients for each range combination. The set of basic PID parameter correction coefficients includes proportional correction coefficients. Integral correction factor Differential correction coefficient ; Different load characteristic value ranges were pre-defined in the experiment. and the characteristic value range of ground material The corresponding set of basic PID parameter correction coefficients ; Based on the robot's real-time operation data, the basic PID parameters are dynamically corrected; The robot's real-time operational data includes: ground material characteristic values. Load characteristic value Trajectory location data; Based on ground material characteristic values Load characteristic value From the ground material-load characteristic value range library, match the set of basic PID parameter correction coefficients. ; If the collected ground material feature values Load characteristic value For transitional states involving multiple intervals, linear interpolation is used to calculate the characteristic values of the ground material. Load characteristic value The corresponding basic PID parameter correction coefficients; If the collected ground material feature values Load characteristic value If it is not in a transitional state between multiple intervals, then the ground material feature value is used directly. Load characteristic value The corresponding basic PID parameter correction coefficients; The control quantity output by the basic PID The proportional correction coefficient obtained after interpolation. Integral correction factor Differential correction coefficient The commands are integrated to generate adaptively adjusted final control commands. ,satisfy: .
[0013] As a further improvement, the specific process of predicting the future path of the robot includes: In the data processing module of the Arduino main control board, a historical trajectory database is created for real-time storage of recent data. Trajectory position data collected by the internal tracking sensor; Let the sampling time interval be . The database stores historical trajectory data. common Group data, in which: The timestamp of the i-th sample ; Let $\frac{i}{i}$ be the lateral offset of the robot relative to the preset trajectory during the i-th sampling. The historical trajectory data is processed by the computing unit of the Arduino main control board. By performing linear fitting, the trend equation of trajectory offset over time is obtained, which can then be used to predict the future path of the robot.
[0014] As a further improvement, the specific process for predicting the future path of the robot also includes: Assume that the trajectory offset x and time t satisfy a linear relationship. , where k is the trajectory offset rate of change and b is the intercept; Using the least squares method, we can solve for k and b to minimize the sum of squared errors. Using the fitted k and b, calculate the future time. trajectory offset : ; like The predicted trajectory shifted to the right; like The predicted trajectory shifted to the left; like The predicted trajectory is approximately a straight line; The predicted In the original final control command Based on this, fine-tune the motor speed parameters in advance to avoid jitter or overshoot during rapid movement; The specific adjustment logic is as follows: Let the basic rotational speeds of the robot's left and right wheels be... , According to the prediction Calculate the speed correction factor : ; in, The maximum allowable trajectory offset, Adjust the gain for rotational speed; Generate the pre-adjusted motor speed command: like This means reducing the speed of the left wheel and increasing the speed of the right wheel. ; ; like This means increasing the speed of the left wheel and decreasing the speed of the right wheel. ; like If so, the speed will not be adjusted.
[0015] On the other hand, this invention provides an open-source control system for the operating parameters of a tracking robot based on a work scenario, including: Arduino hardware module: Build a hardware infrastructure with the Arduino main controller as the core as a motor current detection unit, which is used to collect the motor operating current in real time and indirectly determine the load change; Feature value acquisition module: Utilizes the infrared reflectivity of the tracking sensor to detect different ground materials to determine whether the robot has deviated from the path and generates ground material feature values. The load feature values are also acquired through the motor current detection unit. PID parameter correction module: Based on the robot's trajectory tracking requirements, the module pre-sets basic PID parameters and controls the output of the basic PID based on these parameters. It uses a preset ground material-load characteristic value range library and matches a set of basic PID parameter correction coefficients to different ground material-load characteristic value range libraries. Combined with the robot's real-time operation data, the module dynamically corrects the basic PID parameters and outputs the final basic PID, thereby improving the stability and adaptability of the robot's path trajectory tracking requirements under different load characteristics and ground materials. Robot path prediction module: Through the computing unit of the Arduino main control board, the historical trajectory data is linearly fitted to obtain the trend equation of trajectory offset over time, thereby predicting the future robot path.
[0016] The beneficial effects of this invention are as follows: 1. Only the ACS712 sensor and the multiplexed tracking sensor are expanded, without major modifications to the original hardware, balancing compatibility and low cost; it enables dual-dimensional data acquisition of trajectory, material, and load, and normalized feature values improve data usability, avoiding the need for additional hardware. 2. By dynamically correcting PID parameters through a material-load interval library, and using linear interpolation in the transition interval to avoid parameter abrupt changes, the problem of instability in traditional PID is solved. Path prediction and early speed fine-tuning avoid the rapid motion jitter and overshoot caused by the short-sightedness of traditional control. Parameters such as no-load current threshold and speed gain can be flexibly adapted to different hardware to suit various working scenarios such as warehousing and inspection. Attached Figure Description
[0017] The invention will now be further described with reference to the accompanying drawings.
[0018] Figure 1 This is a schematic diagram of the robot hardware component of the open-source control system and method for the operation parameters of a tracking robot based on a work scenario, as described in this invention.
[0019] Figure 1 The meanings of the symbols in the text are as follows: 1. Arduino main control board; 2. Left wheel; 3. Right wheel; 4. Tracking module potentiometer; 5. Tracking module; 6. Left turn signal; 7. Right turn signal; 8. Front wheel; 9. Power module; Figure 2 This is a flowchart of the steps of the open-source control method for the operating parameters of a tracking robot based on a working scenario, as described in this invention. Figure 3 This is a system module diagram of the open-source control system for the operating parameters of a tracking robot based on a work scenario, as described in this invention. Detailed Implementation
[0020] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0021] Example 1 The hardware component of the open-source control system and method for the operating parameters of a tracking robot based on a working scenario, as described in this embodiment of the invention, is as follows: Figure 1 As shown, it specifically includes: 1. Arduino main control board: The core control unit of the robot, responsible for receiving sensor data, executing control algorithms, and sending instructions to the motor drive module to achieve centralized control of the robot's movement and tracking behavior. 2. Left wheel: Driven by a motor, it rotates to provide power to the left side of the robot. In conjunction with the right wheel, it controls the robot's forward, backward, and left turns by the speed difference. 3. Right wheel: Driven by a motor, it rotates to provide power to the right side of the robot. In conjunction with the left wheel, it controls the robot's forward, backward, and right-turn movements through the speed difference. 4. Tracking Module Potentiometer: Used to adjust the sensitivity of the tracking module. By changing the resistance value, the detection threshold of the tracking sensor for the trajectory line (such as black line or white line) is adjusted to adapt to trajectory recognition under different environments (such as light and ground material). 5. Tracking Module: Composed of infrared reflective sensors, it detects a preset track line (such as a black line) on the ground, converts the track signal into an electrical signal, and transmits it to the Arduino main control board, enabling the robot to determine and maintain its movement along the track. 6. Left turn signal: The left turn signal illuminates when the robot turns left, indicating the intention to turn. 7. Right turn signal: The right turn signal illuminates when the robot turns right, indicating the intention to turn.
[0022] 8. Front wheels: They provide support and auxiliary guidance, work with the left and right wheels to maintain the robot's stable posture while moving, and assist in adjusting the direction of travel when turning. 9. Power Module: Provides power to the entire robot system (Arduino main control board, motors, infrared reflective sensors, turn signals) to ensure the normal operation of each component.
[0023] Example 2 like Figure 2 As shown in the embodiment of the present invention, the open-source control method for the operating parameters of a line-following robot based on a working scenario is, for ease of understanding, referred to as the line-following module in this embodiment 1, and includes: S1: Build a hardware infrastructure with Arduino as the core as the motor current detection unit to collect the motor operating current in real time and indirectly determine the load change. In S1, the specific process of building the hardware infrastructure with the Arduino main controller as the core is as follows: Connect the power supply pin of the ACS712 current sensor to the 5V power supply terminal of the Arduino main control board, connect the ground pin to the GND terminal, and connect the signal output pin to the analog input pin (such as the A0 pin) of the Arduino main control board. Meanwhile, an ACS712 current sensor is connected in series in the power supply circuit of the motor drive module to detect the motor operating current. ; In S1, the second specific, indirect process for judging load changes is as follows: Motor operating current detected by ACS712 current sensor It linearly converts current signals into voltage signals. The transformation relationship satisfies: ;in, This is the operating voltage of the current sensor, with a value of 5V. For the sensitivity of the current sensor, for the ACS7125A range version, ; The Arduino main board uses a built-in 10-bit analog-to-digital converter (ADC) to convert the voltage signal from the ACS712 current sensor. Converting to a digital quantity D, the conversion relationship is as follows: ,in, The reference voltage for the Arduino main control board is 5V; 1023 is the maximum quantization value of the 10-bit ADC (corresponding voltage). ); By combining the formulas and , eliminate To obtain the motor operating current The calculation relationship with the digital quantity D: ; The threshold motor current of the robot during no-load operation was determined in advance through experiments. (For example, after multiple no-load operation tests, the average operating current of the motor is) ), and set the minimum identification current for load changes. (like ); Due to differences in hardware devices, the motor current threshold is not specified in this invention. Minimum identification current To impose restrictions; When calculated At this time, it is determined that the robot is in a state of increased load; By simply extending the Arduino analog pins to connect the ACS712 current sensor, the motor current detection function can be realized without significantly modifying the original hardware structure. This balances hardware compatibility and low implementation cost. Through the cooperation of the ACS712 current sensor and the Arduino main control board, the motor operating current is converted into a quantifiable digital quantity, which can indirectly and in real time detect changes in robot load, solving the problem that traditional PID control is prone to model instability due to sudden load changes. The threshold current for motors and the minimum identification current are not fixed and can be flexibly adjusted according to different hardware devices (such as different models of motors and different load scenarios), which improves the versatility and scalability of the solution in various working scenarios.
[0024] S2: The infrared reflectivity of the tracking sensor is used to detect different ground materials to determine whether the robot has deviated from the path and generate ground material characteristic values. The load characteristic values are collected through the motor current detection unit. In S2, the specific process of determining whether the robot has deviated from the path and generating ground material feature values is as follows: Using the basic data acquisition function of the tracking sensor to collect ground trajectory lines (black / white lines), the digital signals output by the tracking sensor are read through control pins 2, 3, 4, 7, and 8 of the Arduino main control board. Digital signals Divided into: high-level digital signals and low-level digital signals; Among them, a high-level digital signal corresponds to a detected trajectory line, and a low-level digital signal corresponds to a non-detected trajectory line; Based on the digital signals from multiple tracking sensors Combine (for example, pin 2 low level, pin 3 high level) to determine the robot's position relative to the trajectory line (for example, deviating 5cm to the right of the trajectory line) to determine whether the robot has deviated from the path; By utilizing the infrared reflectivity detection function of the tracking sensor, the difference in infrared light reflectivity of different ground materials (tiles, cement, carpets, etc.) is used to generate characteristic values of the ground material. The specific calculation relationship is as follows: ;in, The analog voltage value at the receiving end of the tracking sensor is read from the analog input pin of the Arduino main control board, ranging from 0-5V; This represents the maximum output voltage of the tracking sensor on a high-reflectivity standard surface. This is the material characteristic normalization coefficient, with a value range of... This is used to map feature values to a quantifiable and comparable interval, for example, taking... ,make The range is 0-100; The experiment pre-calibrated the corresponding values for different ground materials. Scope (e.g., corresponding to tiles) Cement corresponds carpet corresponding This allows for the differentiation of ground materials; In S2, the second specific process of acquiring load characteristic values through the motor current detection unit is as follows: The motor current detection unit collects the real-time operating current of the motor and generates load characteristic values based on the positive correlation between current and load. The specific calculation relationship is as follows: ;in, This is the real-time operating current of the motor. The operating current of the robot's motor under no-load conditions (calibrated experimentally, for example, by actual measurement). ), Load characteristic normalization coefficient (range of values) For example, take ,make The range is 0-100, where 0 represents no load and 100 represents full load. when season ;when season This ensures that the eigenvalues are within the valid range. Simultaneously acquire tracking trajectory location data and ground material feature values Load characteristic value This enables the acquisition of dual-dimensional data, including tracking patterns and environmental characteristics. The generation of ground material characteristic values directly utilizes the infrared reflectivity detection function of existing tracking sensors, eliminating the need for additional dedicated material detection hardware. The acquisition of load characteristic values is based on the already established motor current detection unit, maintaining the continuity of the hardware architecture and improving the system's perception capabilities without significantly increasing costs, thus balancing economy and functionality.
[0025] By using formulas to convert raw signals such as ground material reflectivity and motor current into normalized feature values, and by pre-setting feature value ranges for different scenarios, the abstract environment and load status are transformed into quantifiable and comparable digital signals, thereby improving the practicality of the data and the efficiency of the algorithm response.
[0026] S3: Based on the robot's trajectory tracking requirements, pre-set basic PID parameters and control the output of the basic PID according to the basic PID parameters. Through the preset ground material-load characteristic value interval library, and matching the basic PID parameter correction coefficient set for different ground material-load characteristic value interval libraries, combined with the robot's real-time running data, dynamically correct the basic PID parameters and output the final basic PID, thereby improving the stability and adaptability of the robot's path trajectory tracking requirements under different load characteristics and different ground materials. In S3, the first specific process of pre-setting the basic PID parameters is as follows: For the robot's trajectory tracking requirements (such as position control or speed control along a preset trajectory), basic PID parameters are preset. The basic PID parameters include: proportional coefficient, integral coefficient, and derivative coefficient. The output of the basic PID is controlled according to the basic PID parameters. Specifically, for the robot's trajectory tracking requirements, basic PID control parameters are pre-set, including: proportional coefficient. Integral coefficient Differential coefficients Based on the basic PID parameters, the output of the basic PID controller is controlled, and the output of the basic PID controller is... Satisfying the formula: ; in, This represents the trajectory deviation at the current moment (i.e., the difference between the robot's actual position and the desired trajectory position). For time variables, For integration variables; It should be noted that the basic PID parameters (proportional coefficient, integral coefficient, and derivative coefficient) are determined through preliminary debugging and are used to achieve basic trajectory tracking in standard scenarios (such as no load or tiled floor) to ensure that the robot can stably travel along the trajectory when there is no interference.
[0027] In S3, the second specific step involves using a pre-defined ground material-load characteristic value interval library, matching a set of basic PID parameter correction coefficients to different ground material-load characteristic value interval libraries, and combining this with the robot's real-time operating data to dynamically correct the basic PID parameters and output the final basic PID. The specific process is as follows: The system uses a pre-defined library of ground material-load characteristic value intervals and presets correction coefficients for different ground material-load characteristic value interval libraries. The specific process for presetting the ground material-load characteristic value interval library and the specific process for matching the basic PID parameter correction coefficient set for different ground material-load characteristic value interval libraries are as follows: The experiment pre-divided the load characteristic value range and the ground material characteristic value range, and matched a corresponding set of basic PID parameter correction coefficients for each range combination. The set of basic PID parameter correction coefficients includes proportional correction coefficients. Integral correction factor Differential correction coefficient ; Different load characteristic value ranges were pre-defined in the experiment. and the characteristic value range of ground material The corresponding set of basic PID parameter correction coefficients ; When the load characteristic value is between 80-100 (close to full load) and the floor material characteristic value is between 10-30 (for example, carpet floor), set , , Enhanced proportional control to cope with increased load, and reduced derivative control to reduce vibration caused by carpet friction; When the load characteristic value is between 0 and 20 (for example, no load) and the floor material characteristic value is between 80 and 100 (for example, tile floor), set , , Reduce proportional and integral adjustment to avoid overshoot, and enhance derivative adjustment to cope with the low friction characteristics of the tile; Based on the robot's real-time operation data, the basic PID parameters are dynamically corrected; The robot's real-time operational data includes: ground material characteristic values. Load characteristic value Trajectory position data (used to calculate time trajectory deviation) ); Based on ground material characteristic values Load characteristic value From the ground material-load characteristic value range library, match the set of basic PID parameter correction coefficients. ; If the collected ground material feature values Load characteristic value Transitional states in multiple intervals (for example, such as...) For areas between unloaded and half-loaded zones, linear interpolation is used to calculate the characteristic values of the ground material. Load characteristic value The corresponding basic PID parameter correction coefficients; For example, taking the scaling factor as an example, the specific process of calculating it using the linear interpolation method is as follows: Let the load characteristic values of two adjacent intervals be respectively , The corresponding correction factor is , Then the current load characteristic value Corresponding proportional correction factor satisfy: ; Integral coefficient Differential coefficients The interpolation calculation method is the same as the above proportionality coefficient; If the collected ground material feature values Load characteristic value If it is not in a transitional state between multiple intervals, then the ground material feature value is used directly. Load characteristic value The corresponding basic PID parameter correction coefficients; The control quantity output by the basic PID The proportional correction coefficient obtained after interpolation. Integral correction factor Differential correction coefficient The commands are integrated to generate adaptively adjusted final control commands. ,satisfy: ; Then, The commands are converted into instructions that the motor drive module can recognize (such as PWM duty cycle signals corresponding to the left wheel speed and right wheel speed) and sent to the motor drive module to realize the robot's adaptive motion control (such as increasing the motor speed command to compensate for insufficient power and avoid path deviation when the load increases).
[0028] Traditional PID control relies on precise dynamic models, which are prone to oscillations or path deviations due to sudden load changes or variations in ground material. This step, by pre-setting a library of ground material-load characteristic value ranges, matches specific PID correction coefficients to different scenarios, enabling PID parameters to dynamically adapt to real-time operating conditions. This fundamentally solves the problem of insufficient scenario adaptability of traditional PID control, ensuring that the robot can still stably track its trajectory under complex disturbances.
[0029] Linear interpolation is used to calculate the PID correction coefficients, avoiding sudden changes in motor speed or vehicle vibration caused by abrupt changes in parameters at interval boundaries. Matching the correction coefficients based on quantized eigenvalues ensures the accuracy of PID parameter adjustment and avoids errors from human experience.
[0030] S4: By using the computing unit of the Arduino main control board, the historical trajectory data is linearly fitted to obtain the trend equation of trajectory offset over time, thereby predicting the future path of the robot. In S4, the first specific step involves linearly fitting historical trajectory data to obtain the trend equation of trajectory offset over time, and then predicting the future path of the robot. The historical trajectory data specifically includes: In the data processing module of the Arduino main control board, a historical trajectory database is created for real-time storage of recent data. Trajectory position data collected by the internal tracking sensor; Let the sampling time interval be . (like Then the database stores historical trajectory data. common Group data, in which: The timestamp of the i-th sample ; This represents the lateral offset of the robot relative to the preset trajectory during the i-th sampling (calculated from the detection results of the tracking sensor, e.g., when pin 2 is on the white line and pin 3 is on the black line). This indicates centering; when pin 1 is pressed against the black line, (Indicates leftward deviation); The historical trajectory data is processed by the computing unit of the Arduino main control board. By performing linear fitting, the trend equation of trajectory offset over time is obtained, which can then be used to predict the future path of the robot. The specific steps are as follows: Assume that the trajectory offset x and time t satisfy a linear relationship. , where k is the trajectory offset rate of change (reflecting whether the trajectory is deviated to the left, right or straight), and b is the intercept; Using the least squares method, we can solve for k and b to minimize the sum of squared errors. Using the fitted k and b, calculate the future time. trajectory offset : ; like The predicted trajectory shifted to the right; like The predicted trajectory shifted to the left; like The predicted trajectory is approximately a straight line; The predicted In the original final control command Based on this, fine-tune the motor speed parameters in advance to avoid jitter or overshoot during rapid movement; The specific adjustment logic is as follows: Let the basic rotational speeds of the robot's left and right wheels be... , According to the prediction Calculate the speed correction factor : ; in, The maximum allowable trajectory offset is determined experimentally (e.g.) ), Adjust the gain for the rotational speed (determined through debugging, e.g., take...) This indicates that the offset has reached (At that time, the speed is corrected by 10%). Generate motor speed adjustment commands in advance: like (If you anticipate a rightward veer), then reduce the speed of the left wheel and increase the speed of the right wheel. ; ; like (If the target is predicted to veer to the left), then increase the speed of the left wheel and decrease the speed of the right wheel. ; like (If the offset is extremely small and the expected straight line is assumed), then the rotation speed is not adjusted. The adjusted and It is converted into a PWM signal that can be recognized by the motor drive module and sent to the motor drive module to achieve forward-looking trajectory correction; Example 3 like Figure 3 As shown in Embodiment 2, the open-source control system for the operating parameters of a tracking robot based on a work scenario, as described in this embodiment of the invention, includes: Arduino hardware module: Build a hardware infrastructure with the Arduino main controller as the core as a motor current detection unit, which is used to collect the motor operating current in real time and indirectly determine the load change; Feature value acquisition module: Utilizes the infrared reflectivity of the tracking sensor to detect different ground materials to determine whether the robot has deviated from the path and generates ground material feature values. The load feature values are also acquired through the motor current detection unit. PID parameter correction module: Based on the robot's trajectory tracking requirements, the module pre-sets basic PID parameters and controls the output of the basic PID based on these parameters. It uses a preset ground material-load characteristic value range library and matches a set of basic PID parameter correction coefficients to different ground material-load characteristic value range libraries. Combined with the robot's real-time operation data, the module dynamically corrects the basic PID parameters and outputs the final basic PID, thereby improving the stability and adaptability of the robot's path trajectory tracking requirements under different load characteristics and ground materials. Robot path prediction module: Through the computing unit of the Arduino main control board, the historical trajectory data is linearly fitted to obtain the trend equation of trajectory offset over time, thereby predicting the future robot path.
[0031] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for open source control of a mobile robot based on operating scenario, characterized in that: Comprise: S1: build Arduino host as the core hardware infrastructure as motor current detection unit, for real-time acquisition of motor working current, indirect judgment of load change; S2: use the infrared reflectivity of the track sensor to detect different ground materials to determine whether the robot deviates from the path and generate ground material characteristic value, collect load characteristic value through the motor current detection unit; S3: according to the trajectory tracking demand of the robot, the basic PID parameters are set in advance, and the output of the basic PID is controlled according to the basic PID parameters, through the preset ground material-load characteristic value interval library, and the basic PID parameter correction coefficient set is matched for different ground material-load characteristic value interval library, combined with the real-time running data of the robot, the basic PID parameters are dynamically corrected, and the final basic PID is output, which improves the stability and adaptability of the robot in different load characteristics and different ground materials under the path tracking demand; S4: through the operation unit of the Arduino host board, the historical trajectory data is linearly fitted to obtain the trend equation of the trajectory deviation with time, and then the future robot path is predicted.
2. The work scenario based open source control method of the trail robot running parameters according to claim 1, characterized in that: The specific process of building the hardware infrastructure with Arduino host as the core is: Connect the power pin of ACS712 type current sensor to the 5V power supply end of Arduino host board, connect the ground pin to GND end, and connect the signal output pin to the analog input pin of Arduino host board; Connect the ACS712 type current sensor in series to the power supply circuit of the motor drive module to detect the motor working current.
3. The work scenario based open source control method of trail robot operating parameters according to claim 1, characterized in that: The specific process of indirectly judging the load change is: The motor working current detected based on the ACS712 current sensor linearly converts the current signal into a voltage signal The conversion relationship satisfies: ; wherein, is the working voltage of the current sensor, is the sensitivity of the current sensor; The Arduino master board converts the voltage signal converted by the ACS712 current sensor into a digital quantity D through a built-in 10-bit analog-digital converter ADC, and the conversion relationship is: D = 1023 * (V - 2.5) / 5 wherein, V is the reference voltage of the Arduino master board, and 1023 is the maximum quantization value of the 10-bit ADC. By simultaneous equations With , eliminate , get motor operating current And the calculation of digital quantity D: ; Pre-determining the motor current threshold for the robot running empty by experiment and setting the minimum recognition current for load changes ; When the calculated determines that the robot is in a load increase state.
4. The work scenario based open source control method of robot operational parameters based on trail following according to claim 1, characterized in that: The specific process of determining whether the robot deviates from the path and generating the ground material characteristic value is: The basic collection function of the ground track line is realized by using the track sensor, and the digital signal output by the track sensor is read through the control pins 2, 3, 4, 7 and 8 of the Arduino master control board The digital signal is divided into: high-level digital signal and low-level digital signal ; Wherein, the high level digital signal corresponds to detecting the trajectory line, and the low level digital signal corresponds to not detecting the trajectory line; Digital signal from a plurality of groups of track-following sensors Combining, determining a position state of the robot relative to the track line to determine whether the robot is off course; The infrared reflectivity detection function of the track sensor is used to generate a ground material characteristic value by the difference in infrared light reflectivity of different ground materials , and the specific calculation relationship is: ; wherein, is an analog voltage value of the receiving end of the track sensor, which is read by the analog input pin of the Arduino main control board, is the maximum output voltage of the track sensor on the high reflectivity standard surface, is a material characteristic normalization coefficient, the value range , is used to map the characteristic value to a quantifiable contrast interval, so that ranges from 0 to 100; The different ground materials are pre-calibrated by experiments range, and the ground materials are distinguished.
5. The work scenario based open source control method of trail robot operating parameters according to claim 1, characterized in that: The specific process of collecting the load characteristic value is: The motor current detection unit collects real-time working current of the motor, and generates a load characteristic value based on the positive correlation between the current and the load , and the specific calculation relationship is: ; wherein, is the real-time working current of the motor, is the working current of the motor in the no-load state of the robot, is a load characteristic normalization coefficient; When , let ; when , let , ensuring that the eigenvalues are within the valid interval.
6. The work scenario based open source control method of robot operational parameters based on trail following according to claim 1, wherein: The specific process of pre-setting the basic PID parameters is: For the trajectory tracking requirement of the robot, the basic PID control parameters are set in advance, the control parameters include: proportional coefficient , integral coefficient , and differential coefficient ; and the output of the basic PID is controlled according to the basic PID parameters, and the output of the basic PID control satisfies the formula: wherein, is the current time trajectory deviation (i.e. the difference between the actual robot position and the desired trajectory position), is the time variable, is the integral variable.
7. The work scenario based open source control method of trail robot operating parameters according to claim 1, characterized in that: The specific process of outputting the final basic PID is: The load characteristic value interval and the ground material characteristic value interval are pre-divided through experiments, and a corresponding basic PID parameter correction coefficient set is matched for each interval combination, and the basic PID parameter correction coefficient set includes a proportional correction coefficient , an integral correction coefficient , and a differential correction coefficient . Different load characteristic value intervals are pre-divided through experiments and ground material characteristic value intervals Corresponding basic PID parameter correction coefficient sets ; Based on the real-time running data of the robot, the basic PID parameters are dynamically corrected; The robot real-time running data includes ground material characteristic values , load characteristic values , and track position data. Based on ground material characteristic value , load characteristic value , match the basic PID parameter correction coefficient set from the ground material-load characteristic value interval library ; If the collected ground material characteristic value , load characteristic value is in the transition state of multiple intervals, the ground material characteristic value , load characteristic value corresponding to the basic PID parameter correction coefficient is calculated by linear interpolation method. If the collected ground material characteristic value , load characteristic value is not in the transition state of the plurality of intervals, the ground material characteristic value , load characteristic value corresponding to the basic PID parameter correction coefficient is directly used; The control amount of the basic PID output , the proportional correction coefficient obtained after the interpolation processing , the integral correction coefficient , the differential correction coefficient , the final control instruction after adaptive adjustment is generated by fusion , meet: .
8. The work scenario based open source control method of robot operational parameters based on trail following according to claim 1, wherein: The specific process of predicting the future robot path includes: In the data processing module of the Arduino master control board, a historical trajectory database is opened to store the trajectory position data collected by the internal trajectory tracking sensor in real time in real time. Let the sampling time interval be The historical trajectory data is stored in the database In total Group data, wherein: timestamp for the ith sample ; is the lateral offset of the robot relative to the preset trajectory at the i-th sampling time; The historical trajectory data is processed by the computing unit of the Arduino main control board. By performing linear fitting, the trend equation of trajectory offset over time is obtained, which can then be used to predict the future path of the robot.
9. The work scenario based open source control method of trail robot operating parameters according to claim 8, characterized in that: The specific process of predicting the future robot path also includes: Let the trajectory offset x satisfy a linear relationship with time t where k is a trajectory offset change rate and b is an intercept. According to the least square method, minimize the sum of squares of errors, solve k and b; Using the fitted k and b, the trajectory offset at future time is calculated : ; If , predict the trajectory to be right-shifted; If , predict trajectory offset left; If , the predicted trajectory is approximately straight; The pre-judgment obtained On the basis of the original final control instruction , the motor speed parameter is fine-tuned in advance to avoid jitter or overshoot during fast motion. The specific adjustment logic is: The basic rotation speed of the left and right wheels of the robot is set as , , the rotation speed correction coefficient is calculated according to the pre-judged : ; wherein, is the maximum allowed trajectory offset, is the rotational speed adjustment gain; Generate the motor speed instruction after early fine tuning: If then decrease the left wheel rotational speed and increase the right wheel rotational speed, i.e. ; ; If then increase the left wheel rotational speed and decrease the right wheel rotational speed, i.e. ; If then the rotational speed is not adjusted.
10. An open source control system for operating parameters of a trail following robot based on a work scenario, characterized in that: Comprise: Arduino hardware module: build Arduino host as the core hardware infrastructure as motor current detection unit, for real-time acquisition of motor working current, indirect judgment of load change; Characteristic value acquisition module: use the infrared reflectivity of the track sensor to detect different ground materials to determine whether the robot deviates from the path and generate ground material characteristic value, collect load characteristic value through the motor current detection unit; The PID parameter correction module: according to the trajectory tracking requirement of the robot, the basic PID parameter is set in advance, and the output of the basic PID is controlled according to the basic PID parameter, the ground material-load characteristic value interval library is pre-set, and the basic PID parameter correction coefficient set is matched for different ground material-load characteristic value interval libraries, the basic PID parameter is dynamically corrected combined with the real-time running data of the robot, and the final basic PID is output, so that the stability and adaptability of the robot in the path trajectory tracking requirement under different load characteristics and different ground materials are improved. The robot path prediction module: through the operation unit of the Arduino main control board, the historical trajectory data is linearly fitted to obtain the trend equation of the trajectory deviation with time, and then the future robot path trend is predicted.