Disclosure of Invention
The invention aims to solve the technical problem of providing a multi-sensor time synchronization method for an automatic driving vehicle based on a C-ATS algorithm aiming at the defects of the prior art, designs the C-ATS algorithm based on ATS improved weight, the time server and the sensor clock of the automatic driving vehicle are cooperatively synchronized, so that the influence of asymmetric random communication time delay on time synchronization precision is overcome, and higher time synchronization precision of multiple sensors is realized.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
A multi-sensor time synchronization method for an automatic driving vehicle based on a C-ATS algorithm is provided, wherein a time server and a plurality of sensors for providing reference time are arranged on the automatic driving vehicle; the time server and each sensor interact through a form of periodically sending messages;
the time synchronization method specifically comprises the following steps:
Step 1, a sensor c i broadcasts a data packet in the k-th round of interaction, i is less than or equal to N-1, N is less than or equal to N +, and the time for transmitting the data packet by the sensor c i is The time server receives the data packet is thatThe time server receives the data packet and then sends the local time to itselfThe data packet is transmitted to the sensor c i, and the time for the sensor c i to receive the data packet sent by the time server is that
Step 2, the sensor c i records the local clock of the current broadcast message sent by the time serverAnd the time at which the sensor c i receives the data packet sent by the time server
In the step 3, k=1, the drift correction coefficient is presetOffset correction coefficientThe value of (2) versus timeCorrection is carried out to obtain
Step 4, for any ε >0, ifThe time synchronization is completed, otherwise, the step 5 is executed;
Step 5, will Assignment to
Step 6, k=k+1; executing the step1 and the step 2; calculating a filtering scale factor according to the C-ATS algorithm, and calculating a drift correction coefficient through the filtering scale factorOffset correction coefficient
Step 7, correcting the coefficient by driftOffset correction coefficientLocal time to sensorCorrection is carried out to obtain
Step 8, for any ε >0, ifThe time synchronization is completed, otherwise, the step 5 is returned.
As a further improved technical scheme of the invention, in the step 3,
As a further improved technical scheme of the invention, the filtering scale factorThe method comprises the following steps:
Wherein ρ η is the weight coefficient of the filtering scale factor.
As a further improved technical scheme of the invention, the drift correction coefficientThe method comprises the following steps:
wherein ρ α is the drift weight coefficient of the sensor c i to correct its own local time estimate.
As a further improved technical scheme of the invention, the offset correction coefficientThe method comprises the following steps:
wherein ρ o is the offset weight coefficient for the sensor c i to correct its own local time estimate.
As a further improved technical scheme of the invention, the coefficient is corrected by driftOffset correction coefficientLocal time to sensorCorrection is carried out to obtainThe method comprises the following steps:
The beneficial effects of the invention are as follows:
The invention establishes a time interaction synchronization model of a time server and a sensor based on a bidirectional time synchronization mechanism of a sender-receiver, designs a C-ATS algorithm based on ATS improved weight, performs collaborative synchronization on the time server and an automatic driving vehicle sensor clock, overcomes the influence of asymmetric random communication time delay on time synchronization precision, and meets the requirement of an automatic driving vehicle on the time synchronization precision of the sensor. And the simulation verification proves that the C-ATS algorithm can realize higher time synchronization precision.
Detailed Description
The following is a further description of embodiments of the invention, with reference to the accompanying drawings:
The embodiment provides a multi-sensor time synchronization method for an automatic driving vehicle based on a C-ATS algorithm, which establishes a time interaction synchronization model of a time server and a sensor based on a bidirectional time synchronization mechanism of a sender-receiver, designs the C-ATS algorithm based on ATS improved weight, performs collaborative synchronization on the time server and an automatic driving vehicle sensor clock, and overcomes the influence of asymmetric random communication time delay on time synchronization precision. And the time synchronization convergence characteristic of the C-ATS algorithm is mathematically deduced when the asymmetric random communication time delay exists, and meanwhile, the simulation verification proves that the C-ATS algorithm can realize higher time synchronization precision. The sensor on the automatic driving vehicle is an intelligent sensor, and is provided with the functions of collecting data, processing the data, realizing data exchange with the outside, and changing the work of the sensor through software control according to actual needs, so that the intelligent and networking functions are realized.
1. And (3) establishing a model:
There is a time server and a plurality of sensors on an autonomous vehicle, wherein the time server is capable of providing a time synchronized reference time for the sensors and the time server to time synchronize. Meanwhile, the time server and the sensor periodically send messages to complete interaction in a UDP broadcast mode, wherein the messages contain local time of the sending node. As shown in fig. 1, the network topology between a time server and a sensor is described by g= (V, E), where v= { c i|i≤n-1,n∈N+ } represents all sensors within the time server coverage area and the edge set e= { (i, j) |i+.ltoreq.n, j+.ltoreq.n + } represents the communication between nodes in the network.
Using a typical linear clock model (equation (1)), defining t as the real time, taking sensor c i as an example, its local clock reading τ i can be expressed as:
ηi=αit+βi (1);
Where α i is the local clock drift and β i is the local clock bias. Since the time synchronization of the sensors on the autonomous vehicle only needs to achieve relative synchronization, but does not require absolute synchronization, the local time of the time server can be considered as absolute time, and the relationship between the clock reading of the time server and the real time is τ j =t.
The time model of the time server and sensor is shown in fig. 2, where β represents the relative clock offset of the sensor and α represents the relative clock frequency drift of the two nodes. Clock synchronization is the estimation of alpha and beta so that the sensor and the clock of the time server remain identical. If the clocks of the two nodes are identical, β=0, α=1. Since clock skew and drift are an objective condition that exists in practical situations, it is generally necessary to clock the sensor periodically to ensure time consistency with the time server.
The two-way time synchronization mechanism of the time server and the sensor based on the sender-receiver is shown in fig. 3, where the line c i is the clock of the sensor, the clock of the time server OIs a ray starting from the origin and the slope of the line is 1. Assuming that the clock update rate of the sensor is α i, and that the sensor has an initial deviation of β i from the clock of the time server at the initial time, the real clock of each turn is denoted by t k, and k is the turn of the interaction between the sensor and the time server, the clock of the sensor at each turn can be expressed as: While the clock of the time server may represent the real clock, i.e. the update per round is 1 second, i.e. it may be expressed as It is assumed that the sensor broadcasts a data packet about its own local time in the kth round of interaction, and the sensor transmits the data packet at the time ofFor reasons of random network delay, it is assumed that the time server receives the data packet isThe time server receives the data packet and then sends the local time to itselfThe time when the sensor receives the data packet sent by the time server is transferred to the sensor, also due to random network delayThereby completing a complete interaction process.
Each sensor periodically broadcasts messages to interact with the time server, and estimates and adjusts own local time according to local time readings received by other nodes. For sensor c i, there is formula (2):
Wherein the method comprises the steps of For the logical clock reading of sensor c i in the k-th broadcast cycle (i.e. the final time after synchronization),For the correction factor of the drift rate of the sensor c i to its own local clock during the kth round of broadcast,And the correction coefficient of the offset value of the sensor c i to the local clock in the k-th round of broadcasting period.
For any ε >0, the sensor and time server nodes i, j can go through a finite number of interaction iterations (number of interaction iterations is less than or equal to a bounded value) When the following equation (3) is satisfied, it is considered that the time synchronization of the automatic driving vehicle sensor is completed:
2. C-ATS algorithm:
Considering that the ATS algorithm cannot achieve accurate time synchronization in the presence of asymmetric communication delays, a time synchronization algorithm suitable for an asymmetric communication network is provided herein. In performing time synchronization of the time server and the sensor, it is assumed that during the kth round of interaction, the time server node j receives a message from the sensor node c i. The time server first uses the time data information about the sensor node c i in the message to The form is stored in a cache, wherein: is the local time estimate when the kth round of time server node j receives the message from sensor node c i; Is the local time estimate for the kth round of sensor nodes c i when sending messages. After receiving the k+1 round of messages, the time server uses the new data received by the current k+1 round And replacing the data received in the kth interaction, and sequentially cycling. Sensor c i updates its own local time periodLocal time update period with time serverComparing with a filtered scale factorTo characterize the estimated ratio of the deviations between the local clocks of each other after each round, where ρ η represents the weight coefficient. Thereafter, sensor c i will filter the scale factor according to each round of broadcast periodThe magnitude of the value to clock the local logicIs adjusted by a correction factor including a drift rate correction factor of a local logic clockCorrection coefficient of deviation valueA specific synchronization algorithm is represented by ρ α being the drift weight coefficient for sensor c i to correct its own local time estimate, and ρ o being the drift weight coefficient for sensor c i to correct its own local time estimate.
As shown in fig. 10, the C-ATS time synchronization algorithm:
Step 1, a sensor c i broadcasts a data packet through UDP in the k-th round of interaction, i is less than or equal to N-1, N is epsilon N +, and the time for transmitting the data packet by the sensor c i is The time server receives the data packet is thatThe time server receives the data packet and then sends the local time to itselfThe data packet sent by the time server is received by the sensor c i by the time of the UDP broadcast and then transmitted to the sensor c i
Step 2, sensor c i is inTime of day reception time server is inBroadcast messages sent at the moment; extracting time stamp from broadcast message, recording local clock of current broadcast message sent by time serverAnd the time at which the sensor c i receives the data packet sent by the time server
In the step 3, k=1, the drift correction coefficient is presetOffset correction coefficientThe value of (2) versus timeCorrection is carried out to obtainThe correction formula is:
step 4, for any ε >0, if The time synchronization is completed, otherwise, the step 5 is executed;
Step 5, will Assignment to
Step 6, k=k+1; executing the step 1 and the step 2;
calculating a filter scale factor according to a C-ATS algorithm
Calculating drift correction coefficients by filtering scale factorsOffset correction coefficient
Step 7, correcting the coefficient by driftOffset correction coefficientLocal time to sensorCorrection is carried out to obtain
Step 8, for any ε >0, ifThe multi-sensor time synchronization is completed, otherwise, the step 5 is returned.
After time synchronization is completed, finally obtainedRecorded as a synchronized time estimate. Wherein, All are preset empirical values, in this embodiment,Taking out 1 of the mixture,Taking out 1 of the mixture,Taking 0.
3. Synchronization performance analysis of the C-ATS algorithm:
in order to prove that the C-ATS algorithm can inhibit the time error divergence caused by the asymmetrical network delay, the invention uses the logic clock deviation expression in the k-th round broadcasting period Convergence enables proof of accurate time synchronization of sensor c i. Will be described inDecomposition into the sum of two sub-terms, the expression is derived by proving that both sub-terms are bounded or convergent, respectivelyAnd (5) limited convergence. This example demonstrates thatIs convergent, i.e., it can be deduced that the sensor c i meets the convergence for its own local time estimate.
4. Simulation analysis:
In order to analyze and verify the influence of different time synchronization algorithms on the convergence and dispersion of time synchronization errors under the asymmetric link delay, matlab is utilized to carry out simulation verification on the time synchronization algorithm of the sensor. The setup model comprises a distributed network of time server nodes and sensor nodes. The nodes send time messages in data frames through UDP broadcasting with the period of 100 ms as a period. For any sensor node c i, its true transmit period can be expressed as Where T represents the time update period at absolute time.
The invention selects ATS algorithm, WMTS algorithm, LSTS algorithm and C-ATS algorithm, firstly, the synchronous performance of different time synchronous algorithms is simulated and compared, and the parameter setting is shown in table 1.
Table 1, time synchronization algorithm parameter table:
|
ATS |
WMTS |
LSTS |
C-ATS |
ρη |
0.5 |
1/(1+k) |
1/(1+…+k2) |
1/k |
ρα |
0.5 |
1 |
1/(1+k)0.6 |
1/k |
ρo |
0.5 |
1 |
0.4 |
0.5 |
In consideration of various factors such as the manufacturing process of the vehicle and environmental influence, the typical error of the sensor node clock oscillator is [10,100] ppm, namely clock offset generated in each million seconds, and the clock oscillators of the actual sensor nodes are usually different due to the manufacturing process, the initial value of the hardware clock offset of each node in simulation is randomly selected in a section [0.9999,1.0001], and the initial value of the phase offset is selected in a section [0,0.0002 ]. Therefore, the simulation part of the invention sets the clock drift slope alpha i =0.9999 of the sensor, the clock drift deviation o i =0.0002, and the simulation part selects the time interval in the (0,0.0005) interval and performs the test by following the random communication time delay of uniform distribution.
To measure the time synchronization effect of the time server and the sensor, a time deviation d k and a relative time deviation variance R k are defined for analysis. The meaning of each index is as follows:
Time offset d k: the magnitude of the logic time deviation after the adjustment between the sensor and the time server after any round of communication is used for measuring the effect of clock synchronization between the sensor and the time server, and the smaller d k is, the better the synchronization effect is represented. The formula is as follows: Representing time server logic time, and local clock In accordance with the method, the device and the system,Indicating the logic time after sensor adjustment.
The relative time bias variance R k: logic time after sensor adjustmentThe smaller the R k value, the smaller the change trend of the difference value between the absolute time t k and the R k value, the logic time obtained by the sensor adjustment is representedThe smaller the variation of the difference from the absolute time t k, the logic clock of the sensorThe more stable it tends to be, the more it tends to converge. The formula is as follows:
And performing 50s, namely 500 interactive simulation tests on the sensor and the time server by using ATS, WMTS, LSTS and a C-ATS algorithm respectively, wherein the simulation results are as follows:
It can be seen from fig. 4 and 5 that the time offset cannot converge in the presence of asymmetric time delays using ATS and WMTS algorithms. When the ATS algorithm is used, after interaction starts, the time deviation gradually increases along with the increase of the interaction times, and the time deviation is in a divergent state, wherein the maximum value of the time deviation is 55.57ms in 500 interactions; when using WMTS algorithm, the time offset is continuously oscillating in the (-0.6 ms-0.4 ms) range. As can be seen from fig. 6, the LSTS algorithm and the C-ATS algorithm can achieve time synchronization without divergence of time deviation in the case of asymmetric random communication time delay. Both LSTS algorithm and C-ATS algorithm quickly converge after the simulation begins. The LSTS algorithm achieves convergence after about 40 interactions, and the time bias stabilizes at 0.34ms. The time offset of the C-ATS algorithm is reduced rapidly in 20 interactions, there is a small amplitude of vibration in 100 interactions, but the maximum time offset remains within 0.20ms, and then the time offset converges to 0.19ms. Therefore, compared with the ATS algorithm and the WMTS algorithm, the C-ATS algorithm can achieve convergence of synchronous time deviation, and under the optimal condition in the simulation environment set in the process, compared with LSTS algorithm, the time synchronization accuracy is improved by 0.15ms, and the time deviation is reduced by 44.12%.
As can be seen from fig. 7, in the case of asymmetric random communication time delay, using ATS algorithm, the relative time deviation variance gradually increases in the form of oscillation divergence, and reaches a maximum value of 733.61ms 2 when the iteration is performed 460-470 times; as can be seen from fig. 8, in the case where there is an asymmetric random communication time delay, the relative time deviation variance is not diverged as in the case of using the ATS algorithm but oscillates in the range of (0 to 0.08ms 2) using the WMTS algorithm. As can be seen from fig. 9, the relative time bias variance is not divergent and converges to a certain value, respectively 0.034ms 2 and 0.0099ms 2, when using LSTS and C-ATS algorithms. Therefore, the time synchronization by using the C-ATS algorithm can be obtained to ensure that the logic clock of the sensor tends to be more stable, and compared with LSTS algorithm, the stability of the logic clock is improved by 70.88% under the optimal condition in the simulation environment set in the text.
The scope of the present invention includes, but is not limited to, the above embodiments, and any alterations, modifications, and improvements made by those skilled in the art are intended to fall within the scope of the invention.