# Real-Time Sea State Estimation for Wave Energy Converter Control via Machine Learning
## 3 Proposed Control Approach  
_WEC Control by Sea State_  
WEC control traditionally relies on anticipating and responding to incoming ocean wave to maximize energy capture. In a study by [PERSON] et al. (2018), several WEC control methods are evaluated, including FBR control and MPC [6]. These approaches attempt to match the controller's response to wave characteristics, often through wave prediction. However, capturing wave profiles directly requires additional equipment like auxiliary measurement buoys, leading to increased complexity, cost, and reliability issues.  
In contrast to direct measurement, we propose a control strategy that predicts sea states based on the velocity, position, and PTO force of the WEC device. By analyzing these parameters, our approach identifies the sea state that would produce the observed WEC dynamics, allowing the dynamic selection of optimal control gains. This method leverages readily accessible metrics, eliminating the need for direct wave measurements. The prediction is inherently reactive to the WEC's real-time response, reducing delay and uncertainty while achieving high energy capture with less complexity.  
The proposed WEC control method begins by collecting readily measurable parameters from the WEC, specifically the device's position (\(z\)), velocity (\(\dot{z}\)), and the PTO force (\(F_{\text{PTO}}\)), which are essential indicators of the interaction of the WEC with incoming waves. These parameters are then used as inputs to a neural network model that predicts sea state characteristics, i.e., peak wave period (\(T_{p}\)).  
A JONSWAP spectrum in terms of sea states can be expressed as follows:  
\[S(\omega)=\frac{\alpha g^{2}}{\omega^{5}}\exp\left(-\frac{5}{4}\left(\frac{ \omega}{\omega_{p}}\right)^{-4}\right)\gamma^{\exp\left(-\frac{(\omega-\omega _{p})^{2}}{2\omega_{p}^{2}}\right)} \tag{8}\]  
where  
\[\alpha=\frac{5}{16}\frac{H_{m}^{2}}{T_{p}^{4}},\qquad\omega_{p}=\frac{2\pi}{T_ {p}},\qquad\sigma=\begin{cases}0.07,&\text{if }\omega\leq\omega_{p},\\ 0.09,&\text{if }\omega>\omega_{p}\end{cases}\]  
where we have the following: \(\alpha\) is the Phillips parameter, controlling the overall amplitude of the spectrum; \(g\) is gravitational acceleration; \(\omega\) is the wave frequency; \(\omega_{p}\) is the peak wave frequency; \(\gamma\) is the peak enhancement factor; and \(\sigma\) is the spectral width parameter, with typical values of \(\sigma=0.07\) for \(\omega<\omega_{p}\) and \(\sigma=0.09\) for \(\omega\geq\omega_{p}\).  
The neural network model is trained and fine-tuned by incorporating additive white Gaussian noise (AWGN) to improve robustness in noisy conditions. Once the sea state parameter \(T_{p}\) is predicted, it is mapped to obtain optimal controller gains (\(K_{P}\) and \(K_{I}\)) for a PID controller. This enables dynamic adjustment of the control actions to match the identified sea state characteristics and maximize energy absorption. Figure 2 represents the overall proposed approach showing the input excitation force, \(F_{exec}\), and primary and supervisory control blocks to obtain the desired PTO force, \(F_{PTO}^{*}\). Primary control is the conventional PID control block, which takes peak periods (\(T_{p}\)) of sea states as input. The supervisory control block is the neural network approach that takes features from the WECphysical parameters and estimates the corresponding \(T_{p}\). The WEC system was obtained for a sample time of 0.1 s, and hence the step time for both supervisory and primary control blocks is kept at 0.1 s.