Galvanometer control method and device, radar and storage medium
By adjusting the slow-axis scanning speed of the galvanometer and matching 1/K of the ellipse height, the problem of ellipse trajectory adhesion in the radar is solved, and the scanning resolution and image uniformity are improved.
Patent Information
- Application Number
- CN202310858565.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-14
AI Technical Summary
In the radar field, the elliptical trajectory of the two-dimensional galvanometer is prone to sticking when the temperature or air pressure changes, resulting in uneven scanning trajectory and affecting resolution.
By adjusting the slow axis scanning speed of the galvanometer, ensure that the slow axis scanning stroke matches 1/K of the ellipse height within a fast axis period, and K is a positive integer, and different scanning speeds are allocated to the ROI area and sparse area to pull evenly Elliptical trajectory.
It effectively avoids elliptical trajectory adhesion, improves the actual resolution of point clouds in the slow axis direction, and ensures the uniformity and accuracy of the scanned image.
Smart Images

Figure CN119310733A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of radar, and more specifically, to a control method and device for a galvanometer in the field of radar, a radar and a storage medium. Background Art
[0002] The 2D galvanometer is usually driven by a single coil, that is, the same coil drives both the fast axis and the slow axis.
[0003] When a sinusoidal signal is used to drive the fast axis resonant motion, the galvanometer will also produce sinusoidal motion in the slow axis direction. Of course, the motion amplitude in the slow axis direction is smaller than the motion amplitude in the fast axis direction, and there is a phase difference between the two. This will form a projection in space like Figure 1 When the slow axis moves slowly, the ellipses are staggered in the vertical direction, forming the following Figure 2 The two-dimensional scanning trajectory diagram shown is an elliptical trajectory distributed in a spiral shape.
[0004] However, the inventors of the present application have found that when the temperature or air pressure changes, the elliptical trajectory is likely to become stuck. Summary of the invention
[0005] The present application provides a control method, device, radar and storage medium for a galvanometer, which can prevent adhesion of an elliptical trajectory when the temperature or air pressure changes.
[0006] In a first aspect, a control method for a galvanometer is provided, the method comprising: determining a slow-axis scanning speed of the galvanometer; determining an elliptical height in a second direction of an elliptical trajectory formed when the fast axis of the galvanometer scans to a rated angle in a first direction; when it is determined that the slow-axis scanning speed does not match the elliptical height, determining a first slow-axis scanning speed of an ROI area and a second slow-axis scanning speed of a sparse area; controlling the galvanometer to scan the ROI area at the first slow-axis scanning speed, and to scan the sparse area at the second slow-axis scanning speed, so that within one fast-axis cycle, the slow-axis scanning stroke of the galvanometer matches 1 / K of the elliptical height, where K is a positive integer.
[0007] In the above technical solution, when it is determined that the slow axis scanning speed of the galvanometer does not match the ellipse height, it indicates that the ellipse trajectory may be stuck. At this time, the slow axis scanning speeds of the ROI area and the sparse area are distributed and adjusted, that is, the first slow axis scanning speed of the ROI area and the second slow axis scanning speed of the sparse area are determined, and then the galvanometer is controlled to scan the ROI area at the first slow axis scanning speed, and the sparse area is scanned at the second slow axis scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height in one fast axis cycle, where K is a positive integer. Because in one fast axis cycle, when the slow axis scanning stroke is 1 / K of the ellipse height, the ellipse trajectory can be evenly stretched. Therefore, in this embodiment, the ROI area is scanned at the first slow axis scanning speed, and the sparse area is scanned at the second slow axis scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height in one fast axis cycle, which is conducive to achieving a uniform stretch of the ellipse trajectory, thereby avoiding the ellipse trajectory from sticking when the temperature or air pressure changes.
[0008] In combination with the first aspect, in some possible implementations, the ROI area corresponds to a preset parameter set; the method also includes: calculating multiple candidate scanning strokes based on the ellipse height and multiple K values; wherein one of the candidate scanning strokes is: when K takes a positive integer, the product of 1 / K and the ellipse height; and determining a first target number of rows allocated to the ROI area and a second target number of rows allocated to the sparse area based on the multiple candidate scanning strokes and the preset parameter set corresponding to the ROI area.
[0009] In combination with the first aspect and the above-mentioned implementation manner, in some possible implementation manners, the preset parameter set includes: a design resolution and a design stroke range of the ROI area, and determining a first target number of rows allocated to the ROI area and a second target number of rows allocated to the sparse area according to the preset parameter set corresponding to the multiple candidate scanning strokes and the ROI area includes: obtaining differences between the multiple candidate scanning strokes and twice the design resolution respectively, and determining a first scanning stroke of the ROI area among the multiple candidate scanning strokes; wherein the difference between the first scanning stroke and twice the design resolution is the smallest; determining a first target resolution of the ROI area according to the first scanning stroke; determining a first ideal number of rows of the ROI area according to the design stroke range and the first target resolution; determining a second ideal number of rows of the sparse area according to the first ideal number of rows of the ROI area; calculating an edge resolution of the sparse area according to the first ideal number of rows, the first target resolution and the second ideal number of rows based on the principle that the total stroke remains unchanged; and calculating the first target number of rows and the second target number of rows according to the edge resolution and the first target resolution.
[0010] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the calculating the first target number of rows and the second target number of rows based on the edge resolution and the first target resolution includes: obtaining the difference between the multiple candidate scanning strokes and twice the edge resolution respectively, and determining the second scanning stroke of the sparse area among the multiple candidate scanning strokes; wherein the difference between the second scanning stroke and twice the edge resolution is the smallest; determining the second target resolution of the sparse area based on the second scanning stroke; and calculating the first target number of rows and the second target number of rows based on the first target resolution and the second target resolution.
[0011] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, calculating the first target number of rows and the second target number of rows according to the first target resolution and the second target resolution includes: based on the principle that the total number of rows and the total stroke remain unchanged, analyzing the set of equations to obtain the first calculated number of rows in the ROI area; wherein the set of equations includes: x+y=h, x*f1+y*f2=z, x is the first calculated number of rows, y is the second calculated number of rows, h is the total number of rows, f1 is the first target resolution, f2 is the second target resolution, and z is the total stroke; determining the first target number of rows and the second target number of rows according to the first calculated number of rows.
[0012] In combination with the first aspect and the above-mentioned implementation manner, in some possible implementation manners, the preset parameter set also includes: a minimum value of the design travel range and a maximum value of the design travel range of the ROI area, and determining the first target number of rows and the second target number of rows based on the first calculated number of rows includes: comparing the first calculated number of rows with the maximum number of rows and the minimum number of rows respectively; wherein the maximum number of rows is obtained based on the first target resolution and the maximum value of the design travel range, and the minimum number of rows is obtained based on the first target resolution and the minimum value of the design travel range; when the first calculated number of rows is greater than the maximum number of rows, the maximum number of rows is used as the first target number of rows; when the first calculated number of rows is less than the minimum number of rows, the minimum number of rows is used as the first target number of rows; when the first calculated number of rows is greater than or equal to the minimum number of rows and less than or equal to the maximum number of rows, the rounded first calculated number of rows is used as the first target number of rows; and the second target number of rows is determined based on the first target number of rows and the total number of rows.
[0013] In combination with the first aspect and the above implementation manner, in some possible implementation manners, before comparing the first calculated number of rows with the maximum number of rows and the minimum number of rows respectively, the method further includes:
[0014] Determine whether the first number of calculated rows is an odd number; if the first number of calculated rows is an odd number, evenify the first number of calculated rows so that the first number of calculated rows after evenification is an even number; compare the first number of calculated rows with the maximum number of rows and the minimum number of rows respectively, including: compare the first number of calculated rows after evenification with the maximum number of rows and the minimum number of rows respectively.
[0015] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the edge resolution of the sparse area is calculated based on the principle of unchanged total stroke according to the first ideal number of lines, the first target resolution and the second ideal number of lines, including: taking the quotient of the first target resolution divided by the default resolution of the scanning area as a first coefficient; calculating the first stroke of the ROI area according to the first coefficient and the first ideal number of lines; calculating a first difference between the total stroke of the scanning area and the first stroke; and calculating the edge resolution of the sparse area according to the default resolution, the first difference and the second ideal number of lines.
[0016] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, determining the first slow-axis scanning speed of the ROI area and the second slow-axis scanning speed of the sparse area includes: taking the quotient of the first target resolution divided by the default resolution of the scanning area as the first coefficient; taking the product of the first coefficient and the uniform scanning speed as the first slow-axis scanning speed; wherein the uniform scanning speed is the scanning speed when the scanning area is scanned at a uniform speed; determining the second stroke of the ROI area according to the first slow-axis scanning speed and the first target number of rows; calculating the second difference between the total stroke and the second stroke; and determining the second slow-axis scanning speed according to the second difference and the second target number of rows.
[0017] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, the preset parameter set also includes: a minimum value of the design resolution and a maximum value of the design resolution, and determining the first target resolution of the ROI area based on the first scanning stroke includes: when 1 / 2 of the first scanning stroke is greater than the maximum value of the design resolution, taking the maximum value of the design resolution as the first target resolution; when 1 / 2 of the first scanning stroke is less than the minimum value of the design resolution, taking the minimum value of the design resolution as the first target resolution; when 1 / 2 of the first scanning stroke is greater than or equal to the minimum value of the design resolution and less than or equal to the maximum value of the design resolution, taking 1 / 2 of the first scanning stroke as the first target resolution.
[0018] In combination with the first aspect and the above-mentioned implementation methods, in some possible implementation methods, determining the first ideal number of rows of the ROI area according to the design angle range and the first target resolution includes: calculating the quotient obtained by dividing the design stroke range by the first target resolution, and rounding the quotient to obtain a target quotient; when the target quotient is an even number, using the target quotient as the first ideal number of rows of the ROI area; when the target quotient is not an even number, evenizing the target quotient, and using the even-numbered target quotient as the first ideal number of rows.
[0019] In a second aspect, a control device for a galvanometer is provided, the device comprising: a first determination module for determining a slow-axis scanning speed of the galvanometer; a second determination module for determining an elliptical height in a second direction of an elliptical trajectory formed when the fast axis of the galvanometer scans to a rated angle in a first direction; a scanning speed determination module for determining a first vertical scanning speed of an ROI area and a second vertical scanning speed of a sparse area when it is determined that the slow-axis scanning speed does not match the elliptical height; a scanning control module for controlling the galvanometer to scan the ROI area at the first vertical scanning speed and scan the sparse area at the second vertical scanning speed, so that the slow-axis scanning stroke of the galvanometer matches 1 / K of the elliptical height within one fast-axis cycle, where K is a positive integer.
[0020] In a third aspect, a radar is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the radar executes the method in the first aspect or any possible implementation of the first aspect.
[0021] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0022] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a schematic diagram of a scanning trajectory provided in an embodiment of the present application;
[0024] Figure 2 is a schematic diagram of a two-dimensional scanning trajectory provided in an embodiment of the present application;
[0025] Figure 3 is a schematic flow chart of a control method for a galvanometer provided in an embodiment of the present application;
[0026] Figure 4 is a partial schematic diagram of a two-dimensional scanning trajectory provided in an embodiment of the present application;
[0027] Figure 5 is a partial schematic diagram of another two-dimensional scanning trajectory provided in an embodiment of the present application;
[0028] Figure 6 It is a schematic diagram of a uniform distribution between elliptical trajectories provided in an embodiment of the present application;
[0029] Figure 7 This is a distribution diagram of a sparse area and a ROI area provided in an embodiment of the present application;
[0030] Figure 8 is a structural schematic diagram of a galvanometer control device provided in an embodiment of the present application;
[0031] Fig. 9 It is a schematic diagram of the structure of a radar provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0033] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0034] To achieve two-dimensional scanning, a two-dimensional galvanometer usually needs to connect two low-voltage drive signals for superposition. One is the fast-axis drive signal (for example, it can control the galvanometer to move around the vertical axis, corresponding to the Y axis), and the other is the slow-axis drive signal (for example, it can control the galvanometer to move around the horizontal axis, corresponding to the X axis). Superposition of the two signals of the slow axis and the fast axis can achieve two-dimensional scanning of the galvanometer.
[0035] The two-dimensional galvanometer vibrates around the fast axis and the slow axis to achieve two-dimensional deflection. The detection laser is emitted to the two-dimensional galvanometer, and the two-dimensional galvanometer reflects the detection laser and then emits it outward, covering the vertical field of view angle range and the horizontal field of view angle range, thereby realizing a two-dimensional scan of the field of view. Among them, the two-dimensional galvanometer vibrates around the fast axis so that the detection laser covers the horizontal field of view angle range, and the two-dimensional galvanometer vibrates around the slow axis so that the detection laser covers the vertical field of view angle range. The two-dimensional galvanometer starts to move along the slow axis and the fast axis from the starting position. At this time, the detection laser is reflected by the two-dimensional galvanometer and then emits it outward to the upper left corner of the field of view. In the process of the two-dimensional galvanometer moving along the slow axis to the next position, it completes a reciprocating motion along the fast axis, and the time it takes to complete a reciprocating motion along the fast axis is a fast axis cycle; similarly, in the process of the two-dimensional galvanometer moving along the slow axis to the next position, it reciprocates along the fast axis to start scanning the next row of the field of view until the two-dimensional galvanometer moves to the lowest position along the slow axis, and then completes a reciprocating motion along the fast axis, completing a scanning cycle. The starting position of the two-dimensional galvanometer can be any position in the scanning cycle, such as the upper right corner, the lower right corner, the center position, etc.; the direction of movement along the fast axis and the slow axis is also not limited, such as scanning from right to left along the fast axis, such as scanning from bottom to top along the slow axis. The starting position of the two-dimensional galvanometer and the direction of movement along the fast axis and the slow axis do not affect the scanning pattern and scanning cycle of the two-dimensional galvanometer.
[0036] The 2D galvanometer is usually driven by a single coil, that is, the same coil drives both the fast axis and the slow axis.
[0037] When a sinusoidal signal is used to drive the fast axis resonant motion, the galvanometer will also produce sinusoidal motion in the slow axis direction. Of course, the motion amplitude in the slow axis direction is smaller than the motion amplitude in the fast axis direction, and there is a phase difference between the two. This will form a projection in space like Figure 1 When the slow axis moves slowly, the ellipses are staggered in the vertical direction, forming the following Figure 2 The two-dimensional scanning trajectory diagram shown is an elliptical trajectory distributed in a spiral shape.
[0038] The inventor of the present application discovered that the galvanometer performs resonant motion in response to the fast-axis drive signal, and the deflection angle that can be achieved is affected by changes in temperature and air pressure. In order to keep the fast axis of the galvanometer scanning to the rated angle in the fast-axis direction, the fast-axis drive signal is continuously and dynamically adjusted by phase-locking. In this way, the height of the ellipse in the slow-axis direction of the elliptical trajectory formed will also change continuously with the fast-axis drive signal. However, the response relationship between the galvanometer and the slow-axis drive signal is linear. The slow-axis drive signal remains unchanged, and the slow-axis scanning speed remains unchanged. This will cause the unchanged slow-axis scanning speed to be mismatched with the changed ellipse height, so that there may be some elliptical trajectories in the two-dimensional scanning trajectory diagram that are too small between two adjacent elliptical trajectories in the slow-axis direction, resulting in adhesion of the elliptical trajectories. When the elliptical trajectories are adhered, it will further cause the actual resolution of the point cloud in the slow-axis direction to be less than the designed resolution.
[0039] Based on this, in order to solve the technical problem of adhesion of the above-mentioned elliptical trajectory, an embodiment of the present application provides a control method for a galvanometer, which can prevent the adhesion of the elliptical trajectory when the environment such as temperature or air pressure changes.
[0040] The execution subject of the method provided in the embodiment of the present application may be a radar, specifically a control and processing unit inside a laser radar, or a terminal device connected to the laser radar for communication. The terminal device may be a mobile terminal such as a smart phone, a tablet computer, or a wearable device, or a computer, a cloud server, a radar-assisted computer, or other devices in various application scenarios. The following is an example of the execution subject being a radar:
[0041] Figure 3 It is a schematic flow chart of a galvanometer control method provided in an embodiment of the present application.
[0042] For example, Figure 3 As shown, the method includes:
[0043] Step 101: Determine the slow axis scanning speed of the galvanometer.
[0044] Step 102: Determine the elliptical height in the second direction of the elliptical track formed when the fast axis of the galvanometer scans to a rated angle in the first direction.
[0045] Step 103: When it is determined that the slow axis scanning speed does not match the ellipse height, a first slow axis scanning speed of the ROI region and a second slow axis scanning speed of the sparse region are determined.
[0046] Step 104: Control the galvanometer to scan the ROI area at a first slow axis scanning speed, and scan the sparse area at a second slow axis scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height within one fast axis cycle, where K is a positive integer.
[0047] exist Figure 3In the embodiment shown, when it is determined that the slow axis scanning speed of the galvanometer does not match the ellipse height, it indicates that the ellipse trajectory may be stuck. At this time, the slow axis scanning speeds of the ROI area and the sparse area are distributed and adjusted, that is, the first slow axis scanning speed of the ROI area and the second slow axis scanning speed of the sparse area are determined, and then the galvanometer is controlled to scan the ROI area at the first slow axis scanning speed and the sparse area at the second slow axis scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height in one fast axis cycle, where K is a positive integer. Because in one fast axis cycle, when the slow axis scanning stroke is 1 / K of the ellipse height, the ellipse trajectory can be evenly stretched. Therefore, in this embodiment, the ROI area is scanned at a first slow-axis scanning speed, and the sparse area is scanned at a second slow-axis scanning speed, so that the slow-axis scanning stroke of the galvanometer within one fast-axis cycle matches 1 / K of the ellipse height, which is conducive to achieving a uniform stretching of the elliptical trajectory, thereby avoiding adhesion of the elliptical trajectory when the temperature and air pressure change, and thus avoiding the actual resolution of the point cloud in the slow-axis direction being less than the design resolution, thereby improving the actual resolution of the point cloud in the slow-axis direction.
[0048] Below Figure 3 The specific implementation of each step in the embodiment shown is described as follows:
[0049] In step 101, the slow axis scanning stroke within a fast axis period can be determined first, and then the quotient of the slow axis scanning stroke divided by the fast axis period can be calculated to obtain the slow axis scanning speed of the galvanometer. The fast axis period can be a known parameter of the galvanometer, and the galvanometer in this embodiment specifically refers to a two-dimensional galvanometer. The slow axis scanning stroke within a fast axis period can be determined by taking two adjacent elliptical trajectories in the slow axis direction, and taking the distance between the two adjacent elliptical trajectories in the slow axis direction as the slow axis scanning stroke.
[0050] For example, see Figure 4 , Figure 4 is a partial schematic diagram of a two-dimensional scanning trajectory. Figure 4 As shown, it can be Figure 4 The leftmost points on two adjacent elliptical trajectories are taken to obtain points P1 and P2. The slow axis scanning stroke within a fast axis cycle can be calculated based on the Y-axis coordinates of points P1 and P2. However, in this example, only the leftmost point is taken as an example. In the specific implementation, the rightmost point or points at other positions can also be taken. It is only necessary that the horizontal coordinates of the points taken on the two adjacent elliptical trajectories are the same or nearly the same, or the time interval between the two points taken on the elliptical trajectory is a fast axis cycle.
[0051] Optionally, the slow axis scanning stroke within a fast axis cycle can be determined at every preset time period to perform a subsequent control process. That is, the above steps 101 to 104 can be performed once at every preset time period, which is equivalent to periodically determining whether the slow axis scanning speed of the galvanometer matches the ellipse height, so as to periodically control the galvanometer according to the process of steps 101 to 104. The preset time period can be set according to actual needs, such as one day, one week, half a month, etc.
[0052] Optionally, during the initialization process after each power-on of the radar, the slow axis scanning stroke within a fast axis cycle can be determined to perform subsequent control procedures.
[0053] Optionally, when a change in temperature or air pressure is detected, the slow-axis scanning speed of the galvanometer can be determined to perform a subsequent control process. Among them, detecting a change in temperature or air pressure can be understood as: detecting that the temperature or air pressure has changed compared to the average temperature or average air pressure in the current period of time. Among them, the current period of time can be the current day, the current week, etc., and this embodiment does not make specific limitations on this. Since the elliptical trajectory is prone to adhesion when the temperature or air pressure changes, when the temperature or air pressure changes are detected, the slow-axis scanning speed of the galvanometer is determined to perform a subsequent control process. In the case where the elliptical trajectory adhesion may occur, steps 101 to 104 can be performed more effectively, which is beneficial to saving computing power while avoiding the adhesion of the elliptical trajectory to a certain extent.
[0054] In step 102, the first direction can be understood as the fast axis direction, and the second direction can be understood as the slow axis direction. The rated angle can be pre-set, and its size is usually related to the optical requirements of the radar device. For example, it can be set to 27.5 degrees or other angle values, which is not specifically limited in this embodiment. The galvanometer drive control can be phase-locked so that the galvanometer always keeps scanning to the rated angle in the first direction. In a specific implementation, the first direction can be a horizontal direction, and the second direction can be a vertical direction.
[0055] The following is a detailed description of how to determine the height of the ellipse:
[0056] For example, two points with a difference of half a fast axis period can be taken on an elliptical trajectory, and then the slow axis scanning stroke between the two points can be calculated according to the Y axis coordinates of the two points (for example, it can be the vertical distance between the two points), and the slow axis scanning stroke between the two points is theoretically equal to the ellipse height plus the slow axis scanning stroke within half a fast axis period. The slow axis scanning stroke within a fast axis period has been obtained above, so the slow axis scanning stroke within half a fast axis period can be determined, and based on this, the ellipse height can be calculated.
[0057] For ease of understanding, the above method for determining the height of the ellipse is combined with Figure 4 and Figure 5 To explain, Figure 5 A partial schematic diagram of the two-dimensional scanning trajectory. Figure 5 In the example, two points P3 and P4 are selected on an elliptical trajectory with a difference of half a fast axis period. Figure 4 Points P1 and P2 are taken on two adjacent elliptical trajectories. Assume that the slow axis scanning distance between points P3 and P4 is Pitch P3 -Pitch P4 , the slow axis scanning distance between point P1 and point P2 is Pitch P1 -Pitch P2 , then the ellipse height ovality can be calculated by the following formula:
[0058] ovality=Pitch P3 -Pitch P4 -(Pitch P1 -Pitch P2 ) / 2
[0059] In step 103, the ROI area and the sparse area can be two different types of areas in the scanning area of the galvanometer. The region of interest (ROI) belongs to the key focus area of the radar. As the key focus area in the scanning area, the ROI area is usually located in the relatively middle position of the entire scanning area, and the sparse area is usually located at the relatively edge position of the entire scanning area. The point cloud density of the ROI area is greater than the point cloud density of the sparse area. Of course, the setting positions of the ROI area and the sparse area can also be allocated according to the point cloud information. For example, if the point cloud information indicates that there is a high-priority target object at the edge of the scanning area, the ROI area can also be set at the edge of the scanning area.
[0060] In this embodiment, it can be determined whether the slow-axis scanning speed determined in step 101 matches the ellipse height determined in step 102. Specifically, it can be determined whether the product of the slow-axis scanning speed and a fast-axis period can be divided by the ellipse height. If it can be divided by an integer, it can be determined that the slow-axis scanning speed matches the ellipse height. If it cannot be divided by an integer, it can be determined that the slow-axis scanning speed does not match the ellipse height.
[0061] If the slow axis scanning speed matches the ellipse height, it means that there is no adhesion between the ellipse tracks, that is, the distribution is relatively uniform, and there is no need to continue with the subsequent steps.
[0062] If the slow-axis scanning speed does not match the ellipse height, it means that there is adhesion between the ellipse tracks. In order to avoid adhesion between the ellipse tracks, in this embodiment, the slow-axis scanning speeds of the ROI area and the sparse area are distributed and adjusted to determine the first slow-axis scanning speed of the ROI area and the second slow-axis scanning speed of the sparse area, and the first slow-axis scanning speed and the second slow-axis scanning speed are different. Thus, in step 104, the galvanometer is controlled to scan the ROI area at the first slow-axis scanning speed, and to scan the sparse area at the second slow-axis scanning speed, so that the slow-axis scanning stroke of the galvanometer in one fast-axis cycle matches 1 / K of the ellipse height, where K is a positive integer. The matching of the slow-axis scanning stroke of the galvanometer in one fast-axis cycle to 1 / K of the ellipse height can be understood as follows: the slow-axis scanning stroke of the galvanometer in one fast-axis cycle is as close to 1 / K of the ellipse height as possible, for example, it can be equal to 1 / K of the ellipse height.
[0063] Exemplarily, since the ROI area is the area of interest, the ROI area is the angle area of focus compared to the sparse area. Therefore, if it is not possible to ensure that the slow-axis scanning stroke of the galvanometer in one fast-axis cycle is equal to 1 / K of the ellipse height for both the ROI area and the sparse area, it is possible to prioritize ensuring that the slow-axis scanning stroke of the galvanometer in one fast-axis cycle of the ROI area is equal to 1 / K of the ellipse height, and the slow-axis scanning stroke of the galvanometer in one fast-axis cycle of the sparse area is as close to 1 / K of the ellipse height as possible. The closer to 1 / K of the ellipse height, the closer the ellipse trajectories are to being evenly stretched. This ensures that the elliptical trajectory is evenly stretched when scanning the ROI area, which is conducive to more accurate and detailed detection of objects in the front center area.
[0064] To understand the above, when the slow axis scanning stroke of the galvanometer in one fast axis cycle is equal to 1 / K of the ellipse height, the ellipse trajectory can be evenly stretched, please refer to Figure 6 . Figure 6 The schematic diagram shows the elliptical trajectory when K = 1, K = 2 and K = 3. Figure 6 It can be seen that the elliptical trajectories are evenly distributed, and the larger the value of K is, the smaller the interval between two adjacent elliptical trajectories is, that is, the elliptical trajectories are denser, but it can still be guaranteed to be evenly distributed in the slow axis direction.
[0065] In this embodiment, when the slow-axis scanning speed does not match the ellipse height, the uniform-speed scanning of the scanning area is adjusted to variable-speed scanning, that is, the ROI area is scanned at a first slow-axis scanning speed, and the sparse area is scanned at a second slow-axis scanning speed. The first slow-axis scanning speed is usually lower than the default uniform-speed scanning speed, so that the area with low scanning speed is placed in the key focus angle area, namely the ROI area. The second slow-axis scanning speed is usually higher than the default uniform-speed scanning speed. These two new speeds, namely the first slow-axis scanning speed and the second slow-axis scanning speed, can make the slow-axis scanning stroke within a fast-axis cycle close to 1 / K of the ellipse height, thereby solving the adhesion problem between the ellipse trajectories and improving the actual resolution in the slow-axis direction.
[0066] In an exemplary embodiment, the ROI region corresponds to a preset parameter set, and the first target number of rows allocated to the ROI region and the second target number of rows allocated to the sparse region can be determined in the following manner:
[0067] According to the ellipse height and multiple K values, multiple candidate scanning strokes are calculated; wherein a candidate scanning stroke is: when K takes a positive integer, the product of 1 / K and the ellipse height; according to the preset parameter sets corresponding to the multiple candidate scanning strokes and the ROI area, the first target number of rows allocated to the ROI area and the second target number of rows allocated to the sparse area are determined.
[0068] Among them, the preset parameter set includes parameter values of multiple parameters of the ROI area, and these parameter values can be designed according to the product performance requirements and belong to the design parameters of the product. For example, the preset parameter set may include: the design resolution of the ROI area (which can be recorded as idealresolution), the minimum value of the design resolution (which can be recorded as minresolution), the maximum value of the design resolution (which can be recorded as maxresolution), the design travel range of the ROI area (which can be recorded as idealanglezone), the minimum value of the design travel range (which can be recorded as minanglezone), the maximum value of the design travel range (which can be recorded as maxanglezone), the minimum value of the design number of lines in the ROI area (which can be recorded as minlineslimit), and the maximum value of the design number of lines (which can be recorded as maxlineslimit). Among them, idealresolution can also be called the ideal design resolution, and idealanglezone can also be called the ideal design travel range.
[0069] The above-mentioned resolutions all refer to the resolution in the slow axis direction, and the above-mentioned candidate scanning strokes refer to the scanning strokes in the slow axis direction.
[0070] For example, assuming that the ellipse height is recorded as ovality, and the multiple candidate scanning strokes are 4 candidate scanning strokes when K is 1, 2, 3, and 4, then the 4 candidate scanning strokes can be expressed as follows:
[0071] The candidate scan trip when K=1 is recorded as singleovality, singleovality=ovality;
[0072] When K = 2, the candidate scanning trip is recorded as halfovality, halfovality = ovality / 2;
[0073] The candidate scanning trip when K=3 is recorded as thirdovality, thirdovality=ovality / 3;
[0074] When K=4, the candidate scanning trip is recorded as quarterovality, quarterovality=ovality / 4;
[0075] It should be noted that, in this embodiment, K is taken as 4 positive integers to obtain 4 candidate scanning strokes as an example. In a specific implementation, the specific value of K and the number of values can be set according to actual needs, and this embodiment does not make any specific limitation on this.
[0076] It can be understood that, since the multiple candidate scanning strokes are all the product of the ellipse height and 1 / K, that is, the multiple candidate scanning strokes are all divisible by the ellipticity, if the slow axis scanning stroke of the galvanometer in one fast axis cycle is equal to any one of the multiple candidate scanning strokes, the ellipse trajectory can be evenly stretched. Therefore, in this embodiment, if the slow axis scanning stroke of the galvanometer in one fast axis cycle is equal to any one of the multiple candidate scanning strokes, the ellipse trajectory in the ROI area and the sparse area can be evenly stretched.
[0077] Since the slow axis scanning stroke = slow axis resolution * number of rows, in order to make the slow axis scanning stroke of the galvanometer in a fast axis cycle in the ROI area and the sparse area equal to or close to any one of the above-mentioned multiple candidate scanning strokes, it can be achieved by adjusting the number of rows and / or the slow axis resolution of the ROI area and the sparse area. Since the size of the slow axis resolution is related to the slow axis scanning speed, the slow axis scanning speed is a parameter that can be directly controlled. Therefore, this embodiment can adjust the slow axis scanning speed of the ROI area and the sparse area so that the slow axis resolution of the ROI area and the sparse area changes accordingly, thereby adjusting the slow axis scanning stroke to make it equal to or close to any one of the multiple candidate scanning strokes.
[0078] In this embodiment, the ROI area corresponds to its preset parameter set. In order to make the first target number of rows finally allocated to the ROI area meet its preset parameter set, that is, to meet the design requirements of the product for the ROI area, this embodiment can determine the first target number of rows allocated to the ROI area and the second target number of rows allocated to the sparse area according to multiple candidate scanning strokes and the above-mentioned preset parameter set, so that while being able to meet the product design requirements, the galvanometer scans the ROI area with the first target number of rows at a first scanning speed and scans the sparse area with the second target number of rows at a second scanning speed. In this way, the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height within one fast axis cycle, thereby making the elliptical trajectories of the ROI area and the sparse area evenly stretched.
[0079] In an exemplary embodiment, the above-mentioned determining the first target number of rows allocated to the ROI region and the second target number of rows allocated to the sparse region according to the preset parameter sets corresponding to the plurality of candidate scanning runs and the ROI region includes the following steps S10 to S15:
[0080] S10: Obtain differences between multiple candidate scanning strokes and twice the design resolution, and determine a first scanning stroke of the ROI area among the multiple candidate scanning strokes; wherein the difference between the first scanning stroke and twice the design resolution is the smallest.
[0081] Specifically, the difference between the multiple candidate scanning strokes and 2 times the design resolution can be calculated to obtain multiple difference values, and then the multiple difference values are traversed to select the minimum difference value from the multiple difference values, and the candidate scanning stroke with the minimum difference value between 2 times the design resolution is used as the first scanning stroke. The above difference value is mainly used to characterize the degree of proximity between the multiple candidate scanning strokes and 2 times the design resolution, so the above difference value can be specifically the absolute value of the difference value.
[0082] Exemplarily, in combination with the description above, assuming that a plurality of candidate scanning strokes are respectively recorded as: singleovality, halfovality, thirdovality, quarterovality, and the design resolution is recorded as idealresolution, then the absolute value of the difference between the four candidate scanning strokes and twice the design resolution can be expressed as follows: D1 = abs(singleovality-idealresolution*2), D2 = abs(halfovality-idealresolution*2), D3 = abs(thirdovality-idealresolution*2), D4 = abs(quarterovality-idealresolution*2), where abs represents the absolute value. Among D1, D2, D3, and D4, when D1 is the smallest, singleovality is used as the first scanning stroke, when D2 is the smallest, halfovality is used as the first scanning stroke, when D3 is the smallest, thirdovality is used as the first scanning stroke, and when D4 is the smallest, quarterovality is used as the first scanning stroke.
[0083] It can be understood that, since the slow axis scanning stroke = slow axis resolution * number of lines, and the number of lines in a fast axis cycle is 2, the above ideal resolution * 2 can represent the slow axis scanning stroke in a fast axis cycle. Therefore, S10 is equivalent to finding a candidate scanning stroke closest to ideal resolution * 2 among multiple candidate scanning strokes.
[0084] S11: Determine a first target resolution of the ROI area according to the first scanning stroke.
[0085] The first scanning stroke is actually a scanning stroke in the slow axis direction within a fast cycle, and the number of lines within a fast cycle is 2 lines. Therefore, in theory, 1 / 2 of the first scanning stroke can be used to represent the first target resolution.
[0086] In an exemplary embodiment, when 1 / 2 of the first scanning stroke is greater than the maximum value maxresolution of the design resolution, the maximum value of the design resolution is used as the first target resolution; when 1 / 2 of the first scanning stroke is less than the minimum value minresolution of the design resolution, the minimum value minresolution of the design resolution is used as the first target resolution; when 1 / 2 of the first scanning stroke is greater than or equal to the minimum value minresolution of the design resolution and less than or equal to the maximum value maxresolution of the design resolution, 1 / 2 of the first scanning stroke is used as the first target resolution.
[0087] In this embodiment, the size of the first target resolution of the determined ROI area is limited between the maximum and minimum values of the design resolution, which is beneficial for meeting the design requirements for the ROI area while making twice the first target resolution close to the first scanning stroke.
[0088] S12: Determine a first ideal number of rows of the ROI area according to the designed travel range and the first target resolution.
[0089] Specifically, based on the relationship between the stroke, resolution, and number of lines, in theory, the quotient obtained by dividing the design stroke range by the first target resolution is the first ideal number of lines. In the specific implementation, the number of lines is an integer, so the quotient obtained by dividing the design stroke range by the first target resolution can be rounded to obtain the first ideal number of lines. For example, the design stroke range is recorded as idealanglezone, the first target resolution is recorded as optimizeresolution, and the first ideal number of lines is recorded as ideallines. Then ideallines can be calculated by the following formula: ideallines=round(idealanglezone / optimizeresolution), where round means rounding.
[0090] In an exemplary embodiment, S12 may be implemented as follows: calculating the quotient obtained by dividing the design travel range by the first target resolution, and rounding the quotient to obtain a target quotient; when the target quotient is an even number, using the target quotient as the first ideal number of rows of the ROI area; when the target quotient is not an even number, evening the target quotient, and using the even-numbered target quotient as the first ideal number of rows, so that the first ideal number of rows can be an even number.
[0091] In this embodiment, by ensuring that the first ideal number of rows is an even number, the elliptical trajectory obtained by scanning can be presented as a complete ellipse, avoiding the situation where a half ellipse appears.
[0092] It should be noted that, in this embodiment, the first ideal number of rows is taken as an even number as an example, and in a specific implementation, the first ideal number of rows may also be an odd number. For example, in the above S12, the quotient obtained by dividing the design stroke range by the first target resolution may be calculated, and the quotient may be rounded to obtain the target quotient, and then the target quotient may be directly used as the first ideal number of rows. In other words, at this time, whether the target quotient is an odd number or an even number, the target quotient may be directly used as the first ideal number of rows.
[0093] S13: Determine a second ideal number of rows in the sparse area according to the first ideal number of rows in the ROI area.
[0094] Specifically, based on the principle that the total number of lines in the scan area remains unchanged, the difference between the total number of lines and the first ideal number of lines can be used as the second ideal number of lines. For example, the total number of lines is recorded as totalLines, the first ideal number of lines is recorded as ideallines, and the second ideal number of lines is recorded as totalLines-ideallines.
[0095] S14: Based on the principle that the total stroke remains unchanged, the edge resolution of the sparse area is calculated according to the first ideal number of lines, the first target resolution and the second ideal number of lines.
[0096] Specifically, based on the principle that the total stroke remains unchanged, the first ideal number of lines, the first target resolution, the second ideal number of lines and the edge resolution have the following relationship:
[0097] First ideal number of lines*first target resolution+second ideal number of lines*edge resolution=total stroke Since, in the above relationship, the first ideal number of lines, the first target resolution, the second ideal number of lines and the total stroke are all known quantities, the edge resolution can be calculated based on the above relationship.
[0098] In an exemplary embodiment, the implementation of the above S14 may also be implemented through the following S20 to S23:
[0099] S20: Taking the quotient of the first target resolution divided by the default resolution of the scanning area as the first coefficient.
[0100] Among them, the default resolution is the default resolution in the slow axis direction. The default resolution can be determined based on the total stroke of the scanning area in the slow axis direction and the total number of rows in the scanning area. For example, the quotient of the total stroke divided by the total number of rows can be used as the default resolution. The default resolution can be recorded as defaultresolution.
[0101] For example, assuming that the total travel of the scanning area in the slow axis direction is 25°, the total number of fast axis cycles required to scan the entire scanning area is 63. Since the total number of lines is twice the total number of fast axis cycles, the default resolution is defaultresolution = 25 / 63 / 2. If the first target resolution is recorded as optimizeresolution and the first coefficient is recorded as m1, m1 can be calculated by the following formula:
[0102] m1=optimizeresolution / defaultresolution.
[0103] S21: Calculate a first run length of the ROI area according to the first coefficient and the first ideal number of lines.
[0104] Specifically, the product of the first coefficient, the uniform scanning speed and the first ideal number of lines can be used as the calculated first stroke. If the first ideal number of lines is recorded as ideallines, the first stroke is recorded as midZone1, and the uniform scanning speed is recorded as v, then midZone1 = m1*v*ideallines. Among them, the uniform scanning speed is the scanning speed when the scanning area is uniformly scanned, and the uniform scanning speed specifically refers to the speed of uniform scanning along the slow axis direction. m1*v can be understood as the first vertical scanning speed of the ROI area.
[0105] S22: Calculate a first difference between the total stroke of the scanning area and the first stroke.
[0106] If the total travel distance is recorded as totalZone, the first difference may be totalZone-midZone1.
[0107] S23: Calculate the edge resolution of the sparse area according to the default resolution, the first difference and the second ideal number of lines.
[0108] Specifically, the quotient of the first difference divided by the second ideal number of lines can be calculated, and the product of the calculated quotient and the default resolution is used as the border resolution. Assuming that the first difference is recorded as totalZone-midZone1, the default resolution is recorded as defaultresolution, and the second ideal number of lines is recorded as totalLines-ideallines, the border resolution borderresolution can be calculated by the following formula: borderresolution=defaultresolution*[(totalZone-midZone1) / (totalLines-ideallines)]
[0109] S15: Calculate a first target number of rows and a second target number of rows according to the edge resolution and the first target resolution.
[0110] In an exemplary embodiment, the implementation of the above S15 may include the following S30 to S32:
[0111] S30: Obtain differences between multiple candidate scanning strokes and twice the edge resolution, and determine a second scanning stroke of the sparse area from the multiple candidate scanning strokes; wherein the difference between the second scanning stroke and twice the edge resolution is the smallest.
[0112] Specifically, the difference between the multiple candidate scanning strokes and 2 times the edge resolution can be calculated to obtain multiple difference values, and then the multiple difference values are traversed to select the minimum difference value among the multiple difference values, and the candidate scanning stroke with the minimum difference value between the multiple candidate scanning strokes and 2 times the edge resolution is used as the second scanning stroke. The above difference value is mainly used to characterize the degree of proximity between the multiple candidate scanning strokes and 2 times the edge resolution, so the above difference value can be specifically the absolute value of the difference value.
[0113] For example, in combination with the above description, assuming that the multiple candidate scan runs are recorded as: singleovality, halfovality, thirdovality, quarterovality, and the edge resolution is recorded as borderresolution, then the absolute value of the difference between the four candidate scan runs and twice the edge resolution can be expressed as follows: E1 = abs(singleovality-borderresolution*2)
[0114] E2=abs(halfovality-borderresolution*2)E3=abs(thirdovality-borderresolution*2)E4=abs(quarterovality-borderresolution*2)
[0115] Among them, abs means taking the absolute value. Among E1, E2, E3, and E4, when E1 is the smallest, singleovality is used as the second scanning stroke, when E2 is the smallest, halfovality is used as the second scanning stroke, when E3 is the smallest, thirdovality is used as the second scanning stroke, and when E4 is the smallest, quarterovality is used as the second scanning stroke.
[0116] It can be understood that, since the slow axis scanning stroke = slow axis resolution * number of lines, and the number of lines in a fast axis cycle is 2, the above borderresolution*2 can represent the slow axis scanning stroke in a fast axis cycle. S30 is equivalent to finding a candidate scanning stroke closest to borderresolution*2 among multiple candidate scanning strokes.
[0117] S31: Determine a second target resolution of the sparse area according to the second scanning stroke.
[0118] The second scanning stroke is actually a scanning stroke in the slow axis direction within a fast cycle, and the number of lines within a fast cycle is 2, so theoretically, the second target resolution can be represented by 1 / 2 of the second scanning stroke, that is, the second target resolution = 1 / 2*second scanning stroke.
[0119] S32: Calculate the first target number of lines and the second target number of lines according to the first target resolution and the second target resolution. Specifically, the first target number of lines and the second target number of lines may be calculated according to the first target resolution and the second target resolution based on the principle that the total number of lines and the total stroke of the scanning area remain unchanged.
[0120] In an exemplary embodiment, the implementation of the above S32 may include the following S40 to S41:
[0121] S40: Based on the principle that the total number of rows and the total stroke remain unchanged, the first calculated number of rows in the ROI area is obtained by analyzing the equation group; wherein the equation group includes: x+y=h, x*f1+y*f2=z, x is the first calculated number of rows, y is the second calculated number of rows, h is the total number of rows, f1 is the first target resolution, f2 is the second target resolution, and z is the total stroke.
[0122] It can be understood that in the above equations, h, f1, f2, and z are all known quantities, and x and y are quantities to be solved. Therefore, by substituting the known quantities h, f1, f2, and z into the above equations, the x and y values can be solved. The solved x value is the first calculated row number of the ROI area obtained by the analytical equations, and the solved y value is the second calculated row number of the sparse area obtained by the analytical equations.
[0123] S41: Determine a first target number of rows and a second target number of rows according to the first calculated number of rows.
[0124] For example, the most basic requirement for the number of rows is that the number of rows is an integer. However, when solving the above equations, the first calculated number of rows may not be an integer. Therefore, in this embodiment, at least the first calculated number of rows needs to be rounded. Without considering the design requirements for the ROI area,
[0125] The rounded first calculated row number may be used as the first target row number, and then the difference between the total number of rows and the first target number of rows may be used as the second target number of rows.
[0126] In an exemplary embodiment, when determining the first target number of rows and the second target number of rows according to the first calculated number of rows, it is necessary to consider the design requirements for the ROI area. Thus, the implementation of the above S41 may include the following S50 to S54:
[0127] S50: Compare the first calculated number of rows with the maximum number of rows and the minimum number of rows respectively; wherein the maximum number of rows is obtained based on the maximum value of the first target resolution and the design stroke range, and the minimum number of rows is obtained based on the minimum value of the first target resolution and the design stroke range.
[0128] Combined with the first target resolution described above, record it as optimizeresolution, record the maximum value of the design stroke range as maxanglezone, and record the minimum value of the design stroke range as minanglezone. Based on this, the maximum number of lines maxlines = round(minanglezone / optimizeresolution) and the minimum number of lines minlines = round(minanglezone / optimizeresolution) can be calculated; where round means rounding. Considering that the maxlines and minlines calculated above may not be even numbers, if it is determined that maxlines or minlines is not an even number, it is evened so that the final maxlines and minlines are even numbers.
[0129] It should be noted that this embodiment only takes the case where the maxlines and minlines finally obtained are even numbers as an example. In a specific implementation, the maxlines and minlines finally obtained may also be odd numbers, which is not specifically limited in this embodiment.
[0130] S51: When the first calculated number of rows is greater than the maximum number of rows, the maximum number of rows is used as the first target number of rows.
[0131] S52: When the first calculated number of rows is less than the minimum number of rows, the minimum number of rows is used as the first target number of rows.
[0132] S53: When the first calculated row number is greater than or equal to the minimum row number and less than or equal to the maximum row number, the first calculated row number after rounding is used as the first target row number.
[0133] S54: Determine a second target number of rows according to the first target number of rows and the total number of rows.
[0134] Specifically, the difference between the total number of rows and the first target number of rows may be used as the second target number of rows.
[0135] In this embodiment, by limiting the first target number of rows to between the minimum number of rows and the maximum number of rows, the first target number of rows can meet the design requirements for the ROI area.
[0136] In an exemplary embodiment, before the above S51, it is also possible to first determine whether the first calculated row number is an odd number. If the first calculated row number is an odd number, the first calculated row number is evened so that the first calculated row number after the evening process is an even number. Then, in the above S51, the first calculated row number after the evening process is compared with the maximum row number and the minimum row number respectively. Thus, when the first calculated row number after rounding is used as the first target row number, the first target row number is an even number. Since the total number of rows is also an even number, the second target row number obtained based on the difference between the total number of rows and the second target number of rows is also an even number.
[0137] In this embodiment, by ensuring that the first target number of lines and the second target number of lines finally obtained are even numbers, when scanning the ROI area and the sparse area, the elliptical trajectories obtained are all complete elliptical trajectories.
[0138] It should be noted that, in this embodiment, the first number of calculation rows finally obtained is an even number. In a specific implementation, the first number of calculation rows finally obtained may also be an odd number, that is, the first number of calculation rows may not be evened. This embodiment does not specifically limit whether the first number of calculation rows is an even number or an odd number.
[0139] In an exemplary embodiment, the above-mentioned determination of the first slow axis scanning speed of the ROI region and the second slow axis scanning speed of the sparse region includes the following steps S60 to S64:
[0140] S60: Taking the quotient of the first target resolution divided by the default resolution of the scanning area as the first coefficient.
[0141] For the introduction of the first coefficient, please refer to the above S20, which will not be described again here to avoid repetition.
[0142] S61: taking the product of the first coefficient and the uniform scanning speed as the first slow axis scanning speed, wherein the uniform scanning speed is the scanning speed when the scanning area is uniformly scanned, and specifically refers to the speed of uniform scanning along the slow axis direction.
[0143] S62: Determine a second stroke of the ROI area according to the first slow axis scanning speed and the first target number of lines.
[0144] Specifically, the product of the first slow axis scanning speed and the first target number of lines can be used as the second stroke. The first slow axis scanning speed is recorded as Vmid, the first target number of lines is recorded as midlines, and the second stroke is recorded as midZone2, then midZone2 = Vmid*midlines. The second stroke actually represents the actual stroke of the ROI area.
[0145] S63: Calculate a second difference between the total stroke and the second stroke.
[0146] The second difference obtained by subtracting the second stroke from the total stroke actually represents the actual stroke in the sparse area, which can be recorded as totalZone-midZone2.
[0147] S64: Determine a second slow-axis scanning speed according to the second difference and the second target number of lines.
[0148] Specifically, the quotient of the second difference divided by the second target number of lines, that is, the quotient of the actual travel of the sparse area divided by the second target number of lines, can be calculated to obtain the second slow axis scanning speed of the sparse area.
[0149] In an exemplary embodiment, the sparse region may specifically include a first sparse region located above the ROI region and a second sparse region located below the ROI region. Figure 7 , Figure 7 The scanning area is divided into three areas along the slow axis direction, namely area A, area B and area C. Among them, area B is the ROI area, area A is the first sparse area, and area C is the second sparse area.
[0150] Exemplarily, the slow axis scanning speeds of the first sparse area and the second sparse area can be the same, for example, both are the second slow axis scanning speed mentioned above, and the slow axis scanning speed of the ROI area is the first slow axis scanning speed mentioned above, ensuring that the stroke obtained by multiplying the slow axis scanning speed of the ROI area by one fast axis cycle can be divided by the ellipse height, so that the ellipse trajectory in the ROI area can be evenly stretched. The number of rows of the first sparse area and the second sparse area can also be the same, for example, the number of rows of the first sparse area and the second sparse area are both half of the second target number of rows mentioned above.
[0151] Exemplarily, the slow axis scanning speeds of the first sparse area and the second sparse area may not be different, but it is necessary to ensure that the stroke obtained by multiplying the slow axis scanning speeds of the first sparse area and the second sparse area by one fast axis cycle can be divided by the ellipse height as much as possible, so that the ellipse tracks in the first sparse area and the second sparse area are stretched as evenly as possible. The number of rows of the first sparse area and the second sparse area may also be different, but it is necessary to ensure that the sum of the number of rows of the first sparse area and the second sparse area is the above-mentioned second target number of rows.
[0152] In this embodiment, when it is determined that the slow-axis scanning speed does not match the ellipse height, the number of rows and the slow-axis scanning speed of the ROI area and the sparse area in the scanning area can be allocated and adjusted to obtain the first target number of rows and the first slow-axis scanning speed allocated to the ROI area and the second target number of rows and the second slow-axis scanning speed allocated to the sparse area, and the galvanometer is controlled to scan the ROI area at the first slow-axis scanning speed, and the sparse area at the second slow-axis scanning speed, so that the slow-axis scanning stroke of the galvanometer matches 1 / K of the ellipse height within one fast-axis cycle, thereby solving the adhesion problem of the ellipse trajectory. At the same time, the first slow-axis scanning speed allocated to the ROI area is usually lower than the uniform scanning speed, and the second slow-axis scanning speed allocated to the sparse area is usually higher than the uniform scanning speed, so as to place the area with a low slow-axis scanning speed in the angle area that the radar focuses on, namely the ROI area, so that objects in the front center area can be detected more accurately and finely.
[0153] Figure 8 It is a structural schematic diagram of a galvanometer control device provided in an embodiment of the present application.
[0154] For example, Figure 8 As shown, the device includes: a first determination module 201, used to determine the slow axis scanning speed of the galvanometer. A second determination module 202, used to determine the ellipse height in the second direction of the ellipse track formed when the fast axis of the galvanometer scans to a rated angle in the first direction; a scanning speed determination module 203, used to determine the first vertical scanning speed of the ROI area and the second vertical scanning speed of the sparse area when it is determined that the slow axis scanning speed does not match the ellipse height; a scanning control module 204, used to control the galvanometer to scan the ROI area at the first vertical scanning speed, and scan the sparse area at the second vertical scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height within one fast axis cycle, where K is a positive integer.
[0155] It is not difficult to find that this embodiment is a device embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above method embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above method embodiment.
[0156] Fig. 9 It is a schematic diagram of the structure of a radar provided in an embodiment of the present application.
[0157] For example, Fig. 9As shown, the radar includes: a memory 301 and a processor 302, wherein the memory 301 stores executable program codes, and the processor 302 is used to call and execute the executable program codes to perform a galvanometer control method.
[0158] In this embodiment, the radar can be divided into functional modules according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0159] In the case of dividing each functional module according to each function, the radar may include: a first determination module, a second determination module, a scanning speed determination module, a scanning control module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0160] The radar provided in this embodiment is used to execute the above-mentioned galvanometer control method, and thus can achieve the same effect as the above-mentioned implementation method.
[0161] In the case of an integrated unit, the radar may include a processing module and a storage module. The processing module may be used to control and manage the actions of the radar. The storage module may be used to support the radar in executing mutual program codes and data.
[0162] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits represented in combination with the contents disclosed in this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0163] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is run on a computer, the computer executes the above-mentioned related method steps to implement a control method for a galvanometer in the above-mentioned embodiment.
[0164] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement a control method of a galvanometer in the above-mentioned embodiment.
[0165] In addition, the radar provided in the embodiments of the present application may specifically be a chip, a component or a module, and the radar may include a connected processor and a memory; wherein the memory is used to store instructions, and when the radar is running, the processor may call and execute the instructions so that the chip executes a galvanometer control method in the above-mentioned embodiment.
[0166] Among them, the radar, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0167] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0168] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0169] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for controlling a galvanometer, characterized in that: The method comprises: Determine the slow axis scanning speed of the galvanometer; Determine the elliptical height in the second direction of the elliptical track formed when the fast axis of the galvanometer scans to a rated angle in the first direction; In the case where it is determined that the slow axis scanning speed does not match the ellipse height, determining a first slow axis scanning speed of the ROI area and a second slow axis scanning speed of the sparse area; The galvanometer is controlled to scan the ROI area at the first slow axis scanning speed, and to scan the sparse area at the second slow axis scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height within one fast axis cycle, where K is a positive integer.
2. The method according to claim 1, characterized in that The ROI area corresponds to a preset parameter set; the method further includes: According to the ellipse height and multiple K values, multiple candidate scanning strokes are calculated; wherein one The candidate scanning stroke is: when K is a positive integer, the product of 1 / K and the height of the ellipse; According to the plurality of candidate scanning runs and a preset parameter set corresponding to the ROI region, a first target number of rows to be allocated to the ROI region and a second target number of rows to be allocated to the sparse region are determined.
3. The method according to claim 2, characterized in that The preset parameter set includes: The design resolution and design stroke range of the ROI region, and determining a first target number of rows allocated to the ROI region and a second target number of rows allocated to the sparse region according to the plurality of candidate scanning strokes and a preset parameter set corresponding to the ROI region, include: Obtaining differences between the plurality of candidate scanning strokes and twice the design resolution, Determine a first scanning stroke of the ROI region from among the multiple candidate scanning strokes; wherein the difference between the first scanning stroke and twice the design resolution is the smallest; Determining a first target resolution of the ROI area according to the first scanning stroke; Determining a first ideal number of rows of the ROI area according to the designed travel range and the first target resolution; Determining a second ideal number of rows in the sparse area according to the first ideal number of rows in the ROI area; Based on the principle that the total stroke remains unchanged, the edge resolution of the sparse area is calculated according to the first ideal number of lines, the first target resolution and the second ideal number of lines; The first target number of lines and the second target number of lines are calculated according to the edge resolution and the first target resolution.
4. The method according to claim 3, characterized in that The calculating the first target number of rows and the second target number of rows according to the edge resolution and the first target resolution includes: Obtaining differences between the plurality of candidate scanning strokes and twice the edge resolution, Determining a second scanning stroke of the sparse area from the plurality of candidate scanning strokes; wherein a difference between the second scanning stroke and twice the edge resolution is the smallest; Determining a second target resolution of the sparse area according to the second scanning stroke; The first target number of lines and the second target number of lines are calculated according to the first target resolution and the second target resolution.
5. The method according to claim 4, characterized in that The calculating the first target number of rows and the second target number of rows according to the first target resolution and the second target resolution includes: Based on the principle that the total number of rows and the total stroke remain unchanged, the first calculated number of rows of the ROI area is obtained by analyzing the equation group; wherein the equation group includes: x+y=h, x*f1+y*f2=z, x is the first calculated number of rows, y is the second calculated number of rows, h is the total number of rows, f1 is the first target resolution, f2 is the second target resolution, and z is the total stroke; The first target number of rows and the second target number of rows are determined according to the first calculated number of rows.
6. The method according to claim 5, characterized in that The preset parameter set further includes: a minimum value of the design travel range of the ROI area and a maximum value of the design travel range; and determining the first target number of rows and the second target number of rows according to the first calculated number of rows includes: Compare the first calculated number of rows with the maximum number of rows and the minimum number of rows respectively; wherein the maximum number of rows is obtained based on the maximum value of the first target resolution and the designed stroke range, and the minimum number of rows is obtained based on the minimum value of the first target resolution and the designed stroke range; When the first calculated number of rows is greater than the maximum number of rows, taking the maximum number of rows as the first target number of rows; When the first calculated number of rows is less than the minimum number of rows, taking the minimum number of rows as the first target number of rows; When the first calculated row number is greater than or equal to the minimum row number and less than or equal to the maximum row number, the first calculated row number after rounding is used as the first target row number; The second target number of rows is determined according to the first target number of rows and the total number of rows.
7. The method according to claim 6, characterized in that Before comparing the first calculated number of rows with the maximum number of rows and the minimum number of rows respectively, the method further includes: Determine whether the first calculation row number is an odd number; When the first number of calculation rows is an odd number, performing an even number processing on the first number of calculation rows, so that the first number of calculation rows after the even number processing is an even number; The comparing the first calculated number of rows with the maximum number of rows and the minimum number of rows respectively comprises: The first calculated row number after the even numbering process is compared with the maximum row number and the minimum row number respectively.
8. The method according to claim 3, characterized in that The calculating the edge resolution of the sparse area based on the principle that the total stroke remains unchanged and according to the first ideal number of lines, the first target resolution and the second ideal number of lines includes: taking a quotient of the first target resolution divided by a default resolution of the scanning area as a first coefficient; Calculating a first stroke of the ROI area according to the first coefficient and the first ideal number of lines; Calculating a first difference between a total stroke of the scanning area and the first stroke; The edge resolution of the sparse area is calculated according to the default resolution, the first difference and the second ideal number of lines.
9. The method according to any one of claims 3 to 8, characterized in that: The step of determining a first slow axis scanning speed of the ROI region and a second slow axis scanning speed of the sparse region comprises: taking a quotient of the first target resolution divided by a default resolution of the scanning area as a first coefficient; The product of the first coefficient and the uniform scanning speed is used as the first slow axis scanning speed; wherein the uniform scanning speed is the scanning speed when the scanning area is scanned at a uniform speed; determining a second stroke of the ROI region according to the first slow axis scanning speed and the first target number of lines; calculating a second difference between the total stroke and the second stroke; The second slow-axis scanning speed is determined according to the second difference and the second target number of lines.
10. The method according to any one of claims 3 to 8, characterized in that: The preset parameter set further includes: a minimum value of the design resolution and a maximum value of the design resolution. The determining, according to the first scanning stroke, a first target resolution of the ROI area includes: In a case where 1 / 2 of the first scanning stroke is greater than the maximum value of the design resolution, taking the maximum value of the design resolution as the first target resolution; In a case where 1 / 2 of the first scanning stroke is less than the minimum value of the design resolution, the minimum value of the design resolution is used as the first target resolution; When 1 / 2 of the first scanning stroke is greater than or equal to the minimum value of the designed resolution and less than or equal to the maximum value of the designed resolution, 1 / 2 of the first scanning stroke is used as the first target resolution.
11. The method according to any one of claims 3 to 8, characterized in that: The step of determining a first ideal number of rows of the ROI area according to the design angle range and the first target resolution includes: Calculating a quotient obtained by dividing the designed travel range by the first target resolution, and rounding the quotient to obtain a target quotient; When the target quotient is an even number, taking the target quotient as the first ideal row number of the ROI area; In the case that the target quotient is not an even number, the target quotient is evened, and the evened target quotient is used as the first ideal row number.
12. A control device for a galvanometer, characterized in that: The device comprises: A first determination module is used to determine the slow axis scanning speed of the galvanometer; A second determination module is used to determine the elliptical height in the second direction of the elliptical track formed when the fast axis of the galvanometer scans to a rated angle in the first direction; A scanning speed determination module, used for determining a first vertical scanning speed of the ROI area and a second vertical scanning speed of the sparse area when it is determined that the slow axis scanning speed does not match the ellipse height; The scanning control module is used to control the galvanometer to scan the ROI area at the first vertical scanning speed and scan the sparse area at the second vertical scanning speed, so that the slow axis scanning stroke of the galvanometer matches 1 / K of the ellipse height within one fast axis cycle, where K is a positive integer.
13. A radar, characterized in that: The radar comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the radar executes the method according to any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Method for determining ovality of cross section of tubular object and reference equipment used by method
CN112113510A
Scanning method and device and computer storage medium
CN116338624A
Lissajous dual-axial scan element and scan frequency generation method thereof
TW201416791A
Multi-beam emitting device and light scanning unit employing the same
US20050105155A1
Scanning Mirror Control with Slow Scan Position Offset
US20190094667A1