1 Introduction

With the continuous development of the new generation of technology, it becomes particularly important to be able to efficiently and accurately perceive 3D data of all kinds of things. The demand for 3D reconstruction in all walks of life is increasing, and the importance of 3D imaging technology is also increasing. In addition to traditional industries, emerging industries today are inseparable from the measurement of 3D information, 3D imaging technology has been widely used in different fields such as automatic driving, face recognition, and augmented reality/virtual reality (AR/VR). At present, the more mainstream 3D imaging technologies are the time-of-flight method, stereovision method, and structured light method. Among them, the structured light method is more widely used in 3D imaging technology, because it has higher detection accuracy and integration, better real-time performance, and a simpler optical path.

The traditional 3D measurement method of structured light generally uses a DLP (Digital Light Processing) projector to project-specific structured light to the object, then the camera takes the structured light modulated by the object, and the 3D information of the object is calculated through image processing and visual model, to realize 3D reconstruction. However, some of problems with DLP projectors, such as large size and the difficulty of changing position in real time, have limited their application in some fields. The emergence of metasurface provides a new way to solve these problems. Metasurface [1,2,3] is a planar 2D optical element with sub-wavelength thickness, which can control the light field by adjusting the rotation angle, size, and shape of the surface nanorod. Different from traditional optical elements, the subwavelength structure of the metasurface can interact with the incident electromagnetic field. Abrupt optical parameters are introduced on the surface to break the dependence of traditional optical elements on the propagation path.

This method can also be used for structured light based on the flexibility of the metasurface to control the optical front. Many efforts have been made to achieve metasurface-based structured light. Li et al. [4] designed an all-silicon phase-only metasurface using geometric phase concepts and depth-controlled dynamic phase modulation to achieve a \(4 \times 4\) uniform spot array in the infrared band with an extension angle of \(59^{ \circ } \times 59^{ \circ }\). Yang et al. [5] designed a metasurface based on all-dielectric fundamental mode waveguides to realize a \(5 \times 5\) point array insensitive to polarized light. Chen et al. [6] proposed a geometric hypersurface-based fan-out diffraction optical element with continuous accurate phase manipulation and high polarization conversion efficiency, achieving a uniform \(4 \times 4\) spot array with an extension angle of \(32^{ \circ } \times 32^{ \circ }\). Ni et al. [7] proposed a polarization-independent silicon-based metasurface that can project a collimated laser beam into a far-field with an extension angle of \(120^{ \circ } \times 120^{ \circ }\) to form a spot array. Zheng et al. [8] proposed an all-dielectric metasurface that achieves a \(5 \times 5\) uniformly diffracted spot array in a broad band of 650–690 nm, with high efficiency and insensitive polarization. Li et al. [9] studied a Hermite conjugated metasurface made of amorphous silicon, which disturbed the incident light into random point clouds with compressed information density in the whole space. Song et al. [10] proposed a new strategy for generating selective diffraction order based on dielectric metasurface, which can manipulate amplitude by modulating geometric parameters in the normalization stage, to strongly suppress the undesirable diffraction order and achieve selective diffraction. We also proposed in our previous work [11] to change the operating wavelength range by changing the structure of the DG metasurface through multi-beam interference.

With the continuous development of metasurface technology, a variety of new metasurface-based devices such as holograms and metasurface lenses emerge at the right moment. However, in general, the prepared metasurface optical components only have a fixed and single function, which hinders the practical application. Therefore, the study of dynamically tunable optical components has become a hot topic in recent years, attracting the attention of many scholars. So far, to achieve a dynamically tunable metasurface, researchers have successively proposed electrically tunable metasurfaces [12,13,14,15,16], mechanically switchable metasurfaces [17,18,19], and optically tunable metasurfaces [20,21,22,23,24], etc. Although the above methods are ingenious, to some extent, they are complicated in structure and difficult in design.

Inspired by the Moiré effect [25, 26], the two layers of the metasurface are cascaded to make their phase superposition. After the beam incident, a certain amount of phase regulation will be generated. When rotating one metasurface, the amount of phase superposition will also change with the rotation angle so that the light pattern generated by the beam passing through the bilayer metasurface can be changed. This regulation method is relatively simple and has a wide application prospect. However, there are few studies on the dynamic tuning of structured light, and few studies on the combination of Moiré effect and DG metasurface. Inspired by diffractive Alvarez lenses and Moire lenses, Du et al. [25] proposed a general method for designing mechanically tunable devices based on cascaded bilayer metasurfaces. Wu et al. [26] proposed a novel chiral metamaterial consisted of two layers of identical achiral Au nanohole arrays stacked into Moiré patterns, where the chiroptical responses of the Moiré chiral metamaterial can be precisely tuned by the in-plane rotation between the two layers of nanohole arrays. The study of metasurface based on Moiré effect provides a new solution for the dynamic tuning of structured light.

