Continuous zoom lens cam curve fitting method and storage medium
By establishing mathematical models and solving parameters, outputting and drawing the cam curve of a continuous zoom lens, the problem of difficult to accurately control the curve design in traditional methods is solved, and the imaging clarity and zooming rate stability during the lens zooming process are achieved, as well as the high-precision machining of the cam-driven curved surface profile.
Patent Information
- Application Number
- CN202510194383.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-03
AI Technical Summary
When designing the cam curve of a continuous zoom lens, it is difficult to accurately control the nonlinear relationship of the curve, resulting in unclear imaging, unstable zoom rate and insufficient machining accuracy during the zooming process of the lens.
By establishing a mathematical model, using input data such as optical intervals, solving mathematical model parameters, outputting cam curve equations, and drawing cam curves, the three-dimensional structural features of the cam drive surface profile are completed, and the accuracy of the fitting curve is evaluated.
The precise fit of the cam curve of the continuous zoom lens is achieved, which improves the imaging clarity and the stability of the zoom rate during the lens zoom process, and also improves the machining accuracy of the cam drive surface profile.
Smart Images

Figure CN120085459A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of lens opto-mechanical design, and particularly relates to a method for fitting a cam curve of a continuous zoom lens and a storage medium. Background Art
[0002] In continuous zoom lenses, cam mechanisms are widely used. The cam is the driving part, which can be divided into a cam barrel or a camshaft, and is a component with a driving surface contour; the guide rail or bracket is the frame and is fixed; each lens is the follower part, which can be divided into single-element or multi-element, and moves axially along the optical axis direction. When the continuous zoom lens operates, its motor drives the cam to rotate, driving each lens to move axially on the guide rail or bracket. The movement law of each lens depends on the driving surface contour of the cam. The movement law of each lens axially moves according to the expected optical interval requirement to achieve the optical continuous zoom function. Therefore, the design of the cam driving surface contour can obtain the cam curve by inverse solution through the optical interval between each lens, and the three-dimensional characteristics of the cam driving surface contour can be created through the cam curve.
[0003] The optical system of a continuous zoom lens has extremely strict requirements for the optical interval between each lens. During the continuous zoom process, the optical interval error between each lens must be less than the optical design tolerance to ensure clear and stable imaging during the continuous zoom process. Therefore, the design of the cam driving surface contour is the key to clear imaging of the optical lens.
[0004] At the same time, the cam driving surface contour also affects the zoom rate of the continuous zoom lens and the smoothness of the zoom process. Therefore, when designing, it is necessary to consider the changes in the cam radius and the cam rotation angle to control the change in the helix angle of the cam driving surface contour.
[0005] For the widely used constant-lead screw drive, since the helix angle is a fixed value, the axial displacement and the rotation angle of the cam curve are linearly related, which is suitable for use in focusing lenses. For continuous zoom lenses, the axial displacement and the rotation angle of the cam curve often show a non-linear relationship, and the constant-lead screw drive cannot meet the requirements of displacement changes. Therefore, in continuous zoom lenses, a variable-lead screw drive is used to achieve the required motion law, and the cam curve is a variable-lead spiral curve.
[0006] For the design of a variable lead spiral curve, the traditional design method is to find the discrete points on the variable lead spiral curve, use the curve tool in 3D model software to generate the cam curve, and create the 3D feature of the cam drive surface contour corresponding to the variable lead spiral line by methods such as lofting or scanning. During the machining process, a CNC machining center is used to obtain the corresponding CNC machining program based on the 3D feature, so as to machine the required cam drive surface contour. However, when using the traditional design method, it is cumbersome to obtain discrete points, the generation of the cam curve lacks error control, and it is impossible to effectively evaluate the accuracy of the obtained cam curve; the CNC machining program is extracted through 3D features, the machining process is time-consuming and laborious, the cam drive surface contour is not smooth enough, and there are disadvantages such as easy production of defective products.
[0007] It can be seen that the key to the design of the cam curve is how to accurately design the variable lead spiral curve, and it is very necessary to analyze the mathematical model of the variable lead spiral curve. Summary of the Invention
[0008] The purpose of the present invention is to provide a fitting method for the cam curve of a continuous zoom lens. Through this method, a mathematical model of the motion law during the continuous zoom process is established, based on input data such as the optical interval, the parameters of the mathematical model are solved, the cam curve equation is output and the cam curve is drawn, the 3D structural feature of the cam drive surface contour is created through the cam curve, and the accuracy of the fitted cam curve is accurately evaluated.
[0009] The technical solution of the present invention is as follows:
[0010] A fitting method for the cam curve of a continuous zoom lens, comprising:
[0011] The first step is to establish a mathematical model
[0012] The variable lead spiral curve belongs to the cylindrical spiral curve. The direction perpendicular to the axial direction is the circular motion, and the axial direction is the linear motion. During the design process of the variable lead spiral curve, what needs to be considered is the relationship between the cam rotation angle and the axial displacement. Therefore, the mathematical model of the variable lead spiral line is:
[0013] x = Rcos(θ + θ 0 )
[0014] y = Rsin(θ + θ 0 )
[0015] z = f(θ)
[0016] In the formula:
[0017] R is the cam radius;
[0018] θ is the cam rotation angle;
[0019] θ 0is the initial phase, which represents the initial position of the cam curve on the circumference when the cam rotation angle or lens displacement is zero;
[0020] f(θ) represents that the displacement z of the axial lens has a functional relationship with the cam rotation angle θ.
[0021] In mathematics, the functional relationship between variables can be analyzed using various regression models, such as polynomial, Fourier, Gaussian, rational, sine sum, etc. regression models for fitting. The mathematical expression forms of the functional relationships obtained by different fitting types are different, but the methods for solving the functional relationships are the same.
[0022] The second step is to solve the functional relationship, including:
[0023] Fitting solution:
[0024] a) Select a regression model to extract the coefficients of the functional relationship of the function z = f(θ);
[0025] b) Construct a regression model equation through the extracted coefficients;
[0026] c) Inversely calculate the function values of the equation for constructing the regression model;
[0027] d) Compare the function values calculated by the constructed regression equation with the original displacement data to obtain the fitting error value of the lens axial displacement;
[0028] e) Repeat a) - d) to obtain the fitting error values of all lens axial displacements;
[0029] Fitting accuracy verification:
[0030] Compare and judge the obtained fitting error value with the initialized fitting accuracy:
[0031] If the fitting error value is greater than the fitting accuracy condition is true, the number of terms of the regression model equation increases by 1, and the program enters the fitting solution again. Calculate the fitting error values of each lens according to a) - e) in the fitting solution until the fitting error value at the solution is less than the fitting accuracy, and the program exits the fitting solution loop.
[0032] Optical design tolerance verification:
[0033] a) Sum the absolute values of the fitting error values of the axial displacements of two adjacent lenses;
[0034] b) Judge whether the sum of the absolute values of the fitting errors is less than the optical design tolerance, including:
[0035] If the sum of the absolute values of the fitting errors is less than the optical design tolerance, output the functional relationship;
[0036] If the sum of the absolute values of the fitting errors is greater than or equal to the optical design tolerance, the program automatically increases the fitting accuracy and repeats the processes of fitting solution, fitting accuracy verification, and optical design tolerance verification until the sum of the absolute values of the obtained fitting errors is less than the optical design tolerance requirement, and then outputs the regression model equation.
[0037] The third step is to draw the cam curve, including:
[0038] Output the regression model equation constructed in the last loop of the fitting solution loop. According to the mathematical model in the first step and combined with the regression model equation obtained by fitting in the second step, draw the curves of the motion laws of each lens, thereby obtaining the cam curve.
[0039] A computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, it implements the steps of a method for fitting a cam curve of a continuous zoom lens according to the present invention.
[0040] The present invention takes the optical interval between lenses, cam rotation angle, cam radius, optical design tolerance, etc. as input parameters, converts the variation law of the optical interval between lenses into a cam curve, takes the optical interval design tolerance as the curve fitting target to control the curve fitting accuracy, and outputs the cam curve when the curve fitting error meets the optical design tolerance. The content of the fitting method includes establishing a mathematical model of the cam curve, an optical interval data processing method, a lens motion state discrimination method, a displacement algorithm under different motion states, a cam rotation angle generation method, a fitting data accuracy control method, etc. Specifically, the beneficial effects of the present invention include:
[0041] (1) Through mathematical modeling, the motion law of the spiral transmission of the cam mechanism is fully parameterized, and an error evaluation mechanism is established to judge in real time whether the cam curve fitting error meets the optical interval design tolerance requirement, achieving the purpose of precise control;
[0042] (2) The solved mathematical model is used for creating the three-dimensional structural characteristics of the cam drive surface profile and kinematic simulation analysis, improving the design accuracy; at the same time, it is used for machining the drive surface profile of the cam solid part, which can effectively improve the machining accuracy;
[0043] (3) Through this method, program codes can be written for engineering applications. By adapting and improving this method, the rapid design of the cam drive surface profiles of other lenses can be completed, thereby improving the design and development efficiency of continuous zoom lenses. Description of the Drawings
[0044] Figure 1 It is a flowchart of the method for fitting a cam curve of a continuous zoom lens according to the present invention. Detailed Embodiments
[0045] A method for fitting a cam curve of a continuous zoom lens comprises the following steps:
[0046] 1. Read data
[0047] Save the optical spacing data file as a text document or spreadsheet file, and the program reads the data in the file and stores it in a matrix or array variable.
[0048] 2. Initialization parameters
[0049] Enter parameters such as motion state, cam angle, cam radius, fitting accuracy, optical design tolerance, etc. as prompted by the program.
[0050] 3. Data Preprocessing
[0051] Delete the optical spacing data that is undefined or unusable after being imported and stored in the variable due to missing optical spacing data or inconsistent optical spacing data dimensions of each lens. Check and judge the read data before deleting. Determine whether there is NaN (Not a Number) data in the read data. If not, the data is not processed, and the preprocessed data is the read data. If so, perform data processing and remove all rows with NaN in the read data.
[0052] 4. Calculate the displacement of the lens relative to the reference point
[0053] According to the initialized motion state, it is selected whether each lens moves absolutely or relatively relative to the reference point;
[0054] If the motion state is absolute motion, the relative reference point displacement is equal to the optical interval;
[0055] If the motion state is relative motion, it is necessary to determine the relative motion direction of the two lenses;
[0056] For relative motion, there are two states: same direction or reverse direction. We need to make another judgment. Because for reverse motion, the product of the axial displacement of the two groups of lenses is negative; for same direction motion, the product of the axial displacement of the two groups of lenses is positive. Therefore, the relative motion direction can be automatically judged by using preprocessed data for calculation. The judgment conditions are as follows:
[0057] a) If (optical interval at the end of the lens - optical interval at the start of the lens) × (optical interval at the end of the opposite lens - optical interval at the start of the opposite lens) > 0, the two groups of lenses move in the same direction along the axial direction.
[0058] The displacement algorithm relative to the reference point is:
[0059] The displacement of the lens relative to the reference point = the optical spacing of the lens - the absolute value of the relative displacement of the lens;
[0060] Displacement of the relative lens = Optical interval of the relative lens - Initial optical interval of the relative lens;
[0061] b) If (Final optical interval of the lens - Initial optical interval of the lens) × (Final optical interval of the relative lens - Initial optical interval of the relative lens) < 0, then the two groups of lenses move in the opposite direction along the axis. The displacement algorithm relative to the reference point is as follows:
[0062] Displacement of the lens relative to the reference point = Optical interval of the lens + Absolute value of the displacement of the relative lens;
[0063] Displacement of the relative lens = Optical interval of the relative lens - Initial optical interval of the relative lens;
[0064] 5. Calculate the displacement of the lens relative to the starting point
[0065] Displacement of the lens relative to the starting point = Displacement of the lens relative to the reference point - Initial optical interval;
[0066] 6. Create an array or array variable of rotation angles
[0067] Generate a rotation angle matrix or array variable according to the cam rotation angle. The data dimension of the variable needs to be the same as that of the displacement of the lens relative to the starting point.
[0068] When the cam radius and the axial displacement of each lens are determined, the change amount of the rotation angle affects the helix angle of the fitting curve. To suppress the excessive change range of the helix angle of the cam curve and the excessive or too small extreme value, the change of the rotation angle needs to consider the weight. The generation method of the rotation angle matrix or array is as follows.
[0069] 6.1 Generation method with the same weight for rotation angle change
[0070] Divide the cam rotation angle evenly according to the data dimension of the displacement of the lens relative to the starting point to generate an equally spaced rotation angle matrix or array.
[0071] 6.2 Generation method with different weights for rotation angle change
[0072] The helix angle of the cam curve is proportional to the ratio of the change amount of the axial displacement to the product of the cam radius and the change amount of the rotation angle. When the cam radius has been initialized and determined, the change trend of the change amount of the rotation angle is the same as that of the change amount of the axial displacement, which can effectively suppress the helix angle of the cam curve. Therefore, the weight of the rotation angle change can be solved through the change amount of the axial displacement. The method is as follows.
[0073] a) Calculate the change amount of displacement during the axial movement of the lens according to the displacement of the lens relative to the starting point;
[0074] Displacement change during lens movement = Current displacement of the lens relative to the starting point - Displacement of the lens at the previous position relative to the starting point.
[0075] b) Obtain the absolute value of the displacement change of each lens and the sum of the absolute values of the displacement changes of the lenses;
[0076] c) Calculate the weight of the displacement change of each lens;
[0077] Weight of the displacement change of the lens = Absolute value of the displacement change of the lens / Sum of the absolute values of the displacement changes of the lenses.
[0078] d) Calculate the average weight of the displacement changes of all lenses through the weights of the displacement changes of each lens;
[0079] Average weight of the displacement changes of all lenses = Weight of the displacement change of each lens / Number of lenses.
[0080] e) Generate a rotation angle matrix or array through the average weight of the displacement changes of all lenses;
[0081] Rotation angle matrix or array = Cam rotation angle × Average weight of the displacement changes of all lenses.
[0082] 7. Fitting, including:
[0083] 7.1 Fitting solution
[0084] The program enters a loop and executes a) to f).
[0085] a) The program calls the regression model extraction function to obtain the coefficients of the functional relationship of the function z = f(θ);
[0086] b) Construct a regression model equation through the extracted coefficients;
[0087] c) Calculate the function value of the equation of the constructed regression model;
[0088] d) Compare the function value calculated by the constructed regression equation with the original displacement data to obtain the fitting error value of the displacement;
[0089] e) Repeat a) to d) to obtain the fitting error values of the axial displacements of all lenses;
[0090] 7.2 Fitting accuracy verification
[0091] Compare and judge the obtained fitting error value with the initialized fitting accuracy:
[0092] If the fitting error value is less than the fitting accuracy, output the regression model equation.
[0093] If the fitting error value is greater than the fitting accuracy, the number of terms in the regression model equation is increased by 1, and the program enters the fitting solution in 7.1 again. Calculate the fitting error values of each lens according to a) to e) in the fitting solution in 7.1 until the fitting error value at the solution is less than the fitting accuracy, and the program exits the fitting solution loop.
[0094] 7.3 Optical Design Tolerance Check
[0095] a) Sum the absolute values of the fitting error values of the axial displacements of two adjacent lenses;
[0096] b) Determine whether the sum of the absolute fitting errors is less than the optical design tolerance, including:
[0097] If the sum of the absolute fitting errors is less than the optical design tolerance, output the regression model equation;
[0098] If the sum of the absolute fitting errors is greater than or equal to the optical design tolerance, the program automatically increases the fitting accuracy and repeats the processes of 7.1 fitting solution, 7.2 fitting accuracy check, and 7.3 optical design tolerance check again until the sum of the absolute values of the obtained fitting errors is less than the optical design tolerance requirement, and then output the regression model equation.
[0099] 8. Plot the Cam Curve
[0100] Output the regression model equation constructed in the last loop of the fitting solution loop. According to the mathematical model and combined with the regression model equation obtained in 7, plot the cam curve.
[0101] The operation method of the cam curve fitting program is as follows:
[0102] (1) Put the optical interval data file into the specified path of the program and run the program, and the program automatically reads the data.
[0103] (2) Input the initialization parameters according to the program prompts: cam radius, number of cam turns, motion type (absolute or relative), fitting accuracy, optical design tolerance.
[0104] (3) The program automatically processes and outputs the data according to the above method.
Claims
1. A method for fitting a cam curve of a continuous zoom lens, characterized in that: The following steps are involved: Step 1: Establish a mathematical model of the cam curve of the continuous zoom lens x=Rcos(θ+θ0) y=Rsin(θ+θ0) z=f(θ) Where: R is the cam radius; θ is the cam rotation angle; θ0 is the initial phase, which indicates the initial position of the cam curve on the circumference when the cam angle or lens displacement is zero; f(θ) represents the functional relationship between the displacement z of the axial lens and the cam rotation angle θ; Step 2, solving the functional relationship, including: Fitting solution: a) Select the coefficients of the functional relationship of the regression model to extract the function z=f(θ); b) construct the regression model equation using the extracted coefficients; c) calculating the function value of the equation of the constructed regression model; d) comparing the function value calculated by the constructed regression equation with the original displacement data to obtain the fitting error value of the displacement; e) repeating steps a) to d) to obtain the fitting error values of the axial displacements of all lenses; Fitting accuracy check: Compare the solved fitting error value with the initialized fitting accuracy to determine: If the fitting error value is less than the fitting accuracy, the regression model equation is output; If the fitting error value is greater than the fitting accuracy, the number of terms in the regression model equation increases by 1, and the program enters the fitting solution again, and calculates the fitting error value of each lens according to a) to e) in the fitting solution, until the solved fitting error value is less than the fitting accuracy, and the program exits the fitting solution loop; Optical design tolerance check: a) summing the absolute values of the fitting errors of the axial displacements of two adjacent lenses; b) Determine whether the sum of the absolute values of the fitting errors is less than the optical design tolerance, including: If the sum of the absolute values of the fitting errors is less than the optical design tolerance, the regression model equation is output; If the sum of the absolute values of the fitting errors is greater than or equal to the optical design tolerance, the program will automatically improve the fitting accuracy and repeat the fitting solution, fitting accuracy verification, and optical design tolerance verification processes until the sum of the absolute values of the fitting errors is less than the optical design tolerance requirement, and the regression model equation is output.
2. The method according to claim 1, characterized in that Also includes: Step 3: Draw the cam curve Output the regression model equation constructed in the last cycle of the fitting solution cycle, and draw the cam curve according to the mathematical model in step 1 and the regression model equation obtained by fitting in step 2.
3. The method according to claim 1, characterized in that Step 2 also includes: (1) Reading data The optical spacing data file is saved as a text document or spreadsheet file, and the program reads the data in the file and saves it into a matrix or array; (2) Initialization parameters Initialize parameters such as motion state, cam angle, cam radius, fitting accuracy, and optical spacing design tolerance; (3) Data preprocessing Delete the undefined or unusable values stored in the variables after the optical spacing data is imported due to the missing optical spacing data or the inconsistent optical spacing data dimensions of each lens; (4) Calculation of displacement relative to the reference point According to the initialized motion state, determine whether each lens is in absolute motion or relative motion relative to the reference point, and convert the optical intervals under different motion states into displacements of each lens relative to the reference point; If the motion state is absolute motion, the optical interval is equal to the relative reference point displacement; If the motion state is relative motion, it is necessary to determine the relative motion direction of the two lenses; (5) Calculation of displacement relative to the starting point The displacement of the lens relative to the starting point = the displacement of the lens relative to the reference point - the starting optical interval; (6) Create a rotation angle matrix or array variable Generate a rotation angle matrix or array variable based on the cam angle. The data dimension of the variable must be consistent with the data dimension of the displacement of the lens relative to the starting point.
4. The method according to claim 3, characterized in that Step (4) further includes: The relative motion between the lenses can be in the same direction or in the opposite direction, and a further judgment is made; the judgment conditions include: a) If (optical interval at the end of the lens - optical interval at the start of the lens) × (optical interval at the end of the opposite lens - optical interval at the start of the opposite lens) > 0, the two groups of lenses move in the same direction along the axis; the displacement algorithm relative to the reference point is: The displacement of the lens relative to the reference point = the optical distance of the lens - the absolute value of the relative displacement of the lens, Relative lens displacement = relative lens optical interval - relative lens initial optical interval; b) If (optical interval at the end of the lens - optical interval at the start of the lens) × (optical interval at the end of the opposite lens - optical interval at the start of the opposite lens) < 0, the two groups of lenses move in opposite directions along the axis; the displacement algorithm relative to the reference point is: The displacement of the lens relative to the reference point = the optical distance of the lens + the absolute value of the relative displacement of the lens, Relative lens displacement = relative lens optical interval - relative lens initial optical interval.
5. The method according to claim 3, characterized in that: Step (3) also includes: Before deleting, check the read data and determine whether there is NaN data in the read data; if not, the data is not processed, and the preprocessed data is the read data; if so, process the data and remove all rows with NaN in the read data.
6. The method according to claim 3, characterized in that: Step (6) further includes: When the cam radius and the axial displacement of each lens are determined, the change in the rotation angle affects the helix angle of the fitting curve. In order to suppress the excessive range of the helix angle of the cam curve and the excessive or small limit value, the rotation angle change needs to consider the weight. The generation method of the rotation angle matrix or array is as follows: (1) Generation method with the same weight for rotation angle changes The cam rotation angle is evenly divided according to the data dimension of the displacement of the lens relative to the starting point to generate a rotation angle matrix or array with equal spacing; (2) Generation method with different rotation angle change weights The helix angle of the cam curve is proportional to the ratio of the axial displacement change to the cam radius multiplied by the rotation angle change. When the cam radius has been initialized, the change trend of the rotation angle change is consistent with the change trend of the axial displacement change, which can effectively suppress the helix angle of the cam curve; therefore, the rotation angle change weight can be obtained through the axial displacement change, as follows: a) Calculate the displacement change of the lens during axial movement based on the displacement of the lens relative to the starting point The change in displacement during lens movement = the current relative displacement of the lens relative to the starting point - the displacement of the lens at the previous position relative to the starting point; b) obtaining the absolute value of each lens displacement change and the sum of the absolute values of the lens displacement changes; c) Calculate the weight of each lens displacement change Weight of lens displacement change = absolute value of lens displacement change / sum of absolute values of lens displacement change; d) Calculate the average weight of all lens displacement changes by the weight of each lens displacement change The average weight of all lens displacement changes = the weight of each lens displacement change / the number of lenses; e) Generate a rotation angle matrix or array by averaging the weights of all lens displacement changes Rotation angle matrix or array = cam rotation angle × average weight of all lens displacement changes.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a continuous zoom lens cam curve fitting method as described in any one of claims 1 to 6 are implemented.