Control method, device and computer readable storage medium of laser galvanometer

By converting the scanning trajectory into data fields and matching them with functional functions, and encapsulating them into a control program, the problem of high data processing resource overhead in laser galvanometer control is solved, achieving efficient scanning trajectory control and improving the scanning accuracy and system stability of the laser galvanometer.

CN117047265BActive Publication Date: 2025-11-28SHENZHEN RUIDA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311130492.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-11-28
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

Existing control methods for laser galvanometers suffer from high data processing resource overhead and difficulty in efficiently solving complex scanning trajectories.

Method used

By acquiring the steps to be executed and the execution parameters of the scanning trajectory, converting them into data fields, matching the corresponding function, and encapsulating them into a control program, the laser galvanometer is controlled to execute the scanning trajectory, reducing the amount of data processing required by the controller.

Benefits of technology

This improved the data processing efficiency of the controller, enhanced the scanning accuracy of the laser galvanometer and the stability of the system, and reduced computational overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117047265B_ABST
    Figure CN117047265B_ABST
Patent Text Reader

Abstract

The application discloses a kind of control method, equipment and computer readable storage medium of laser galvanometer, the control method of laser galvanometer includes the following steps: obtaining the step to be executed contained in scanning track and the execution parameter corresponding to the step to be executed;The step to be executed and the execution parameter are converted into corresponding data field;Based on the character content of the data field, the corresponding function function is matched;All function functions corresponding to the scanning track are encapsulated as corresponding to be executed control program, and the control program is based on laser galvanometer and executes the scanning track to control.The data processing amount of controller can be reduced by the above method, and the data processing efficiency of controller is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of laser processing, in particular to a laser galvanometer control method, device and computer readable storage medium. BACKGROUND

[0002] As a common tool in the field of laser processing, laser galvanometer is often used to perform laser marking, laser projection and laser cutting and the like. At present, the working mode of laser galvanometer is usually to transmit the working parameters of the scanning track to the controller, and convert the corresponding electrical signals by the controller to control the movement of the galvanometer to complete the scanning track. For complex scanning tracks, the data volume covered by the working parameters is large, which requires the controller to have high data processing capacity, but the above working mode still has the defect of large data processing resource consumption.

[0003] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY

[0004] The main purpose of the present application is to provide a laser galvanometer control method, device and computer readable storage medium, aiming at solving the technical problem that the current control mode of laser galvanometer has the defect of large data processing resource consumption and is difficult to efficiently solve complex scanning tracks.

[0005] To achieve the above purpose, the present application provides a laser galvanometer control method, which comprises the following steps:

[0006] Obtaining the to-be-executed steps contained in the scanning track and the execution parameters corresponding to the to-be-executed steps;

[0007] Converting the to-be-executed steps and the execution parameters into corresponding data fields;

[0008] Matching the corresponding function functions based on the character content of the data fields;

[0009] Packaging all the function functions corresponding to the scanning track into corresponding to-be-executed control programs, and controlling the laser galvanometer to execute the scanning track based on the control programs.

[0010] Optionally, before the step of obtaining the to-be-executed steps contained in the scanning track and the execution parameters corresponding to the to-be-executed steps, it further comprises:

[0011] Obtaining the function operations executable by the laser galvanometer and the input parameters required when executing the function operations;

[0012] Defining the generation of the function functions based on the execution logic corresponding to the control operations and the input parameters.

[0013] Optionally, the step of converting the to-be-executed step and the execution parameter into a corresponding data field comprises:

[0014] sampling the coordinate points in the execution parameter when the execution parameter contains a large number of coordinate points;

[0015] compressing the sampled coordinate data;

[0016] determining a function function name corresponding to the to-be-executed step;

[0017] constructing the data field based on the function function name and the compressed coordinate data.

[0018] Optionally, the step of converting the to-be-executed step and the execution parameter into a corresponding data field further comprises:

[0019] when the to-be-executed parameter does not contain a large number of coordinate points, mapping the execution parameter into a corresponding symbol sequence based on a symbol set;

[0020] determining a function function name corresponding to the to-be-executed step;

[0021] constructing the data field based on the symbol sequence and the function function name.

[0022] Optionally, the step of matching the character content of the data field with a corresponding function function further comprises:

