Radar clock synchronization method, electronic device, electronic equipment and readable storage medium

By acquiring and smoothing the clock deviation between the lidar and the master clock source, and using an adaptive PID controller to adjust the clock cycle count value, the problems of low accuracy and clock drift in existing radar time synchronization schemes are solved, achieving high-precision clock synchronization and real-time data acquisition.

CN116990786BActive Publication Date: 2026-07-10BENEWAKE BEIJING TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BENEWAKE BEIJING TECH CO LTD
Filing Date
2023-09-06
Publication Date
2026-07-10

Smart Images

  • Figure CN116990786B_ABST
    Figure CN116990786B_ABST
Patent Text Reader

Abstract

The application provides a radar clock synchronization method, an electronic device, an electronic equipment and a readable storage medium, and relates to the technical field of laser radars. After an actual master-slave clock deviation of a laser radar relative to a master clock source at a current local time is obtained, the actual master-slave clock deviation is subjected to exponential smoothing filtering processing to obtain a target smoothed master-slave clock deviation, an adaptive PID controller is called based on actual PID parameters of the current local time, a target time synchronization control amount corresponding to the target smoothed master-slave clock deviation is calculated, and then the clock period count value of the local system clock signal of the laser radar is counted and adjusted according to the target time synchronization control amount to adjust the clock frequency of the laser radar, so that the laser radar can be synchronized with the master clock source, thereby effectively improving the radar time synchronization accuracy, meeting the real-time requirements of the radar, and improving the clock synchronization accuracy and the clock synchronization stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lidar technology, and more specifically, to a radar clock synchronization method, electronic device, electronic equipment, and readable storage medium. Background Technology

[0002] With the continuous development of science and technology, LiDAR technology is being used more and more widely in various industries. In practical applications, LiDAR often needs to be synchronized with a master clock source (e.g., the adaptive cruise control controller in an in-vehicle system) to ensure that the LiDAR's local clock can achieve clock synchronization with the master clock source.

[0003] Currently, existing radar time synchronization solutions directly utilize the GPTP (Generalized Precision Time Protocol) for message exchange to achieve time synchronization between the lidar and the master clock source. However, it is worth noting that this radar time synchronization solution is often prone to transient fluctuations in the communication network, resulting in low accuracy of the final time synchronization result, which cannot meet the real-time data acquisition requirements of lidar. Furthermore, this radar time synchronization solution typically cannot effectively address local clock drift issues caused by changes in lidar hardware and / or application environment, leading to decreased clock synchronization accuracy and an inability to achieve stable clock synchronization. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a radar clock synchronization method, electronic device, electronic device and readable storage medium, which can effectively improve the time synchronization accuracy between lidar and master clock source, meet the real-time data acquisition requirements of lidar, effectively improve the local clock drift problem of lidar, improve clock synchronization accuracy and clock synchronization stability, so that the vehicles, robots and other equipment where lidar is located can realize high-precision automation functions and improve the safety performance of equipment systems.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:

[0006] In a first aspect, this application provides a radar clock synchronization method, the method comprising:

[0007] Obtain the actual master-slave clock deviation of the lidar relative to the master clock source at the current local time;

[0008] The actual master-slave clock skew is subjected to exponential smoothing filtering to obtain the target smoothed master-slave clock skew.

[0009] The adaptive PID controller is invoked to calculate the target time synchronization control quantity corresponding to the target smoothing master-slave clock deviation based on the actual PID parameters at the current local time; wherein, the target time synchronization control quantity is the time control quantity required to eliminate the target smoothing master-slave clock deviation;

[0010] The clock cycle count value of the local system clock signal of the lidar is adjusted according to the target time control quantity to synchronize the lidar with the master clock source; wherein, the local system clock signal is the reference clock signal for the lidar to emit laser beams, and the clock cycle count value is used to represent the local time when the system clock cycle of the local system clock signal has been counted at the lidar.

[0011] Therefore, this application eliminates the need to adjust the system clock cycle duration of the local system clock signal of the LiDAR. Instead, the clock frequency of the LiDAR can be adjusted directly by adjusting the clock cycle count value of the local system clock signal. This improves the local clock drift problem of the LiDAR, enabling the LiDAR to achieve clock synchronization with the master clock source. Through the synergistic effect of exponential smoothing filtering, adaptive PID control, and clock cycle count adjustment, the time synchronization accuracy between the LiDAR and the master clock source is improved, meeting the real-time data acquisition requirements of the LiDAR. At the same time, it improves the local clock drift problem of the LiDAR, enhances clock synchronization accuracy and stability, and facilitates high-precision automation functions in vehicles, robots, and other equipment where the LiDAR is located, thereby improving the safety performance of the equipment system.

[0012] In an optional implementation, the step of adjusting the clock cycle count value of the local system clock signal of the lidar according to the target time control quantity includes:

[0013] Determine the number of frequency modulation intervals corresponding to the target time synchronization control quantity, and determine the target clock period corresponding to the current local time at the local system clock signal;

[0014] Using the target clock cycle as the frequency modulation start point, and taking the number of system clock cycles of the frequency modulation interval as the frequency modulation cycle interval, multiple clock cycles to be frequency-modulated are determined at the local system clock signal.

[0015] For each clock cycle to be regulated, the actual count increment of the clock cycle count value at the clock cycle to be regulated is adjusted according to the target time synchronization control value.

[0016] Therefore, this application can smoothly adjust the local clock frequency of the lidar by adjusting the clock cycle count value corresponding to the above-described embodiments, so as to meet the real-time data acquisition requirements of the lidar and improve the local clock drift problem of the lidar.

[0017] In an optional implementation, the step of determining the number of frequency modulation intervals corresponding to the target time control quantity includes:

[0018] Calculate the target frequency value corresponding to the absolute value of the target time control quantity;

[0019] Based on the time unit of the target time control quantity, the time unit of the local system clock signal, and the target frequency value, determine the number of frequency modulation intervals that are compatible with the local system clock signal.

[0020] Therefore, this application can effectively determine the smoothness of the adjustment of the target time synchronization control quantity during the local clock frequency adjustment process through the above-described embodiments.

[0021] In an optional implementation, the step of adjusting the actual count increment of the clock cycle count value at the clock cycle to be frequency-tuned according to the target time control quantity includes:

[0022] If the target time synchronization control value is positive, the actual count increment of the clock cycle count value at the clock cycle to be regulated is increased from the original count increment to the desired count increment, wherein the desired count increment is a non-positive integer multiple of the original count increment, and the original count increment is the cycle count increment used by the clock cycle count value at each system clock cycle other than the clock cycle to be regulated.

[0023] If the target time control value is negative, the actual count increment of the clock cycle count value at the clock cycle to be regulated will be reduced from the original count increment to zero.

[0024] Therefore, this application can improve the local clock drift problem of the lidar by cleverly changing the local clock frequency of the lidar by adjusting the clock cycle count value while ensuring the real-time data acquisition of the lidar through the above-described embodiments.

[0025] In an optional implementation, the method further includes:

[0026] Send a synchronization request message to the master clock source, wherein the synchronization request message is used to request clock synchronization from the master clock source;

[0027] The step of obtaining the actual master-slave clock deviation of the lidar relative to the master clock source at the current local time includes:

[0028] Obtain the message sending timestamp of the master clock source sending the master clock synchronization message, and the current local time when the lidar receives the master clock synchronization message;

[0029] The actual master-slave clock offset is calculated based on the message sending timestamp, the current local time, and the link transmission time between the lidar and the master clock source.

[0030] Therefore, this application can effectively determine the master-slave clock deviation of the lidar relative to the master clock source when clock synchronization is required through the above-described embodiments.

[0031] In an optional implementation, the step of performing exponential smoothing filtering on the actual master-slave clock skew to obtain the target smoothed master-slave clock skew includes:

