Next Article in Journal
A Versatile Model for Describing Energy Harvesting Characteristics of Composite-Laminated Piezoelectric Cantilever Patches
Previous Article in Journal
A Variable-Volume Heart Model for Galvanic Coupling-Based Conductive Intracardiac Communication
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research on Particle Swarm Compensation Method for Subdivision Error Optimization of Photoelectric Encoder Based on Parallel Iteration

1
Mechanical Engineering Faculty, Changchun University of Science and Technology, Changchun 130022, China
2
Chongqing Research Institute, Changchun University of Science and Technology, No. 618 Liangjiang Avenue, Chongqing 401135, China
*
Author to whom correspondence should be addressed.
Sensors 2022, 22(12), 4456; https://doi.org/10.3390/s22124456
Submission received: 6 May 2022 / Revised: 2 June 2022 / Accepted: 6 June 2022 / Published: 12 June 2022
(This article belongs to the Section Optical Sensors)

Abstract

:
Photoelectric encoders are widely used in high-precision measurement fields such as industry and aerospace because of their high precision and reliability. In order to improve the subdivision accuracy of moiré grating signals, a particle swarm optimization compensation model for grating the subdivision error of a photoelectric encoder based on parallel iteration is proposed. In the paper, an adaptive subdivision method of a particle swarm search domain based on the honeycomb structure is proposed, and a raster signal subdivision error compensation model based on the multi-swarm particle swarm optimization algorithm based on parallel iteration is established. The optimization algorithm can effectively improve the convergence speed and system accuracy of traditional particle swarm optimization. Finally, according to the subdivision error compensation algorithm, the subdivision error of the grating system caused by the sinusoidal error in the system is quickly corrected by taking advantage of the high-speed parallel processing of the FPGA pipeline architecture. The design experiment uses a 25-bit photoelectric encoder to verify the subdivision error algorithm. The experimental results show that the actual dynamic subdivision error can be reduced to ½ before compensation, and the static subdivision error can be reduced from 1.264″ to 0.487″ before detection.

1. Introduction

As a precise position-sensing device, the photoelectric encoder has been widely used in industrial manufacturing and assembly processes [1,2,3]. At present, the precision measurement field puts forward higher requirements on the precision and resolution of photoelectric encoders, and it is difficult to meet the actual requirements only by improving the processing accuracy of the grating. Therefore, it is of great significance to study the correction method of the subdivision error to improve the angle measurement accuracy of photoelectric shaft angle encoders [4,5,6,7].
The grating moiré signal usually has the following typical errors: DC error offset, equal amplitude error, quadrature error, sinusoidal deviation [8], and harmonic error. The above error factors are easily disturbed by the external environment during the experiment and are directly reflected in the signal as the change in the subdivision error. In order to improve the angular resolution of moiré gratings, the grating moiré signals generated by the moiré grating are usually processed by means of subdivision [9].
At present, a grating moiré signal compensation model is established for the subdivision error existing in the output signal [10], and then the waveform parameters of the signal are solved by the error fitting algorithm. The method of further realizing grating moiré signal subdivision compensation is relatively common [11,12,13]. Sun proposed a triangular signal integral compensation method for the subdivision error of the moiré triangle [14,15]. During the experimental test, the error compensation system reduced the subdivision error to ⅓ of the original error. The South Korean company LG uses the grating movement measurement method to compensate for the phase subdivision error in the signal acquisition process [16]. In 2017, Zhang et al. of China Jiliang University proposed a digital quadrature deviation real-time compensation method based on the CORDIC algorithm [17]. This method solves the problem that the principle error of quadrature error compensation in the previous CORDIC algorithm and the angle calculation sensitivity of the signal interval are low. Real-time compensation for the quadrature deviation is realized, but the CORDIC algorithm is used many times in the process of angle calculation and compensation, and the system hardware resources are occupied and the system delay is more serious.
To sum up, the above encoder subdivision error compensation methods have the following problems: First, most subdivision error compensation methods cannot achieve comprehensive subdivision error compensation, and only analyze and correct the subdivision error under ideal conditions; second, the methods used in the above error compensation methods are all software-based subdivision error compensation methods. Post-processing of error data can only satisfy the compensation of subdivision errors under laboratory conditions, and cannot meet the real-time error compensation effect.
This paper takes the arctangent principle as the theoretical basis of error compensation, analyzes the mathematical model of the photoelectric signal error model, and proposes a parallel iterative multi-group optimization search algorithm. A parallel iterative multi-group optimization search algorithm based on the von Neumann topology model is designed to solve the optimal value of the nonlinear waveform equation obtained from the sampled data. The multi-region parallel search is realized by adaptive region division of the search target region, and the key optimal solution of the algorithm is obtained more efficiently and accurately. The principle of information sharing between subgroups can make it easier for particle swarm optimization to get rid of the dilemma of falling into local optimum in complex high-latitude optimization problems, and effectively improve the global search ability and comprehensive performance of particle swarm optimization.
In this paper, the 25-bit photoelectric encoder is used as the experimental object to verify the effect of the algorithm. The implementation results show that the multi-swarm optimization search algorithm proposed in this paper can effectively improve the convergence speed of the particle swarm algorithm and the accuracy of the optimal value, and effectively improve the calculation speed and system accuracy of the error compensation algorithm. The subdivision error existing in the output signal of the encoder can be effectively compensated for, and the problem of system instability caused by the change in signal quality in a harsh environment can be effectively improved. The dynamic subdivision error after compensation can be reduced to that before compensation, and the static subdivision error can be reduced from 1.264″ before detection to 0.487″, and the compensation effect is better.

2. Analysis of Subdivision Error