[0023] reading the data field, and determining a corresponding function function based on the function function name of the data field;

[0024] assigning a data parameter in the data field as an input parameter to the function function.

[0025] Optionally, the step of encapsulating all function functions corresponding to the scanning trajectory into a corresponding to-be-executed control program, and controlling a laser galvanometer to execute the scanning trajectory based on the control program comprises:

[0026] determining an execution order of the function functions based on the scanning trajectory;

[0027] arranging and splicing the function functions based on the execution order and encapsulating to obtain the to-be-executed control program;

[0028] reading the to-be-executed control program, and generating a corresponding digital signal based on the to-be-executed control program;

[0029] controlling the laser galvanometer to execute the scanning trajectory based on the digital signal.

[0030] Optionally, after the step of encapsulating all the function functions corresponding to the scanning track into corresponding to-be-executed control programs and controlling the laser galvanometer to execute the scanning track based on the control programs, the method further comprises:

[0031] acquiring a position feedback signal and determining an actual position of the laser galvanometer based on the position feedback signal;

[0032] determining an expected position of the laser galvanometer based on an execution progress of the to-be-executed control program;

[0033] determining a position deviation of the laser galvanometer according to the actual position and the expected position;

[0034] calculating and generating a corresponding correction signal based on the position deviation;

[0035] correcting the position of the laser galvanometer based on the correction signal.

[0036] Optionally, the control method of the laser galvanometer further comprises:

[0037] when there are multiple scanning tracks to be executed, acquiring a calculation task in the scanning track;

[0038] splitting the calculation task into multiple sub-calculation tasks;

[0039] parallel processing the sub-calculation tasks based on a data dependency relationship between the sub-calculation tasks and reserving calculation results;

[0040] when the scanning track needs to be executed, using the corresponding calculation results as the execution parameters.

[0041] In addition, to achieve the above technical purposes, the application further provides a galvanometer vector control device, and the control device of the laser galvanometer comprises a memory, a processor, and a control program of the laser galvanometer stored on the memory and executable on the processor, and the control program of the laser galvanometer is configured to implement the steps of the control method of the laser galvanometer.

[0042] In addition, to achieve the above technical purposes, the application further provides a computer readable storage medium, and the computer readable storage medium stores a control program of the laser galvanometer, and the control program of the laser galvanometer is executed by a processor to implement the steps of the control method of the laser galvanometer.

[0043] This invention provides a control method for a weight-bearing laser galvanometer. The method involves acquiring the steps to be executed along the scanning trajectory and the corresponding execution parameters. These steps and parameters are then converted into corresponding data fields. Based on the character content of these data fields, appropriate function codes are matched. All function codes corresponding to the scanning trajectory are encapsulated into a corresponding control program, which is then used to control the laser galvanometer to execute the scanning trajectory. This method reduces the amount of data processing required by the controller and improves its data processing efficiency. Attached Figure Description

[0044] Figure 1 This is a flowchart illustrating the first embodiment of the laser galvanometer control method of the present invention;

[0045] Figure 2 This is a flowchart illustrating the second embodiment of the laser galvanometer control method of the present invention;

[0046] Figure 3 This is a flowchart illustrating the third embodiment of the laser galvanometer control method of the present invention;

[0047] Figure 4 This is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiments of the present invention.

[0048] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0049] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0050] This invention provides a method for controlling a laser galvanometer, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of a laser galvanometer control method according to the present invention.

[0051] In this embodiment, the control method of the laser galvanometer includes:

[0052] Step S10: Obtain the steps to be executed contained in the scan trajectory and the execution parameters corresponding to the steps to be executed.

[0053] In the present embodiment, the laser galvanometer is composed of an X-Y optical scanning head, an electronic driving amplifier and an optical mirror. When the laser galvanometer is working, the signal provided by the controller will drive the optical scanning head through the electronic driving amplifier circuit, so as to control the deflection of the laser beam in the X-Y plane, thereby completing the scanning of the two-dimensional pattern. If the laser galvanometer needs to complete a work task, it is often necessary to first formulate a scanning trajectory, which will be divided into a plurality of to-be-executed steps for execution. In addition, the to-be-executed steps need to be set with corresponding execution parameters. The formulation of the scanning trajectory is carried out according to the shape and requirements of the target pattern, and the scanning mode can be linear scanning, spiral scanning, circular arc scanning or complex curve path, etc. The parameters of the to-be-executed steps also need to be set according to the specific application and demand, which include the scanning parameters of the laser galvanometer, such as scanning speed, scanning range and scanning angle, etc. In addition, it also includes the starting point coordinates of the to-be-executed steps, scanning radius and other parameters.

