A preferred method and system for target image for linear motor mover position measurement
By improving the sparrow search algorithm and optimizing image parameters, combined with image optimization techniques, the problem of insufficient accuracy in linear motor mover position measurement was solved, achieving efficient and accurate measurement results.
Patent Information
- Application Number
- CN202310674997.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-06-07
AI Technical Summary
In existing methods for measuring the position of linear motor movers, sensor detection is susceptible to external interference and is costly. When using image measurement technology, the selection of the target image affects the measurement accuracy, resulting in low measurement precision.
An improved sparrow search algorithm based on artificial fish swarm optimization algorithm is adopted to improve measurement accuracy by optimizing image parameters, including image parameter derivation, iterative update and optimal parameter selection. Combined with image optimization technology, the target image is optimized to improve measurement accuracy.
It achieves high precision and stability in linear motor mover position measurement, avoids the limitations of sensor detection, and improves measurement accuracy and efficiency.
Smart Images

Figure CN116645357B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image measurement, in particular to the field of digital image measurement, and provides a preferred method and system of target image for linear motor mover position measurement. BACKGROUND
[0002] Linear motor has the advantages of simple structure, no stroke constraint, high precision, high reliability and fast response capability, and is widely used in fields such as laser processing, 3D printing and electromagnetic launching system. The manufacturing precision of products in many fields is restricted by the control precision of linear motor, that is, the control precision of linear motor determines the manufacturing and processing precision of products, and the measurement precision of linear motor mover position restricts the control precision of linear motor.
[0003] Therefore, in order to improve the manufacturing and processing precision of products, the measurement precision of linear motor mover position needs to be improved; at present, the detection method of linear motor mover position is mainly sensor detection, such as grating sensor and magnetic grating sensor; the measurement precision of grating sensor and magnetic grating sensor is high, but the magnetic grating is easily affected by external interference and demagnetization, the grating has high requirements for working environment and is expensive. Image measurement technology is applied to different fields due to its high efficiency, non-contact and low cost characteristics, and existing research has applied image measurement technology to the field of linear motor mover position measurement, and can realize fast and high-precision measurement of mover position. When image measurement technology is used for linear motor mover position measurement, the selection of target image directly affects the measurement precision of linear motor mover position. SUMMARY
[0004] The purpose of the embodiment of the application is to provide a preferred method of target image for linear motor mover position measurement, aiming at further improving the measurement precision of the existing digital image measurement method.
[0005] The embodiment of the application is implemented in the following way: a preferred method of target image for linear motor mover position measurement, the preferred method of target image for linear motor mover position measurement comprises the following steps:
[0006] The obtained target image is processed into first image information, and the sub-pixel displacement of adjacent frame target image is calculated based on the first image information, so as to deduce the image parameters affecting the measurement precision of linear motor mover position;
[0007] According to the improved sparrow search algorithm, the deduced image parameters are iteratively updated, and an image parameter set is formed;
[0008] Based on the set constraint condition, the optimal image parameter is selected in the image parameter set;
[0009] The target image is optimized through the optimal image parameter to obtain an optimal image for measuring the position of the mover of the linear motor.
[0010] The pre-improved sparrow search algorithm is a sparrow search algorithm improved based on an artificial fish school optimization algorithm.
[0011] Another purpose of the embodiment of the present application is to provide a target image optimization system for measuring the position of the mover of the linear motor, which comprises an image parameter derivation module, an image parameter set generation module, an optimal image parameter selection module and a target image optimization module.
[0012] The image parameter derivation module is used for processing the obtained target image into first image information and calculating the sub-pixel displacement of the adjacent frame target image based on the first image information to derive the image parameter affecting the measurement accuracy of the position of the mover of the linear motor.
[0013] The image parameter set generation module can iteratively update the derived image parameter based on the pre-improved sparrow search algorithm and form an image parameter set.
[0014] The optimal image parameter selection module selects the optimal image parameter from the image parameter set based on the set constraint condition.
[0015] The target image optimization module can optimize the target image through the optimal image parameter to obtain an optimal image for measuring the position of the mover of the linear motor.
[0016] The pre-improved sparrow search algorithm is a sparrow search algorithm improved based on an artificial fish school optimization algorithm.
[0017] Another purpose of the embodiment of the present application is to provide a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the computer program is executed by the processor to make the processor execute the steps of the target image optimization method for measuring the position of the mover of the linear motor.
[0018] The embodiment of the present application provides a target image optimization method for measuring the position of the mover of the linear motor, which derives the image parameter affecting the measurement accuracy, improves the sparrow search algorithm based on the artificial fish school optimization algorithm, inputs the image parameter to be optimized into the improved sparrow search algorithm with the measurement accuracy as the objective function, so that the global optimization of the image parameter can be quickly realized according to the optimal image parameter, the image optimization is realized, and the measurement accuracy of the position is effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1A flowchart illustrating an improved sparrow search algorithm using an artificial fish swarm optimization algorithm, provided as an embodiment of the present invention;
[0020] Figure 2 A flowchart illustrating a preferred method for measuring the position of a linear motor mover using a target image, as provided in an embodiment of the present invention.
[0021] Figure 3 This is a comparison chart of measurement errors before and after the improvement of the sparrow search algorithm in this embodiment of the invention;
[0022] Figure 4 This is a diagram showing the chirp signal (linear frequency modulated signal) generated using the first set of image parameters in an embodiment of the present invention.
[0023] Figure 5 This is a displacement-error map of subpixel displacement calculated using LUPCA (subpixel displacement measurement algorithm) in an embodiment of the present invention;
[0024] Figure 6 This is a comparison chart of measurement results before and after target image optimization in an embodiment of the present invention;
[0025] Figure 7 An application environment diagram for a preferred method of measuring the target image for a linear motor mover position provided in an embodiment of the present invention;
[0026] Figure 8 This is a structural block diagram of a preferred system for measuring the position of a linear motor mover, provided in an embodiment of the present invention.
[0027] Figure 9 This is a block diagram of the internal structure of a computer device in one embodiment. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0029] Figure 7 This is an application environment diagram of a preferred method for measuring the position of a linear motor mover using a target image, as provided in an embodiment of the present invention. Generally, the linear motor 100 includes a mover and a stator, wherein the stator may consist of a base, a back iron, an electromagnetic coil, etc. Under the influence of a magnetic field, the mover can drive a load to move along a guide rail on the base. To measure the position of the mover, a target image can be set on the base along the direction of the mover's movement. A camera is mounted on the mover, and this camera can be connected to a terminal 110 via a computer device 120. Figure 7 The application environment includes a terminal 110 and a computer device 120.
[0030] Computer device 120 can be an independent physical server or terminal, or a server cluster consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud servers, cloud databases, cloud storage, and CDN.
[0031] Terminal 110 may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 110 and computer device 120 can be connected via a network, which is not limited herein.
[0032] like Figure 2 As shown, in one embodiment, a preferred method for measuring the position of a linear motor mover using a target image is proposed. This embodiment mainly applies this method to the above-mentioned... Figure 7 Taking terminal 110 (or server) as an example, a preferred method for measuring the position of a linear motor mover using a target image may specifically include the following steps S101 to S107:
[0033] Step S101: The acquired target image is processed into first image information, and the sub-pixel displacement of the target image in adjacent frames is calculated based on the first image information to derive the image parameters that affect the position measurement accuracy of the linear motor mover.
[0034] To facilitate the implementation of subsequent related algorithms, the target images acquired by the aforementioned camera and computer equipment can be processed first, including but not limited to processing the target images into first image information. Specifically, the camera uses a linear CCD (Charge Coupled Device) fixed on the mover of the linear motor 100, and moves linearly along the guide rail direction together with the mover. The target image is placed directly below the camera on the base. During the measurement process, the linear CCD only acquires one line of image information, and since the mover has basically no displacement in the direction perpendicular to the guide rail, a one-dimensional signal can be used to generate a two-dimensional target image.
[0035] In this example, a linear sweep frequency signal (Chirp signal) is selected as the one-dimensional signal of the target image, i.e., the first image information; wherein, the frequency of the Chirp signal increases or decreases continuously with time, satisfying the requirement that the target image is non-periodic.
[0036] In this example, the acquisition of the target image has been achieved before the processing of the first image information, specifically through the aforementioned camera and computer equipment.
[0037] Step S103: Based on the pre-improved sparrow search algorithm, the derived image parameters are iteratively updated to form an image parameter set;
[0038] Step S105, selecting optimal image parameters in the image parameter set based on the set constraint condition;
[0039] In this step, the set constraint condition can be a certain number of steps, or the initial frequency f0, the frequency modulation rate k, and the total length of the signal N; the limited variable method can be used for setting, by determining one parameter of the initial frequency f0, the frequency modulation rate k, and the discrete step d during signal generation, the total length of the signal N, and limiting the other three parameters, the selection of the optimal parameters is realized;
[0040] Step S107, image optimization of the target image is performed through the optimal image parameters to obtain the optimal image for measuring the position of the mover of the linear motor;
[0041] The pre-improved sparrow search algorithm is a sparrow search algorithm improved based on an artificial fish school optimization algorithm.
[0042] In this embodiment, the method derives the image parameters affecting the measurement accuracy first; at the same time, the sparrow search algorithm is improved by the artificial fish school optimization algorithm, and the improved sparrow search algorithm is used to take the measurement accuracy as the objective function and input the image parameters to be optimized, so that the global optimization of the image parameters can be quickly realized according to the optimal image parameters, and the image optimization is realized; the accuracy of position measurement can be effectively improved.
[0043] In one example, the step of processing the acquired target image into first image information and calculating the sub-pixel displacement of the adjacent frame target image based on the first image information to derive the image parameters affecting the measurement accuracy of the position of the mover of the linear motor specifically includes:
[0044] The target image is acquired, and a linear frequency sweep signal is selected as a one-dimensional signal of the target image to generate first image information; the linear frequency sweep signal satisfies:
[0045]
[0046] Wherein, f0 is the initial frequency of the signal, k is the frequency modulation rate of the signal, t is the time, -j is a constant value; the frequency f of the signal at time t t is:
[0047] f t = f0+kt (2);
[0048] Suppose f1(x) is the image taken before the displacement of the mover, and f2(x) is the image taken after the displacement. f1(x) is expressed by a Chirp signal as:
[0049]
[0050] In one example, when generating the Chirp signal, since x is discrete data, assuming the discrete step is d, the signal frequency is f at [x, x+d] x , the signal frequency is f at [x+d, x+2d] x+d . If the mover displacement value Δx is not an integer multiple of d, f x+Δx After substituting formula (1), the signal waveform has deviation compared with the original graph, that is, not a translational relationship. Therefore, the discrete step d limits the order of magnitude of the measured pixels. To make the measurement accuracy as small as possible, the discrete step d also needs to be reasonably selected, that is, d is derived as one of the image parameters to be optimized; in this example, the Chirp signal can be generated in a computer device preloaded with a MATLAB program.
[0051] Based on the first image information (i.e. the Chirp signal), the sub-pixel displacement of the adjacent frame target image is calculated;
[0052] The image parameters related to the measurement accuracy include: the initial frequency f0, the frequency modulation rate k, and the discrete step d and the total length N of the signal when the signal is generated;
[0053] Wherein, when calculating the sub-pixel displacement of the adjacent frame target image, the local up-sampling phase correlation method is used to calculate the sub-pixel displacement of the adjacent frame target image.
[0054] In one example, the step of calculating the sub-pixel displacement of the adjacent frame target image based on the first image information specifically includes:
[0055] Based on the first image information, assuming f1(x) is the image taken before the mover displacement, and f2(x) is the image taken after the mover displacement, f1(x) is expressed by the Chirp signal as formula (3);
[0056] When generating the Chirp signal, since x is discrete data, assuming the discrete step is d, the signal frequency is f at [x, x+d] x , if the mover displacement value Δx is not an integer multiple of d, it is derived that d affects the measurement accuracy of the mover position of the linear motor;
[0057] Assuming that the mover displacement value Δx is an integer multiple of d, the discrete Fourier transform of f1(x) and f2(x) is calculated, and the cross power spectrum r(x) of the adjacent two images is calculated;
[0058] Up-sampling the peak neighborhood of the cross power spectrum r(x) gives that the mover displacement value and the variable parameter when generating the Chirp signal are related, that is, the image parameters related to the measurement accuracy include the initial frequency f0, the frequency modulation rate k, and the discrete step d and the total length N of the signal when the signal is generated.
[0059] Wherein, the discrete Fourier transform (DFT) of f1(x) and f2(x) can be obtained as follows:
[0060]
[0061]
[0062] Wherein, Δx is the value of the mover displacement; the cross power spectrum r(x) of the adjacent two images is:
[0063]
[0064] Wherein, F2*(u) is the complex conjugate of F2(u); finally, the peak value neighborhood of the cross power spectrum r(x) is up-sampled by using the matrix multiplication DFT method to refine the peak curve; the up-sampling matrix Fourier transform is defined as:
[0065]
[0066] Wherein, D is the number of selected points in the peak value neighborhood of the cross power spectrum r(x), U=(u0, u1,…u MA-1 ) T is the output sequence of DFT, T is the transpose, D / NM A is the normalized up-sampling coefficient, and is the up-sampling function with the dimension M A ×N. The matrix DFT result of the cross power spectrum is a pulse curve, and the abscissa of the peak value corresponds to the value of the mover displacement.
[0067] As can be seen from the above formula, the calculated value of the mover displacement is related to the variable parameters during the generation of the Chirp signal; in addition, since the frequency of the latter half of the Chirp signal may become more and more dense, the camera cannot capture the change, which is not conducive to the measurement of the mover position, therefore, the total length N of the signal can be added to the image parameters to be optimized, that is, the highest frequency of the signal change is limited.
[0068] In summary, when calculating the sub-pixel displacement, the image parameters related to the measurement accuracy include the initial frequency f0, the frequency modulation k, and the discrete step d and the total length N of the signal during the generation of the signal.
[0069] In one embodiment, in order to avoid the sparrow search algorithm from falling into the state of local optimal value, the sparrow search algorithm can be improved; as Figure 1 shown, the improvement of the sparrow search algorithm at least includes:
[0070] The optimization result of the artificial fish swarm optimization algorithm is used as the initial value of the population of the sparrow search algorithm;
[0071] In the process of updating the fish swarm position by the artificial fish swarm optimization algorithm as the optimization result, the field of view and the step of the artificial fish swarm are determined according to a preset rule.
[0072] More specifically, in the step of determining the visual field and step length of the artificial fish swarm according to a preset rule, the preset rule is an adaptive rule of the visual field and step length of the artificial fish swarm, satisfying:
[0073]
[0074] step = β * visual, 0 < β < 1 (9);
[0075] wherein visual represents the visual field, step represents the step length, S is a specified parameter, X i represents the limit value of the visual field; ||X i -X i+1 ||, ||X i -X1|| all represent the range of the visual field;
[0076] It can be understood that the artificial fish swarm optimization algorithm is a bionics optimization algorithm that simulates the foraging behavior, flocking behavior, tail-chasing behavior and random behavior of fish to realize the optimization process, and has the characteristics of strong global search ability and strong robustness. Considering the defect of poor global search ability of the sparrow search algorithm, the artificial fish swarm optimization algorithm is used for optimization in this embodiment, and then the optimized fish swarm position is used as the initial position of the individual of the sparrow search algorithm. Since the initial position of the sparrow search algorithm is no longer randomly generated, the hybrid improved algorithm can effectively complete the image parameter optimization and improve the measurement accuracy.
[0077] Further, in the conventional artificial fish swarm optimization algorithm, the visual field and step length of the artificial fish swarm are fixed. If the displacement values before and after the displacement of the mover are not integer period values of the step length, measurement errors are likely to occur.
[0078] Therefore, in an example, an adaptive change rule of the visual field and step length of the artificial fish swarm is introduced. In the rule, the visual field value changes continuously with the distance between the artificial fish swarms, and the step length value has a linear relationship with the visual field value, so as to realize the dynamic change of the visual field and step length.
[0079] In the artificial fish swarm optimization algorithm of this embodiment, the step length refers to the distance of single movement of the fish swarm. A larger step length can appropriately improve the convergence speed, but a too large step length can also cause the individual to oscillate around the optimal value and slow down the convergence speed. The visual field refers to that an individual takes its own position as the center and searches all individuals within the range with the visual field value as the radius, and moves a step length in the direction of the minimum fitness value.
[0080] If the visual field is large, the flocking behavior and tail-chasing behavior of the fish swarm can be improved, and it is easier to find the global optimal solution, but the complexity of the algorithm will increase accordingly. Therefore, reasonable setting of the visual field and step length value is helpful to improve the convergence speed of the algorithm and find the global optimal solution faster.
[0081] The update formulas of the field of view and the step length are shown in equations (8) and (9), respectively. In the early stage of algorithm iteration, the individuals in the population are far apart, so the field of view value and the step length value are large, and the convergence speed is fast. In the later stage of algorithm iteration, the distance between the individuals in the population is shortened, and the field of view value and the step length value are reduced, and the individuals gradually approach the optimal value, and at this time, the step length is not too large to cause oscillation near the optimal value of the individual, which helps to improve the convergence accuracy and the convergence speed.
[0082] In one example of the embodiment, as shown in Figure 1 The pre-improved sparrow search algorithm includes the following steps:
[0083] Initializing the parameters of the artificial fish swarm;
[0084] Calculating the fitness value of the artificial fish;
[0085] Calculating the field of view and the step length of the artificial fish swarm;
[0086] Performing the four behaviors of aggregation, foraging, random and tail chasing, and updating the optimal fitness value and the position of the fish swarm;
[0087] When the number of iterations reaches the maximum, the position of the fish swarm is transmitted to the sparrow population, and the parameters of the sparrow search algorithm are initialized;
[0088] Updating the positions of the discoverer, the follower and the early warning person, and recording the optimal fitness;
[0089] When the number of iterations reaches the maximum, the optimal fitness value and the optimal individual position are output.
[0090] In one example, the image parameters of the target image are optimized by using the improved sparrow search algorithm before and after the improvement, respectively, the measurement error value is recorded with the change of the number of iterations, and the comparison results are shown in Figure 3 It can be known from Figure 3 that the improved sparrow search algorithm has been stabilized at the third iteration, and the measurement error value is smaller than that before the algorithm is improved, and the measurement accuracy is improved.
[0091] In one embodiment, according to the pre-improved sparrow search algorithm, the derived image parameters are iteratively updated, and an image parameter set is formed. In specific implementation, the measurement accuracy can be taken as the objective function, the image parameters f0, k, N and d to be optimized are allowed to change within a limited range, the image displacement is set to 0.5743 pixel (pixel) displacement to 9 pixel (pixel), the improved sparrow search optimization algorithm is run multiple times, and part of the results are shown in Table 1.
[0092] Table 1 is the optimization result of the image parameters
[0093]
[0094]
[0095] Wherein, the first group of image parameters in Table 1 is selected, and the generated chirp signal is as shown in Figure 4 The chirp signal of Figure 4 is taken as the target image, the sub-pixel displacement is calculated by using LUPCA (sub-pixel displacement measurement algorithm), and the error result is as shown in Figure 5
[0096] The target image before and after optimization is respectively set to different translation values, the calculated image displacement value is compared with the set translation value, and the measurement error curve is as shown in Figure 6
[0097] As can be seen from Figure 6 , before the optimization of the target image, the average absolute error and the maximum error are 0.0057 pixel and 0.0120 pixel respectively; after the optimization of the target image, the average absolute error and the maximum error are 0.0012 pixel and 0.0030 pixel respectively, it is obvious that the measurement accuracy is obviously improved after the optimization, and the measurement result is more stable.
[0098] Therefore, the embodiment aims at the parameter optimization of the target image for the linear motor moving element position measurement, combines the advantages of the artificial fish swarm optimization algorithm and the sparrow search algorithm, proposes the improved sparrow search algorithm, effectively avoids falling into the local optimal solution, realizes the global optimization of the image parameters, can efficiently and accurately determine the optimal image parameters, and thus improves the linear motor moving element position measurement accuracy.
[0099] Figure 8 A preferred system of a target image for linear motor moving element position measurement is shown, and the preferred system of the target image for linear motor moving element position measurement comprises an image parameter derivation module 200, an image parameter set generation module 400, an optimal image parameter selection module 600 and a target image optimization module 800;
[0100] The image parameter derivation module 200 is used for processing the acquired target image into first image information, calculating the sub-pixel displacement of adjacent frame target images based on the first image information, and deriving the image parameters affecting the linear motor moving element position measurement accuracy;
[0101] The image parameter set generation module 400 can iteratively update the derived image parameters according to the pre-improved sparrow search algorithm, and form an image parameter set;
[0102] The optimal image parameter selection module 600 selects the optimal image parameters in the image parameter set based on the set constraint conditions.
[0103] The target image optimization module 800 can perform image optimization on the target image through the optimal image parameter to obtain an optimal image for measuring the position of the mover of the linear motor.
[0104] The pre-improved sparrow search algorithm is a sparrow search algorithm improved based on an artificial fish school optimization algorithm.
[0105] In this embodiment, the image parameter set is the data set shown in Table 1. The constraint condition can be any of the image parameters f0, k, N, and d to be optimized. The implementation of the system can refer to the steps of the foregoing method, and both belong to the same inventive concept, which will not be described in detail here.
[0106] In this embodiment, during the movement of the linear motor, the mover of the motor moves linearly in a certain direction along the guide rail, and there is no effective movement in the direction perpendicular thereto. It is assumed in this embodiment that the motor only has transverse movement consistent with the guide rail and has no effective movement in the longitudinal direction. The vibration of the motor in the longitudinal direction will cause distortion of the image acquisition, resulting in a decrease in the measurement accuracy. Therefore, the construction of the target image should be combined with the actual situation of the movement of the linear motor, and the image longitudinal parameter should be kept consistent, that is, the image should be designed as a fence stripe image to avoid changes in the image information collected due to the longitudinal vibration of the motor, thereby avoiding the decrease in the measurement accuracy.
[0107] Therefore, in one embodiment, the longitudinal parameter in the target image parameter is set to a fixed value, so that the target image is a fence stripe image.
[0108] In this embodiment, the longitudinal parameter is set to a fixed value, so that the information of the image acquisition is not affected by the longitudinal vibration of the motor, thereby improving the optimization accuracy of the target image for measuring the position of the mover of the linear motor.
[0109] In one application scenario of this embodiment, the target image can be obtained by a camera arranged on the side of the motor mover. The camera can use a linear array CCD or other cameras with high-speed imaging function. In this embodiment, a linear array CCD is preferred because of its simple structure and low cost. The linear array CCD is fixed on the side of the motor mover and moves with the mover. During the movement of the motor mover, the linear array CCD collects images at certain time intervals.
[0110] In the above embodiment, the longitudinal parameter of the target image is set to a certain value, which can be 1. Therefore, the two images scanned by the linear array CCD at adjacent time points have a size of Mx1, the linear array CCD effectively reduces the redundancy of image information, converts two-dimensional image information into one-dimensional signals, and improves the measurement efficiency.
[0111] Figure 9An internal structure diagram of a computer device in one embodiment is shown. The computer device can be specifically a terminal 110 (or a server) in Figure 7 As shown in Figure 9 , the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and can also store a computer program which, when executed by the processor, can enable the processor to implement the preferred method of target image for linear motor moving element position measurement. The computer program can also be stored in the internal memory, and when executed by the processor, can enable the processor to execute the preferred method of target image for linear motor moving element position measurement. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer overlaid on the display screen, or can be a key, trackball or touchpad arranged on the shell of the computer device, or can be an external keyboard, touchpad or mouse, etc.
[0112] Those skilled in the art can understand that Figure 9 the structure shown in the above description is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the diagram, or combine certain components, or have a different arrangement of components.
[0113] In one embodiment, the preferred device of target image for linear motor moving element position measurement provided by the embodiment can be implemented in the form of a computer program which can run on the computer device as shown in Figure 9 . The memory of the computer device can store various program modules constituting the preferred system of target image for linear motor moving element position measurement, such as the image parameter derivation module 200, the image parameter set generation module 400, the optimal image parameter selection module 600 and the target image optimization module 800 as shown in Figure 8 . The computer program constituted by various program modules enables the processor to execute the steps in the preferred method of target image for linear motor moving element position measurement of each embodiment of the present application described in the specification.
[0114] For example, Figure 9 the computer device as shown in Figure 8 may execute step S101 of Figure 2 by the image parameter derivation module 200.
[0115] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0116] In step S101, the acquired target image is processed into first image information, and sub-pixel displacement of adjacent frame target images is calculated based on the first image information to derive image parameters affecting the measurement accuracy of the linear motor mover position;
[0117] In step S103, the derived image parameters are iteratively updated according to the pre-improved sparrow search algorithm, and an image parameter set is formed;
[0118] In step S105, the optimal image parameters are selected from the image parameter set based on the set constraint conditions;
[0119] In step S107, the target image is optimized by the optimal image parameters to obtain an optimal image for measuring the linear motor mover position.
[0120] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to make the processor execute the following steps:
[0121] In step S101, the acquired target image is processed into first image information, and sub-pixel displacement of adjacent frame target images is calculated based on the first image information to derive image parameters affecting the measurement accuracy of the linear motor mover position;
[0122] In step S103, the derived image parameters are iteratively updated according to the pre-improved sparrow search algorithm, and an image parameter set is formed;
[0123] In step S105, the optimal image parameters are selected from the image parameter set based on the set constraint conditions;
[0124] In step S107, the target image is optimized by the optimal image parameters to obtain an optimal image for measuring the linear motor mover position.
[0125] It should be understood that, although the steps of the methods of the various embodiments of the present application are shown in a sequential order, such steps can be performed in other sequences. Unless otherwise specified, the steps of the methods of the various embodiments of the present application need not be performed in the order shown. Further, at least some of the steps of the methods of the various embodiments of the present application can include multiple sub-steps or multiple stages, which can be performed at different times or in different orders. Unless otherwise specified, the steps of the methods of the various embodiments of the present application need not be performed in the order shown.
[0126] It is to be understood that all or part of the procedures of the above-mentioned embodiments can be implemented by a computer program instructing relevant hardware, and the program can be stored in a non-volatile computer readable storage medium. When the program is executed, it can include the procedures of the above-mentioned embodiments. Any reference to memory, storage, database, or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink), DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0127] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A preferred method of target image for linear motor mover position measurement, characterized by, The preferred method for target image of linear motor mover position measurement comprises the following steps: The acquired target image is processed into first image information, and sub-pixel displacement of adjacent frame target images is calculated based on the first image information to deduce image parameters affecting linear motor mover position measurement accuracy; According to the pre-improved sparrow search algorithm, the deduced image parameters are iteratively updated, and an image parameter set is formed; Based on the set constraint condition, the optimal image parameter is selected from the image parameter set; The target image is optimized by the optimal image parameter to obtain the optimal image for measuring the linear motor mover position; The pre-improved sparrow search algorithm is a sparrow search algorithm improved based on an artificial fish school optimization algorithm; The improvement of the sparrow search algorithm at least includes: The optimization result of the artificial fish school optimization algorithm is used as the initial value of the population of the sparrow search algorithm; During the process of updating the fish school position as the optimization result by the artificial fish school optimization algorithm, the field of view and the step length of the artificial fish school are determined according to a preset rule; In the step of determining the field of view and the step length of the artificial fish school according to the preset rule, the preset rule is an adaptive rule of the field of view and the step length of the artificial fish school, which satisfies: ; wherein visual represents the visual field, step represents the step size, S is a specified parameter, X i represents the limit of the visual field; The step of processing the acquired target image into first image information and calculating sub-pixel displacement of adjacent frame target images based on the first image information to deduce image parameters affecting linear motor mover position measurement accuracy specifically includes: The target image is acquired, and a linear frequency modulation signal is selected as a one-dimensional signal of the target image to generate first image information; the linear frequency modulation signal satisfies: ; Wherein, f0 is the initial frequency of the signal, k is the frequency modulation rate of the signal, and -j is a constant value; Sub-pixel displacement of adjacent frame target images is calculated based on the first image information; The image parameters related to the measurement accuracy include the initial frequency f0, the frequency modulation rate k, the discrete step length d when the signal is generated, and the total length N of the signal; When calculating the sub-pixel displacement of adjacent frame target images, the local up-sampling phase correlation method is used to calculate the sub-pixel displacement of adjacent frame target images.
2. The preferred method of target image for linear motor moving object position measurement according to claim 1, characterized in that, The step of calculating the sub-pixel displacement of adjacent frame target images based on the first image information specifically includes: Based on the first image information, it is assumed that f1(x) is the image taken before the mover displacement, f2(x) is the image taken after the mover displacement, and f1(x) is expressed by a Chirp signal as: ; In the generation of Chirp signal, since x is discrete data, assuming the discrete step is d, the signal frequency is always f at [x, x+d] time x If the mover displacement value Δx is not an integer multiple of d, it is deduced that d affects the measurement accuracy of the mover position of the linear motor. When the mover displacement value Δx is an integer multiple of d, the discrete Fourier transform of f1(x) and f2(x) is calculated, and the cross power spectrum r(x) of the adjacent two images is calculated; The peak neighborhood of the cross power spectrum r(x) is up-sampled, and it is found that the mover displacement value and the parameters that can be changed when the Chirp signal is generated are related, that is, the image parameters related to the measurement accuracy include the initial frequency f0, the frequency modulation rate k, the discrete step length d when the signal is generated, and the total length N of the signal.
3. The preferred method of target image for linear motor moving object position measurement according to claim 1, wherein, The pre-improved sparrow search algorithm comprises the following steps: Initialization of artificial fish school parameters; Calculating the fitness value of the artificial fish; Calculating the field of view and step length of the artificial fish school; Executing the four behaviors of aggregation, foraging, random and tail chasing, and updating the optimal fitness value and the fish school position; When the number of iterations reaches the maximum, the fish population position is passed to the sparrow population, and the sparrow search algorithm parameter is initialized; Update the positions of the discoverer, follower and early warning, and record the optimal fitness; When the number of iterations reaches the maximum, output the optimal fitness value and the optimal individual position.
4. A preferred system of target images for linear motor mover position measurement, characterized by, The preferred system for target image of linear motor moving element position measurement includes: image parameter derivation module, image parameter set generation module, optimal image parameter selection module and target image optimization module; The image parameter derivation module is used for processing the obtained target image into first image information, and calculating the sub-pixel displacement of adjacent frame target image based on the first image information, so as to derive the image parameters affecting the linear motor moving element position measurement accuracy; The image parameter set generation module can iteratively update the derived image parameters based on the pre-improved sparrow search algorithm, and form an image parameter set; The optimal image parameter selection module selects the optimal image parameter in the image parameter set based on the set constraint condition; The target image optimization module can optimize the target image through the optimal image parameter to obtain the optimal image for measuring the linear motor moving element position; The pre-improved sparrow search algorithm is an improved sparrow search algorithm based on artificial fish school optimization algorithm; The improvement of the sparrow search algorithm at least includes: The optimization result of the artificial fish school optimization algorithm is used as the initial value of the population of the sparrow search algorithm; During the process of updating the fish population position as the optimization result by the artificial fish school optimization algorithm, the field of view and the step length of the artificial fish school are determined according to the preset rule; In the process of determining the field of view and the step length of the artificial fish school according to the preset rule, the preset rule is an adaptive rule of the field of view and the step length of the artificial fish school, which satisfies: ; wherein visual represents the visual field, step represents the step size, S is a specified parameter, X i represents the limit of the visual field; The target image is obtained, and a linear sweep signal is selected as a one-dimensional signal of the target image to generate first image information; the linear sweep signal satisfies: Wherein, f0 is the initial frequency of the signal, k is the frequency modulation of the signal, -j is a constant value; ; Based on the first image information, the sub-pixel displacement of the adjacent frame target image is calculated; The image parameters related to the measurement accuracy include: initial frequency f0, frequency modulation k, and discrete step length d and total length N of signal generation; Wherein, when calculating the sub-pixel displacement of the adjacent frame target image, the local up-sampling phase correlation method is used to calculate the sub-pixel displacement of the adjacent frame target image.