As shown in Figure 1, the main working principle of the photoelectric encoder is photoelectric conversion, but its output is digital. There are several concentric code tracks on the code disc of the photoelectric encoder. Each code track is formed by intersecting light-transmitting and non-light-transmitting sector intervals. The number of code tracks is the number of binary digits of the code disc where it is located. The two sides of the code wheel are the light source and the photosensitive element, respectively. During the operation of the system, the LED light source emits monochromatic light, the scale grating in the grating pair rotates with the rotating shaft, and the indicating grating is fixed on the body shell. The outgoing light is received by the photodetection device through the sub-slits of the grating. The collected grating signal can be converted into the digital signal of the system by the photoelectric detection device. This article takes the 25-bit optical encoder produced by Yuheng Optical Co., Ltd. (Changchun, China), as the test object. This model is a hollow shaft absolute rotary encoder, the size of the body shell of this type of product is 90 mm, and the system resolution is 2 25 .
The grating moiré signal is affected by sinusoids and is usually a periodic signal between a triangular wave and a sine wave, and the sine wave is often used as a model in the calculation process. The main reason for the subdivision error is that the photoelectric signal of moiré grating fringes deviates from the standard of sine and cosine signals. The ideal moiré fringe photoelectric signal can be expressed as (1):
{ u 1 = A sin θ u 2 = B cos θ
Affected by the scribing accuracy of the code disc, the accuracy of the shaft system, and the quality of the photoelectric signal, the complete expression of the precise code signal can be expressed as:
{ U 1 = a 0 + a 1 sin θ + i = 2 19 a i sin ( i θ + φ i 1 ) + δ e U 2 = b 0 + b 1 cos θ + i = 2 19 b i cos ( i θ + φ i 2 ) + δ e
Among them, a 0 , b 0 represents the DC component of the signal, which causes the DC level drift; a m , b m represents the fundamental wave of the signal amplitude, which causes the amplitude subdivision error; and i = 2 19 a i sin ( i θ + φ i 1 ) , i = 2 19 b i sin ( i θ + φ i 2 ) is the higher harmonic error, which causes the harmonic subdivision error. In the spectrum analysis of higher harmonic errors later, the influence of harmonic errors higher than the 19th order on the signal can be ignored, so in this paper, we select the 19th order harmonic error as the highest; φ i 1 , φ i 2 is the cause of the phase error. In the actual measurement process, there will also be electrical noise interference, which can be represented by δ e .
From the above expression, we can conclude that the subdivision angle can be calculated by the arctangent function [18] formula:
θ = arctan U 1 U 2
When u 1 , u 2 is in an ideal state, θ in the sine–cosine waveform signal is the ideal value of the subdivision angle. The angle value θ r = θ + Δ θ = arctan U 1 U 2 in the actual subdivision process, where Δ θ is the subdivision error.
Because the data output of the moiré grating adopts a digital encoding method, quantization errors will inevitably occur. When the encoder is located at a certain angle θ , the theoretical output voltage values of the encoder’s moiré fringe are sin θ and cos θ , but the data values generated in the actual measurement process are U 1 and U 2 , resulting in a certain interpolation error.

2.1. Sine Error Analysis

When the grating signal only has the amplitude error component, the amplitude error component Δ r is introduced into the expression of the interpolation error. In the Lissajous graph, the amplitude difference between the X-axis and the Y-axis is the ellipse state.
As shown in Figure 2, when the actual position of the detection signal is point B , the amplitude of the sine is r and the amplitude of the cosine is r Δ r . At this time, the amount of error of the cosine amplitude in the Y-axis direction is l .
l = Δ r sin θ r
r sin ( Δ θ ) = l sin ( π 2 + θ r Δ θ )
r sin ( Δ θ ) = Δ r sin θ r cos ( θ r Δ θ )
Δ θ = θ r arctan ( r Δ r ) sin θ r r cos θ r
tan Δ θ = tan θ r ( r Δ r ) sin θ r r cos θ r 1 + tan θ r ( r Δ r ) sin θ r r cos θ r
After simplification, the error expression of Δ θ can be obtained:
Δ θ = arctan Δ r sin ( 2 θ + 2 Δ θ ) cos ( 2 θ + 2 Δ θ ) Δ r + 2 r Δ r
Let K = 2 r Δ r 1 , θ k = 2 θ r and derivate the above formula:
( Δ θ ) = [ 1 1 + ( sin θ k K + cos θ k ) 2 ] ( sin θ k K + cos θ k )
( Δ θ ) = 1 + K cos θ k 1 + 2 K cos θ k + K 2
In θ r = n π / 4 n = 1 , 3 , 5 , 7 , obtain the maximum error value Δ θ max = arctan Δ r / ( 2 r Δ r ) .
Obtain the minimum error at θ r = n π / 2 , Δ θ min = 0 .
Under normal circumstances, the amplitude of a single harmonic in the grating moiré signal should not exceed 20% of the fundamental amplitude. According to the arctangent principle, the higher the sine exponent, the more obvious the error trend caused by the change in the theoretical angle due to the interpolation error. When the sine index reaches the peak value of 0.2 within the range, the maximum interpolation error reaches 11.30″. Through MATLAB, we can simulate the relationship between the sine exponent and the angle error curve as shown in Figure 3.

2.2. Analysis of Higher Harmonic Error

In the actual signal measurement process, the high-precision waveform signal is close to the sine wave. When the fine code signal decreases, the subdivided waveform approaches the triangle wave. The error of higher harmonic components depends on the acquisition quality of the moiré fringe signal, and the processing algorithm of signal subdivision can be calculated by the θ = arctan sin θ / cos θ method. The method of checking the subdivision table is often used in the algorithm program. When the degree of sine and triangle waveform of the subdivision signal waveform is low, a subdivision table error will occur. The error between the standard sine wave subdivision table and the triangle wave subdivision table is about 8.2%. When the sampled signal only contains high-order harmonic errors, Formula (2) can be rewritten as:
{ U 1 = a 1 sin θ + i = 2 5 a i sin ( i θ + φ i 1 ) U 2 = b 1 cos θ + i = 2 5 b i cos ( i θ + φ i 2 )
From the previous derivation of the relationship between the actual angle value and the subdivision error value, θ r = θ + Δ θ . Introduce Formula (12) into the algorithm:
Δ θ = θ r arctan a 1 sin θ r + i = 2 5 a i sin i θ r b 1 cos θ r + i = 2 5 b i cos i θ r
Arranging Formula (13), we can get:
tan Δ θ = tan θ r a 1 sin θ r + i = 2 5 a i sin i θ r b 1 cos θ r + i = 2 5 b i cos i θ r 1 + tan θ r a 1 sin θ r + i = 2 5 a i sin i θ r b 1 cos θ r + i = 2 5 b i cos i θ r
In order to further consider the influence of harmonic error on the output signal of the photoelectric encoder, Fourier harmonic analysis was carried out on the sampled signal. The analysis results are shown in Figure 4. It can be seen that the influence of harmonics above the 19th order is approximately negligible. The harmonic errors that can significantly affect the subdivision accuracy of the output signal of the photoelectric encoder are the second, third, and fifth harmonic errors. Therefore, it is further verified that in Formula (12), our error and upper limit for higher harmonics are the fifth harmonic.

3. PSO Algorithm Error Compensation

3.1. Principle of Error Correction

Usually in a grating optical system, the slit disk adopts a four-phase indicating grating, and the collected photoelectric moiré fringe signal will be split into four current signals that are out of phase with each other. After the current–voltage conversion process, the signal is amplified, and the A/D data conversion processor is used to convert the sampled signal to facilitate decoding and other tasks. The converted electrical signal can be amplified, filtered, and subdivided by the data processing system, and finally the output angle code can be obtained. Ideally, when the phase difference of the photoelectric signals output by the four groups is π / 2 , the harmonic error and the DC level component existing in the signal can be canceled by the method of differential complementarity. However, in the actual signal acquisition process, the phase of the acquired signal is difficult to ensure a standard phase difference, so the subdivision signal after the acquired signal is differentiated will contain different degrees of harmonic interference.
In the grating detection process, the quality of the fine code signal will directly determine the accuracy of the subdivision precision. In order to improve the resolution and subdivision accuracy of the encoder in a complex working environment, it is necessary to correct the sinusoidal deviations and harmonic errors contained in the sampled signal. In this paper, the non-uniform sampling method is used to simulate the actual working state, and the spectrum analysis of the moiré fringe signal through discrete Fourier transform can be obtained. The differential output signal of the grating moiré fringe photoelectric signal can be expressed as the mathematical analysis expression model shown in the previous Formula (2).
According to the Fourier space transform theory, it can be obtained that the periodic photoelectric moiré fringe signal actually output by the grating in the actual output process can be expressed by the Fourier series expansion. It can be seen from the previous harmonic error amplitude–frequency analysis that in the precision grating system, the harmonic components that have the greatest influence on the subdivision error of the photoelectric moiré signal are the second, third, and fifth harmonics of the photoelectric signal. In this paper, taking the third harmonic with the highest influence as an example, the third harmonic component in the signal is represented by U′, and the maximum harmonic subdivision error can be expressed as Formula (15):
Δ ϕ s ± arcsin U
When U is close to zero, the maximum subdivision error can be approximately expressed as Δ ϕ s ± U , which is converted to the relative value expression of the angle:
U = Δ X s / A ( T / 2 π )
When the subdivision number T = 1024 and Δ X s / A 1 , the third harmonic is U 0.6 % ; if the subdivision number is halved, T = 512, and the relative value of the maximum subdivision angle is less than 1, the third harmonic is U 1.2 % .
According to the actual output of the grating moiré fringe signal, the actual output is calibrated by means of parameter identification. Within the experimental value range, we can express the subdivision error compensation model as Formula (17):
θ = arctan ( U 1 / U 2 ) Δ θ

3.2. Moiré Fringe Interpolation Error Compensation Model

After discrete error acquisition and differential processing, a set of ideal sine and cosine moiré fringe signals can be obtained. We use the tangent method to construct the subdivision error compensation function:
f ( θ ) = U 1 U 2 = A sin θ B cos θ
Because the signal is considered to be in an ideal state at this time, A = B . At this time, the rotation angle can be obtained by Formula (3).
However, in practice, the amplitude-to-phase relationship of the sine signal is nonlinear. We use U ( θ ) to represent the state of the sine and cosine signals in different intervals.
U ( θ ) = { tan θ = | A sin θ | | B cos θ | | A sin θ | | B cos θ | cot θ = | B cos θ | | A sin θ | | B cos θ | | A sin θ |
Using the principle of the tangent method, at this time, the effective angle information can be obtained from the amplitude of the collected moiré fringe photoelectric signal. arctan ( A 1 sin θ / B 1 cos θ ) is a multivalued function in the [ 0 , 2 π ] phase angle range, which is converted into a numerical function and then operated on.
The tangent function and the cotangent function have the following relationship in numerical value:
θ = π 2 - a r c cot ( A cos θ / B sin θ )
A single acquisition period was selected as the test sample, and the acquisition signal was divided into eight parts S 1 ~ S 8 , with the intersection point and zero point of the sine and cosine moiré signals as the dividing line, and π 8 used as a single group step size. In a single group of steps, the tangent function represents the single-angle value function about θ , and the subdivision output value is calculated and obtained according to the number of intervals. The relationship between the number of intervals and the subdivision value is shown in Figure 5.
It can be seen from the image properties of the tangent function that the function value of the tangent function at π / 2 and 3 π / 2 tends to infinity, which will directly lead to the overflow of the angle calculation value. In order to reduce the influence of the above errors on the output results, a set of overdetermined nonlinear equations for waveform parameter identification are established for the collected periodic moiré fringe photoelectric signal data. The equation can obtain the optimal solution of the overdetermined nonlinear equation system and convert it into the identification result of the waveform parameters.
According to the subdivision error compensation model mentioned above, in this paper, we adopt the nonlinear least squares estimation method to deal with the optimal solution of parameters in the nonlinear equation of moiré fringe signal. The moiré fringe output signal can be obtained from Formula (2), and its mathematical model is recorded as:
u = f [ ( θ 1 , α 1 ) , ( θ 2 , α 2 ) , , ( θ i , α i ) ]
u represents the moiré signal output value, and α i represents the parameter value to be identified in the output waveform equation. In the actual error signal processing system, the error component mainly exists in the observation component u . If u is repeatedly output m times at the time [ t b e g i n , t e n d ] , the output value deviation of the moiré output signal observation function signal can be expressed as:
e i = u i - f ( α i )
The merit function solution model of the error estimation algorithm is established according to the principle of least squares. The magnitude deviation contained in the observation u will directly affect the stability of the cost function model. The signal within the output period of the grating is sampled, and the error squared sum e of the sampled signal is used as the cost function of the algorithm to estimate the parameters.
e = min i = 1 N [ u i f ( α i ) ] 2
In order to improve the robustness of the system and reduce the influence of random errors, the number of sample points should be increased during the acquisition period of the grating moiré fringe signal. An overdetermined nonlinear equation for parameter identification is established, and the optimal solution obtained is used as the parameter identification solution of the grating moiré waveform equation.
In order to improve the system accuracy of particle swarm optimization and the problem of low convergence efficiency, this paper is based on traditional particle swarm optimization. By dividing the target population search area by Latin hypercube sampling, parallel population iteration is performed on the particle individuals in the grouped area. The local optimal information is exchanged and compared using the von Neumann topology to obtain the optimal global target value. It effectively improves the search efficiency of population target particles and quickly filters out invalid search areas according to the system accuracy requirements, improving the search accuracy of target parameters.

3.3. Particle Swarm Optimization Compensation Principle

The particle swarm optimization method initially simulates the predation behavior of birds and uses the information interaction between population individuals to determine the optimal location in the population search area. It guides the individual particles in the whole group to iteratively converge to the optimal individual position while retaining the individual diversity characteristics.
The PSO algorithm can be described as a process in which n particles in an N-dimensional search space determine the global optimum through continuous iterative updates of the search speed and search position. In the startup phase of the algorithm, the particles in the search space are initialized, and a “position” is assigned to a single particle—that is, the potential solution of the desired target problem. The method for judging the feasibility of the current solution is to bring the individual particle x i , d into the objective function to calculate the fitness value of the calculator, and based on this, measure the pros and cons of the potential solution among all solutions. For individual particles, each iteration compares an individual optimal position with the current search velocity vector. By summarizing and comparing the states of all particles in the search space, the optimal value of the population will be obtained—that is, the optimal value of the population will converge, and the optimal solution of the objective function will be output. v i d represents the current state search speed of the individual particle, x i d represents the current search position of the individual particle, P b e s t represents the optimal search position of the individual particle, and G b e s t represents the global optimal position of the individual particle in the search domain. The population particle adjusts its own search direction and speed by cyclically tracking P b e s t and G b e s t in the population, and continuously optimizes the particle swarm search algorithm until the system records the individual extreme value and the overall extreme value to meet the predetermined value or the number of operation overflows. In the process of finding the optimal monomer extreme point, we can express the iterative process of particle velocity and position as Formulas (24) and (25).
v i . d ( k + 1 ) = ω v i . d ( k ) + c 1 r 1 ( P i . d x i . d ( k ) ) + c 2 r 2 ( P g . d x g . d ( k ) )
x i . d ( k + 1 ) = x i . d ( k ) + v i . d ( k + 1 )
where k is the iteration number, d is the dimension of the independent variable, and ω is the inertia weight, which is used to adjust the influence of the upper-dimensional search speed on the current speed. r 1 and r 2 are random numbers with a value range of [ 0 , 1 ] , and r 1 and r 2 are independent of each other. In the variables, x i ( k ) is the position vector of particle i at the k-th iteration, and v i ( k ) is the velocity vector of the particle at the k-th iteration. c 1 is the acceleration weight coefficient of the detected particle itself, and c 2 is the weight coefficient of the global acceleration, which is used to adjust the movement speed of the particle at the optimal position of the individual and the overall optimal position. Generally, the coefficient is a constant between [ 0 , 2 ] . This coefficient can effectively improve the direction and trajectory algorithms of particles in the process of searching for optimal positions. The schematic diagram of particle search displacement is shown in Figure 6.
In the iterative formula of the PSO algorithm, Formulas (24) and (25) are composed of three parts: The particle is affected by the previous search speed v i d ( k ) and its influence degree is represented by the inertia weight, the distance P b e s t x i d ( k ) between the position of the particle i and the best position of the monomer sampling, and distance G b e s t x i d ( k ) between the position of particle i and the optimal sampling position of the group. By introducing the ability of the self-searching strategy and selecting appropriate learning weights, the convergence speed of the algorithm can be greatly accelerated, and the situation of search oscillation caused by particles falling into local optimum during the search process can be avoided.
The PSO algorithm is an optimization algorithm established by simulating swarm intelligence, which breaks through the continuity and differentiability required in the mathematical model of the traditional signal system. Compared with other genetic algorithms, the PSO algorithm can save the optimal solutions of all particles before the current state, and will not be destroyed with the change in the population, which makes the algorithm have better stability. In addition, the PSO algorithm does not need coding, and the individual particles are updated through the internal velocity, the principle is simpler, and the required parameters are fewer. However, when the PSO algorithm is aimed at discrete problems, it still lacks a relatively mature convergence analysis method and needs to be further explored. In order to improve iterative efficiency, a lot of logic resources are often required, so it is necessary to make strict judgments on the number of particles when high real-time performance is required.

3.4. Particle Swarm Adaptive Interval Division

The sampling data function of the output signal of the photoelectric encoder is a nonlinear function. In the constrained optimization problem, in the early stage of the particle swarm algorithm execution, attention should be paid to the global particle search to maximize the exploration of the feasible area. In the later stage of the algorithm, local search needs to be strengthened to improve the algorithm’s finding of the optimal solution. In this paper, in order to better guide the individual population and promote the optimization process, through the adaptive interval division, the parallel particle swarm iteration algorithm is performed in the sub-region, and the local optimal value is found and stored in the external memory for optimal value comparison. As the number of particles in the external memory increases, the adaptive interval is further subdivided, which is beneficial to guide particles for further exploration in low-density areas or blank areas. This method is conducive to the development of feasible areas and avoids local convergence while maintaining population diversity.
The interval division method adopts the hexagonal area division of the bionic honeycomb structure, and the area division is determined by the distribution number of the area containing the optimal particles of the area in the current external memory. In the initial stage, the number of locally optimal individual particles in the external memory is small, and a looser particle area division method is adopted to avoid the appearance of particle-free areas. When the optimal particle region is found, the next step can be divided. No matter how many times the sub-region is divided, the sub-region can maintain the same search area, which effectively avoids the problem of individual particle optimization falling into the “local trap”. The target space division area is continuously improved with the increase in the number of optimal particles in the area in the external memory. This type of adaptive angle area division can gradually refine the area division and more effectively guide the population to explore areas with different particle densities, thereby increasing the probability of particle generation in extremely small areas.
Within the population search domain, the search interval should be adaptively divided according to the sub-area search density, and a single sub-area should be further divided into areas. In this paper, the area division is based on the honeycomb hexagonal structure. D represents the number of sub-areas included in the current area division state, and i represents the number of iterations of the area division in the current state. The upper limit of the external memory particle is 50 as an example.
  • Divide the population search space into D 0 = 6 regions, where i is the number of region divisions. As shown in Figure 7a, when the search area is divided for the first time, six effective search areas are obtained, and the search range of each group of areas is completely equal. As the number of algorithm iterations increases, the number of individual historical optimal particles extracted to the external memory increases. When the termination condition of the first division iteration is reached, the second region division is performed. In this paper, the number of particles in the external memory is represented by P g a t h e r , and the external memory is essentially a comparator, which compares the extracted particles in the current optimal position of the individual to obtain the optimal position G b e s t in the current population history. The optimal location acquisition is processed in parallel with the individual optimal location search in the subspace of the search domain.
  • As shown in Figure 7b, as the number of iterations in the search domain is accumulated, the number of particles P b e s t in the individual optimal historical position in the external comparator increases, and the number of particles in the search subspace also increases accordingly, so it is necessary to further subdivide the search area. Starting from i = 2 iterations, the region adaptive division is performed:
( i 1 ) N / i max < P g a t h e r < i N / i max
N is the maximum number of individual current optimal values set in the internal and external memory of the current iteration number, and i max log D N .
3.
By analogy, the interval division of the population search domain can be continuously realized. Ideally, it should be ensured that there is one particle in each sub-region. However, due to the fast convergence speed of the PSO algorithm, even if the number of iterations is increased in some areas, better optimization results cannot be achieved. Therefore, according to the feedback state of the particle search space, some search areas without particles can be excluded accordingly, as shown in Figure 7c. In order not to affect the overall convergence speed of the algorithm, it is necessary to set the termination condition of the algorithm iteration. In this paper, we set the algorithm to stop when the algorithm reaches the predetermined maximum number of iterations or when the number of particles in the subspace of the search domain is 1.

3.5. Particle Swarm Multi-Swarm Parallel Iteration

During the execution of the standard particle swarm optimization, the system network structure is usually a single-community fully connected grid. The fully connected topology has better information transfer speed and algorithm convergence speed, and performs better in the search process of lower dimensions. However, in the higher-dimensional global optimal value optimization problem, the network structure model will be trapped in the optimal structure in some dimensions, resulting in a local optimal situation in the overall search of the population. Relatively speaking, the von Neumann topology, because of its three-dimensional network particle distribution structure, strengthens the exchange of particle information between multiple search areas and enables the population to have a stronger ability to get rid of local traps. This further strengthens the optimization ability of the algorithm, improves the search efficiency and accuracy of the algorithm, and avoids the algorithm falling into the local optimal situation. Based on the self-adaptive division of the search domain mentioned above, a composite mesh model combining fully connected topology and von Neumann topology with multi-group parallel cooperation is proposed. Different topology models use different weights to achieve better cooperation. The schematic diagram of the parallel topology algorithm is shown in Figure 8.
Combined with the adaptive region division proposed in Section 3.4, a fully connected topology is used in the divided sub-regions to explore the regional optimal value of a small number of particles, and the regional optimal value P b e s t will be extracted to the external memory. The global exploration area adopts the von Neumann topology model. For each evolution, the particle extracts the global optimal value G b e s t in the current iteration state and sends it to the fully connected topology of the sub-area in the form of information exchange. After the fully connected topology receives the G b e s t sent by the von Neumann topology, it compares the optimal value P b e s t obtained by the fully connected topology in the sub-region with the global optimal value G b e s t obtained by the von Neumann topology model. If the regional optimal value P b e s t is better than the global optimal value, the iterative information is fed back to the von Neumann structure to adjust its evolution rules. If the regional optimal value is worse than the global optimal value, the sub-regional evolution direction is adjusted according to the global optimal value.
In the particle search process, in order to effectively improve the algorithm’s search ability, it can effectively avoid falling into the “local optimal trap” when dealing with complex iterative problems. Starting from the structural characteristics of different topology types in the iterative process, the von Neumann topology is used as the global topology structure, and the fully connected topology is used as the sub-region population to explore the structure. Taking advantage of the information-sharing characteristics among multi-swarm particles and based on particle fitness, a particle swarm optimization algorithm for multi-structure parallel search is established. The two topology algorithms perform a parallel search for the global and sub-search domains of the population search domain. The particle swarm algorithm compares the local optimum and the global optimum through external memory and uses the comparison results to adjust the iterative strategy. Information sharing between topological structures adopts a secondary communication strategy. After each iteration, the subgroup and the population as a whole share information. At the beginning of each iteration, different population algorithms will detect whether the target population needs to update the evolutionary rules to ensure that the population evolves in the optimal direction and avoids falling into the trap of local optimality. The flowchart of the parallel iterative particle swarm algorithm is shown in Figure 9.

4. FPGA Implementation of Particle Swarm Optimization Algorithm

4.1. FPGA Logic Design of Particle Swarm Optimization Algorithm

The particle swarm algorithm requires high resource weighting and computing speed. FPGA is the most mainstream hardware circuit-bearing platform at this stage. The computing method is the parallel computing mode of the pipeline architecture. This method can greatly improve the computing speed and meet the system performance requirements. In the process of building the FPGA platform for the particle swarm algorithm, it mainly includes the following four modules: a digital signal acquisition module, particle velocity update module, particle position update module, and data processing module.
(1)
Digital Signal Acquisition Module
The digital signal acquisition module adopts an AD9248 digital acquisition chip. The chip adopts a multi-stage differential pipeline architecture, has built-in output error correction logic, and can provide 16-bit accuracy at the highest data rate of 65 MSPS. A double single-ended independent clock input is used to control the internal conversion cycle. In the double-frame acquisition mode, the data are output through two pins— D 1 and D 0 —of which the D 1 pin outputs the high byte and the D 0 pin outputs the low byte. The deserialization operation of the sampled data is completed through the FPGA internal IP core LVDS_RX. The deserialization clock is set to 50 MHz in this paper, and the data bus bandwidth is designed to be 640 Mbps. The 16-bit test data source is generated according to the actual sampling data, in which the high-order 8-bit data decrease in turn, and the low-order 8-bit data increase in turn. The simulation results in Modelsim are shown in Figure 10.
(2)
Particle Velocity Update Module
The particle swarm iteration speed update thinking expressed by Equation (24) is set, the particle swarm speed update module is set, and the inertia weight is set to a fixed value of 0.8. The particle search speed is updated according to the particle speed stored in RAM, as well as the global optimal value and local optimal value appearing in the historical search process. In the design process of the speed update module, a judge is added to prevent the particles from exceeding the predetermined search boundary due to the high search speed during the particle speed update process, resulting in repeated oscillations at the search boundary. v is the current particle search speed, c 1 , c 2 is the acceleration factor, r 1 , r 2 is a random number, p o p  is the particle, and the output value u p d a t e is the particle update speed. The particle velocity update FPGA module is shown in Figure 11.
(3)
Particle Position Update Module
From Formula (25), the particle position update method in the PSO algorithm can be obtained. In the design of the FPGA logic module, a judger is also added to ensure that the particle search process is limited within the search domain. The testing process mainly includes a serial–parallel conversion module, data ROM module, weight–threshold processing module, weight–threshold conversion module, output layer module, subtraction module, and so on. The weight–threshold processing module can split the particles according to a predetermined grid structure. Assuming that the network has n node input layers, m node hidden layers, and l node output layers, the algorithm particle dimension can be expressed as ( n + 1 ) × m + ( m + 1 ) × l . Convert the weights and thresholds generated by the weight–threshold processing module into a structure suitable for FPGA logic calculation. In order to facilitate parallel computing, the weights and thresholds generated by the weight–threshold processing module are converted into parallel output data. The input of the serial–parallel conversion module is the global optimal individual after the iteration is completed, and the subtraction module calculates the difference between the test data and the simulation data. The particle position update FPGA module is shown in Figure 12.

4.2. FPGA Key Parameter Setting

When the PSO algorithm is used to compensate the subdivision error of the photoelectric encoder, a larger initial population size can better realize the global exploration ability of the particle swarm to the target interval, whereas a smaller initial population can complete the rapid convergence of the algorithm. Therefore, it is necessary to combine the stability and effectiveness of the algorithm to select appropriate population parameters so that the error compensation algorithm can achieve better performance. In addition, since the particle swarm optimization algorithm has high requirements for the computing speed and resources of the hardware platform in the compensation process, it is necessary to select appropriate algorithm parameters. Therefore, in Section 4.2, we set the inertia weight mode and the number of particles contained in the particle swarm in the PSO algorithm based on the application scenario of the PSO algorithm and the occupancy of the logic resources of the FPGA platform.
(1)
Inertia Weight
In the process of local area and global area search, inertia weight plays a very important role. Usually, there are two change modes of linear inertia weight and nonlinear inertia weight. For the moiré grating output signal, in the variation mode of nonlinear inertia weight, the fitness value of the PSO algorithm fitting degree test result fluctuates less and is relatively stable. The linear inertia weight change mode is less stable than the nonlinear weight change mode, but from the perspective of fitting accuracy, the linear weight change mode is more accurate at the optimal point. The fitness analysis of linear inertia weight and nonlinear inertia weight is shown in Figure 13.
From the analysis of the logical occupancy, the same population quantity and spatial dimension distribution are selected to compare the logical resource occupancy of the two inertia weight changes. It can be seen from the actual simulation results that the number of logic resources occupied by the linear inertia weight change method in the FPGA is slightly lower than that of the nonlinear inertia weight logic resource occupancy.
In general, a larger inertia weight can help particles effectively avoid falling into a local optimum during the search process and improve the algorithm’s search ability, whereas a smaller inertia weight can help improve the particle’s convergence ability during the global search process. The inertia weight should also be dynamically adjusted with the performance of the current optimal value of the population and the number of algorithm iterations. In the study by [20], a linear inertia weight change Formula (31) is proposed:
ω = ω max ( ω max ω min ) k k max
Among them, ω max is the maximum value of the inertia weight, k max is the upper limit of the set number of iterations, and k is the current number of iterations. In this paper, the value variation range of the inertia weight is ω [ 0.4 , 1 ] .
(2)
Number of Particles
The size of the number of particles will affect the convergence and accuracy of the algorithm to a certain extent. In general, optimization algorithms in different scenarios will choose different particle numbers. For most problems, N [ 10 , 50 ] . A smaller number of particles can make the particle swarm algorithm achieve a better population convergence effect, but when the population search domain is large or in a more complex optimization problem, a larger number of particles should be selected to meet the search effect. In this paper, in the problem of setting the number of particles in the population, the FPGA platform is used to test the sampling signal particles of grating moiré fringes. By controlling other variables to be exactly the same, the comparison of the system logic resource occupancy under the condition of different population particle numbers is achieved. The test results are shown in Table 1.
It can be concluded that when the other variables are exactly the same, as the number of particles in the population increases, the algorithm improves the search efficiency of sub-regions and the fluctuation of the optimal fitness value during the search process is relatively reduced. From the data analysis and comprehensive analysis of the FPGA logic resource occupancy, the number of particles is positively correlated with the FPGA logic resource occupancy. However, when the number of particles is 20 and the number of particles is 30, the difference between the optimal fitting accuracy values is small, but the use of 30 search particles takes up more logic resources, so this paper chooses N = 20  as the number of particles in the test population.
In order to test the performance superiority of the FPGA platform, under the same experimental conditions, FPGA and MATLAB are used to realize the fitness of the PSO algorithm to de-encode sampling data function optimization. The test results are shown in Figure 14.
From Figure 14, it can be concluded that FPGA can better complete the population convergence, and the overall performance is higher than that of MATLAB and other system execution platforms.

5. Experimental Design

In this paper, in order to verify the effectiveness of the subdivision error compensation algorithm proposed above, the experimental signal is loaded into the precision error detection and compensation platform written with the algorithm execution program to verify the function of the algorithm. The data acquisition and calculation development board of the test platform is shown in Figure 14. The AD acquisition module adopts an AD9248 conversion board. The FPGA development board selects ALTERA’s DE2-115 to implement the error compensation algorithm. The algorithm-writing work is carried out in a Quartus II development environment using Verilog HDL language to design the compensation algorithm circuit and download it to the FPGA chip to complete the compensation task.
In order to cooperate with the verification test results, a photoelectric encoder error detection platform is designed as a special error detection and compensation device. The internal structure of the subdivision error detection and compensation platform is shown in Figure 15. The platform uses an autocollimator and a regular tetrahedron to form an optical position closed loop as an angle reference, and a fixed-position optical reflection device is also installed to detect the signal drift of the autocollimator during the process. The detection device can perform ±360° continuous or fixed compensation detection, and adopts an internal and external dual-axis structure. The positioning accuracy of the angular position of the inner and outer shafts is ±0.2″, the angular position stability is ±0.36″, the verticality of the shaft system and the axis rotation accuracy error are ≤±2″, and the angular position resolution is ≤0.36″. The detection device consists of a detection platform and a control box that can transmit the collected data to the host computer in real time for display. The size of the inner table at the top of the detection device is designed to be Φ210 mm, and the material is super-hard aluminum alloy. The flatness of 0.005 mm and the runout of the end face of 0.01 mm are guaranteed by grinding the table surface and the installation positioning surface. Load-mounting screw holes are arranged on the table, and by matching the clamping flanges with corresponding dimensions, the detection of encoders of any size with a diameter of less than 210 mm and a single weight of less than 2.5 kg can be realized. The structure designed in this paper can form an optical closed-loop detection structure and has a relatively low cost to complete higher-precision detection, which effectively improves the detection efficiency and accuracy. The system structure of the subdivision error detection and compensation platform is shown in Figure 16.
In order to verify the experimental effect of the algorithm proposed in this paper, we compare the signal subdivision results of the output signal of the photoelectric encoder before and after compensation under the same experimental environment. As shown in Figure 17, the subdivision result in one sinusoidal signal period outputted by the detection platform is obtained, and the unit of the curve is the subdivision value.
From the image analysis, it can be concluded that in the uncompensated subdivision period, using the normal subdivision look-up table, the deviation value of the signal angle subdivision point connection reaches the peak value at π/2 and 3π/2. The subdivision value corresponding to the π/2 subdivision point is 1.81 radians, and the subdivision value corresponding to the 3π/2 subdivision point is 4.89 radians. When the optimized subdivision look-up table is used to compensate the detection error, it can be seen from the blue marked points in Figure 17 that the connection of the angle subdivision points of the signal is close to the line of subdivision points in the ideal state at π/2 and 3π/2—that is, at the peak of the error, the orthogonality deviation is significantly reduced. The subdivision value corresponding to the π/2 subdivision point is 1.51 radians, and the subdivision value corresponding to the 3π/2 subdivision point is 4.54 radians.
In order to verify the effect of error compensation, 64 points are measured in one subdivision period selected by the specific angular position of the 25-bit encoder. The subdivision accuracy before and after the compensation of the photoelectric signal of the encoder is detected, and the detection result of the dynamic subdivision error is shown in Figure 18:
As can be seen from Figure 16, the maximum value of the subdivision error before compensation is +0.50″, the minimum value is −0.49″, and the peak-to-peak error is 0.99″; after the algorithm compensation, the subdivision error value is significantly reduced, the maximum error value is +0.31″, the minimum error value is −0.16″, the peak-to-peak error is 0.47″, and the subdivision accuracy is significantly improved. This algorithm is effective for quadrature errors. The dynamic subdivision error after compensation is about the same as that before compensation 1 2 .
It can be concluded from Figure 19 that the maximum value of the subdivision error before compensation is +0.48″, the minimum value is −0.78″, and the peak-to-peak error is 1.26″; after the algorithm compensation, the subdivision error value is significantly reduced, the maximum error value is +0.16″, the minimum error value is −0.31″, the peak-to-peak error is 0.48″, and the subdivision accuracy is significantly improved. In addition, a small numbers of systematic errors and random errors of readings are still included in the detection of subdivision errors using the precision error precision-measuring platform.
Fourier spectrum analysis is performed on the above subdivision error compensation results, and the results are shown in Figure 20. Before subdivision error compensation, the influence of low-order signals (first-order, second-order, third-order, and fourth-order signals) in the subdivision error spectrum is more obvious; after the subdivision error compensation operation, the low-order interference components are effectively suppressed, and the overall high-order harmonic components of the subdivision error of the signal are significantly reduced. From the analysis of the subdivision error results in the time and frequency domains, it can be seen that the moiré grating signal subdivision error compensation scheme based on the particle swarm optimization algorithm proposed in this paper is effective and feasible, and the subdivision accuracy is improved significantly.

6. Conclusions

To sum up, the subdivision error compensation method of the moiré grating fringe signal is studied in this paper. According to the characteristics of the grating signal waveform equation, the generation principle of grating moiré fringe subdivision error is analyzed by a mathematical model. A search domain subdivision method based on hive-adaptive area division is proposed, and a multi-swarm optimization search algorithm using parallel iteration is proposed by taking advantage of the pipeline architecture of the FPGA development platform and the advantages of parallel processing. Using the advantages of the fully connected topology and the von Neumann topology, the rapid iterative convergence of the particle population search domain is realized, which effectively improves the convergence speed and accuracy of the traditional PSO algorithm. Based on the FPGA development platform and the optical detection device, a photoelectric encoder moiré grating subdivision signal error detection and compensation device is constructed, and the dynamic/static error compensation test of the 25-bit photoelectric encoder is carried out. The test results show that the optimized error compensation algorithm reduces the dynamic subdivision error of the system from the original 0.9928″ to 0.4779″, the static subdivision error is reduced from 1.2641″ to 0.4866″, and the overall system can obtain better convergence efficiency and a more accurate fitness value.

Author Contributions

Validation, H.H., G.C., H.D. and K.L.; formal analysis, H.H.; investigation, H.H.; data curation, H.H.; writing—original draft preparation, H.H.; writing—review and editing, G.C., H.D. and K.L.; funding acquisition, G.C. and H.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Major National Scientific Instrument and Equipment Development Project of China (grant No. 2017YFF0105304) and the Key Research and Development Project of Science and Technology Development Plan of Jilin Provincial of China (No. 20200401117GX).

Acknowledgments

The authors would like to express their appreciation to Shangyu Jiang for assistance with the investigation work.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Wang, X.J. Errors and precision analysis of subdivision signals for photoelectric angle encoder. Opt. Precis. Eng. 2012, 20, 379–386. (In Chinese) [Google Scholar]
  2. Das, S.; Chakraborty, B. Design and Realization of an Optical Rotary Sensor. IEEE Sens. J. 2018, 18, 2675–2681. [Google Scholar] [CrossRef]
  3. Tameh, T.A.; Sawan, M.; Kashyap, R. Novel analog ratio-metric optical rotary encoder for avionic applications. IEEE Sens. J. 2016, 16, 6586–6595. [Google Scholar] [CrossRef]
  4. Su, Y.; Wang, Q.; Yan, F.; Liu, X.; Huang, Y. Subdivision error analysis and compensation for photoelectric angle encoder in a telescope control system. Math. Probl. Eng. 2015, 2015, 967034. [Google Scholar] [CrossRef] [Green Version]
  5. Yang, Y.-P.; Ting, Y.-Y. Improved angular displacement estimation based on Hall-effect sensors for driving a brushless permanent-magnet motor. IEEE Trans. Ind. Electron. 2014, 61, 504–511. [Google Scholar] [CrossRef]
  6. Das, S.; Sarkar, T.S.; Chakraborty, B.; Dutta, H.S. Study on array of photo-detector based absolute rotary encoder. Sens. Actuators A Phys. 2016, 246, 114–122. [Google Scholar] [CrossRef]
  7. Bajić, J.S.; Stupar, D.Z.; Dakić, B.M.; Živanov, M.B.; Nagy, L.F. An absolute rotary position sensor based on cylindrical coordinate color space transformation. Sens. Actuators A Phys. 2015, 213, 27–34. [Google Scholar] [CrossRef]
  8. Wang, Y.; Liu, Y.; Yan, X.; Chen, X.; Lv, H. Compensation of moire fringe sinusoidal deviation in photoelectrical encoder based on tunable filter. In Proceedings of the 2011 Symposium on Photonics and Optoelectronics (SOPO), Wuhan, China, 6–18 May 2011; Volume 39, pp. 1–4. [Google Scholar]
  9. Anguo, H.; Honglin, Y.; Chuanxin, Z.; Wang, Y.G. Subdivision and direction judgment of grating Moire fringes. Opto Electron. Eng. 2007, 34, 45–49. [Google Scholar]
  10. Xianjun, W. Analysis of the error and accuracy of the subdivision signal of the photoelectric shaft encoder. Opt. Precis. Eng. 2012, 20, 379–386. [Google Scholar]
  11. Matszoe, Y.; Yoshizawa, T. High-performance absolute rotary encoder using muhitrack and M-code. Opt. Eng. 2003, 42, 124–131. [Google Scholar] [CrossRef]
  12. Luo, C.Z.; Chen, L.Y.; Sun, Y. A new optical encoder. Opt. Precis. Eng. 2003, 11, 104–108. [Google Scholar]
  13. Matsuzoe, Y.; Koizumi, K.; Saitoh, T. Optimizing design of high-resolution optical encoder using a poin-source light-emitting diode with slits. Opt. Eng. 2005, 44, 013609-1–013609-6. [Google Scholar] [CrossRef]
  14. Zhifeng, L.; Xiupeng, H.; Li, L.; Xiaodong, W. Measurement of spindle radial movement error with circular grating and autocollimator. Opt. Precis. Eng. 2019, 27, 2053–2061. [Google Scholar]
  15. Ying, S.; Qiuhua, W.; Ronghong, S. Subdivision error compensation method of small photoelectric encoder. J. Electron. Meas. Instrum. 2011, 25, 605–611. [Google Scholar]
  16. Song, J.H.; Kim, K.C.; Kim, S.H.; Yoon, K.K. A new error compensation method in linear encoder using phase shifted grating. SPIE 1999, 2740, 124–127. [Google Scholar]
  17. Shuliang, Y.; Qian, Z.; Weibin, Z. Study on quadrature error real-time compensation for grating Moiré signal. Chin. J. Sci. Instrum. 2017, 38, 57–64. [Google Scholar]
  18. Zhu, W.B.; Ye, S.J.; Huang, Y.; Xue, Z. Design of a precise subdivision system for gratings using a modified CORDIC algorithm. IET Circuits Devices Syst. 2019, 13, 1284–1291. [Google Scholar] [CrossRef]
  19. Zhu, W.; Lin, Y.; Huang, Y.; Xue, Z. Research on Sinusoidal Error Compensation of Moiré Signal Using Particle Swarm Optimization. IEEE Access 2020, 8, 14820–14831. [Google Scholar] [CrossRef]
  20. Gao, X.; Wan, Q.; Lu, X.; Sun, Y. Automatic compensation of sine deviation for grating fringe photoelectric signal. J. Opt. 2013, 33, 194–199. [Google Scholar]
Figure 1. Photoelectric encoder explosion structure diagram.
Figure 1. Photoelectric encoder explosion structure diagram.
Sensors 22 04456 g001
Figure 2. Graphical analysis of the Lissajous sine error.
Figure 2. Graphical analysis of the Lissajous sine error.
Sensors 22 04456 g002
Figure 3. Subdivision error introduced by signal sinusoidal error [19].
Figure 3. Subdivision error introduced by signal sinusoidal error [19].
Sensors 22 04456 g003
Figure 4. Analysis of high-order harmonic error.
Figure 4. Analysis of high-order harmonic error.
Sensors 22 04456 g004
Figure 5. Comparison among original signals and constructed function.
Figure 5. Comparison among original signals and constructed function.
Sensors 22 04456 g005
Figure 6. Schematic diagram of particle displacement.
Figure 6. Schematic diagram of particle displacement.
Sensors 22 04456 g006
Figure 7. Adaptive sampling area division of the honeycomb structure (D = 6). (a) Partition of particle initial iterative region; (b) 2 iterations to search the domain model; (c) Schematic representation of iterative derivation of the search domain.
Figure 7. Adaptive sampling area division of the honeycomb structure (D = 6). (a) Partition of particle initial iterative region; (b) 2 iterations to search the domain model; (c) Schematic representation of iterative derivation of the search domain.
Sensors 22 04456 g007
Figure 8. Schematic diagram of the parallel topology algorithm.
Figure 8. Schematic diagram of the parallel topology algorithm.
Sensors 22 04456 g008
Figure 9. Flow chart of the parallel iterative particle swarm algorithm.
Figure 9. Flow chart of the parallel iterative particle swarm algorithm.
Sensors 22 04456 g009
Figure 10. Subdivision circuit simulation test results.
Figure 10. Subdivision circuit simulation test results.
Sensors 22 04456 g010
Figure 11. FPGA particle velocity update module.
Figure 11. FPGA particle velocity update module.
Sensors 22 04456 g011
Figure 12. Particle position update module.
Figure 12. Particle position update module.
Sensors 22 04456 g012
Figure 13. Comparison of fitness of linear and nonlinear inertial weight transformation methods. (a) Linear inertia weight change method; (b) non-linear inertia weight change method.
Figure 13. Comparison of fitness of linear and nonlinear inertial weight transformation methods. (a) Linear inertia weight change method; (b) non-linear inertia weight change method.
Sensors 22 04456 g013
Figure 14. The fitness diagram of the PSO algorithm implemented by FPGA and MATLAB.
Figure 14. The fitness diagram of the PSO algorithm implemented by FPGA and MATLAB.
Sensors 22 04456 g014
Figure 15. Moiré grating interpolation error precision detection platform.
Figure 15. Moiré grating interpolation error precision detection platform.
Sensors 22 04456 g015
Figure 16. Moiré grating interpolation error precision detection platform.
Figure 16. Moiré grating interpolation error precision detection platform.
Sensors 22 04456 g016
Figure 17. Subdivision error of the signal before and after error compensation.
Figure 17. Subdivision error of the signal before and after error compensation.
Sensors 22 04456 g017
Figure 18. Comparison before and after dynamic subdivision error compensation.
Figure 18. Comparison before and after dynamic subdivision error compensation.
Sensors 22 04456 g018
Figure 19. Comparison before and after static subdivision error compensation.
Figure 19. Comparison before and after static subdivision error compensation.
Sensors 22 04456 g019
Figure 20. Spectrum results of the subdivision error before and after error compensation.
Figure 20. Spectrum results of the subdivision error before and after error compensation.
Sensors 22 04456 g020
Table 1. FPGA resource occupation under different inertia weight methods and particle numbers.
Table 1. FPGA resource occupation under different inertia weight methods and particle numbers.
Particle
Population
Space DimensionalityChanging ModeLEBest Fitness
205Nonlinear inertia weight13,852
105Linear inertia weight76972.638 × 105
20513,0677.41 × 104
30518,6736.97 × 104
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Hou, H.; Cao, G.; Ding, H.; Li, K. Research on Particle Swarm Compensation Method for Subdivision Error Optimization of Photoelectric Encoder Based on Parallel Iteration. Sensors 2022, 22, 4456. https://doi.org/10.3390/s22124456

AMA Style

Hou H, Cao G, Ding H, Li K. Research on Particle Swarm Compensation Method for Subdivision Error Optimization of Photoelectric Encoder Based on Parallel Iteration. Sensors. 2022; 22(12):4456. https://doi.org/10.3390/s22124456

Chicago/Turabian Style

Hou, Han, Guohua Cao, Hongchang Ding, and Kun Li. 2022. "Research on Particle Swarm Compensation Method for Subdivision Error Optimization of Photoelectric Encoder Based on Parallel Iteration" Sensors 22, no. 12: 4456. https://doi.org/10.3390/s22124456

APA Style

Hou, H., Cao, G., Ding, H., & Li, K. (2022). Research on Particle Swarm Compensation Method for Subdivision Error Optimization of Photoelectric Encoder Based on Parallel Iteration. Sensors, 22(12), 4456. https://doi.org/10.3390/s22124456

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop