Disclosure of Invention
The invention aims to provide a vehicle transverse control method and device, a medium, equipment and a vehicle, which are efficient, accurate and reliable.
In order to achieve the above object, the present disclosure provides a vehicle lateral control method, the method including:
acquiring a target course angle and a current course angle of the vehicle;
controlling a PID controller to output a front wheel corner of the vehicle according to the target course angle and the current course angle, wherein control parameters in the PID controller are determined according to a conjugate gradient algorithm;
and controlling the front wheel rotation angle of the vehicle to be the front wheel rotation angle output by the PID controller.
Optionally, the control parameters in the PID controller are determined by:
determining an initial solution;
determining a search direction for searching from the initial solution;
performing linear search according to the determined search direction until the searched solution meets the termination condition;
determining a solution satisfying the termination condition as a control parameter in the PID controller.
Optionally, the search direction satisfies the following formula:
the termination conditions are as follows:
the linear search satisfies the following formula:
wherein, tk≥0,x(k+1)=x(k)+tkp(k)
Wherein x is
(k)Is the kth solution, k is 0,1,2 …, x
(0)For the initial solution, | | · | | is a norm,
for the gradient, for the error tolerance,
is the search direction of the kth solution,
is twice homogeneousFunction, t
kAnd p
(k)Is an intermediate variable.
Optionally, controlling a PID controller to output a front wheel rotation angle of the vehicle according to the target heading angle and the current heading angle, wherein a control parameter in the PID controller is determined according to a conjugate gradient algorithm, and the method includes:
determining status information of the vehicle;
searching a control parameter corresponding to the determined state information from a corresponding relation between predetermined state information of the vehicle and a control parameter in the PID controller, wherein the control parameter in the PID controller is calculated according to the determined state information and a conjugate gradient algorithm;
and controlling a PID controller to output the front wheel rotation angle of the vehicle according to the target course angle, the current course angle and the searched control parameter.
Optionally, the state information of the vehicle is an interval to which a target heading angle of the vehicle belongs.
Optionally, controlling a PID controller to output a front wheel rotation angle of the vehicle according to the target heading angle and the current heading angle, wherein a control parameter in the PID controller is determined according to a conjugate gradient algorithm, and the method includes:
and when the PID controller is controlled to output the front wheel rotation angle of the vehicle according to the target course angle and the current course angle, if a trigger condition is met, updating the control parameters in the PID controller according to a conjugate gradient algorithm.
The present disclosure also provides a vehicle lateral control apparatus, the apparatus comprising:
the acquisition module is used for acquiring a target course angle and a current course angle of the vehicle;
the first control module is used for controlling the PID controller to output the front wheel rotating angle of the vehicle according to the target course angle and the current course angle, wherein control parameters in the PID controller are determined according to a conjugate gradient algorithm;
and the second control module is used for controlling the front wheel rotation angle of the vehicle to be the front wheel rotation angle output by the PID controller.
The present disclosure also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above-described method provided by the present disclosure.
The present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the above-described method provided by the present disclosure.
The present disclosure also provides a vehicle comprising a controller for performing the steps of the above method provided by the present disclosure.
Through the technical scheme, the conjugate gradient algorithm is utilized, so that the PID controller for the transverse control of the vehicle has a self-optimization function, the workload of the PID controller for controlling parameter setting is reduced, compared with a self-optimization controller based on rules, such as fuzzy PID, the logic complexity in design is reduced, the searching speed is high, and the transverse control of the vehicle is more efficient.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
FIG. 1 is a flow chart of a method for lateral vehicle control provided by an exemplary embodiment. As shown in fig. 1, the vehicle lateral control method may include the steps of:
step S11, a target heading angle and a current heading angle of the vehicle are obtained.
And step S12, controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target course angle and the current course angle, wherein the control parameter in the PID controller is determined according to a conjugate gradient algorithm.
In step S13, the front wheel steering angle of the vehicle is controlled to the front wheel steering angle output by the PID controller.
The disclosure applies to lateral control in vehicle autopilot, in which a PID controller is applied to determine the front wheel turning angle of the vehicle in real time according to a target course angle determined in path planning. The control parameters in the PID controller are determined by a conjugate gradient algorithm. That is, the control parameter is optimized by using the conjugate gradient algorithm, i.e. the self-adaptation or self-tuning of the PID controller is performed, and finally the control parameter in the PID controller is determined to be a better value.
Wherein the control parameters in the PID controller can be determined by:
1. determining an initial solution x(0)。
2. A search direction is determined from which to search starting from the initial solution. Wherein the search direction may satisfy the following formula:
wherein x is
(k)For the kth solution, k is 0,1,2 …,
is the search direction of the kth solution,
in order to be a gradient of the magnetic field,
the average of the two homogeneous functions, for example,
wherein x is a function
A is a semi-positive definite matrix, and A belongs to R
n×nI.e. A is a matrix of n rows and n columns, R is a real number, x
TIs the transpose of x, b, x ∈ R
n×1I.e. both b and x are n rows and 1 columns matrices.
Let x be
*Is a function of
Is the optimal variable, the direction of function solution is x
*The direction in which the gradient of the function is 0, that is,
thus, the optimization problem of the function can be translated into the Ax solution*The solution of b.
3. And performing linear search according to the determined search direction until the searched solution meets the termination condition. The linear search may satisfy the following formula:
wherein, tk≥0,x(k+1)=x(k)+tkp(k)
Wherein, tkAnd p(k)Min is the minimum value for the intermediate variable.
The termination conditions may be:
wherein, | | · | | is a norm, for error tolerance.
4. Determining a solution satisfying the termination condition as a control parameter in the PID controller, i.e., KP、KIAnd KD。
The conjugate gradient algorithm will work out the optimal solution within a given search interval through a series of arithmetic steps.
In addition, in the PID controller, the system response can be better adjusted by removing the leading excitation of the D controller, so that the P control term and the I control term in the PID controller, namely the PI controller can also be used.
Through the technical scheme, the conjugate gradient algorithm is utilized, so that the PID controller for the transverse control of the vehicle has a self-optimization function, the workload of the PID controller for controlling parameter setting is reduced, compared with a self-optimization controller based on rules, such as fuzzy PID, the logic complexity in design is reduced, the searching speed is high, and the transverse control of the vehicle is more efficient.
In one embodiment, the control parameters in the PID controller can be calibrated in advance according to a conjugate gradient algorithm. FIG. 2 is a flow chart of a method for lateral vehicle control provided by another exemplary embodiment. As shown in fig. 2, on the basis of fig. 1, the step of controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target heading angle and the current heading angle, wherein the step of determining the control parameters in the PID controller according to the conjugate gradient algorithm (step S12) may include the steps of:
in step S121, the state information of the vehicle is determined.
And step S122, searching a control parameter corresponding to the determined state information from the corresponding relation between the preset state information of the vehicle and the control parameter in the PID controller, wherein the control parameter in the PID controller is calculated according to the determined state information and the conjugate gradient algorithm.
And S123, controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target course angle, the current course angle and the searched control parameter.
The state information of the vehicle may include a vehicle speed, a front wheel angle, a road curvature, a road surface friction coefficient, and the like. The control parameters in the PID controller may be calibrated in advance before the vehicle is running. Specifically, one (set of) state information of the vehicle corresponds to a set of control parameters. I.e. a set of control parameters is determined according to the conjugate gradient algorithm under a corresponding one (set of) state information. The calibrated control parameters can be stored in association with the corresponding state information of the vehicle, and a corresponding relation between the state information of the vehicle and the control parameters in the PID controller is generated. In the actual running process of the vehicle, the control parameters are determined without real-time application of genetic calculation, and only the control parameters corresponding to the current state information of the vehicle need to be found, so that the real-time calculation amount is reduced, the data processing speed is accelerated, and the response time is shortened.
For example, the state information of the vehicle may be a section to which a target heading angle of the vehicle belongs. Dividing the course angle of the vehicle into a plurality of intervals in advance, calibrating the control parameters of the PID controller when the control parameters are in each interval, and storing each interval and the control parameters determined according to the conjugate gradient algorithm in a correlation mode. When the vehicle actually runs, the corresponding control parameters are directly searched according to the section to which the target course angle belongs, the PID controller is given, and the feedback control is carried out on the transverse control of the vehicle by the PID controller.
Because the target course angle of the vehicle has a large influence on the lateral control of the vehicle, the section to which the target course angle of the vehicle belongs is used as a factor for determining the control parameter of the PID controller, so that the change of the control parameter of the PID controller can be reflected more accurately, the vehicle which can be controlled more accurately by the PID controller can run according to a preset path, and the automatic driving function of the vehicle is improved.
When the control parameters are calibrated, a real vehicle test method can be adopted, and a vehicle model can also be adopted for simulation. FIG. 3 is a schematic diagram of a vehicle lateral control method provided by an exemplary embodiment. As shown in FIG. 3, the system eliminates the deviation e (t) between the target heading angle R (t) and the current heading angle y (t) output by the system through a PID controller, wherein u (t) is the input of the PID controller to the vehicle model, namely the front wheel turning angle. During operation of the PID controller, a conjugate gradient algorithm may be employed simultaneously to update the control parameters of the PID controller.
The vehicle model can use a dynamic model with two degrees of freedom, wherein the two degrees of freedom refer to that the vehicle has longitudinal, transverse and vertical translation and rotation in three directions of rolling, pitching and yawing. The two degree of freedom model may be represented as follows:
wherein, V
xIs the longitudinal speed, V, of the vehicle
yIs the lateral speed of the vehicle, is the front wheel angle, m is the total mass of the vehicle, I
zMoment of inertia at course angle, C
fFor front wheel cornering stiffness, C
rFor rear wheel cornering stiffness, /)
fAnd l
rRespectively the distance between the front wheel and the rear wheel and the mass center of the vehicle,
is the angle of the course direction and is,
is composed of
T is time. The two-degree-of-freedom model is used as a vehicle model, and the model is simple and has small calculation amount, so that the processing speed is high.
Further, the vehicle model may be linearized and discretized to generate a linearly discretized vehicle model. For example, it can be solved via a fourth order Runge Kutta algorithm. Both the PID controller and the conjugate gradient algorithm may be calculated based on this discrete vehicle model.
In the embodiment, the real-time calculation amount of the vehicle in operation is reduced, the data processing speed is increased, and the response time is shortened.
In yet another embodiment, the control parameters in the PID controller may also be updated in real time during vehicle operation according to a conjugate gradient algorithm. In this embodiment, on the basis of fig. 1, the step of controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target heading angle and the current heading angle (step S12), wherein the step of determining the control parameters in the PID controller according to the conjugate gradient algorithm (step S12) may include the following steps:
and when the PID controller is controlled to output the front wheel rotation angle of the vehicle according to the target course angle and the current course angle, if the triggering condition is met, updating the control parameters in the PID controller according to a conjugate gradient algorithm.
In this embodiment, the principle of the vehicle lateral control method is similar to that in fig. 3. Unlike fig. 3, the vehicle model in fig. 3 is replaced with a real vehicle.
Specifically, during vehicle operation, a trigger condition may be set, and if the trigger condition is reached, the control parameters of the primary PID controller are updated using a conjugate gradient algorithm. The trigger condition may be, for example, a time period, a target heading angle interval, a vehicle speed interval, a front wheel turning angle interval, or the like. For example, the conjugate gradient algorithm is used to update every hour, or the target course angle is updated every time a new course angle interval is reached, or the vehicle speed is updated every time a new vehicle speed interval is reached, or the front wheel steering angle is updated every time a new steering angle interval is reached. The trigger condition may also be generated by combining the above factors. For example, every hour and the vehicle speed reaches a new vehicle speed interval, etc.
In this embodiment, since the conjugate gradient algorithm is executed during the actual running of the vehicle, the result of the update of the PID parameters more conforms to the actual vehicle conditions, thereby making the lateral control of the vehicle more accurate.
The present disclosure also provides a vehicle lateral control device. FIG. 4 is a block diagram of a vehicle lateral control apparatus provided in an exemplary embodiment. As shown in fig. 4, the vehiclelateral control apparatus 10 may include anacquisition module 11, afirst control module 12, and asecond control module 13.
The obtainingmodule 11 is used for obtaining a target heading angle and a current heading angle of the vehicle.
Thefirst control module 12 is used for controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target course angle and the current course angle, wherein the control parameter in the PID controller is determined according to a conjugate gradient algorithm.
Thesecond control module 13 is used for controlling the front wheel rotation angle of the vehicle to be the front wheel rotation angle output by the PID controller.
Optionally, thefirst control module 12 may include a determination sub-module, a lookup sub-module, and a first control sub-module.
The determination submodule is used for determining state information of the vehicle.
The searching submodule is used for searching the control parameter corresponding to the determined state information from the corresponding relation between the preset state information of the vehicle and the control parameter in the PID controller, wherein the control parameter in the PID controller is obtained by calculation according to the determined state information and a conjugate gradient algorithm.
The first control submodule is used for controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target course angle, the current course angle and the searched control parameter.
Optionally, the state information of the vehicle is a section to which a target heading angle of the vehicle belongs.
Optionally, thefirst control module 12 may include a second control sub-module.
And the second control submodule is used for updating the control parameters in the PID controller according to a conjugate gradient algorithm if the triggering condition is met while controlling the PID controller to output the front wheel rotation angle of the vehicle according to the target course angle and the current course angle.
Optionally, in thefirst control module 12, the control parameters in the PID controller are determined by:
determining an initial solution;
determining a search direction for searching from the initial solution;
performing linear search according to the determined search direction until the searched solution meets the termination condition;
determining a solution satisfying the termination condition as a control parameter in the PID controller.
Optionally, the search direction satisfies the following formula:
the termination conditions were:
the linear search satisfies the following formula:
wherein, tk≥0,x(k+1)=x(k)+tkp(k)
Wherein x is
(k)Is the kth solution, k is 0,1,2 …, x
(0)For the initial solution, | | · | | is a norm,
for the gradient, for the error tolerance,
is the search direction of the kth solution,
is a quadratic homogeneous function, t
kAnd p
(k)Is an intermediate variable.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Through the technical scheme, the conjugate gradient algorithm is utilized, so that the PID controller for the transverse control of the vehicle has a self-optimization function, the workload of the PID controller for controlling parameter setting is reduced, compared with a self-optimization controller based on rules, such as fuzzy PID, the logic complexity in design is reduced, the searching speed is high, and the transverse control of the vehicle is more efficient.
The present disclosure also provides an electronic device comprising a memory and a processor.
The memory has a computer program stored thereon; the processor is used for executing the computer program in the memory to realize the steps of the above method provided by the present disclosure.
Fig. 5 is a block diagram of anelectronic device 500 shown in an exemplary embodiment. As shown in fig. 5, theelectronic device 500 may include: aprocessor 501 and amemory 502. Theelectronic device 500 may also include one or more of amultimedia component 503, an input/output (I/O)interface 504, and acommunication component 505.
Theprocessor 501 is configured to control the overall operation of theelectronic device 500, so as to complete all or part of the steps in the vehicle lateral control method. Thememory 502 is used to store various types of data to support operation at theelectronic device 500, such as instructions for any application or method operating on theelectronic device 500 and application-related data, such as contact data, messaging, pictures, audio, video, and so forth. TheMemory 502 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. Themultimedia component 503 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in thememory 502 or transmitted through thecommunication component 505. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 504 provides an interface between theprocessor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. Thecommunication component 505 is used for wired or wireless communication between theelectronic device 500 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. Thecorresponding communication component 505 may thus comprise: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, theelectronic Device 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described vehicle lateral control method.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the vehicle lateral control method described above is also provided. For example, the computer readable storage medium may be thememory 502 described above including program instructions executable by theprocessor 501 of theelectronic device 500 to perform the vehicle lateral control method described above.
The present disclosure also provides a vehicle comprising a controller for performing the steps of the above method provided by the present disclosure.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.