In this work, we propose a bilayer metasurface based on the Moiré effect, which is different from other studies, and consists of two layers of metasurface with different structures placed opposite to each other. Because the scheme combines the advantages of the Moiré effect and DG is tunable, and easy to integrate and manufacture. It can generate \(5 \times 5\) diffraction spot arrays in the working range 860–930 nm. By rotating one layer of the metasurface, the structure light pattern can be changed. The scheme has good conversion efficiency and contrast ratio, and provides a new idea for the dynamic control of metasurface and the design of active optical elements.

2 Design principle

Moiré effect [27] is an optical phenomenon that produces based on light interference and diffraction. Moiré effect will be produced when two or more layers of metasurfaces are superimposed. At the same time, different effects can be generated by changing the period, position, or angle of two or more layers of the metasurface. In addition, it has more abundant characteristics than the original structure, such as multi-band response, wide band, and so on. The traditional 3D measurement method of structured light generally uses a DLP projector or diffractive optical element to project specific structured light to the object, then the camera takes the structured light modulated by the object, and the 3D information of the object is calculated through image processing, and visual model, to realize 3D reconstruction. With the trend of miniaturization of optical components, more and more DG is used to generate lattice-structured light.

DG [28,29,30] is binary (0, π) phase grating with only a (+ 1, − 1) transmission coefficient. As shown in Fig. 1, the figure shows 1D DG with a normalized period, which is the phase mutation point of the grating. The required grating properties can be obtained by changing the position. The ordinate in the figure represents the transmission coefficient of the grating, and + 1 and − 1 correspond to the phases 0 and π, respectively.

Fig. 1
figure 1

Distribution diagram of the transmission coefficient of 1D DG[5]

To simplify the design process, a 1D structure can be designed first, and then two 1D structures can be superimposed in the orthogonal direction to obtain a 2D structure. The transmission coefficient of the 1D DG can be expressed and then the transmission coefficient distribution of the 2D DG can be obtained through the matrix multiplication shown in Eq. (1.1).

$$\left[ {1, - 1,1, - 1,1} \right]^{{\text{T}}} \times \left[ {1, - 1,1, - 1,1} \right].$$
(1.1)

To evaluate the optical specificity of a DG metasurface, we define the conversion efficiency as the ratio of the optical power projected to the target diffraction level and the input power:

$$\eta = {{\left( {\sum\limits_{{{\text{i}},j \in N}} {P_{ij} } } \right)} \mathord{\left/ {\vphantom {{\left( {\sum\limits_{{{\text{i}},j \in N}} {P_{ij} } } \right)} {P_{in} }}} \right. \kern-0pt} {P_{in} }},$$
(1.2)

where \(\sum\nolimits_{{{\text{i}},j \in N}} {P_{ij} }\) is the optical power of the light projected to all target diffraction, \(P_{in}\) is the power of the incident light.

Another important parameter is the contrast ratio, defined as

$$C = \frac{{I_{\max } - I_{\min } }}{{I_{\max } + I_{\min } }},$$
(1.3)

where \(I_{\max }\) and \(I_{\min }\) represent the maximum and minimum light intensity of the target diffraction level, respectively. The better the contrast ratio is, the smaller the \(C\) will be, and vice versa, the larger the \(C\).

3 Results and discussion

According to the above analysis, the Moiré effect can be generated by using two layers of metasurface, which can realize optical effect different from those of single-layer metasurface. Inspired by the case, this section will study the bilayer DG metasurface based on the Moiré effect. As a kind of excellent electro-optical material, Lithium niobate(LiNbO3, LN) has strong regulation, photorefractive effect, and other photoelectric properties, and has a wide range of applications in optical modulators linear and non-linear optics and other fields. Therefore, LN can play a role in light modulation and is chosen as the material for the nanorod in the metasurface. Our bilayer metasurface also use LN as nanorod in Fig. 2, and it can be seen from Fig. 3 that the LN metasurface can achieve 2π phase delay and maintain high efficiency.

Fig. 2
figure 2

a Top view of the bilayer-metasurface nanorod. b Structure diagram of a cell nanorod with cell size \(D = 600\;{\text{nm}}\) and height \(H_{1} = H_{2} = 1000\;{\text{nm}}\)

Fig. 3
figure 3

a and b are the curve of phase and transmittance change when the radius of the direct waveguide is \(R_{1} = 117\;{\text{nm}}\) and \(R_{1} = 138\;{\text{nm}}\), respectively