[0054] Alternatively, the scanning trajectory can be described using mathematical equations or parametric curves. For example, linear scanning can be represented using the starting point, end point and scanning speed, and circular arc scanning can be represented using the center coordinates, radius and start-stop angle. This form can directly obtain the actual coordinate points through mathematical calculation and formula. In addition, the scanning trajectory can also be represented as a series of discrete coordinate points, which are arranged in a specific order to describe the position of the galvanometer in space. In other applicable scenarios, the scanning trajectory can also be presented in the form of graphical visualization, such as drawing in a two-dimensional coordinate system. Graphical software, drawing library or custom program can be used to draw the trajectory graph.

[0055] Further, when the laser galvanometer needs to perform a scan trajectory, first, the to-be-executed steps in the scan trajectory and the execution parameters corresponding to the to-be-executed steps are obtained. The to-be-executed steps in the scan trajectory can be that the pattern to be scanned is divided into a plurality of to-be-executed steps, each step has its own corresponding expression form, and the scan speed. Taking the coordinate point expression form as an example, assuming that the current scan trajectory is to scan a square, the side length of the square is L, and the starting point is the top left corner vertex. Before that, the four sides of the square are evenly divided into N small segments, and the length of each small segment is L / N. Starting from the top left corner vertex, scanning is performed in the clockwise direction. The to-be-executed steps include scanning the four sides of the square, the first side is from the top left corner vertex to the top right corner vertex, the coordinate points are generated in the x-axis direction, and the y coordinate remains unchanged. The execution parameters corresponding to the execution step are a series of coordinate points, the first coordinate point is (0, 0), the second coordinate point is (L / N, 0)…(L, 0). The second side is from the top right corner vertex to the bottom right corner vertex, the coordinate points are generated in the y-axis direction, and the x coordinate remains unchanged. The coordinate points are (L, L / N), (L, 2L / N)…(L, L). The third side is from the bottom right corner vertex to the bottom left corner vertex, the coordinate points are generated in the x-axis direction, and the y coordinate remains unchanged. The coordinate points are ((N-1)L / N, L), ((N-2)L / N, L)…(0, L). The fourth side is from the bottom left corner vertex to the top left corner vertex, the coordinate points are generated in the y-axis direction, and the x coordinate remains unchanged. The coordinate points are (0, (N-1)L / N), (0, (N-2)L / N)…(0, 0). In addition, the execution parameters also include the scan speed, such as 1 mm / s. In this way, the to-be-executed steps included in the current task and the series of coordinate points to be scanned for each to-be-executed step can be obtained.

[0056] Optionally, the coordinate points or expressions in the to-be-executed steps can be selected according to actual needs, such as integers, floating-point numbers, or other formats. Such expression forms can be saved for subsequent data transmission and used to generate control signals for the laser galvanometer system.

[0057] It should be noted that dividing the scan trajectory of the scan pattern into multiple segments and into multiple to-be-executed steps can better control the scanned area. By adjusting the starting point and the ending point of each segment, the scanning range and position can be accurately determined, avoiding scanning beyond or missing the target area, and improving the scanning precision and accuracy. For some specific application scenarios, the scan trajectory can be divided into multiple segments according to different parameters, light sources, target materials, and other factors to meet specific needs.

[0058] In this embodiment, by obtaining a plurality of to-be-executed steps of the scan trajectory and corresponding execution parameters, the execution steps can be converted into fields with less data quantity for matching corresponding functions in the subsequent process.

[0059] Step S20, converting the to-be-executed step and the execution parameter into corresponding data fields.

