## 3 Methodology
#### 3.1.1 Model Derivation  
The rotating dual-grating two-dimensional scanning model based on inertial navigation feedforward technology was built upon the spatial beam-pointing model of the rotating dual-grating and inertial navigation feedforward technology. It relies on diffraction to alter the direction of beam propagation, allowing the beam to perform stable scanning in a two-dimensional plane. When the ship is performing tasks on the sea surface, the change in the ship's attitude causes the optical axis to jitter, which may result in target misalignment. Therefore, it is crucial to eliminate the effect of the change of the ship'sattitude. Feedforward compensation control combines deviation-correcting feedback loops with additional disturbance-anticipating feedforward paths, forming a composite control architecture. Direct measurement of the disturbance allows compensation to be applied before the disturbance causes an error, thus mitigating its impact in a timely manner [19; 20]. The ship's attitude angles, including pitch, roll, and yaw angles, need to be measured using an inertial navigation system installed on the ship's deck [21]. First, the azimuth and elevation angles of the scanning trajectory (\(\theta_{x}\), \(\theta_{y}\)) are converted to their corresponding trajectory coordinates in the geodetic rectangular coordinate system (\(X_{d},\ Z_{d},\ Y_{d}\)). These coordinates are then further converted to trajectory coordinates in the deck coordinate system (\(X,\ Z,\ Y\)), resulting in a compensated trajectory that makes it possible to achieve stable two-dimensional beam scanning. Since the dual-grating platform and inertial navigation system are independently installed on the deck of the ship body, this paper simplifies the reference system as follows: the ship body frame and the platform frame share the same coordinate system, namely the deck coordinate system, while the navigation frame adopts the geodetic coordinate system. The rotating dual grating consists of a pair of parallel gratings that independently rotate around the coaxial Z-axis. They share the same rotation period, and through alteration of the rotation angles of the \(\theta_{1}\) and \(\theta_{2}\) gratings, the deflection angle \(\Phi\) and azimuth angle \(\Theta\) can be obtained to precisely adjust the beam pointing. The method of beam deflection is shown in Figure 1.  
Based on the governing equations of the rotating dual grating, the spatial beam-pointing model of the rotating dual grating can be derived as in (1) and (2) [22], as follows:  
\[\Phi=\sin^{-1}\biggl{[}2\frac{\lambda}{\Lambda}\biggr{|}\sin\biggl{(}\frac{ \theta_{1}-\theta_{2}}{2}\biggr{)}\biggr{|}\biggr{]}, \tag{1}\]  
\[\Theta= \begin{cases}\ \ \ \ (\theta_{1}+\theta_{2})/2,\ \sin\biggl{(}\frac{ \theta_{1}-\theta_{2}}{2}\biggr{)}<0\\ \ \ \ (\theta_{1}+\theta_{2})/2+\pi,\sin\biggl{(}\frac{\theta_{1}-\theta_{2}}{2} \biggr{)}>0\end{cases} , \tag{2}\]  
In the equations, \(\Phi\) represents the deflection angle of the emitted beam; \(\Theta\) represents the azimuth angle of the emitted beam; \(\lambda\) is the wavelength of the incident light; \(\Lambda\) is the grating period; \(\theta_{1}\) and \(\theta_{2}\) are the rotation angles of the two gratings, respectively. By optimizing the ratio of the rotation periods of the two gratings, an ideal two-dimensional scanning pattern can be established in certain planes perpendicular to the system's optical  
Figure 1: Beam-deflection mode. axis. The Cartesian coordinates of the dual grating two-dimensional scanning pattern can be expressed as (3) and (4), as follows:  
\[X =P\ \tan\Phi\cos\Theta, \tag{3}\] \[Y =P\ \tan\Phi\sin\Theta, \tag{4}\]  
In the equation, \(P\) represents the distance from the second grating to the observation plane. As shown in Figure 2, consider a point \(M\) on a scanning trajectory perpendicular to the Z-axis in a geodetic rectangular coordinate system.