[0032] Obtain the historical smoothed master-slave clock offset of the lidar at the time when it most recently received the master clock synchronization message before the current local time;

[0033] The pre-stored exponential smoothing coefficient is used as the first weight value of the actual master-slave clock deviation, and the second weight value of the historical smoothed master-slave clock deviation is calculated, wherein the sum of the first weight value and the second weight value is 1;

[0034] Based on the first weight value and the second weight value, a weighted summation operation is performed on the actual master-slave clock deviation and the historical smoothed master-slave clock deviation to obtain the target smoothed master-slave clock deviation of the lidar at the current local time.

[0035] Therefore, this application can effectively filter out the master-slave clock deviation step value caused by network transient fluctuations through the above-described implementation method, so that the target smooth master-slave clock deviation can effectively improve the timing accuracy and timing stability of subsequent radar clock synchronization operations.

[0036] In an optional implementation, the method further includes:

[0037] The actual PID parameters are updated based on the target smoothed master-slave clock deviation at the current local time, the target time synchronization control quantity, the historical smoothed master-slave clock deviation and historical time synchronization control quantity before the current local time.

[0038] Therefore, this application can ensure that the specific PID parameters of the adaptive PID controller can adapt to the real-time network environment through the above-described embodiments, and effectively characterize the dynamic characteristics of radar time synchronization error in the real-time network environment, thereby maximizing the accuracy and stability of radar clock synchronization operation.

[0039] In an optional implementation, the step of updating the actual PID parameters based on the target smoothed master-slave clock skew at the current local time, the target time synchronization control quantity, and the historical smoothed master-slave clock skew and historical time synchronization control quantity prior to the current local time includes:

[0040] Detect whether the adaptive PID controller meets the PID parameter update conditions at the current local time;

[0041] When it is detected that the adaptive PID controller meets the PID parameter update condition at the current local time, the target smooth master-slave clock deviation and target time synchronization control quantity at the current local time, as well as the historical smooth master-slave clock deviation and historical time synchronization control quantity before the current local time, are substituted into the second-order dynamic error model of the adaptive PID controller.

[0042] Based on the dynamic characteristic correlation between the PID parameters and the second-order dynamic error model, the second-order dynamic error model is solved to obtain the expected PID parameters of the adaptive PID controller.

[0043] The adaptive PID controller updates the actual PID parameters at the current local time according to the desired PID parameters.

[0044] Therefore, through the above-described embodiments, this application can effectively ensure that the specific PID parameters of the adaptive PID controller are adaptively and in real-time adapted to the actual network environment where the lidar is located, and effectively characterize the dynamic characteristics of the lidar's time synchronization error in the real-time network environment, so as to maximize the accuracy and stability of the lidar clock synchronization operation.

[0045] Secondly, this application provides an electronic device, the device comprising:

[0046] The first processing module is used to obtain the actual master-slave clock deviation of the electronic device relative to the master clock source at the current local time.

[0047] The first processing module is further configured to perform exponential smoothing filtering on the actual master-slave clock deviation to obtain the target smoothed master-slave clock deviation;

[0048] The second processing module is used to call the adaptive PID controller to calculate the target time synchronization control quantity corresponding to the target smoothing master-slave clock deviation based on the actual PID parameters at the current local time; wherein, the target time synchronization control quantity is the time control quantity required to eliminate the target smoothing master-slave clock deviation;

[0049] The second processing module is further configured to adjust the clock cycle count value of the local system clock signal of the electronic device according to the target time control quantity, so that the electronic device can achieve clock synchronization with the master clock source; wherein, the local system clock signal is a reference clock signal for emitting laser beams, and the clock cycle count value is used to represent the local time when the system clock cycle of the local system clock signal has been counted at the electronic device.

[0050] In an optional embodiment, the apparatus further includes:

[0051] The third processing module is used to send a synchronization request message to the master clock source, wherein the synchronization request message is used to request clock synchronization from the master clock source.

[0052] In an optional embodiment, the apparatus further includes:

[0053] The fourth processing module is used to update the actual PID parameters based on the target smoothed master-slave clock deviation at the current local time, the target time synchronization control quantity, the historical smoothed master-slave clock deviation and historical time synchronization control quantity before the current local time.

[0054] It is understood that the electronic device provided in the second aspect can execute the radar clock synchronization method described in any of the embodiments covered by the first aspect. Optionally, the aforementioned first processing module and second processing module can be divided into more modules, or they can be integrated into one module. This application does not specifically limit the specific implementation of the first processing module and the second processing module.

[0055] Optionally, the apparatus provided in the second aspect may further include a storage module and / or a communication module, the storage module storing a computer program. When the first processing module, second processing module, third processing module, and / or fourth processing module can run the computer program stored in the storage module, the radar clock synchronization method described in any of the foregoing embodiments is executed. The communication module is used to implement data communication functions, and the third processing module included in the electronic device can communicate with the master clock source through the communication module. For example, the third processing module sends a synchronization request message to the master clock source through the communication module, enabling the electronic device to receive master clock synchronization messages from the master clock source.

[0056] It is also understood that the electronic device provided in the second aspect can be a control system or control component, such as the control system or control component integrated on the lidar, or the lidar itself, or a chip system or other component or assembly that can be set in the control system or control component or lidar, and this application does not limit it in this regard.

[0057] Furthermore, the technical effects of the electronic device provided in the second aspect can be referred to in the detailed description of the technical effects of the relevant embodiments in the first aspect above, and will not be repeated here.

[0058] Thirdly, this application provides an electronic device, including the electronic device described in any of the embodiments of the second aspect above. Exemplarily, the electronic device provided in the third aspect may be a lidar device, a smartphone, a vehicle, a robot, a drone, a smart home device, a smart transportation device, a smart manufacturing device, or a surveying device, etc.

[0059] Fourthly, this application provides an electronic device comprising: a processor and a memory, the memory being used to store at least one computer program; when the at least one computer program is executed by the processor, it implements the radar clock synchronization method described in any of the embodiments of the first aspect.

[0060] For example, the electronic device provided in the fourth aspect may be a lidar, a lidar central control system, a smartphone, a vehicle, a robot, a drone, a smart home device, a smart transportation device, a smart manufacturing device, or a surveying device, etc.

[0061] Fifthly, this application provides a readable storage medium having a computer program stored thereon, which, when run by (e.g., a computer device, lidar, or processor), implements the radar clock synchronization method described in any of the embodiments of the first aspect.

[0062] In a sixth aspect, this application provides a computer program product comprising: a computer program (also referred to as code or instructions) that, when run by (e.g., a computer device, a lidar, or a processor), implements the radar clock synchronization method described in any of the embodiments of the first aspect.

[0063] In a seventh aspect, embodiments of this application provide a chip system comprising: a processor and a memory, the memory being used to store at least one computer program; when the at least one computer program is executed by the processor, it implements the radar clock synchronization method described in any of the embodiments of the first aspect.

[0064] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0065] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0066] Figure 1 A schematic diagram illustrating the composition of a lidar system provided in an embodiment of this application;

[0067] Figure 2 One of the flowcharts of the radar clock synchronization method provided in the embodiments of this application;

[0068] Figure 3 for Figure 2 A flowchart illustrating the sub-steps included in step S250;

[0069] Figure 4 A second schematic flowchart illustrating the radar clock synchronization method provided in this application embodiment;

[0070] Figure 5 for Figure 4 A flowchart illustrating the sub-steps included in step S260;

[0071] Figure 6 One of the schematic diagrams of the electronic device provided in the embodiments of this application;

[0072] Figure 7 A second schematic diagram illustrating the composition of the electronic device provided in the embodiments of this application;

[0073] Figure 8 This is a schematic diagram illustrating the composition of an electronic device provided in an embodiment of this application.

[0074] Icons: 10-LiDAR; 11-Main control unit; 12-Communication unit; 13-Radar scanning component; 14-Laser emitter; 100-Electronic device; 110-First processing module; 120-Second processing module; 130-Third processing module; 140-Fourth processing module; 200-Electronic device; 210-Memory; 220-Processor. Detailed Implementation

[0075] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0076] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0077] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0078] In the description of this application, it should be understood that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Those skilled in the art will understand the specific meaning of the above terms in this application based on the specific circumstances.

[0079] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0080] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0081] Please refer to Figure 1 , Figure 1This is a schematic diagram illustrating the composition of the lidar 10 provided in this application embodiment. In this application embodiment, the lidar 10 can be installed on devices such as vehicles, drones, roadside traffic equipment, smartphones, smart home devices, smart manufacturing equipment, or robots. For example, the lidar 10 can be installed on a vehicle to perform radar detection during the vehicle's driving / parking process, thereby assisting the vehicle in achieving functions such as unmanned driving, autonomous driving, assisted driving, and intelligent parking.

[0082] It is understood that the above application scenarios are merely illustrative examples, and the lidar 10 provided in this application can also be applied to various other application scenarios, and is not limited to the application scenarios exemplified above.

[0083] In this embodiment of the application, the aforementioned lidar 10 may include a main control unit 11, a communication unit 12, a radar scanning component 13, and a laser emitter 14; the aforementioned main control unit 11 may be, but is not limited to, at least one of a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0084] In this embodiment, the main control unit 11 is electrically connected to the laser emitter 14 and is used to drive the laser emitter 14 to emit a laser beam to the radar scanning component 13, and the radar scanning component 13 projects the received laser beam onto the object to be scanned to perform laser dot scanning.

[0085] In this embodiment, the main control unit 11 is also electrically connected to the radar scanning component 13, and is used to control the radar scanning component 13 to adjust its outward projection direction for the received laser beam. The radar scanning component 13 may include a horizontal scanning component and a vertical scanning component. The horizontal scanning component is used to implement the line scanning function of the lidar 10 in the horizontal direction, and the vertical scanning component is used to implement the frame scanning function of the lidar 10 in the vertical direction.