[0060] In this embodiment, in order to reduce the data amount of processing of the controller, the to-be-executed step and the execution parameter are converted into data fields with smaller data amount. Alternatively, when converted into data fields with smaller data amount, different conversion manners can be selected according to different scanning trajectory expression manners. For continuous scanning trajectories, a part of key points can be selected by sampling, and the positions or coordinates of the key points are recorded. The data amount can be reduced by reducing the sampling frequency, but it is necessary to ensure that enough key points are reserved to maintain the accuracy of the trajectory. In addition, a compression algorithm (such as Huffman coding, dictionary compression algorithm, etc.) can be used to compress the sampled data to reduce the required space for storage and transmission. For example, when using the dictionary compression algorithm LZ77 to compress the sampled data, the matching string in the dictionary is used to replace the repeatedly appearing data segment, thereby reducing the representation length of the data. In this process, a sliding window is first used to store the recently encountered data, and a lookup buffer is used to find the repeatedly appearing segment. The sliding window always contains the latest input data, and the lookup buffer is used to find the segment matching the data in the sliding window. Starting from the beginning of the input data of the to-be-executed step, each data segment is processed. If the current segment has a match in the lookup buffer, the matching distance (i.e., the relative position in the sliding window) and length are recorded, and the pointer is moved to the next unprocessed segment. If the current segment has no match in the lookup buffer, the segment is recorded as an independent character, and the pointer is moved to the next unprocessed segment. The sliding lookup and matching are repeated until all data segments are processed. Finally, the compressed data fields are output, wherein each compressed data field is composed of the matching distance, length, and an independent character. This character can be an independent character or the next character of the matching segment. For the segment without matching, a character is recorded as the next character. This recording form composed of distance, length, and next character can effectively represent the compressed data.

[0061] Optionally, in another possible implementation, the data in the scan trajectory can also be symbolized, mapped into a smaller symbol space. For example, a finite symbol set can be defined to represent different scan trajectory patterns or features. By converting the original data into a corresponding symbol sequence, the size of the data can be greatly reduced. In the case of a large correlation or repetition between the to-be-executed steps of the scan trajectory, a difference coding method can also be used to represent the data. That is, the difference between each data point and the previous data point is taken as the coding result, instead of directly recording the absolute value of each data point. In this way, the data amount can be effectively reduced, and the change trend of the scan trajectory is retained. In addition, if the scan trajectory contains some redundant or unnecessary information, the characteristics of the trajectory data can be analyzed to identify and remove the redundant information, thereby reducing the data amount. For example, in the case of straight-line motion, only the starting point, the ending point, and the scan speed need to be recorded, and each intermediate point does not need to be recorded.

[0062] It should be noted that when selecting the conversion method of the data field, a suitable method should be selected according to the specific application scenario and the data characteristics to convert the scan trajectory into a data field with a smaller data amount. At the same time, the character content of the converted data field is added with the corresponding function name of the to-be-executed step at the front end of the field. Optionally, a to-be-executed step can use multiple function functions to execute the scan task.

[0063] In this embodiment, by converting the data field in the scan trajectory into a data field with a smaller data amount, in the process of reducing the data amount, a lossless dictionary compression algorithm is used to ensure that the compressed output data field is lossless and does not affect the accuracy of the scan trajectory. The data field with a smaller data amount facilitates subsequent matching of the corresponding function function, thereby reducing the calculation consumption of the controller in processing the data amount.

[0064] Step S30, matching a corresponding function function based on the character content of the data field.

[0065] In this embodiment, the transformed data field is matched with the pre-set function function, each of which has a corresponding function name, and the transformed data field also includes the function name corresponding to the operation to be performed. When matching, the characters or symbols contained in the data field can be matched with the function name of the pre-constructed function function. For example, assume that a part of the transformed data field is "a0001", where a represents a linear scanning function, and 0001 represents the starting point coordinates (0, 0) and the end point coordinates (0, 1), respectively. By a, the linear scanning function with the function name a can be found from the existing function function, and then the starting point coordinates and the end point coordinates are taken as the input parameters of the function function. In this way, the matching process of the data field of the to-be-executed step with the function function is completed. Similarly, the data fields of other to-be-executed steps are matched according to the above process, and the input parameters of the function function are set. In addition, the unit of the numerical value in the data field should also be converted to the same unit as the input parameter setting of the function function when matching, so as to avoid calculation errors.