Based on electromagnetic simulation software FDTD Solutions, the DG metasurface was designed. First, the bilayer metasurface nanorod model was established. As shown in Fig. 2, the straight waveguide nanorods and helical waveguide nanorods placed on the silica substrate were placed opposite each other, and the substrate size \(D\) was \(600\;{\text{nm}} \times 600\;{\text{nm}}\). The height of the nanorod with different structures is all 1000 nm. The change of the straight waveguide radius R1 and helical waveguide radius R2 will cause the change of the transmission phase, so that the optical wavefront can be modulated to form a uniform and equal intensity diffraction spot.

To determine the best arrangement mode, the radius of the straight waveguide and the helical waveguide are nested and scanned to explore the influence of the change of the radius of the straight waveguide and the helical waveguide on the transmission phase. Under the irradiation of a plane wave at 880 nm, the transmission phase of the bilayer nanorod changes with the helical radius, as shown in Fig. 3. With a fixed straight waveguide radius, when the helical waveguide radius changes from 30 to 90 nm, its phase can realize a change of more than 2π. The radius of the straight waveguide \(R_{1} = 117\;{\text{nm}}\) is fixed, and one of the radius of the helical waveguide \(R_{2} = 58\;{\text{nm}}\) is selected. At this time, the phase is about 4π, the transmittance is 0.958, and the reflectivity is 0.042. Then, the radius of the straight waveguide is chosen to be \(R_{1} = 138\;{\text{nm}}\) and the radius of the helical waveguide is chosen to be \(R_{2} = 79\;{\text{nm}}\), so that the phase difference between different radii nanorods of the same layer metasurface is π. In this case, the phase is about 9π, the transmittance is 0.941, and the reflectivity is 0.059.

Then, the straight waveguides and helical waveguides of different radii are arranged on the silica substrate according to Dammann’s calculation, and the two metasurfaces are placed opposite each other. Three cycles were set in the × direction and y direction, respectively, as shown in Fig. 4. The total size of the DG was \(6\;{\mu m} \times 6\;{\mu m}\). In addition, to reduce the friction between the two metasurfaces, there is a certain gap between the two relative metasurfaces, about 140 nm.

Fig. 4
figure 4

a LiNbO3 bilayer-DG metasurface on silica substrate; b Schematic diagram of the bilayer-DG metasurface

Figure 5(a) shows the transmission phase distribution of the metasurface electric field Ex of DG composed of two straight waveguides and helical waveguides with different radii under the irradiation of the plane wave at 880 nm wavelength. It can be seen that the phase of the electric field is about 0 or ± 3π. The DG also obtained an almost uniform and equal intensity \(5 \times 5\) diffraction spot array in the far field, as shown in Fig. 5(b).

Fig. 5
figure 5

a Phase distributions of Ex of the transmitted field of the bilayer-DG metasurface b The normalized far-field diffraction intensity distribution of bilayer-DG met surface

In this paper, the numerical simulation of the bilayer nanorods with two kinds of radius combinations in the optical band range of 800–1000 nm is carried out to verify the wide-band characteristics of the bilayer DG metasurface designed in this section. When the plane wave is normally incident, the simulation results show that the transmission phase difference of two bilayer nanorods with different radii in the optical band of 860–930 nm is about π, as shown in Fig. 6(a), where the area shown by the dotted line is the operating band of the DG metasurface. The transmittance of about 0.9 can be maintained in this band, as shown in Fig. 6(b). At the same time, it should be noted that when the optical wavelength is near 950 nm, the transmittance with the straight waveguide radius \(R_{1} = 138\;{\text{nm}}\) and the helical waveguide radius \(R_{2} = 79\;{\text{nm}}\) suddenly drops to close to zero, so the selection of this wavelength should be avoided. According to the analysis of Fig. 6, it can be seen that the bilayer nanorod is suitable for an 860–930 nm wide band.

Fig. 6
figure 6

a The transmission phase difference of bilayer nanorods. b The transmittance of bilayer nanorods

In addition, according to the Moiré effect principle mentioned above, the helical waveguide layer is rotated by 12° to obtain the structure as shown in Fig. 7.

Fig. 7
figure 7

Schematic diagram of a bilayer-DG metasurface rotated by 12°

It can be seen from the Moiré effect that the rotated grating will produce different optical characteristics from the previous grating. In the case, the same light source is used to irradiate it, resulting in diffraction spots different from those on the metasurface without rotation, as shown in Fig. 8(a), which shows that under the irradiation of plane waves at 880 nm wavelength, the transmission phase distribution of electric field Ex of the bilayer DG rotated by 12° shows that the electric field phase is about 0 or ± 3π. As envisaged, the electric field phase distribution of the rotated DG also rotates accordingly, and the diffraction spot is different from that before rotation, as shown in Fig. 8(b).