[0086] In this embodiment, the main control unit 11 is electrically connected to the communication unit 12 for data interaction with external electronic devices via the communication unit 12. For example, the main control unit 11 can obtain the master clock timestamp from the master clock source through the communication unit 12, so that the main control unit 11 can achieve clock synchronization between the lidar 10 and the master clock source. The master clock source is the clock source of another electronic device besides the lidar 10, which can serve as a clock reference for the lidar 10 to adjust its clock. This other electronic device can be any of the following: a vehicle, a drone, roadside traffic equipment, a smartphone, a smart home device, a smart manufacturing device, or a robot. It can also be a control system component of the aforementioned devices (e.g., the adaptive cruise controller included in a vehicle's in-vehicle system), which is not limited in this application.

[0087] In this embodiment, the main control unit 11 can cooperate to run software function modules and computer programs related to the radar clock synchronization scheme provided in this embodiment to improve the time synchronization accuracy between the lidar 10 and the main clock source, meet the real-time data acquisition requirements of the lidar 10, and effectively improve the local clock drift problem of the lidar 10, improve the clock synchronization accuracy and clock synchronization stability, so that the vehicle, robot and other equipment where the lidar 10 is located can realize high-precision automation functions and improve the safety performance of the equipment system.

[0088] Understandable, Figure 1 The block diagram shown is only a schematic diagram of one configuration of the lidar 10. The lidar 10 may also include components such as... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.

[0089] In this application, to ensure that the lidar 10 has excellent time synchronization accuracy, clock synchronization precision, and clock synchronization stability during clock synchronization with the master clock source, to improve the local clock drift problem of the lidar 10, and to ensure that the final time synchronization result meets the real-time data acquisition requirements of the lidar 10, this application embodiment achieves the aforementioned objective by providing a radar clock synchronization method applicable to the lidar 10. The radar clock synchronization method provided in this application is described in detail below.

[0090] Please refer to Figure 2 , Figure 2This is one of the flowcharts illustrating the radar clock synchronization method provided in this application embodiment. In this application embodiment, the radar clock synchronization method may include steps S210 to S250. The radar clock synchronization method can be executed by a control device that controls the operation of the lidar 10. This control device can be integrated with the lidar 10, enabling it to act as a control component of the lidar 10 (e.g., ...). Figure 1 The main control unit 11 of the lidar 10 shown is also mentioned; the radar clock synchronization method can also be directly executed by the lidar 10. This application does not specifically limit the actual execution carrier of the radar clock synchronization method.

[0091] Step S210: Send a synchronization request message to the master clock source, wherein the synchronization request message is used to request clock synchronization from the master clock source.

[0092] In this embodiment, once the master clock source for the lidar 10 to be synchronized is determined, a synchronization request message can be sent from the main control unit 11 to the master clock source via the communication unit 12. This synchronization request message requests the master clock source to synchronize with the lidar 10. In one implementation of this embodiment, the synchronization request message can be a GPTP synchronization request message that conforms to the GPTP protocol.

[0093] Upon receiving a synchronization request message from the lidar 10, the master clock source responds by generating master clock synchronization messages (e.g., Sync (Synchronization) messages) at preset time intervals and sending these messages to the lidar 10. This allows the lidar 10 to achieve radar clock synchronization based on the message sending timestamps recorded in the received master clock synchronization messages. Each master clock synchronization message records a message sending timestamp and a clock identifier. The message sending timestamp represents the master clock timestamp at which the corresponding master clock synchronization message was sent from the aforementioned master clock source, and the clock identifier represents the identity of the sender of the corresponding master clock synchronization message (i.e., the aforementioned master clock source).

[0094] Therefore, in essence, step S210 is an optional step in the process. After the actual execution carrier of the radar clock synchronization method has executed step S210 once, it does not need to execute step S210 again in subsequent radar clock synchronization processes. It can directly execute steps S220 to S250 to achieve the technical effect of "ensuring that the lidar 10 has excellent time synchronization accuracy, clock synchronization precision and clock synchronization stability during the clock synchronization with the master clock source, improving the local clock drift problem of the lidar 10, and ensuring that the final time synchronization result can meet the real-time data acquisition requirements of the lidar 10".

[0095] Step S220: Obtain the actual master-slave clock deviation of the lidar relative to the master clock source at the current local time.

[0096] In this embodiment, after the main control unit 11 in the lidar 10 sends a synchronization request message through the communication unit 12, it receives a master clock synchronization message from the master clock source through the communication unit 12. When a master clock synchronization message is received at a certain local time (i.e., local timestamp), the local time is used as the message reception timestamp of the lidar 10 for the master clock synchronization message. The message sending timestamp recorded in the master clock synchronization message is obtained by parsing the received master clock synchronization message.

[0097] Therefore, by obtaining the message sending timestamp of the master clock source sending the master clock synchronization message, and the current local time of the lidar 10 when receiving the master clock synchronization message (i.e., the local time of the lidar 10 when receiving the master clock synchronization message), and by performing data processing on the message sending timestamp and the current local time, the master-slave clock deviation reflected by the master clock synchronization message between the lidar 10 and the master clock source can be obtained.

[0098] Optionally, if the lidar 10 receives a master clock synchronization message from the master clock source at the current local time, the step of obtaining the actual master-slave clock deviation of the lidar 10 relative to the master clock source at the current local time may include sub-steps a and b:

[0099] Sub-step a: Obtain the message sending timestamp of the master clock source sending the master clock synchronization message, and the current local time when the lidar receives the master clock synchronization message.

[0100] Sub-step b: Calculate the actual master-slave clock offset based on the message sending timestamp, the current local time, and the link transmission time between the lidar and the master clock source.

[0101] The link transmission time is used to represent the time required for the information transmission link between the lidar 10 and the master clock source to perform a complete message transmission operation. The actual master-slave clock deviation can be calculated using the formula "e'(k)=t_d(k)-t(k)-t0", where "e'(k)" represents the actual master-slave clock deviation corresponding to the master clock synchronization message, "t_d(k)" represents the message sending timestamp recorded in the master clock synchronization message, "t(k)" represents the current local time, and "t0" represents the link transmission time.

[0102] Therefore, by executing the specific steps of step S220 above, this application can effectively determine the master-slave clock deviation of the lidar 10 relative to the master clock source when clock synchronization is required.

[0103] It is understood that the aforementioned communication unit 12 can be implemented using a PHY module that supports GPTP functionality, to ensure that the communication unit 12 can obtain / set the message timestamp through register read / write operations of the PHY module. In one embodiment of this invention, the aforementioned communication unit 12 can be directly implemented using a Marvell Q8812 PHY module.

[0104] Step S230: Perform exponential smoothing filtering on the actual master-slave clock offset to obtain the target smoothed master-slave clock offset.

[0105] In this embodiment, after obtaining the actual master-slave clock deviation of the lidar 10 at the current local time, the actual master-slave clock deviation at the current local time can be subjected to exponential smoothing filtering in combination with the historical smoothed master-slave clock deviation obtained before the current local time through exponential smoothing filtering. This filters out the step value of the master-slave clock deviation caused by network transient fluctuations, ensuring that the target smoothed master-slave clock deviation at the current local time can effectively improve the timing accuracy and timing stability of subsequent radar timing operations.

[0106] In this case, the step of performing exponential smoothing filtering on the actual master-slave clock skew to obtain the target smoothed master-slave clock skew may include sub-steps c-e:

[0107] Sub-step c: Obtain the historical smoothed master-slave clock deviation of the lidar 10 when it most recently received the master clock synchronization message before the current local time.

[0108] Sub-step d: Use the pre-stored exponential smoothing coefficient as the first weight value of the actual master-slave clock deviation, and calculate the second weight value of the historical smoothed master-slave clock deviation, wherein the sum of the first weight value and the second weight value is 1.

[0109] Sub-step e: Based on the first weight value and the second weight value, perform a weighted summation operation on the actual master-slave clock deviation and the historical smoothed master-slave clock deviation to obtain the target smoothed master-slave clock deviation of the lidar 10 at the current local time.

[0110] If the lidar 10 receives the master clock synchronization message from the master clock source for the first time at the current local time, the historical smooth master-slave clock deviation of the lidar 10 at the time when it last received the master clock synchronization message before the current local time can be directly represented by the default master-slave clock deviation value, or it can be directly represented by the actual master-slave clock deviation corresponding to the current local time. In this case, the specific historical smooth master-slave clock deviation can be configured differently according to the time synchronization accuracy requirements.

[0111] Meanwhile, the larger the value of the exponential smoothing coefficient, the stronger the noise suppression capability of the corresponding exponential smoothing filter operation, but the slower the response to signal changes. Therefore, the value range of the exponential smoothing coefficient is 0 to 1, and it is usually set to 0.1 to 0.5. The closer the exponential smoothing coefficient is to 1, the weaker the smoothing effect of the corresponding exponential smoothing filter operation. The specific value of the exponential smoothing coefficient can be configured differently according to the time synchronization accuracy requirements.

[0112] Understandably, if the network environment of the device where the lidar 10 is located fluctuates significantly, a smaller exponential smoothing coefficient should be selected to ensure that the exponential smoothing filter can effectively filter out the master-slave clock deviation step value caused by network transient fluctuations, so as to improve the timing accuracy and timing stability of subsequent radar clock synchronization operations.

[0113] Therefore, by executing the specific steps of step S230 above, this application can effectively filter out the master-slave clock deviation step value caused by network transient fluctuations through exponential smoothing filtering operation, so that the target smooth master-slave clock deviation can effectively improve the timing accuracy and timing stability of subsequent radar clock synchronization operations.

[0114] Step S240: The adaptive PID controller is invoked to calculate the target time synchronization control quantity corresponding to the target smooth master-slave clock deviation based on the actual PID parameters at the current local time.

[0115] In this embodiment, the adaptive PID controller is a controller model built based on the adaptive PID (Proportion-Integral-Differential) control algorithm. The adaptive PID controller can be directly loaded into the lidar 10 or directly loaded into the control device that executes the lidar clock synchronization method. This application does not limit the actual loading method of the adaptive PID controller.

[0116] The adaptive PID controller is used to achieve clock synchronization between the lidar 10 and the master clock source. Based on its PID parameters, the adaptive PID controller can adaptively adjust according to feedback information, ensuring that its specific PID parameters effectively characterize the dynamic characteristics of time adjustment errors during radar clock synchronization. This ensures that the final radar clock synchronization result has sufficiently high time accuracy and clock synchronization stability.

[0117] Meanwhile, the target time control quantity is the time control quantity required to eliminate the target smooth master-slave clock deviation. The target time control quantity can be used to represent the smoothness of the clock frequency adjustment and the direction of the clock frequency adjustment for the lidar 10 at the current local time (e.g., increasing the clock frequency or decreasing the clock frequency).

[0118] After obtaining the target smoothed master-slave clock deviation at the current local time, the target smoothed master-slave clock deviation at the current local time, the historical smoothed master-slave clock deviations corresponding to each master clock synchronization message received before the current local time, and the actual PID parameters (including actual P parameters, actual I parameters, and actual D parameters) of the adaptive PID controller at the current local time can be substituted into the control law equation of the adaptive PID controller. The control law equation after parameter substitution can then be solved to obtain the target time synchronization control quantity of the lidar 10 at the current local time corresponding to the target smoothed master-slave clock deviation. The control law equation of the aforementioned adaptive PID controller can be expressed as follows:

[0119]

[0120] Where u(k) represents the target time-to-time control quantity of the aforementioned adaptive PID controller at the current local time, and K P K is used to represent the actual P parameters of the aforementioned adaptive PID controller at the current local time. I K is used to represent the actual I-parameter of the aforementioned adaptive PID controller at the current local time. DThe parameters are used to represent the actual D parameters of the aforementioned adaptive PID controller at the current local time, e(k) represents the target smooth master-slave clock deviation when the lidar 10 receives the master clock synchronization message at the current local time (i.e., the actual local time when the lidar 10 performs the kth radar clock synchronization operation), e(i) represents the actual smooth master-slave clock deviation of the master control unit 11 when performing the i-th radar clock synchronization operation (including the historical smooth master-slave clock deviations corresponding to each master clock synchronization message received before the current local time), and t represents time.

[0121] Step S250: Adjust the clock cycle count of the local system clock signal of the lidar according to the target time control quantity, so that the lidar can synchronize with the master clock source.

[0122] In this embodiment, because the laser beam emission operation of the lidar 10 is highly dependent on a high-precision clock signal, the local system clock signal of the lidar 10 is usually used as the reference clock signal for the lidar 10 to emit the laser beam (for example, the lidar 10 controls the laser emitter 14 to emit the laser beam). If the clock synchronization effect between the lidar 10 and the master clock source is achieved by modifying the system clock period of the local system clock signal, it will inevitably have a serious impact on the laser beam emission interval and the radar point cloud data acquisition, and thus clearly cannot meet the real-time data acquisition requirements of the lidar 10.

[0123] Therefore, after obtaining the target time synchronization control quantity corresponding to the current local time by calling the adaptive PID controller, the clock frequency of the LiDAR 10 can be adjusted by smoothly counting the clock cycle count value of the local system clock signal according to the target time synchronization control quantity. This adjusts the clock frequency to effectively overcome the master-slave clock deviation between the LiDAR 10 and the master clock source, ensuring clock synchronization between the LiDAR 10 and the master clock source, and improving the local clock drift problem of the LiDAR 10 (i.e., ensuring clock alignment between the local clock of the LiDAR 10 and the master clock source). Simultaneously, it effectively avoids the problem of poor real-time performance of radar data acquisition caused by modifying the system clock cycle duration of the local system clock signal, thus effectively meeting the real-time data acquisition requirements of the LiDAR 10 and effectively improving the time synchronization accuracy, clock synchronization precision, and clock synchronization stability between the LiDAR 10 and the master clock source. The clock cycle count value represents the local time at the LiDAR 10 when the system clock cycle of the local system clock signal has been counted.

[0124] In addition, after adjusting the local clock frequency of the lidar 10, the adjusted local clock frequency and clock cycle count value will be synchronized to the communication unit 12 of the lidar 10 to ensure that the main control unit 11 and the communication unit 12 of the lidar 10 have the same local clock characteristics, which facilitates the subsequent execution of the lidar clock synchronization operation.

[0125] Therefore, by executing steps S210 to S250 or steps S220 to S250, this application utilizes the synergistic effect between exponential smoothing filtering, adaptive PID control, and clock cycle count adjustment to improve the time synchronization accuracy between the lidar 10 and the master clock source, meet the real-time data acquisition requirements of the lidar 10, improve the local clock drift problem of the lidar 10, and enhance clock synchronization accuracy and stability. This enables vehicles, robots, and other equipment equipped with the lidar 10 to achieve high-precision automation functions and improve the safety performance of the equipment system.

[0126] Alternatively, please refer to Figure 3 , Figure 3 yes Figure 2 The flowchart of step S250 is shown below. In this embodiment, step S250 may include steps S251 to S253, which use a clock cycle count adjustment method to smoothly adjust the local clock frequency of the lidar 10 to meet the real-time data acquisition requirements of the lidar 10 and improve the local clock drift problem of the lidar 10. At the same time, it effectively avoids the problem of poor real-time radar data acquisition caused by modifying the system clock cycle duration of the local system clock signal.

[0127] Sub-step S251: Determine the number of frequency modulation intervals corresponding to the target time control quantity, and determine the target clock cycle corresponding to the current local time at the local system clock signal.

[0128] In this embodiment, the number of frequency modulation interval cycles is used to represent the smoothness of the adjustment process when the target time synchronization control quantity acts on the local clock frequency adjustment process of the lidar 10. The larger the value of the number of frequency modulation interval cycles, the smoother the corresponding local clock frequency adjustment operation. The step of the main control unit 11 determining the number of frequency modulation interval cycles corresponding to the target time synchronization control quantity may include sub-steps f and g:

[0129] Sub-step f: Calculate the target frequency value corresponding to the absolute value of the target time control quantity.

[0130] The target frequency value can be calculated using the following formula:

[0131]

[0132] Where u(k) represents the target time synchronization control quantity of the lidar 10 at the current local time, and f represents the target frequency value corresponding to the target time synchronization control quantity.

[0133] Sub-step g: Based on the time unit of the target time control quantity, the time unit of the local system clock signal, and the target frequency value, determine the number of frequency modulation intervals that are compatible with the local system clock signal.

[0134] Specifically, the target frequency value can be converted based on the conversion relationship between the time unit of the target time control quantity and the time unit of the local system clock signal, and then the converted target frequency value can be rounded to obtain the number of frequency modulation intervals.

[0135] In one embodiment of this example, if the time unit of the target time synchronization control quantity is seconds, and the time unit of the local system clock signal is nanoseconds, then the conversion relationship between the time unit of the target time synchronization control quantity and the time unit of the local system clock signal is 1 second = 10^9 nanoseconds. The target frequency value after this conversion can then be calculated using the following formula:

[0136] f' = 10 9 *f;

[0137] Where f' represents the target frequency value after conversion, and f represents the target frequency value corresponding to the target time synchronization control quantity.

[0138] It is understood that the rounding operation performed on the target frequency value after conversion can be either rounding down or rounding up, and the specific rounding method can be configured differently according to the clock synchronization accuracy requirements.

[0139] Therefore, this application can determine the smoothness of the adjustment process when the target time control quantity is applied to the local clock frequency adjustment process by executing the specific steps of the above sub-step S251.

[0140] Sub-step S252: Using the target clock cycle as the frequency modulation starting point and the number of system clock cycles as the frequency modulation interval, determine multiple clock cycles to be frequency-modulated at the local system clock signal.

[0141] In this embodiment, the target clock period is the system clock period directly corresponding to the current local time in the local system clock signal. The first clock period to be frequency-adjusted determined in the local system clock signal is spaced from the target clock period by the number of frequency adjustment interval periods, and the adjacent two clock periods to be frequency-adjusted determined in the local system clock signal are spaced by the number of frequency adjustment interval periods. Each clock period to be frequency-adjusted represents the actual count increment at the clock cycle counter that needs to be adjusted for the corresponding system clock period. The smaller the number of frequency adjustment interval periods, the more clock periods to be frequency-adjusted after the target clock period, and the less smooth the corresponding local clock frequency adjustment operation.

[0142] Taking the target clock period at the local system clock signal at the current local time as the i-th system clock period of the local system clock signal, and the number of frequency modulation interval periods as n, the first frequency-modulated clock period after the target clock period in the local system clock signal is the (i+n)-th system clock period. The frequency-modulated clock periods after the first frequency-modulated clock period are the (i+2*n), (i+3*n), ..., (i+m*n)-th system clock periods, respectively, where m is the total number of frequency-modulated clock periods corresponding to the radar clock synchronization operation at the current local time.

[0143] Sub-step S253: For each clock cycle to be regulated, adjust the actual count increment of the clock cycle count value at the clock cycle to be regulated according to the target time synchronization control value.

[0144] For example, for each clock cycle to be regulated, the actual count increment of the clock cycle count value at the clock cycle to be regulated can be adjusted according to the positive or negative attribute of the target time synchronization control quantity.

[0145] In this embodiment, the positive or negative attribute of the target time synchronization control quantity can be used to indicate the direction of clock frequency adjustment during the process of the target time synchronization control quantity acting on the local clock frequency adjustment of the lidar 10. Specifically, if the positive or negative attribute of the target time synchronization control quantity is positive, it indicates that the remote clock frequency of the master clock source is higher than the local clock frequency of the lidar 10, and the corresponding clock frequency adjustment direction is to increase the local clock frequency of the lidar 10; if the positive or negative attribute of the target time synchronization control quantity is negative, it indicates that the remote clock frequency of the master clock source is lower than the local clock frequency of the lidar 10, and the corresponding clock frequency adjustment direction is to decrease the local clock frequency of the lidar 10.

[0146] In this context, the actual count increment used by the lidar 10 at the clock cycle counter for each system clock cycle other than the clock cycle to be frequency-tuned (i.e., each system clock cycle other than the clock cycle to be frequency-tuned) is the original count increment, and the specific value of this original count increment is consistent with the duration of the system clock cycle. At this time, the step of adjusting the actual count increment of the clock cycle count value at the clock cycle to be frequency-tuned according to the target time control quantity for each clock cycle to be frequency-tuned may include sub-step j and sub-step k:

[0147] Sub-step j: If the target time control quantity is positive, then the actual count increment of the clock cycle count value at the clock cycle to be regulated is increased from the original count increment to the desired count increment, wherein the desired count increment is a non-positive integer multiple of the original count increment, and the original count increment is the cycle count increment used by the clock cycle count value at each system clock cycle other than the clock cycle to be regulated.

[0148] In sub-step k, if the target time control value is negative, the actual count increment of the clock cycle count value at the clock cycle to be regulated is reduced from the original count increment to zero.

[0149] In this embodiment, the main control unit 11 of the lidar 10 can be implemented using a Zynq chip. The main control unit 11 utilizes the FPGA portion of the Zynq chip corresponding to the PL (Programmable Logic) function to generate a local system clock signal via a phase-locked loop. The main control unit 11 also utilizes the ARM processor portion of the Zynq chip corresponding to the PS (Processing System) function to calibrate the local system clock signal generated by the PL function, ensuring the clock accuracy and stability of the local system clock signal. The FPGA portion and the ARM processor portion can exchange data via an AXI (Advanced eXtensible Interface) to achieve coordinated implementation between the clock calibration function and the clock generation function. In one embodiment of this invention, the main control unit 11 of the lidar 10 can be directly implemented using a Xilinx ZYNQ Ultra Scale+MPSoc chip.

[0150] The local clock (local time) implemented by the main control unit 11 through the FPGA part of the Zynq chip can include two parts: seconds and nanoseconds. If the system clock period of the local system clock signal generated by the main control unit 11 is 4ns, the clock cycle counter that implements the local time counting function will include a nanosecond counter and a second counter. The nanosecond counter uses an initial count increment of 4 in each system clock cycle that is not the clock cycle to be frequency-tuned. The second counter will automatically increment by 1 when the nanosecond counter overflows. At this time, the nanosecond counter will be reset to zero and continue counting.

[0151] Assuming the desired count increment is set to twice the original count increment, after determining the target time synchronization control quantity corresponding to the current local time, if the target time synchronization control quantity is positive, the actual count increment of each clock cycle to be regulated at the nanosecond counter is increased from 4 to 8. If the target time synchronization control quantity is negative, the actual count increment of each clock cycle to be regulated at the nanosecond counter is decreased from 4 to 0. Thus, without changing the system clock cycle duration of the local system clock signal of the lidar 10 (i.e., without changing the clock reference that counts once every 4ns), the local clock frequency of the lidar 10 is cleverly changed by adjusting the clock cycle count value to improve the local clock drift problem of the lidar 10 while ensuring the real-time data acquisition of the lidar 10.

[0152] Therefore, by executing the above sub-steps S251 to S253, the local clock frequency of the lidar 10 can be smoothly adjusted using the clock cycle count value adjustment method to meet the real-time data acquisition requirements of the lidar 10 and improve the local clock drift problem of the lidar 10. At the same time, it effectively avoids the problem of poor real-time radar data acquisition caused by modifying the system clock cycle duration of the local system clock signal.

[0153] Alternatively, please refer to Figure 4 , Figure 4 This is a second schematic flowchart of the radar clock synchronization method provided in this application embodiment. In this application embodiment, with Figure 2 Compared to the radar clock synchronization method shown, Figure 4 The radar clock synchronization method shown may also include step S260 to ensure that the specific PID parameters of the adaptive PID controller can adapt to the real-time network environment and effectively characterize the dynamic characteristics of the time adjustment error in the real-time network environment, thereby maximizing the accuracy and stability of the radar clock synchronization operation.

[0154] Step S260: Update the actual PID parameters based on the target smoothed master-slave clock deviation, target time synchronization control quantity, historical smoothed master-slave clock deviation and historical time synchronization control quantity before the current local time.

[0155] In this embodiment, after obtaining the target smooth master-slave clock deviation and the target time synchronization control quantity of the lidar 10 at the current local time, the actual PID parameters of the adaptive PID controller at the current local time can be updated based on the target smooth master-slave clock deviation and the target time synchronization control quantity at the current local time, as well as the historical smooth master-slave clock deviation and historical time synchronization control quantity of the lidar 10 before the current local time. This ensures that the updated actual PID parameters can effectively improve the clock synchronization accuracy and clock synchronization stability of the lidar 10 in subsequent possible radar clock synchronization operations.

[0156] Alternatively, please refer to Figure 5 , Figure 5 yes Figure 4 The flowchart of step S260 is shown below. In this embodiment, step S260 may include sub-steps S261 to S264 to ensure that the specific PID parameters of the adaptive PID controller can adaptively adapt to the actual network environment where the lidar 10 is located in real time, and effectively characterize the dynamic characteristics of the time synchronization error of the lidar 10 in the actual network environment, so as to maximize the accuracy and stability of the radar clock synchronization operation.

[0157] Sub-step S261: Detect whether the adaptive PID controller meets the PID parameter update conditions at the current local time.

[0158] In this embodiment, the aforementioned PID parameter update conditions are used to represent the specific conditions that the adaptive PID controller needs to meet when updating the PID parameters. These PID parameter update conditions may include update time conditions (e.g., the time length between the current local time and the last PID parameter update timestamp is greater than or equal to a preset time threshold), master-slave clock deviation conditions (e.g., the absolute value of the actual master-slave clock deviation at the current local time is greater than or equal to a preset clock deviation value), and control output conditions (e.g., the absolute value of the target time synchronization control quantity at the current local time is greater than or equal to a preset control quantity threshold). The specific PID parameter update conditions can be configured differently according to the radar clock synchronization requirements.

[0159] Step S262: When it is detected that the adaptive PID controller meets the PID parameter update conditions at the current local time, the target smooth master-slave clock deviation and target time synchronization control quantity at the current local time, as well as the historical smooth master-slave clock deviation and historical time synchronization control quantity before the current local time, are substituted into the second-order dynamic error model of the adaptive PID controller.

[0160] In this embodiment, if the adaptive PID controller is detected to meet the PID parameter update condition at the current local time, it indicates that the adaptive PID controller needs to update the PID parameters. At this time, the target smoothed master-slave clock deviation and the target time synchronization control quantity at the current local time, as well as the historical smoothed master-slave clock deviation and historical time synchronization control quantity before the current local time, can be substituted into the second-order dynamic error model of the adaptive PID controller. This second-order dynamic error model effectively characterizes the dynamic characteristics of the time synchronization error under the current network environment. The second-order dynamic error model of the adaptive PID controller can be expressed by the following formula:

[0161]

[0162] Where u(t) represents the time synchronization control quantity of the lidar 10 at the t-th local time, e(t) represents the smooth master-slave clock deviation of the lidar 10 at the t-th local time, ζ represents the system damping ratio of the lidar 10 when performing radar clock synchronization operation, ω represents the system natural frequency of the lidar 10 when performing radar clock synchronization operation, K0 represents the clock receiver gain of the lidar 10, and τ represents the clock receiver delay time of the lidar 10.

[0163] Step S263: Based on the dynamic characteristic correlation between the PID parameters and the second-order dynamic error model, solve the second-order dynamic error model to obtain the expected PID parameters of the adaptive PID controller.

[0164] In this embodiment, the dynamic characteristic correlation between the PID parameters of the adaptive PID controller and the second-order dynamic error model can be expressed by the following formula:

[0165]

[0166] Here, α represents the adaptive update rate of the adaptive PID controller.

[0167] Therefore, the second-order dynamic error model can be solved based on the above dynamic characteristic correlation to obtain the expected PID parameters (including expected P parameters, expected I parameters and expected D parameters) of the adaptive PID controller in the actual network environment where the lidar 10 is located. This ensures that the expected PID parameters effectively characterize the dynamic characteristics of the time synchronization error in the actual network environment where the lidar 10 is located, thereby maximizing the accuracy and stability of the radar clock synchronization operation.

[0168] Step S264: Update the actual PID parameters of the adaptive PID controller at the current local time according to the desired PID parameters.

[0169] In this embodiment, after updating the actual PID parameters of the adaptive PID controller with the desired PID parameters adapted to the actual network environment where the lidar 10 is located, if the lidar 10 receives a master clock synchronization message from the master clock source at a target local time after the current local time, the actual master-slave clock deviation of the lidar relative to the master clock source at the target local time can be obtained by performing step 220 based on the target local time and the message sending timestamp recorded in the master clock synchronization message, and the target smooth master-slave clock deviation corresponding to the target local time can be obtained by performing step S230. Then, the adaptive PID controller calculates the target time synchronization control quantity corresponding to the target local time using the actual PID parameters at the target local time (i.e., the actual PID parameters updated using the aforementioned expected PID parameters). Then, by executing the above step S250, the clock cycle count value of the local system clock signal of the lidar 10 is adjusted using the target time synchronization control quantity, so that the lidar 10 can start to achieve clock synchronization with the master clock source at the target local time. And through the PID parameter update operation, the final radar clock synchronization result has sufficient clock synchronization accuracy and clock synchronization stability.

[0170] Therefore, by executing the above steps S260 and sub-steps S261 to S264, this application can ensure that the specific PID parameters of the adaptive PID controller can adaptively and in real time adapt to the actual network environment where the lidar 10 is located, and effectively characterize the dynamic characteristics of the time synchronization error of the lidar 10 in the actual network environment, so as to maximize the accuracy and stability of the radar clock synchronization operation.

[0171] In this application, to ensure the effective execution of the aforementioned radar clock synchronization method for the lidar 10, this application provides at least one execution carrier for the aforementioned radar clock synchronization method to achieve the aforementioned function. The specific composition of the execution carrier for the aforementioned radar clock synchronization method provided in this application is described below.

[0172] Alternatively, please refer to Figure 6 , Figure 6 This is one of the schematic diagrams illustrating the composition of the electronic device 100 provided in the embodiments of this application. In the embodiments of this application, the electronic device 100 may include a first processing module 110 and a second processing module 120.

[0173] The first processing module 110 is used to obtain the actual master-slave clock deviation of the electronic device relative to the master clock source at the current local time.

[0174] The first processing module 110 is further configured to perform exponential smoothing filtering on the actual master-slave clock deviation to obtain the target smooth master-slave clock deviation.

[0175] The second processing module 120 is used to call the adaptive PID controller to calculate the target time synchronization control quantity corresponding to the target smooth master-slave clock deviation based on the actual PID parameters of the current local time; wherein, the target time synchronization control quantity is the time control quantity required to eliminate the target smooth master-slave clock deviation.

[0176] The second processing module 120 is further configured to adjust the clock cycle count value of the local system clock signal of the electronic device according to the target time control quantity, so that the electronic device can achieve clock synchronization with the master clock source; wherein, the local system clock signal is a reference clock signal for emitting laser beams, and the clock cycle count value is used to represent the local time when the system clock cycle of the local system clock signal has been counted at the electronic device.

[0177] Optionally, in this embodiment of the application, the electronic device 100 may further include a third processing module 130.

[0178] The third processing module 130 is used to send a synchronization request message to the master clock source, wherein the synchronization request message is used to request clock synchronization from the master clock source.

[0179] Alternatively, please refer to Figure 7 , Figure 7 This is a second schematic diagram of the electronic device 100 provided in this application embodiment. In this application embodiment, with... Figure 6 Compared to the electronic device 100 shown, Figure 7 The electronic device 100 shown may also include a fourth processing module 140.

[0180] The fourth processing module 140 is used to update the actual PID parameters based on the target smooth master-slave clock deviation at the current local time, the target time synchronization control quantity, the historical smooth master-slave clock deviation and historical time synchronization control quantity before the current local time.

[0181] It should be noted that the electronic device 100 provided in this application embodiment can execute the method flow shown in the above-described embodiments of the radar clock synchronization method to achieve the corresponding technical effects. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the relevant description of the radar clock synchronization method above.

[0182] It is understood that the embodiments of this application can divide the electronic device 100 into functional modules according to the various process embodiments of the radar clock synchronization method described above. For example, each step function can be divided into a separate functional module, or two or more step functions can be integrated into a processing module. The aforementioned integrated processing module can be implemented in hardware or as a software functional module. It should be noted that the division of processing modules in the embodiments of this application is illustrative and only represents one logical functional division; in actual implementation, there may be other division methods.

[0183] Therefore, optionally, the first processing module 110 and the second processing module 120 can be configured separately. For example, the first processing module 110 and / or the second processing module 120 can both be divided into more modules; the first processing module 110 and the second processing module 120 can also be integrated into one module. This application does not specifically limit the specific implementation of the first processing module 110 and the second processing module 120. It is understood that the specific implementation of the third processing module 130 and the fourth processing module 140 can refer to the aforementioned implementation of the first processing module 110 or the second processing module 120, and will not be repeated here.

[0184] Optionally, the electronic device 100 provided in this application embodiment may further include a storage module and / or a communication module. Figure 6 and Figure 7 (Not shown in the image), the storage module stores a computer program. When the first processing module 110, the second processing module 120, the third processing module 130, and / or the fourth processing module 140 can run the computer program stored in the storage module, they execute any of the aforementioned radar clock synchronization methods. The communication module is used to implement data communication functions. The third processing module 130 included in the electronic device 100 can communicate with the master clock source through the communication module. For example, the third processing module 130 sends a synchronization request message to the master clock source through the communication module, enabling the electronic device 100 to receive master clock synchronization messages from the master clock source.

[0185] It is also understood that the electronic device 100 provided in the embodiments of this application may be a control system or control component. For example, the control system or control component may be integrated on a lidar, or it may be a lidar, or it may be a chip system or other components or parts that can be disposed in the control system or control component or lidar. This application does not limit this.

[0186] Alternatively, please refer to Figure 8 , Figure 8This is a schematic diagram of the electronic device 200 provided in an embodiment of this application. In this embodiment, the electronic device 200 can also be used to execute the method flow shown in the various process embodiments of the radar clock synchronization method described above, in order to achieve the corresponding technical effects. The electronic device 200 may include a memory 210 and a processor 220.

[0187] The processor 220 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for executing the computer program corresponding to the radar clock synchronization method provided in the above method embodiments.

[0188] The memory 210 may be, but is not limited to, ROM or other types of static storage devices capable of storing static information and instructions, RAM or other types of dynamic storage devices capable of storing information and instructions, electrically erasable programmable-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer.

[0189] In this embodiment, the memory 210 can be used to store at least one computer program related to the radar clock synchronization method described above. The processor 220 can execute the at least one computer program stored in the memory 210 to achieve the technical effects corresponding to the radar clock synchronization method described above. The memory 210 can exist independently of the processor 220 and be connected to the processor 220 via a communication bus; alternatively, the memory 210 can be integrated with the processor 220.

[0190] For example, the electronic device 200 provided in the embodiments of this application may be a lidar 10, a central control system of lidar 10, a smartphone, a vehicle, a robot, a drone, a smart home device, a smart transportation device, a smart manufacturing device, or a surveying and mapping device, etc.

[0191] It should be understood that, Figure 8The block diagram shown is only a schematic diagram of one composition of the electronic device 200. The electronic device 200 may also include components such as... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown.

[0192] Furthermore, this application provides a readable storage medium storing a computer program that, when run by (e.g., a computer device, lidar, or processor), implements the radar clock synchronization method disclosed in any of the possible implementations of the above method embodiments.

[0193] This application may provide a computer program product comprising: a computer program (also referred to as code or instructions) that, when run by (e.g., a computer device, lidar, or processor), implements the radar clock synchronization method disclosed in any of the possible implementations of the above method embodiments.

[0194] This application also provides a chip system, which includes a processor and a memory for storing at least one computer program; when the at least one computer program is executed by the processor, it implements the radar clock synchronization method disclosed in any of the above-described method embodiments.

[0195] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of the apparatus, methods, and computer program products according to embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0196] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium and includes several instructions to cause the lidar, computer device, or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned readable storage medium includes: USB flash drives, mobile hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, optical disks, and other media capable of storing program code.