[0066] The function function is a function constructed in advance according to the functions and operations that can be performed by the laser galvanometer. When constructing the function function, the functions that the laser galvanometer can perform are determined, such as scanning, positioning, tracking, etc. According to the execution logic of the function, the input parameters required by the function function are determined, which usually include the current position of the galvanometer, the target position or angle, the scanning speed, the acceleration, the scanning mode, etc. According to the input parameters, the code is written to realize the position control of the laser galvanometer. This can include using control systems, trajectory planning-based control algorithms, calibration, etc. to move the galvanometer to a specified position or angle. For example, if a scanning function is needed, the starting position and the ending position of the scanning can be set according to the input parameters, and the laser galvanometer is controlled to perform scanning motion quickly and smoothly within the specified range. In addition, parameters such as scanning speed and direction are also involved. Variables are defined according to input parameters, and code is written according to execution logic, so that a function function of the scanning function is formed. In addition, according to specific needs, the function function can be further enriched, such as adding a tracking function to enable the laser galvanometer to track a moving target, or adding a complex pattern generation function to enable the laser galvanometer to generate a specific pattern, etc. In view of possible errors and abnormal situations in actual application, corresponding error handling mechanisms and protection measures can be added to improve the stability and reliability of the system. When constructing the function function, appropriate tools and libraries need to be selected according to the specific development environment and programming language. At the same time, the function function needs to be properly debugged and optimized in combination with the specifications and characteristics of the laser galvanometer device to ensure its normal operation and meet the expected functional requirements. The designed function function is assigned a more convenient function name for matching the function function name contained in the data field.

[0067] In this embodiment, by matching the compressed and converted data fields of each to-be-executed step with the corresponding function mode, a plurality of to-be-executed function functions having been passed in can be obtained, and a series of function functions can be directly executed in the execution order of the execution steps, so as to complete the scanning task of the scanning pattern. Compared with the previous processing mode, the data processing amount is greatly reduced.

[0068] In step S40, all function functions corresponding to the scanning trajectory are packaged into a corresponding to-be-executed control program, and the laser galvanometer is controlled to execute the scanning trajectory based on the control program.

[0069] In this embodiment, the function functions that have been matched in advance are packaged into an integral to-be-executed control program according to the sequence of execution steps, and the controller outputs a control signal by executing the control program to control the optical scanning head of the laser galvanometer to execute the scanning task according to the scanning trajectory. During the scanning process, it is necessary to ensure the stability, power and focusing effect of the laser beam, which involves the control of the laser, the adjustment of the optical system and the real-time monitoring and feedback control of the beam parameters, so it is necessary to continuously monitor and control the position of the galvanometer, the beam quality and the scanning result, etc.

[0070] In the process of executing the control program, the current position information of the laser galvanometer can be obtained in real time by installing a position sensor (such as a photodiode, a Hall effect sensor, etc.) on the laser galvanometer. Based on the data feedback by the position sensor, the controller uses a control algorithm to calculate the control signal of the laser galvanometer based on the related parameters in the control program. Common control algorithms include proportional-integral-derivative controllers, fuzzy control, etc. The controller converts the calculated control signal into a current or voltage signal through a drive circuit and inputs it into the driver of the laser galvanometer. In this way, the driver will drive the galvanometer to move accordingly according to the control signal. In order to improve the accuracy and stability of the control, a feedback control mechanism can be used. That is, the output signal is compared with the actual position feedback by the position sensor, and the control signal is corrected according to the comparison result, so that the galvanometer can more accurately reach the target position. The above steps are usually performed in a loop, that is, the current position information is continuously obtained, the control signal is calculated, the galvanometer is driven, and the feedback control is performed until the galvanometer reaches the predetermined position or motion state.

[0071] It should be noted that the specific control method will vary depending on the model of the laser galvanometer, the control requirements and the application scenarios. In actual application, debugging and parameter optimization may be required according to the actual situation to obtain the best control effect.

[0072] Optionally, in order to ensure the scanning accuracy, the laser galvanometer can also be calibrated before scanning to ensure the accuracy of its position and angle. Here the initial adjustment, calibration and alignment of the galvanometer can be performed by using calibration algorithms, sensors and feedback mechanisms.