Fig. 7
figure 8

a Phase distributions of Ex of the transmitted field of a bilayer-DG metasurface rotated by 12° b Normalized far-field diffraction intensity distribution of bilayer-DG metasurface with rotation of 12°

To sum up, based on the Moiré effect, different diffractive spot arrays can be obtained by rotating the two metasurfaces relative to each other, thus realizing the dynamic adjustment of structured light. In comparison, this method is relatively simple and highly operable.

The performance of the designed bilayer DG metasurface is also evaluated. According to Eq. (1.2), the diffraction efficiency of the DG metasurface can be calculated, as shown in the red curve in Fig. 9. For the wavelength of 860 nm, the conversion efficiency is lower than 40%, while for other wavelength ranges, the conversion efficiency is higher than 40%. However, compared with the single-layer metasurface, the energy loss of the bilayer metasurface is greater, because the structure of the bilayer metasurface is more complex. The contrast ratio of the metasurface of the DG can be calculated according to Eq. (1.3). As shown in the blue curve in Fig. 9, the contrast ratio is below 50%. However, at the optical wavelength of 880 nm, the contrast ratio is as low as 28%, and the conversion efficiency is also around 50%. The intensity of some diffraction stages is very low and negligible compared to other diffraction stages, so these points are removed when calculating the uniformity.

Fig. 9
figure 9

The conversion efficiency (red, y-axis on the left) and the contrast ratio (blue, y-axis on the right) of bilayer-DG metasurface wavelengths from 860 to 930 nm

In addition, the performance index evaluation of the metasurface of bilayer DG rotated by 12° is also carried out. The conversion efficiency and contrast ratio are shown in Fig. 10. It can be seen that the contrast ratio is below 50%, and the conversion efficiency increases with the increase of wavelength. In actual use, a compromise needs to be considered. At a wavelength of 870 nm, the contrast ratio is as low as 26%.

Fig. 10
figure 10

The conversion efficiency (red, y-axis on the left) and the contrast ratio (blue, y-axis on the right) of bilayer-DG metasurface rotated by 12° wavelengths from 860 to 930 nm

Finally, the bilayer DG metasurface proposed in this section is numerically simulated at 860–930 nm to analyze and evaluate its diffraction field. When the plane wave of 860–930 nm is irradiated, \(5 \times 5\) almost uniform diffraction spots are generated. The normalized light intensity is shown in Fig. 11(a–h). It can be seen from the figure that the distribution of light intensity is uniform between 860 and 930 nm. The diffraction spots of the bilayer DG metasurface rotated by 12° are also analyzed, as shown in Fig. 12(a–h).

Fig. 11
figure 11

The normalized intensity distribution of the diffraction spot when the plane wave of different wavelength incident with bilayer-DG metasurface

Fig. 12
figure 12

The normalized intensity distribution of the diffraction spot when the plane wave of different wavelength incident in a bilayer-DG metasurface rotated by 12°

It can be seen from the figure that the rotated DG also shows good contrast radio at 860–930 nm, and the two operating wavelength ranges are consistent, but the diffraction spots displayed are inconsistent, as shown in Fig. 11. The unrotated DG presents a diffraction spot array of \(5 \times 5\), while the spot array presented by the DG after rotation of 12° is shown in Fig. 12. For the two kinds of DG metasurface, the reflection loss is the main reason for its low power and poor uniformity, and because the metasurface of DG is a bilayer, the loss in the reflection process is large.

Through the above analysis, the bilayer DG metasurface proposed in this paper can be obtained by arranging two metasurfaces with different arrays relative to each other, and the dynamic tuning of the structured light pattern can be realized by using the Moiré effect. Although it sacrifices in uniformity and diffraction efficiency a little bit, it is less difficult to manufacture, simpler to operate, and more feasible.

4 Conclusion

To sum up, we design a bilayer DG metasurface based on the Moiré effect, and propose a bilayer DG metasurface by placing the straight waveguide and the helical waveguide DG metasurface opposite to each other. The results show that the non-rotating bilayer DG metasurface can achieve an almost uniform and equal intensity \(5 \times 5\) diffraction spot array between 860 and 930 nm. Moreover, the working wavelength range of the metasurface of the bilayer DG rotating 12° is the same, but the realized optical pattern is different. Therefore, the optical pattern of the structural light can be dynamically adjusted through the relative rotation of the metasurface. Finally, numerical simulation is used to verify that the bilayer DG metasurface has broadband response, good conversion efficiency and contrast ratio in a wide band. Compared with the single-layer DG, the regulation of bilayer DG metasurface is simpler and more feasible, which can be widely used in 3D sensing systems.