[0197] In summary, in the radar clock synchronization method, electronic device, electronic device, and readable storage medium provided in this application, after obtaining the actual master-slave clock deviation of the lidar relative to the master clock source at the current local time, this application performs exponential smoothing filtering on the actual master-slave clock deviation to obtain the target smoothed master-slave clock deviation. Then, it calls an adaptive PID controller based on the actual PID parameters at the current local time to calculate the target time synchronization control quantity corresponding to the target smoothed master-slave clock deviation. Finally, without changing the system clock period of the lidar's local system clock signal, it can directly adjust the lidar's local system clock signal according to the target time synchronization control quantity. The clock cycle count value is adjusted to regulate the LiDAR's clock frequency, thereby mitigating the local clock drift problem and enabling synchronization between the LiDAR and the master clock source. Through the synergistic effect of exponential smoothing filtering, adaptive PID control, and clock cycle count adjustment, the synchronization accuracy between the LiDAR and the master clock source is improved, meeting the real-time data acquisition requirements of the LiDAR. This also addresses the local clock drift problem, enhancing clock synchronization accuracy and stability. This facilitates high-precision automation in vehicles, robots, and other equipment using the LiDAR, improving the safety performance of the system.

[0198] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A radar clock synchronization method, characterized in that, The method includes: Obtain the actual master-slave clock deviation of the lidar relative to the master clock source at the current local time; The actual master-slave clock skew is subjected to exponential smoothing filtering to obtain the target smoothed master-slave clock skew. The adaptive PID controller is invoked to calculate the target time synchronization control quantity corresponding to the target smoothing master-slave clock deviation based on the actual PID parameters at the current local time; wherein, the target time synchronization control quantity is the time control quantity required to eliminate the target smoothing master-slave clock deviation; The clock cycle count value of the local system clock signal of the lidar is adjusted according to the target time control quantity to synchronize the lidar with the master clock source; wherein, the local system clock signal is the reference clock signal for the lidar to emit laser beams, and the clock cycle count value is used to represent the local time when the local system clock signal has been counted at the lidar for the past system clock cycles. The step of adjusting the clock cycle count value of the local system clock signal of the lidar according to the target time control quantity includes: Determine the number of frequency modulation intervals corresponding to the target time synchronization control quantity, and determine the target clock period corresponding to the current local time at the local system clock signal; Using the target clock cycle as the frequency modulation start point, and taking the number of system clock cycles of the frequency modulation interval as the frequency modulation cycle interval, multiple clock cycles to be frequency-modulated are determined at the local system clock signal. For each clock cycle to be regulated, the actual count increment of the clock cycle count value at the clock cycle to be regulated is adjusted according to the target time synchronization control value.