[0073] In the embodiment, the scanning task is completed by using a control algorithm by encapsulating the function corresponding to the to-be-executed step into a whole to-be-executed program and then directly executing the to-be-executed program by the controller. The amount of data to be processed is reduced and the calculation overhead is saved.

[0074] Further, with reference to Figure 2 The second embodiment of the control method of the laser galvanometer of the present application further comprises the following steps after step S40:

[0075] Step S50, acquiring a position feedback signal and determining the actual position of the laser galvanometer based on the position feedback signal.

[0076] Step S60, determining the expected position of the laser galvanometer based on the execution progress of the to-be-executed control program.

[0077] Step S70, determining the position deviation of the laser galvanometer according to the actual position and the expected position.

[0078] Step S80, calculating and generating a corresponding correction signal based on the position deviation.

[0079] Step S90, correcting the position of the laser galvanometer based on the correction signal.

[0080] In this embodiment, in order to ensure the scanning accuracy of the laser galvanometer, the scanning position of the laser galvanometer can be continuously corrected during the execution of the scanning task by the laser galvanometer. In the laser galvanometer system, sensors or encoders for measuring the position of the galvanometer are installed. These devices can monitor the position of the galvanometer in real time and convert it into an electrical signal. The controller receives the position feedback signal provided by the sensor or encoder. These signals represent the actual position of the galvanometer, and then determine the expected position of the laser galvanometer according to the execution progress of the scanning task (such as which step is executed). The actual position of the laser galvanometer is compared with the expected position to calculate the error. The position error refers to the deviation of the current position of the galvanometer from the expected position. According to the size and direction of the error, it can be judged whether the galvanometer needs to be corrected. Based on the position error, the controller uses a control algorithm to calculate the corresponding control signal. Based on the control signal calculated by the control algorithm, the controller generates a corresponding current or voltage signal, which will be used to adjust the position of the laser galvanometer to gradually approach the expected position. The correction signal is usually an analog signal that needs to be processed by amplification and filtering. The correction signal is transmitted to the laser galvanometer system through the output interface of the controller. These signals drive the actuator of the galvanometer system to adjust the angle and position of the galvanometer to achieve error correction.

[0081] It should be noted that feedback control is generally a closed control loop, and the above steps will be executed continuously. That is, during the movement of the galvanometer, the position feedback continuously provides actual position information, the control algorithm calculates the correction signal according to the real-time error, and continuously adjusts the position of the galvanometer to maintain the proximity to the expected position.

[0082] In this embodiment, by correcting the position of the laser galvanometer, the stability and accuracy of the laser galvanometer system can be achieved, and real-time correction is performed according to the actual position feedback to achieve the required accurate control effect and improve the scanning accuracy of the laser galvanometer.

[0083] Reference Figure 3 The control method of the laser galvanometer further comprises the following steps:

[0084] Step S100, when there are multiple scanning trajectories to be executed, obtaining a calculation task in the scanning trajectory.

[0085] Step S110, splitting the calculation task into multiple sub-computation tasks.

[0086] Step S120, based on the data dependency relationship between the sub-computation tasks, processing the sub-computation tasks in parallel and retaining the calculation results.

[0087] Step S130, when the scanning trajectory needs to be executed, the corresponding calculation result is used as the execution parameter.

[0088] In this embodiment, the data processing efficiency of the controller is improved from another aspect. Optionally, distributed computing resources can be used for parallel computing. When there are multiple scanning trajectories to be executed by the laser galvanometer, the computing tasks in the scanning trajectories can be acquired first, the computing tasks are divided into multiple sub-computing tasks, then the sub-computing tasks are processed in parallel according to the data dependency relationship between the sub-computing tasks and the calculation results are reserved, when the scanning trajectory needs to be executed, the calculation results are used as execution parameters, and then the step S20 is executed to convert the execution parameters into data fields. In addition, for some steps to be executed with high repetition, pre-computation and pre-storage can also be performed. For example, if a task needs to frequently repeat the same motion trajectory, the corresponding position points can be pre-calculated and stored to avoid re-computation every time the task is executed. When dividing the sub-computing tasks, the tasks can be divided into multiple sub-computing tasks according to different functions and computing steps involved in the computing tasks. Each sub-computing task is responsible for processing one function or computing step. The dependency relationship between the sub-computing tasks mainly refers to the order of the sub-computing tasks and whether the calculation result of the previous sub-computing task is the calculation parameter of the next sub-computing task. The calculation based on the dependency relationship can ensure the correctness of the calculation result. It should be noted that when dividing the sub-computing tasks, the specific application scenarios and requirements should be considered comprehensively, and the relationship between the computing overhead and the system performance should be balanced.

