Calculation method, system, equipment and medium of integral coefficient in PID control
By dynamically adjusting the integral coefficient in PID control and optimizing the motor torque response according to the real-time vehicle speed and road conditions, the problem of insufficient integral coefficient in traditional PID control methods under complex working conditions is solved, and the torque adjustment accuracy and response speed of automatic parking are improved.
Patent Information
- Application Number
- CN202510049791.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-01-13
AI Technical Summary
In existing PID control methods, the integral coefficient changes slowly under complex working conditions, resulting in a slow response of the motor torque and an inability to provide sufficient torque in a timely manner, affecting the reliability and efficiency of automatic parking.
By obtaining the real-time speed and target speed of the target vehicle, dynamically adjusting the integral coefficient, and utilizing the different weight mapping relationships between obstacle roads and flat roads, the motor torque response is optimized, including the integration processing of the integral increment values of obstacle roads and flat roads, and the target integral coefficient is calculated.
It improves the torque adjustment accuracy and response speed under complex working conditions, and enhances the reliability and efficiency of automatic parking.
Smart Images

Figure CN119937285B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of PID (Proportional-Integral-Derivative Controller) control technology, and in particular to a method, system, device and medium for calculating the integral coefficient in PID control. Background Art
[0002] With the widespread adoption of automated parking systems in intelligent driving, precise control of motor torque has become crucial for efficient and smooth parking. Existing automated parking systems generally employ PID-based motor torque regulation to ensure smooth acceleration and successful parking on flat or gently sloping roads.
[0003] However, the existing PID control method mainly calculates the integral coefficient for flat or gently sloping roads. Since the integral coefficient changes smoothly and has a small value, this helps ensure that the vehicle accelerates smoothly and slowly under normal circumstances. However, when facing complex working conditions that require large torque, such as steps, steep slopes or uneven roads, a small integral coefficient will cause the motor torque to respond slowly and fail to provide sufficient torque in time, which may cause the vehicle to get stuck during parking and be unable to execute upper-level instructions, affecting the reliability and efficiency of automatic parking.
[0004] Therefore, how to provide an integral coefficient calculation method to improve the torque adjustment accuracy and response speed of automatic parking under complex working conditions is an urgent problem that needs to be solved. Summary of the Invention
[0005] The present application provides a method, system, device and medium for calculating the integral coefficient in PID control, which can improve the torque adjustment accuracy and response speed during automatic parking under complex working conditions.
[0006] In a first aspect, an embodiment of the present application provides a method for calculating an integral coefficient in PID control, the method for calculating an integral coefficient in PID control comprising:
[0007] Obtain the real-time speed, target speed, and target speed of the target vehicle;
[0008] When it is detected that the real-time vehicle speed is less than a preset vehicle speed threshold, integrating the preset obstacle road integral increment value to obtain a first weight value;
[0009] When it is detected that the real-time vehicle speed is greater than or equal to a preset vehicle speed threshold, integrating the preset flat road integral increment value to obtain a second weight value;
[0010] A target integral coefficient is determined based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and a preset target mapping relationship under different road conditions. The target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient. The sum of the first weight and the second weight is 1.
[0011] In combination with the first aspect, in one embodiment, integrating the preset obstacle road integral increment value to obtain the first weight includes:
[0012] Integrating the obstacle road integral increment value to obtain a first integral value;
[0013] Substitute the first integral value into the first calculation formula to obtain the first weight, wherein the first calculation formula is:
[0014]
[0015] Where x is the first integral value; f(x) is the first weight.
[0016] In conjunction with the first aspect, in one embodiment, after the step of determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, the method further includes:
[0017] Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed;
[0018] When it is detected that the new real-time vehicle speed is less than the preset vehicle speed threshold, the obstacle road integral increment value is integrated to obtain an integral result, and the integral result is summed with the first integral value to obtain a new integral value;
[0019] The step of substituting the first integral value into the first calculation formula to obtain the first weight is performed based on the new integral value.
[0020] In combination with the first aspect, in one embodiment, integrating the preset flat road integral increment value to obtain the second weight includes:
[0021] Integrating the flat road integral increment value to obtain a second integral value;
[0022] Substitute the second integral value into the second calculation formula to obtain the second weight, wherein the second calculation formula is:
[0023]
[0024] Wherein, x′ is the second integral value; f(x′) is the second weight.
[0025] In conjunction with the first aspect, in one embodiment, after the step of determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, the method further includes:
[0026] Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed;
[0027] When it is detected that the new real-time vehicle speed is greater than or equal to the preset vehicle speed threshold, the flat road integral increment value is integrated to obtain an integral result, and the integral result is summed with the second integral value to obtain a new integral value;
[0028] The step of substituting the second integral value into the second calculation formula to obtain the second weight is performed based on the new integral value.
[0029] In conjunction with the first aspect, in one embodiment, the target mapping relationships for different road surfaces include a first mapping relationship corresponding to an obstacle road surface and a second mapping relationship corresponding to a flat road surface, and determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, a preset mapping relationship between the vehicle speed for different road surfaces, and the integral coefficient includes:
[0030] Subtracting the target vehicle speed from the real-time vehicle speed to obtain a first vehicle speed difference absolute value;
[0031] Obtaining a first integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the first mapping relationship;
[0032] obtaining a second integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the second mapping relationship;
[0033] A target integral coefficient is determined based on the first weight or the second weight and the first integral coefficient and the second integral coefficient.
[0034] In combination with the first aspect, in one embodiment, determining the target integral coefficient based on the first weight or the second weight and the first integral coefficient and the second integral coefficient includes:
[0035] Substitute the first weight or the second weight and the first integral coefficient and the second integral coefficient into the third calculation formula to obtain the target integral coefficient. The third calculation formula is:
[0036] I=I1*f(x)+I2*f(x′)
[0037] Wherein, f(x) is the first weight; f(x′) is the second weight; I1 is the first integral coefficient; I2 is the second integral coefficient; and I is the target integral coefficient.
[0038] In a second aspect, an embodiment of the present application provides a system for calculating an integral coefficient in PID control, the system for calculating an integral coefficient in PID control comprising:
[0039] A first processing module is used to obtain the real-time speed and target speed of the target vehicle;
[0040] a second processing module, configured to integrate a preset obstacle road integral increment value to obtain a first weight value when detecting that the real-time vehicle speed is less than a preset vehicle speed threshold;
[0041] a third processing module, configured to integrate the preset flat road integral increment value to obtain a second weight value when detecting that the real-time vehicle speed is greater than or equal to a preset vehicle speed threshold;
[0042] The fourth processing module is used to determine the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, wherein the target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient, and the sum of the first weight and the second weight is 1.
[0043] In a third aspect, an embodiment of the present application provides a device for calculating the integral coefficient in PID control, wherein the device for calculating the integral coefficient in PID control includes a processor, a memory, and a calculation program for the integral coefficient in PID control stored in the memory and executable by the processor, wherein when the calculation program for the integral coefficient in PID control is executed by the processor, the steps of the method for calculating the integral coefficient in PID control as described in any of the above items are implemented.
[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a calculation program for the integral coefficient in PID control is stored. When the calculation program for the integral coefficient in PID control is executed by a processor, the steps of the method for calculating the integral coefficient in PID control as described in any of the above items are implemented.
[0045] The beneficial effects of the technical solutions provided in the embodiments of the present application include:
[0046] By obtaining the real-time speed and target speed of the target vehicle, when it is detected that the real-time speed is less than a preset speed threshold, the preset obstacle road integral increment value is integrated to obtain a first weight; when it is detected that the real-time speed is greater than or equal to the preset speed threshold, the preset flat road integral increment value is integrated to obtain a second weight. The first weight and the second weight determine how the vehicle control system adjusts the integral coefficient under different road conditions; the target integral coefficient is determined based on the first weight or the second weight and the real-time speed, the target speed, and the preset target mapping relationship under different road conditions. The target mapping relationship is a mapping relationship between the target speed, the absolute value of the difference between the target speed and the real-time speed, and the integral coefficient. The present application dynamically adjusts the integral coefficient according to the real-time speed and road condition, so that the control system can optimize the motor torque response when facing different road conditions, solves the power response problem caused by insufficient integral coefficient in the traditional PID control method, and improves the reliability and efficiency of automatic parking. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flow chart of an embodiment of a method for calculating the integral coefficient in PID control of the present application;
[0048] Figure 2 This is a flow chart of the first weight calculation method in the calculation method of the integral coefficient in the PID control of this application;
[0049] Figure 3 For this application Figure 1 Detailed flow chart of step S40;
[0050] Figure 4 This is a schematic diagram of the hardware structure of the calculation device for the integral coefficient in the PID control involved in the embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0053] In a first aspect, an embodiment of the present application provides a method for calculating an integral coefficient in PID control.
[0054] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for calculating the integral coefficient in the PID control of this application. Figure 1 As shown in the figure, the calculation method of the integral coefficient in PID control includes:
[0055] Step S10: Obtain the real-time speed and target speed of the target vehicle.
[0056] For example, it should be noted that the PID controller combines three control mechanisms: proportional, integral, and differential, enabling fast and stable feedback control. Balance is achieved by appropriately adjusting the proportional, integral, and differential coefficients. Specifically, proportional control provides a fast response, integral control eliminates static errors, and differential control slows down error changes and avoids overshoot. The present application proposes a new integral coefficient calculation method, enabling the vehicle to adapt to complex parking conditions and ensuring both comfort and maneuverability.
[0057] In an embodiment of the present application, the real-time speed of the target vehicle can be obtained through vehicle-mounted sensors such as speed sensors and GPS modules, and the target speed (i.e., requested speed or expected speed) sent by the host computer can be obtained at the same time, that is, the speed that the target vehicle wants to reach, so as to subsequently judge the road condition of the vehicle based on the real-time speed, and update the integral coefficient according to the real-time speed and target speed to optimize the vehicle's driving performance and stability.
[0058] Step S20: When it is detected that the real-time vehicle speed is less than a preset vehicle speed threshold, the preset obstacle road integral increment value is integrated to obtain a first weight.
[0059] For example, in the embodiment of the present application, an obstacle road surface refers to a road surface with irregularities, undulations or obstacles, which has a relatively high torque demand and can also be called a high-torque demand road surface; the specific values of the preset vehicle speed threshold and the obstacle road surface integral increment value can be determined according to actual needs and are not limited here. For example, the preset vehicle speed threshold value can preferably be -0.25m / s, where the vehicle speed threshold value is selected as a negative value to help identify whether the vehicle speed is decreasing or stagnant, and the preset obstacle road surface integral increment value is 0.05; the first weight is a weight value of the integral part I in the PID controller, which determines the influence of the integral part on the overall control.
[0060] Specifically, when it is detected that the real-time vehicle speed is less than the preset vehicle speed threshold, it indicates that the target vehicle is on an obstacle road. At this time, a first weight is obtained by integrating the integral increment value of the obstacle road, and the integral part of the PID controller is adjusted according to the first weight, thereby adjusting the output result of the PID controller to ensure the stability of the vehicle.
[0061] Step S30: When it is detected that the real-time vehicle speed is greater than or equal to the preset vehicle speed threshold, the preset flat road integral increment value is integrated to obtain a second weight.
[0062] For example, in the embodiment of the present application, a flat road surface refers to a road with a uniform surface and no obvious undulations or obstacles. It has relatively high comfort requirements and can also be called a high-comfort road surface. The specific value of the preset flat road surface integral increment can be determined according to actual needs and is not limited here. For example, the preset flat road surface integral increment can preferably be -0.05. Specifically, when it is detected that the real-time vehicle speed is ≥ the preset vehicle speed threshold, it indicates that the road surface on which the target vehicle is located is a flat road surface. At this time, a second weight is obtained by integrating the flat road surface integral increment value, and the integral part of the PID controller is adjusted according to the second weight, so as to provide stable and precise torque control on a flat road surface.
[0063] Step S40: Determine a target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions. The target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient. The sum of the first weight and the second weight is 1.
[0064] Exemplarily, in an embodiment of the present application, the sum of the first weight and the second weight is 1, and the target integral coefficient is the final adjustment coefficient for the integral part in the PID controller; the target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient, wherein the preset target mapping relationship under different road surfaces includes a first mapping relationship under a preset obstacle road surface and a second mapping relationship under a preset flat road surface. The first mapping relationship and the second mapping relationship can both be obtained through experimental calibration and are not limited here; for example, through experimental calibration, a first mapping relationship table corresponding to a high-torque demand torque road surface as shown in Table 1 and a second mapping relationship table corresponding to a high-comfort target road surface as shown in Table 2 are obtained.
[0065] Table 1 The first mapping relationship table corresponding to high torque demand torque road surface
[0066]
[0067]
[0068] Table 2 Second mapping relationship table corresponding to high comfort target road surface
[0069]
[0070] Specifically, if it is detected that the target vehicle is traveling on an obstacle road, the target integral coefficient is determined based on the first weight, the first mapping relationship, the second mapping relationship, the target vehicle speed, and the real-time vehicle speed corresponding to the obstacle road; if it is detected that the target vehicle is traveling on a flat road, the target integral coefficient is determined based on the second weight, the first mapping relationship, the second mapping relationship, the target vehicle speed, and the real-time vehicle speed corresponding to the flat road.
[0071] It should be understood that when the vehicle speed is high (i.e. the target vehicle is traveling on a relatively flat road), the target integral coefficient is relatively small; when the vehicle speed is low (i.e. the target vehicle is traveling on an obstacle road such as a slope or complex terrain), the target integral coefficient is relatively large, so as to help the control system better respond to external changes.
[0072] The present application obtains the real-time speed and target speed of the target vehicle. When it is detected that the real-time speed is less than a preset speed threshold, the preset obstacle road integral increment value is integrated to obtain a first weight; when it is detected that the real-time speed is greater than or equal to the preset speed threshold, the preset flat road integral increment value is integrated to obtain a second weight. The first weight and the second weight determine how the vehicle control system adjusts the integral coefficient under different road conditions. The target integral coefficient is determined based on the first weight or the second weight and the real-time speed, the target speed, and the preset target mapping relationship under different road conditions. The target mapping relationship is a mapping relationship between the target speed, the absolute value of the difference between the target speed and the real-time speed, and the integral coefficient. The present application dynamically adjusts the integral coefficient according to the real-time speed and road conditions, so that the control system can optimize the motor torque response when facing different road conditions, solves the power response problem caused by insufficient integral coefficient in traditional PID control methods, and improves the reliability and efficiency of automatic parking.
[0073] Furthermore, in one embodiment, integrating the preset obstacle road integral increment value to obtain the first weight includes:
[0074] Integrating the obstacle road integral increment value to obtain a first integral value;
[0075] Substitute the first integral value into the first calculation formula to obtain the first weight, wherein the first calculation formula is:
[0076]
[0077] Where x is the first integral value; f(x) is the first weight.
[0078] For example, in the embodiment of the present application, when the current road surface is an obstacle road, the weight can be calculated by the following formula. Specifically, the first integral value x is substituted into the following calculation formula to obtain the first weight f(x), which is:
[0079]
[0080] It can be understood that, by integrating the obstacle road integral increment of 0.05 within one cycle (for example, 1ms), a first integral value x=0.05 is obtained. Since x is within the range of (0, 1), x=0.05 can be substituted into the function The first weight f(0.05) is calculated.
[0081] Furthermore, in one embodiment, referring to Figure 2 As shown, after the step of determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, the method further includes:
[0082] Step P10: Control the output target torque based on the target integral coefficient and obtain a new real-time vehicle speed;
[0083] Step P20: When it is detected that the new real-time vehicle speed is less than the preset vehicle speed threshold, the obstacle road integral increment value is integrated to obtain an integral result, and the integral result is summed with the first integral value to obtain a new integral value;
[0084] Step P30: Based on the new integral value, execute the step of substituting the first integral value into the first calculation formula to obtain the first weight.
[0085] Exemplarily, in the embodiment of the present application, the system can dynamically adjust the target torque (i.e., the control signal to the drive motor) through the target integral coefficient, thereby affecting the vehicle's acceleration, deceleration, or maintaining a constant speed, and obtain a new real-time vehicle speed after the vehicle speed is adjusted; the relationship between the new real-time vehicle speed and the preset vehicle speed threshold of -0.25m / s is judged. If it is detected that the new real-time vehicle speed is less than the preset vehicle speed threshold, it means that the target torque at this time still cannot enable the target vehicle to cross the obstacle, then the obstacle road integral increment value 0.05 is continued to be integrated to obtain an integral result of 0.05, and the integral value of the previous cycle (i.e., the first integral value 0.05) is added to the integral result to obtain a new integral value of 0.1; the new integral value 0.1 is substituted into In the equation, a new weight f(0.1) is obtained to adjust the behavior of the PID controller according to the new weight, thereby ensuring that the vehicle can be properly controlled according to the new speed and road conditions. The above control mechanism can improve the vehicle's adaptability, response accuracy, and driving comfort under different driving conditions.
[0086] It should be noted that the integral value x can be limited, that is, if the accumulated new integral value x>1, 1 is assigned to x; if the accumulated new integral value x<0, 0 is assigned to x, thereby ensuring that the value range of x is between [0, 1].
[0087] Furthermore, in one embodiment, integrating the preset flat road integral increment value to obtain the second weight includes:
[0088] Integrating the flat road integral increment value to obtain a second integral value;
[0089] Substitute the second integral value into the second calculation formula to obtain the second weight, wherein the second calculation formula is:
[0090]
[0091] Wherein, x′ is the second integral value; f(x′) is the second weight.
[0092] For example, in the embodiment of the present application, the second integral value is substituted into the following calculation formula to obtain the second weight, which is:
[0093]
[0094] It should be noted that f(x)+f(x′)=1, and the flat road integral value -0.05 is integrated within one cycle to obtain the second integral value x′=-0.05. x′ is limited to obtain x′=0, so x′=0 is substituted into the function f(x′) to calculate the second weight f(0).
[0095] Furthermore, in one embodiment, after the step of determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, the following step is further included:
[0096] Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed;
[0097] When it is detected that the new real-time vehicle speed is greater than or equal to the preset vehicle speed threshold, the flat road integral increment value is integrated to obtain an integral result, and the integral result is summed with the second integral value to obtain a new integral value;
[0098] The step of substituting the second integral value into the second calculation formula to obtain the second weight is performed based on the new integral value.
[0099] Exemplarily, in the embodiment of the present application, the system can dynamically adjust the target torque (i.e., the control signal to the drive motor) through the target integral coefficient, thereby affecting the vehicle's acceleration, deceleration, or maintaining a constant speed, and obtain a new real-time vehicle speed after the vehicle speed is adjusted; the relationship between the new real-time vehicle speed and the preset vehicle speed threshold of -0.25m / s is judged. If it is detected that the new real-time vehicle speed is ≥ the preset vehicle speed threshold, it means that the target vehicle is on a flat road at this time, then the flat road integral increment value -0.05 is integrated to obtain an integral result of -0.05, and the integral value of the previous cycle (i.e., the second integral value 0.25) is added to the integral result to obtain a new integral value of 0.2; the new integral value 0.2 is substituted into In the equation, a new weight f(0.2) is obtained to adjust the behavior of the PID controller according to the new weight, thereby ensuring that the vehicle can be properly controlled according to the new speed and road conditions.
[0100] Furthermore, in one embodiment, referring to Figure 3 As shown, the target mapping relationships under different road conditions include a first mapping relationship corresponding to an obstacle road and a second mapping relationship corresponding to a flat road. The target integral coefficient is determined based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationships under different road conditions. The target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient, including:
[0101] Step S401: Subtracting the target vehicle speed from the real-time vehicle speed to obtain a first vehicle speed difference absolute value;
[0102] Step S402: obtaining a first integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the first mapping relationship;
[0103] Step S403: obtaining a second integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the second mapping relationship;
[0104] Step S404: Determine a target integral coefficient based on the first weight or the second weight and the first integral coefficient and the second integral coefficient.
[0105] For example, in the embodiment of the present application, the target vehicle speed is the speed instruction sent by the host computer, that is, the speed that the target vehicle wants to reach. The target vehicle speed v and the real-time vehicle speed v1 are subtracted to obtain the first vehicle speed difference absolute value |v-v1|; when the target vehicle speed is constant, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed is large, indicating that the current vehicle speed is too slow and the integral coefficient needs to be increased; when the absolute value of the difference between the target vehicle speed and the real-time vehicle speed is constant, the target vehicle speed is large, indicating that the vehicle needs to maintain a high speed at this time and the integral coefficient also needs to be increased.
[0106] Specifically, referring to Table 1, assuming that the target speed sent by the host computer is 1 m / s and the obtained real-time speed v1 is 0.5 m / s, then the absolute value of the difference between the target speed v and the real-time speed v1, |v-v1|, is 0.5 m / s, and the first integral coefficient corresponding to the target speed is 300. It can be understood that referring to Table 2, assuming that the target speed sent by the host computer is 1 m / s and the obtained real-time speed v1 is 0.5 m / s, then the absolute value of the difference between the target speed v and the real-time speed v1, |v-v1|, is 0.5 m / s, and the second integral coefficient corresponding to the target speed is 36.
[0107] It should be noted that if the target vehicle is located on an obstacle road as determined by the real-time vehicle speed, a weighted calculation is performed to obtain the target integral coefficient based on the first weight corresponding to the obstacle road, the first integral coefficient corresponding to the absolute difference between the real-time vehicle speed and the target vehicle speed, and the second integral coefficient corresponding to the absolute difference between the real-time vehicle speed and the target vehicle speed; if the target vehicle is located on a flat road as determined by the real-time vehicle speed, a weighted calculation is performed to obtain the target integral coefficient based on the second weight corresponding to the flat road, the first integral coefficient corresponding to the absolute difference between the real-time vehicle speed and the target vehicle speed, and the second integral coefficient corresponding to the absolute difference between the real-time vehicle speed and the target vehicle speed.
[0108] Furthermore, in one embodiment, determining the target integral coefficient based on the first weight or the second weight and the first integral coefficient and the second integral coefficient includes:
[0109] Substitute the first weight or the second weight and the first integral coefficient and the second integral coefficient into the third calculation formula to obtain the target integral coefficient. The third calculation formula is:
[0110] I=I1*f(x)+I2*[1-f(x)]
[0111] Wherein, f(x) is the first weight; f(x′) is the second weight; I1 is the first integral coefficient; I2 is the second integral coefficient; and I is the target integral coefficient.
[0112] For example, in the embodiment of the present application, since the first weight and the second weight cannot exist at the same time and the sum of the first weight and the second weight is 1, the first weight f(x) or the second weight f(x′), the first integral coefficient I1, and the second integral coefficient I2 can be substituted into the following calculation formula to obtain the target integral coefficient I, which is:
[0113] I=I1*f(x)+I2*[1-f(x)].
[0114] In a second aspect, an embodiment of the present application further provides a system for calculating an integral coefficient in PID control, the system for calculating an integral coefficient in PID control comprising:
[0115] A first processing module is used to obtain the real-time speed and target speed of the target vehicle;
[0116] a second processing module, configured to integrate a preset obstacle road integral increment value to obtain a first weight value when detecting that the real-time vehicle speed is less than a preset vehicle speed threshold;
[0117] a third processing module, configured to integrate the preset flat road integral increment value to obtain a second weight value when detecting that the real-time vehicle speed is greater than or equal to a preset vehicle speed threshold;
[0118] The fourth processing module is used to determine the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, wherein the target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient, and the sum of the first weight and the second weight is 1.
[0119] Furthermore, in one embodiment, the second module is specifically configured to:
[0120] Integrating the obstacle road integral increment value to obtain a first integral value;
[0121] Substitute the first integral value into the first calculation formula to obtain the first weight, wherein the first calculation formula is:
[0122]
[0123] Where x is the first integral value; f(x) is the first weight.
[0124] Furthermore, in one embodiment, the second module is further configured to:
[0125] Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed;
[0126] When it is detected that the new real-time vehicle speed is less than the preset vehicle speed threshold, the obstacle road integral increment value is integrated to obtain an integral result, and the integral result is summed with the first integral value to obtain a new integral value;
[0127] The step of substituting the first integral value into the first calculation formula to obtain the first weight is performed based on the new integral value.
[0128] Furthermore, in one embodiment, the third module is specifically configured to:
[0129] Integrating the flat road integral increment value to obtain a second integral value;
[0130] Substitute the second integral value into the second calculation formula to obtain the second weight, wherein the second calculation formula is:
[0131]
[0132] Wherein, x′ is the second integral value; f(x′) is the second weight.
[0133] Furthermore, in one embodiment, the third module is further configured to:
[0134] Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed;
[0135] When it is detected that the new real-time vehicle speed is greater than or equal to the preset vehicle speed threshold, the flat road integral increment value is integrated to obtain an integral result, and the integral result is summed with the second integral value to obtain a new integral value;
[0136] The step of substituting the second integral value into the second calculation formula to obtain the second weight is performed based on the new integral value.
[0137] Furthermore, in one embodiment, the fourth module is specifically configured to:
[0138] Subtracting the target vehicle speed from the real-time vehicle speed to obtain a first vehicle speed difference absolute value;
[0139] Obtaining a first integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the first mapping relationship;
[0140] obtaining a second integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the second mapping relationship;
[0141] A target integral coefficient is determined based on the first weight or the second weight and the first integral coefficient and the second integral coefficient.
[0142] Furthermore, in one embodiment, the fourth module is further configured to:
[0143] Substitute the first weight or the second weight and the first integral coefficient and the second integral coefficient into the third calculation formula to obtain the target integral coefficient. The third calculation formula is:
[0144] I=I1*f(x)+I2*f(x′)
[0145] Wherein, f(x) is the first weight; f(x′) is the second weight; I1 is the first integral coefficient; I2 is the second integral coefficient; and I is the target integral coefficient.
[0146] The present application obtains the real-time speed and target speed of the target vehicle; when it is detected that the real-time speed is less than a preset speed threshold, the preset obstacle road integral increment value is integrated to obtain a first weight; when it is detected that the real-time speed is greater than or equal to the preset speed threshold, the preset flat road integral increment value is integrated to obtain a second weight. The first weight and the second weight determine how the vehicle control system adjusts the integral coefficient under different road conditions; the target integral coefficient is determined based on the first weight or the second weight and the real-time speed, the target speed, and the preset target mapping relationship under different road conditions. The target mapping relationship is a mapping relationship between the target speed, the absolute value of the difference between the target speed and the real-time speed, and the integral coefficient. The present application dynamically adjusts the integral coefficient according to the real-time speed and road conditions, so that the control system can optimize the motor torque response when facing different road conditions, solves the power response problem caused by insufficient integral coefficient in the traditional PID control method, and improves the reliability and efficiency of automatic parking.
[0147] Among them, the functional implementation of each module in the above-mentioned integral coefficient calculation system in PID control corresponds to the steps in the above-mentioned embodiment of the integral coefficient calculation method in PID control, and their functions and implementation processes are no longer repeated here.
[0148] On the third aspect, an embodiment of the present application provides a device for calculating the integral coefficient in PID control. The device for calculating the integral coefficient in PID control can be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0149] Reference Figure 4 , Figure 4 Schematic diagram of the hardware structure of the device for calculating the integral coefficient in PID control involved in the embodiment of the present application. In the embodiment of the present application, the device for calculating the integral coefficient in PID control may include a processor, a memory, a communication interface and a communication bus.
[0150] The communication bus may be of any type and is used to interconnect the processor, memory, and communication interface.
[0151] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces interconnect components within the device that calculates the integral coefficient in PID control, as well as interfaces that connect the device to other devices (such as other computing devices or user devices). Physical interfaces can include Ethernet, fiber optic, and ATM interfaces; user devices can include displays and keyboards.
[0152] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0153] The processor may be a general-purpose processor, which may call a calculation program for the integral coefficient in PID control stored in a memory and execute the calculation method for the integral coefficient in PID control provided in an embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the calculation program for the integral coefficient in PID control is called may refer to the various embodiments of the calculation method for the integral coefficient in PID control of the present application, and will not be repeated here.
[0154] Those skilled in the art will understand that Figure 4 The hardware structure shown in the figure does not constitute a limitation to the present application and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0155] In a fourth aspect, an embodiment of the present application also provides a readable storage medium.
[0156] The readable storage medium of the present application stores a calculation program for the integral coefficient in PID control, wherein when the calculation program for the integral coefficient in PID control is executed by a processor, the steps of the calculation method for the integral coefficient in PID control as described above are implemented.
[0157] Among them, the method implemented when the calculation program of the integral coefficient in PID control is executed can refer to the various embodiments of the calculation method of the integral coefficient in PID control of this application, and will not be repeated here.
[0158] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit the "first", "second" and "third" to different types.
[0159] In the description of the embodiments of this application, the words "exemplary," "for example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "for example," or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "for example," or "for example" is intended to present the relevant concepts in a concrete manner.
[0160] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.
[0161] In some processes described in the embodiments of the present application, multiple operations or steps are included that appear in a specific order. However, it should be understood that these operations or steps may not be performed in the order in which they appear in the embodiments of the present application or may be performed in parallel. The sequence numbers of the operations are only used to distinguish between different operations, and the sequence numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations or steps may be performed in sequence or in parallel, and these operations or steps may be combined.
[0162] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device to execute the methods described in each embodiment of the present application.
[0164] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for calculating the integral coefficient in PID control, characterized in that: The calculation method of the integral coefficient in the PID control includes: Obtain the real-time speed, target speed, and target speed of the target vehicle; When it is detected that the real-time vehicle speed is less than a preset vehicle speed threshold, integrating the preset obstacle road integral increment value to obtain a first weight value; When it is detected that the real-time vehicle speed is greater than or equal to a preset vehicle speed threshold, integrating the preset flat road integral increment value to obtain a second weight value; determining a target integral coefficient based on the first weight or the second weight, the real-time vehicle speed, the target vehicle speed, and a preset target mapping relationship for different road conditions, wherein the target mapping relationship is a mapping relationship between the target vehicle speed, the absolute value of the difference between the target vehicle speed and the real-time vehicle speed, and the integral coefficient, and the sum of the first weight and the second weight is 1; The step of integrating the preset obstacle road integral increment value to obtain the first weight includes: Integrating the obstacle road integral increment value to obtain a first integral value; Substitute the first integral value into the first calculation formula to obtain the first weight, wherein the first calculation formula is: Where, is the first integral value; is the first weight; The integrating process of the preset flat road integral increment value to obtain the second weight value includes: Integrating the flat road integral increment value to obtain a second integral value; Substitute the second integral value into the second calculation formula to obtain the second weight, wherein the second calculation formula is: Where, is the second integral value; is the second weight.
2. The method for calculating the integral coefficient in PID control according to claim 1, wherein: After the step of determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, the method further includes: Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed; When it is detected that the new real-time vehicle speed is less than the preset vehicle speed threshold, the obstacle road integral increment value is integrated to obtain an integral result, and the integral result is summed with the first integral value to obtain a new integral value; The step of substituting the first integral value into the first calculation formula to obtain the first weight is performed based on the new integral value.
3. The method for calculating the integral coefficient in PID control according to claim 1, wherein: After the step of determining the target integral coefficient based on the first weight or the second weight and the real-time vehicle speed, the target vehicle speed, and the preset target mapping relationship under different road conditions, the method further includes: Control the output target torque based on the target integral coefficient and obtain the new real-time vehicle speed; When it is detected that the new real-time vehicle speed is greater than or equal to the preset vehicle speed threshold, the flat road integral increment value is integrated to obtain an integral result, and the integral result is summed with the second integral value to obtain a new integral value; The step of substituting the second integral value into the second calculation formula to obtain the second weight is performed based on the new integral value.
4. The method for calculating the integral coefficient in PID control according to claim 1, wherein: The target mapping relationships under different road conditions include a first mapping relationship corresponding to an obstacle road and a second mapping relationship corresponding to a flat road. The target integral coefficient is determined based on the first weight or the second weight and the real-time vehicle speed, a preset mapping relationship between the vehicle speed under different road conditions and the integral coefficient, including: Subtracting the target vehicle speed from the real-time vehicle speed to obtain a first vehicle speed difference absolute value; Obtaining a first integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the first mapping relationship; obtaining a second integral coefficient corresponding to the absolute value of the difference between the target vehicle speed and the first vehicle speed based on the second mapping relationship; A target integral coefficient is determined based on the first weight or the second weight and the first integral coefficient and the second integral coefficient.
5. The method for calculating the integral coefficient in PID control according to claim 4, wherein: The determining of the target integral coefficient based on the first weight or the second weight and the first integral coefficient and the second integral coefficient includes: Substitute the first weight or the second weight and the first integral coefficient and the second integral coefficient into the third calculation formula to obtain the target integral coefficient. The third calculation formula is: Where, is the first weight; is the first integral coefficient; is the second integral coefficient; is the target integral coefficient.
6. A calculation system for the integral coefficient in PID control, characterized in that: The calculation system of the integral coefficient in the PID control includes: A first processing module is used to obtain the real-time speed and target speed of the target vehicle; a second processing module, configured to integrate a preset obstacle road integral increment value to obtain a first weight value when detecting that the real-time vehicle speed is less than a preset vehicle speed threshold; a third processing module, configured to integrate the preset flat road integral increment value to obtain a second weight value when detecting that the real-time vehicle speed is greater than or equal to a preset vehicle speed threshold; a fourth processing module, configured to determine a target integral coefficient based on the first weight or the second weight, the real-time vehicle speed, the target speed, and a preset target mapping relationship for different road conditions, wherein the target mapping relationship is a mapping relationship between the target speed, the absolute value of the difference between the target speed and the real-time vehicle speed, and the integral coefficient, and the sum of the first weight and the second weight is 1; The second processing module is specifically configured to: Integrating the obstacle road integral increment value to obtain a first integral value; Substitute the first integral value into the first calculation formula to obtain the first weight, wherein the first calculation formula is: Where, is the first integral value; is the first weight; The third processing module is specifically configured to: Integrating the flat road integral increment value to obtain a second integral value; Substitute the second integral value into the second calculation formula to obtain the second weight, wherein the second calculation formula is: Where, is the second integral value; is the second weight.
7. A device for calculating the integral coefficient in PID control, characterized in that: The device for calculating the integral coefficient in PID control includes a processor, a memory, and a calculation program for the integral coefficient in PID control stored in the memory and executable by the processor, wherein when the calculation program for the integral coefficient in PID control is executed by the processor, the steps of the method for calculating the integral coefficient in PID control according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a calculation program for the integral coefficient in PID control, wherein when the calculation program for the integral coefficient in PID control is executed by a processor, the steps of the calculation method for the integral coefficient in PID control according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Vehicle speed control method and device, medium, equipment and vehicle
CN115503709A
Parameter tuning method of unknown PID controller
US20170115641A1