2. The method according to claim 1, characterized in that, The step of determining the number of frequency modulation intervals corresponding to the target time synchronization control quantity includes: Calculate the target frequency value corresponding to the absolute value of the target time control quantity; Based on the time unit of the target time control quantity, the time unit of the local system clock signal, and the target frequency value, determine the number of frequency modulation intervals that are compatible with the local system clock signal.

3. The method according to claim 1, characterized in that, The step of adjusting the actual count increment of the clock cycle count value at the clock cycle to be frequency-tuned according to the target time control value includes: If the target time synchronization control value is positive, the actual count increment of the clock cycle count value at the clock cycle to be regulated is increased from the original count increment to the desired count increment, wherein the desired count increment is a non-positive integer multiple of the original count increment, and the original count increment is the cycle count increment used by the clock cycle count value at each system clock cycle other than the clock cycle to be regulated. If the target time control value is negative, the actual count increment of the clock cycle count value at the clock cycle to be regulated will be reduced from the original count increment to zero.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Send a synchronization request message to the master clock source, wherein the synchronization request message is used to request clock synchronization from the master clock source; The step of obtaining the actual master-slave clock deviation of the lidar relative to the master clock source at the current local time includes: Obtain the message sending timestamp of the master clock source sending the master clock synchronization message, and the current local time when the lidar receives the master clock synchronization message; The actual master-slave clock offset is calculated based on the message sending timestamp, the current local time, and the link transmission time between the lidar and the master clock source.