[0089] In this embodiment, the advantages of parallel computing can improve the computing efficiency. In addition, the computing overhead of the laser galvanometer when executing the task can be effectively reduced, and the real-time performance and responsiveness of the system can be improved.

[0090] Referring to Figure 4 , Figure 4 The control device structure diagram of the laser galvanometer related to the hardware running environment of the embodiment scheme of the present application.

[0091] As Figure 4As shown, the control device of the laser galvanometer can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.

[0092] Those skilled in the art can understand that Figure 4 The structure shown in the figure does not constitute a limitation on the control device of the laser galvanometer, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.

[0093] As Figure 4 As shown, the memory 1005 as a storage medium can include an operating system, a data storage module, a network communication module, a user interface module, and a control program of the laser galvanometer.

[0094] In Figure 4 In the control device of the laser galvanometer shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the control device of the laser galvanometer can be arranged in the control device of the laser galvanometer, and the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and performs the following steps:

[0095] Obtain the to-be-executed steps contained in the scanning track and the execution parameters corresponding to the to-be-executed steps;

[0096] Convert the to-be-executed steps and the execution parameters into corresponding data fields;

[0097] Match the corresponding function function based on the character content of the data field;

[0098] The control device of the laser galvanometer encapsulates all the function functions corresponding to the scanning trajectory as corresponding to-be-executed control programs, and controls the laser galvanometer to execute the scanning trajectory based on the control programs.

[0099] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further executes the following steps:

[0100] Obtain the function operations executable by the laser galvanometer, and the input parameters required when executing the function operations;

[0101] Based on the execution logic corresponding to the control operation and the input parameters, define the function function.

[0102] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further executes the following steps:

[0103] When the execution parameter contains a large number of coordinate points, sample the coordinate points in the execution parameter;

[0104] Compress the sampled coordinate data;

[0105] Determine the function function name corresponding to the to-be-executed step;

[0106] Based on the function function name and the compressed coordinate data, the data field is constituted.

[0107] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further executes the following steps:

[0108] When the to-be-executed parameter does not contain a large number of coordinate points, map the execution parameter to a corresponding symbol sequence based on a symbol set;

[0109] Determine the function function name corresponding to the to-be-executed step;

[0110] Based on the symbol sequence and the function function name, the data field is constituted.

[0111] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further executes the following steps:

[0112] Read the data field, determine the corresponding function function based on the function function name of the data field;

[0113] The data parameters in the data field are assigned as input parameters to the function function.

[0114] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further performs the following steps:

[0115] Based on the scan trajectory, determine the execution order of the function function;

[0116] Based on the execution order, arrange and splice the function function and encapsulate to obtain the to-be-executed control program;

[0117] Read the to-be-executed control program, and generate a corresponding digital signal based on the to-be-executed control program;

[0118] Based on the digital signal, control the laser galvanometer to execute the scan trajectory.

[0119] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further performs the following steps:

[0120] Obtain a position feedback signal, and determine the actual position of the laser galvanometer based on the position feedback signal;

[0121] Based on the execution progress of the to-be-executed control program, determine the expected position of the laser galvanometer;

[0122] According to the actual position and the expected position, determine the position deviation of the laser galvanometer;

[0123] Based on the position deviation, calculate and generate a corresponding correction signal;

[0124] Based on the correction signal, correct the position of the laser galvanometer.

[0125] Further, the control device of the laser galvanometer calls the control program of the laser galvanometer stored in the memory 1005 through the processor 1001, and further performs the following steps:

[0126] When there are multiple to-be-executed scan trajectories, obtain the calculation task in the scan trajectory;

[0127] Split the calculation task into multiple sub-computation tasks;

