Automatic sample plate matching method of athermalization optical system
By writing macro commands and SPL languages in CodeV software, the lens curvature radius of the thermally-free optical system is automatically matched, solving the problem of experience dependence on template matching and achieving high-precision and efficient optical system design.
Patent Information
- Application Number
- CN202510483066.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-08-01
AI Technical Summary
Thermal-free optical system relies on designer experience during the template matching process, resulting in low matching accuracy and low efficiency, and the global optimal solution cannot be achieved.
The macro commands and SPL language programming in CodeV optical design software are used to automatically match the curvature radius of the optical system lenses, evaluate the optimal replacement order through the error function, and call the optimization sequence file after each replacement to ensure imaging quality until all lenses are replaced.
High-precision template matching for thermal-free optical systems is achieved, reducing dependence on designer experience, and improving design efficiency and system performance stability.
Smart Images

Figure CN120408977A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of athermal optical design, and particularly to an automatic matching method for templates of an athermal optical system. Background Art
[0002] In the design of modern optical systems, changes in environmental temperature can cause changes in the structural parameters of optical elements, thereby deteriorating the performance of the optical system. To solve this problem, athermal optical design has become an important research direction in optical engineering. Athermal design optimizes the combination of optical materials, element layout, and structural parameters to ensure that the optical system can maintain stable imaging performance when the temperature changes.
[0003] However, after the athermal design is completed, it needs to be processed, and template matching becomes an important part of it. The traditional method of matching the glass curvature radius with the template still relies on the experience of designers. Since the optical parameters of the system change after athermalization, the original macro commands of the glass sleeve template library cannot be directly applied, resulting in designers having to manually screen for appropriate curvature radii. This not only increases the complexity of the design, but also the matching accuracy is limited by personal experience, making it difficult to ensure the global optimal solution. Therefore, developing an intelligent and automated curvature radius matching method is of great significance for improving the efficiency and accuracy of optical system design.
[0004] Currently, the selection of the curvature radius when fitting templates for athermal optical systems mainly relies on the manual selection method in the design. According to the system parameters after athermalization, a suitable curvature radius is manually selected for matching, but this method relies on personal experience and has low accuracy and efficiency. Summary of the Invention
[0005] The present invention aims to solve the technical problems in the prior art of low matching accuracy, low efficiency, and dependence on experience in the conventional template fitting process of athermal optical systems, and provides an automatic matching method for templates of an athermal optical system.
[0006] To solve the above technical problems, the technical solution of the present invention is specifically as follows:
[0007] An automatic matching method for templates of an athermal optical system, comprising the following steps:
[0008] Step 1: Read the curvature radius of each lens in the optical system one by one through a macro command, store it in an internal variable, and store the template library data in a format available for CodeV;
[0009] Step 2: Traverse the lens curvature and the template library curvature, and calculate the optimal replacement order according to the matching degree between the current lens parameters and the template library curvature;
[0010] Step 3: Replace the lens curvatures in sequence according to the calculated optimal order;
[0011] Step 4: After each replacement, call the CodeV optimization sequence file for optimization.
[0012] In the above technical solution, after Step 4, there is also a step:
[0013] Step 5: Loop through Steps 3 to 4 until all lens replacements are completed.
[0014] In the above technical solution, Step 1 is specifically: With the help of the CodeV built-in macro command GETVALUE combined with the FOR loop statement, collect the lens curvature radii of the current optical system, store the read curvature data, and save the template library data in a format that CodeV can use.
[0015] In the above technical solution, Step 2 is specifically:
[0016] Traverse all the lenses of the optical system and the template library data, and calculate the current lens curvature R 原 and the error between the curvature R 样 in the template library:
[0017] E = |R 样 - R 原 |
[0018] Traverse all the lenses, calculate the errors, sort them in ascending order of the errors, and form a replacement priority list.
[0019] In the above technical solution, Step 4 is specifically: After each lens curvature replacement, call the optimization sequence file to automatically adjust the optical system parameters to ensure the stability of the optical system imaging quality; after optimization, save the current optical system state and continue with the replacement of the next lens.
[0020] The present invention has the following beneficial effects:
[0021] The automatic template matching method for the athermalized optical system of the present invention can automatically traverse all optional curvature radii in the template library, evaluate the matching quality through the error function, select the optimal solution, and achieve high-precision matching of the athermalized optical system.
[0022] The automatic template matching method for the athermalized optical system of the present invention reduces the dependence on the designer's experience, makes the optical system design more stable; through the traversal of the template library and the evaluation method of the error function, it ensures the best matching of the curvature radius, improves the system performance; the automatic calculation process reduces the manual screening. Description of the Drawings
[0023] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0024] Figure 1 It is a schematic flow chart of the steps of the template automatic matching method for the athermalized optical system of the present invention. Specific embodiments
[0025] The inventive concept of the present invention is as follows:
[0026] For the template automatic matching method of the athermalized optical system of the present invention, in the CodeV optical design software, a method for automatically matching templates is realized by writing a macro (Macro, based on the SPL language), which is used to update the optical system parameters in the athermalized design state.
[0027] The traditional template matching function can only automatically generate standard templates in the thermalized state. Under athermalized conditions, since only the _seat optimization file can be used for optimization, it is impossible to automatically match the preset template parameters, and only the experience of optical designers can be used to match templates, which has a certain dependence. To solve this problem, the present invention designs an automated process to realize the process of automatic template matching by using CodeV macro commands.
[0028] The template automatic matching method of the athermalized optical system of the present invention, based on the automatic matching technology of macro programming, not only realizes the function of automatically matching templates in the athermalized state, but also ensures the accuracy of optical design parameter update and the real-time feedback of system performance, thus greatly improving the design efficiency and automation degree.
[0029] The template automatic matching method of the athermalized optical system of the present invention focuses on elaborating in detail the method of realizing the automatic template matching of the athermalized optical system by relying on the built-in macro commands (SPL language) of the CodeV optical design software. Each functional module is deeply analyzed, and specific programming means and operation steps are given for each step of technical implementation, aiming to make the present invention replicable and complete from principle to specific implementation.
[0030] The present invention will be described in detail below in conjunction with the accompanying drawings.
[0031] As Figure 1 shown, the template automatic matching method of the athermalized optical system of the present invention includes the following steps:
[0032] Step 1: Read the radius of curvature of each lens in the optical system one by one through macro commands, store it in internal variables, and store the template library data in a format available for CodeV;
[0033] Step 2: Traverse the lens curvature and the template library curvature, and calculate the optimal replacement order according to the matching degree between the current lens parameters and the template library curvature;
[0034] Step 3: Replace the lens curvatures in sequence according to the calculated optimal order;
[0035] Step 4: After each replacement, call the CodeV optimization sequence file for optimization to keep the system with reasonable optical performance throughout the process;
[0036] Step 5: Loop and execute Steps 3 - 4 until all lens replacements are completed.
[0037] Specifically:
[0038] In Step 1, the radius of curvature of each lens in the optical system is read one by one through macro commands and stored in internal variables, and the template library data is stored in a format usable by CodeV. Specifically:
[0039] With the help of the built - in macro command GETVALUE in CodeV combined with the FOR loop statement, collect the radius of curvature of the lenses in the current optical system, store the read curvature data for comparison with the template library data, and store the template library data in a format that CodeV can use.
[0040] In Step 2, traverse the lens curvatures and the template library curvatures, and calculate the optimal replacement order according to the matching degree between the current lens parameters and the template library curvatures. Specifically:
[0041] Determine the replacement priority of the lenses by calculating the matching degree between the original lens curvatures and the template library curvatures; traverse all the lenses in the optical system and the template library data, and calculate the error between the current lens curvature R 原 and the template library curvature R 样 :
[0042] E = |R 样 - R 原 |
[0043] The smaller the error, the closer the template curvature is to the original lens curvature, and it will be replaced preferentially; in this step, it is necessary to traverse all the lenses, calculate the errors, and sort them in ascending order of error to form a replacement priority list.
[0044] In Step 4, after each replacement, call the CodeV optimization sequence file for optimization. Specifically:
[0045] After each replacement of the lens curvature, the optimization sequence file will be called to automatically adjust the optical system parameters to ensure the stability of the imaging quality of the optical system. After optimization, save the current state of the optical system and continue with the replacement of the next lens.
[0046] The template automatic matching method of the athermalized optical system of the present invention can automatically traverse all optional curvature radii in the template library, evaluate the quality of the match through an error function, select the optimal solution, and achieve high-precision matching of the athermalized optical system.
[0047] The template automatic matching method of the athermalized optical system of the present invention reduces the dependence on the experience of designers, making the optical system design more stable; through the traversal of the template library and the evaluation method of the error function, it ensures the best match of the curvature radius and improves the system performance; the automatic calculation process reduces manual screening.
[0048] Obviously, the above embodiments are only examples given for clear illustration and are not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. And the obvious changes or variations derived therefrom are still within the protection scope of the present invention.
Claims
1. A method for automatically matching templates of an athermalized optical system, characterized in that, It includes the following steps: Step 1: Read the curvature radii of each lens in the optical system one by one through macro commands, store them in internal variables, and save the template library data in a format usable by CodeV; Step 2: Traverse the lens curvatures and the template library curvatures, and calculate the optimal replacement order according to the matching degree between the current lens parameters and the template library curvatures; Step 3: Replace the lens curvatures in sequence according to the calculated optimal order; Step 4: After each replacement, call the CodeV optimization sequence file for optimization.
2. The method for automatically matching templates of an athermalized optical system according to claim 1, wherein There is also a step after Step 4: Step 5: Loop through Steps 3 to 4 until all lenses are replaced.
3. The template automatic matching method for an athermalized optical system according to claim 1 or 2, characterized in that Specifically, Step 1 is: With the help of the built-in macro command GETVALUE in CodeV combined with the FOR loop statement, collect the curvature radii of the lenses in the current optical system, store the read curvature data, and save the template library data in a format that CodeV can use.
4. The method for automatically matching templates of an athermalized optical system according to claim 1 or 2, characterized in that, Specifically, Step 2 is: Traverse all the lenses and sample library data of the optical system to calculate the curvature R of the current lens 原 Curvature R of the template library 样 The error between: E = |R 样 -R 原 | Traverse all lenses, calculate the errors, sort them in ascending order of errors, and form a replacement priority list.
5. The method for automatically matching templates of an athermalized optical system according to claim 1 or 2, characterized in that, Specifically, Step 4 is: After each replacement of the lens curvature, call the optimization sequence file to automatically adjust the optical system parameters to ensure the stability of the imaging quality of the optical system; after optimization, save the current state of the optical system and continue with the replacement of the next lens.