5. The method according to claim 4, characterized in that, The step of performing exponential smoothing filtering on the actual master-slave clock skew to obtain the target smoothed master-slave clock skew includes: Obtain the historical smoothed master-slave clock offset of the lidar at the time when it most recently received the master clock synchronization message before the current local time; The pre-stored exponential smoothing coefficient is used as the first weight value of the actual master-slave clock deviation, and the second weight value of the historical smoothed master-slave clock deviation is calculated, wherein the sum of the first weight value and the second weight value is 1; Based on the first weight value and the second weight value, a weighted summation operation is performed on the actual master-slave clock deviation and the historical smoothed master-slave clock deviation to obtain the target smoothed master-slave clock deviation of the lidar at the current local time.

6. The method according to any one of claims 1-3, characterized in that, The method further includes: The actual PID parameters are updated based on the target smoothed master-slave clock deviation at the current local time, the target time synchronization control quantity, the historical smoothed master-slave clock deviation and historical time synchronization control quantity before the current local time.

7. The method according to claim 6, characterized in that, The step of updating the actual PID parameters based on the target smoothed master-slave clock skew at the current local time, the target time synchronization control quantity, and the historical smoothed master-slave clock skew and historical time synchronization control quantity before the current local time includes: Detect whether the adaptive PID controller meets the PID parameter update conditions at the current local time; When it is detected that the adaptive PID controller meets the PID parameter update condition at the current local time, the target smooth master-slave clock deviation and the target time synchronization control quantity at the current local time, as well as the historical smooth master-slave clock deviation and the historical time synchronization control quantity before the current local time, are substituted into the second-order dynamic error model of the adaptive PID controller. Based on the dynamic characteristic correlation between the PID parameters and the second-order dynamic error model, the second-order dynamic error model is solved to obtain the expected PID parameters of the adaptive PID controller. The adaptive PID controller updates the actual PID parameters at the current local time according to the desired PID parameters.