[0128] Based on the data dependency relationship between the sub-computation tasks, the sub-computation tasks are processed in parallel and the calculation results are reserved;

[0129] When the scan trajectory needs to be executed, the corresponding calculation result is used as the execution parameter.

[0130] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.

[0131] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0132] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, of course, they can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) as described above, and includes a number of instructions for making a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of the present application.

[0133] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.

Claims

1. A method of controlling a laser galvanometer, characterized by, The control method of the laser galvanometer comprises the following steps: acquiring a scanning track and a corresponding execution parameter of a to-be-executed step included in the scanning track; converting the to-be-executed step and the execution parameter into a corresponding data field; matching a corresponding function function based on the character content of the data field; encapsulating all function functions corresponding to the scanning track into a corresponding to-be-executed control program, and controlling the laser galvanometer to execute the scanning track based on the control program; Before the step of acquiring the scanning track and the corresponding execution parameter of the to-be-executed step included in the scanning track, the method further comprises the following steps: acquiring a function operation executable by the laser galvanometer, and an input parameter required when the function operation is executed; defining a function function based on the execution logic corresponding to the function operation and the input parameter; The step of converting the to-be-executed step and the execution parameter into a corresponding data field comprises the following steps: When the execution parameter includes a large number of coordinate points, sampling the coordinate points in the execution parameter; compressing the sampled coordinate data; determining the function function name corresponding to the to-be-executed step; based on the function function name and the compressed coordinate data, the data field is formed; When the to-be-executed parameter does not include a large number of coordinate points, the execution parameter is mapped into a corresponding symbol sequence based on a symbol set; determining the function function name corresponding to the to-be-executed step; based on the symbol sequence and the function function name, the data field is formed. The step of matching a corresponding function function based on the character content of the data field further comprises the following steps:

2. The control method of a laser galvanometer as claimed in claim 1, wherein, reading the data field, determining the corresponding function function based on the function function name of the data field; assigning the data parameter in the data field as an input parameter to the function function. The step of encapsulating all function functions corresponding to the scanning track into a corresponding to-be-executed control program, and controlling the laser galvanometer to execute the scanning track based on the control program comprises the following steps:

3. The method of controlling a laser galvanometer according to claim 1, wherein determining the execution order of the function function based on the scanning track; based on the execution order, arranging and splicing the function function and encapsulating to obtain the to-be-executed control program; reading the to-be-executed control program, and generating a corresponding digital signal based on the to-be-executed control program; controlling the laser galvanometer to execute the scanning track based on the digital signal. After the step of encapsulating all function functions corresponding to the scanning track into a corresponding to-be-executed control program, and controlling the laser galvanometer to execute the scanning track based on the control program, the method further comprises the following steps:

4. The method of controlling a laser galvanometer according to claim 1, wherein, acquiring a position feedback signal, and determining an actual position of the laser galvanometer based on the position feedback signal; determining an expected position of the laser galvanometer based on the execution progress of the to-be-executed control program; determining a position deviation of the laser galvanometer according to the actual position and the expected position; calculating and generating a corresponding correction signal based on the position deviation; correcting the position of the laser galvanometer based on the correction signal. ​ 5. The method of controlling a laser galvanometer according to claim 1, wherein, The control method of the laser galvanometer further comprises: When there are multiple scanning tracks to be executed, obtaining a calculation task in the scanning tracks; Splitting the calculation task into multiple sub-calculation tasks; Parallel processing the sub-calculation tasks based on the data dependency relationship between the sub-calculation tasks and reserving calculation results; When the scanning track needs to be executed, corresponding calculation results are used as the execution parameters.

6. A control device for a laser galvanometer, characterized in that The control device of the laser galvanometer comprises a memory, a processor, and a control program of the laser galvanometer stored on the memory and executable on the processor, and the control program of the laser galvanometer is configured to implement the steps of the control method of the laser galvanometer according to any one of claims 1 to 5.

7. A computer readable storage medium characterized by The control program of the laser galvanometer is stored on the computer readable storage medium, and when executed by the processor, the steps of the control method of the laser galvanometer according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Galvanometer calibration system and method

    CN110497075A

  • Vehicle trajectory data compression method and device based on fuzzy coding

    CN115909545A