8. An electronic device, characterized in that, The device includes: The first processing module is used to obtain the actual master-slave clock deviation of the electronic device relative to the master clock source at the current local time. The first processing module is further configured to perform exponential smoothing filtering on the actual master-slave clock deviation to obtain the target smoothed master-slave clock deviation; The second processing module is used to call the adaptive PID controller to calculate the target time synchronization control quantity corresponding to the target smoothing master-slave clock deviation based on the actual PID parameters at the current local time; wherein, the target time synchronization control quantity is the time control quantity required to eliminate the target smoothing master-slave clock deviation; The second processing module is further configured to adjust the clock cycle count value of the local system clock signal of the electronic device according to the target time control quantity, so that the electronic device can synchronize with the master clock source; wherein, the local system clock signal is a reference clock signal for emitting laser beams, and the clock cycle count value is used to represent the local time when the system clock cycle of the local system clock signal has been counted at the electronic device. The method by which the second processing module adjusts the clock cycle count value of the local system clock signal of the electronic device according to the target time control quantity includes: Determine the number of frequency modulation intervals corresponding to the target time synchronization control quantity, and determine the target clock period corresponding to the current local time at the local system clock signal; Using the target clock cycle as the frequency modulation start point, and taking the number of system clock cycles of the frequency modulation interval as the frequency modulation cycle interval, multiple clock cycles to be frequency-modulated are determined at the local system clock signal. For each clock cycle to be regulated, the actual count increment of the clock cycle count value at the clock cycle to be regulated is adjusted according to the target time synchronization control value.

9. The apparatus according to claim 8, characterized in that, The device further includes: The third processing module is used to send a synchronization request message to the master clock source, wherein the synchronization request message is used to request clock synchronization from the master clock source.

10. The apparatus according to claim 8 or 9, characterized in that, The device further includes: The fourth processing module is used to update the actual PID parameters based on the target smoothed master-slave clock deviation at the current local time, the target time synchronization control quantity, the historical smoothed master-slave clock deviation and historical time synchronization control quantity before the current local time.

11. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, it implements the radar clock synchronization method according to any one of claims 1-7.

12. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run, it implements the radar clock synchronization method according to any one of claims 1-7.