Fuzzy Control of Waves Generation in a Towing Tank

: This paper presents the results of research related to the transformation of electrical energy into potential and kinetic energy of waves generated on the water surface. The waves are generated to model the environmental conditions for the needs of the model tests. The model tests are performed on model-scale objects to predict the features of full-scale maritime objects. It is done to improve human safety and the survivability of constructions. Electrical energy is transformed into the energy of the water waves using a wave maker. The wave maker considered is a facility with an electrohydraulic drive and an actuator submerged into the water. The actuator movement results in the waves being mechanically-generated in accordance with the wave maker theory. The study aimed to investigate the advantage of the newly implemented fuzzy-logic controller over the hitherto cascading proportional-integral controllers of the wave maker actuator. The research was focused on experimental investigation of the transformation process outcomes harvested under the fuzzy-logic controller, versus the cascading proportional-integral controllers. The waves were generated and measured in the real towing tank, located in the Maritime Advanced Research Centre (CTO S.A.). the advantage of the fuzzy-logic controller. It provides more accurate transformation of energy into the desired form of the water waves of speciﬁed parameters—frequency and amplitude—and more ﬂat amplitude-frequency characteristic of the transformation process.


Introduction
Physical model tests are of paramount importance for improving the safety of maritime structures. The model tests, carried out on the reduced-scale models (Figure 1), allow the prediction of the properties of full-scale objects, such as ships, oil rigs, wind turbines or wave energy converters, in their environment conditions [1]. The full-scale prediction, based on the reduced-scale model tests, is justified under the similitude, pursuant to the Buckingham theorem [2]. This kind of model test is performed in hydromechanics laboratories worldwide [3][4][5][6]. It finally improves the maritime safety and survivability of naval, offshore and onshore constructions as well as improving their performance.
The proper realization of the model tests requires accurate modelling of the environmental conditions in the scope of waves. The waves are modelled to reflect the conditions of the target type of sea and state of the sea on the model-scale, with the use of a wave maker [8]. The wave maker is a facility intended for transformation of the energy into the desired form of water waves. The facility consists of the actuator submerged into the water and the drive. The actuator oscillates into the water and mechanically generates the waves in accordance with a transfer function derived from wave maker theory and specific to geometry of the actuator. The wave maker theory was early formulated by Havelock in 1929 [9]. Afterwards, the formulas called Biésel Transfer Functions, were derived by Biésel and Suquet in 1951 [10][11][12][13]. These works relate to the linear wave maker theory, that links the movements of the wave maker actuator with the profile of the generated wave. The experimental research carried out in the hydromechanics laboratories, validated the linear wave maker theory as sustainable within the waves of low steepness [14][15][16][17]. For the waves of high steepness, the nonlinearities and energy losses appear, making the linear theory inapplicable [17]. The development of weakly-nonlinear wave maker theories, allowed to extend the range of the theoretically covered physics, related to wave generation processes in typical wave flumes [18][19][20][21][22]. The more advanced techniques were also considered to simulate the generation of nonlinear waves numerically [23][24][25][26][27][28][29][30][31][32][33]. The complete nonlinear theory of the wave maker for the physical towing tank, up to now, is being developed and improved [34][35][36]. Thus, the linear wave maker theory, is validated to link the movements of the wave maker actuator with the profile of the low steepness waves, generated in the real towing tank. This is covered by the general formulation (1), where z A is the wave amplitude, S (z) is a wave maker stroke, h is a level of the waterplane above the bottom and k is a wave number [10][11][12][13].
The wave maker of a flap-type actuator with an electrohydraulic or electric drive is broadly applied [37]. This type of the facility was made available for the research in the deepwater towing tank by the Maritime Advanced Research Centre (CTO S.A.). The wave maker considered, is presented in Figure 2. On the basis of the transfer function derived, for the geometry of the flap-type wave maker [34], the z A is associated with the amplitude of the wave maker flap oscillations at the waterplane a as follows (2).
η p is a constant coefficient, specific for the facility considered, and is equal to 0.8 [34]. It reflects the efficiency of the mechanical energy transformation into the form of the progressive sinusoidal waves due to the pressure loss in the water gap between the walls of the towing tank and the flap of the wave maker. h 0 is the level of the hinge above the bottom. k is associated with the harmonic frequency via the dispersion relation (3).
The previous control system of the wave maker considered, was composed of two obsolete cascading proportional-integral-derivative PID controllers, designed in the 1970s. The first one controlled the wave maker flap velocity in the inner loop. The second one controlled the wave maker flap position in the outer loop. The control algorithm was applied using an operational amplifiers and capacitors [38]. It was modernized by translation the original control algorithm into a digital form using an 8-bit AVR microcontroller [39,40]. Subsequently, it was tuned with the Åström-Hägglund relay method [41]. Afterwards, the control algorithm was successfully developed into the form of two cascading PI controllers, properly tuned and implemented with a 32-bit Advanced RISC Machine ARM microcontroller [7]. Despite the stability and fine quality of regulation of the implemented control system, there was still room for improvement. The amplitude-frequency characteristic, experimentally determined for the proportional-integral controllers PIs-based system, was not flat enough within the operating frequencies [7]. It induced unfavourable dependence of generated wave amplitude on its frequency. This disadvantage was manifested by a decrease of the wave amplitude whilst the desired wave frequency increased. It was hindering the model tests significantly. However, fuzzy-logic controller of Mamdani-type was successfully applied versus PI and PID controllers to achieve higher performance of electrohydraulic actuators in other applications [42][43][44]. The greatly satisfactory results reported there allowed us to expect improvement of the wave maker performance for the control system based on the fuzzy-logic controller, versus the hitherto applied cascading PI ones.
The objectives and scope of the research aimed to investigate the flatness improvement of the amplitude-frequency characteristics for waves generation process with use of the one fuzzy-logic controller (FL), versus the cascading PIs. The FL was expected to improve the performance of the energy transformation process and obtain a much more flat amplitude-frequency characteristic to provide more accurate control over the process of modeling the environmental conditions.

Energy Transformation
The energy E A , related to progressive sinusoidal wave on the water surface, includes the potential energy E p and kinetic energy E k . It is given by the formula (4), that expresses amount of the energy per unit of the water surface [1].
The ρ is the water density. The g is the standard acceleration due to gravity. The z A is the amplitude of progressive sinusoidal wave of the frequency f . The two-dimensional progressive sinusoidal wave on the water surface is graphically depicted in Figure 3. The time domain model of the water waves that occur in the environment can be considered a summation of two-dimensional progressive sinusoidal waves, derived in the form of (5) [8].
The z A i and f i are the amplitude and frequency of the subsequent components-sinusoidal progressive waves. The ε k is the random phase distributed in the range of 0 to 2π and applied due to the space-time randomness of the process in the environmental conditions, related to waves. The summation of two-dimensional progressive sinusoidal waves in accordance with (5) is graphically depicted in Figure 4. Therefore, the energy E, expressed per unit of the water surface and related to the water waves considered as (5), is derived as (6).
The time domain mathematical model of the subsequent progressive sinusoidal waves can be transformed to the frequency domain into the form of harmonics of the amplitudes z A i at the frequencies of f i . Consequently, the waves on the water surface can be formulated in the form of the energy spectral density harmonics S ( f i ), as follows (7) [45].
A and B are the parameters that can be specified depending on the modelled type of sea [45] and the modelled state of the sea [46]. Accordingly, the energy E ( f i ) expressed per unit of the water surface and related to the harmonic of the energy spectral density (7) is derived as (8).
The energy of the wind waves, naturally occurring in the sea, is harvested with the wave energy converters for electricity generation [47][48][49][50]. Opposite to that, the energy transformation process is inverted for the needs of the model tests. The wave maker consumes electricity to generate waves and model the environmental conditions in the hydromechanics laboratories [3][4][5][6]. Thus, the z A in (4) and the z A i in (6) are associated with the movements of the wave maker actuator, in accordance with the formulations (1) and (2).
In view of the above, the efficient control of the wave maker is essential for the process of energy transformation into the desired form of two-dimensional progressive sinusoidal waves and for proper realization of the model tests. It was the great motivation for insight into the more advanced control method, than the hitherto applied ones.

Model of the Fuzzy-Logic Controller
The fuzzy-logic controller (FL) is a type of nonlinear controller that uses a logic based on a fuzzy set theory [51]. The FL models the quantification of the crisp values acquired, estimated by the human brain with the linguistic values, such as hot, cold, fast, slow. It acquires the crisp input values and determines its membership with the predefined fuzzy sets within the fuzzification process. The fuzzy inference system of the FL, models the decision process, made by the human brain, such as-if the input value is cold, then the output value is heat. It realizes the actions in accordance with the rules, predefined in the system. The linguistic value heat is subsequently translated into the crisp value within the defuzzification, to process the signal further, out of the FL. This kind of the nonlinear control process is suitable for the real world and is particularly recommended for the plants that are actually nonlinear [52]. Thus, it is widely applied to improve the performance of the energy converting devices [53][54][55].
The fuzzy-logic system was developed with use of the Xcos/Scilab simulation environment. The Xcos is the dynamic systems modeller and simulator, available with the Scilab-the open source software, intended for numerical computation and analysis with use of the dedicated modules [56]. The Scilab software of 5.5.2 release and the Fuzzy Logic Toolbox module of 0.4.7 version [57] were used. The FL was developed in the form of the Mamdani-type fuzzy inference system. The Mamdani-type was chosen due to previous successive applications, reported in related work [42][43][44]. The FL applied to the wave maker actuators was established with two inputs and one output. The structure uses the flap velocity feedback signal AX1 and the flap position feedback signal AX2. The structural diagram of the developed fuzzy-control system is shown in Figure 5. The membership functions defined for the FVE are graphically presented in Figure 6. According to the functions defined, the FVE crisp value is quantified to the NF, NM, ZO, PM, PF fuzzy sets. The Λ-type membership functions were applied due to common use and proven efficiency [42][43][44]52]. The Γ-type and L-type of the membership functions were applied due to the thresholds of the sensors and actuators [40,42,52]. The membership functions defined for the FPE are graphically presented in Figure 7. According to the functions defined, the FPE crisp value is quantified to the NL, NM, ZO, PM, PL fuzzy sets. The L-, Λand Γtypes of the membership functions were applied for the FPE, in the same way as previously applied for the FVE. Subsequently, the fuzzy rules base of the Mamdani-type fuzzy inference system is defined in accordance with Table 1.

NL(FPE) NM(FPE) ZO(FPE) PM(FPE) PL(FPE) PF(FVE)
PM The membership functions defined for the S, are graphically presented in Figure 8. The fuzzy implication of the membership functions is realized with the algebraic product method. The aggregation of the active rules is realized with the algebraic sum method. The inference and defuzzyfication are realized with the output membership functions (Figure 8) and the center of gravity method (CoG), respectively [52]. Finally, the resultant output control surface of the FL is presented in Figure 9. The stability of developed model of fuzzy-logic controller was examined in the Lyapunov sense. It was done following the procedure of state variable trajectory tracking [58]. This procedure is applicable and recommended for nonlinear systems, such as the fuzzy-logic ones [52,58]. Accordingly, a system is stable, if the state variables tend to the origin from any initial state on the phase plan. The examination was carried out in simulation of work of closed-loop system presented in Figure 5. The flap velocity module I1 and the flap position module I2 were identified within the related works [7,41]. The I1, within current examination, was modelled as an integral term (9), with k I1 =10. 15.
The I2, within current examination, was modelled as an integral term with inertia (10), with k I2 = 2.48 and T I2 = 0.12 s.
The trajectories of the derived model with fuzzy-logic controller were tracked for initial values of state variables-FVE and FPE-along the bound of the phase plane. The trajectories acquired on the phase plane are presented in Figure 10. The threshold of internal variables is of range from 0 [a.u.] to 1 [a.u.]. Thus, the origin is coordinated as (0.5;0.5). Respectively, the state variables tend to the origin. Thus, the proposed system is stable in Lyapunov sense and could be applied.

Implementation of the Model
The developed model of the FL was applied with .NET micro framework platform, in C# code, in Microsoft Visual Studio [59]-an integrated development environment. The Microsoft.SPOT.Hardware namespace and STM32F429I_Discovery.Netmf.Hardware.cs managed library were used [60]. The source code was uploaded to the embedded system, based on the microcontroller of STM32F4 type with a 32-bit ARM Cortex-M4 processor core. The embedded system is presented in Figure 11. It is equipped with a Graphical User Interface, composed of thin-film-transistor liquid-crystal display panel and resistive touch panel. Figure 11. The wave maker embedded system, equipped with a Graphical User Interface [7].
The control algorithm was realized in accordance with Figure 5. The embedded system acquires the analogue feedback signals of AX1 and AX2. The feedback signals are acquired using the wave maker sensors [40]. The acquired signals are processed to calculate the error signals of FVE and FPE. The error signals are further processed to the FL. The fuzzy-inference process is realized in accordance with the FL model developed. The FL processing results in the S control signal. The S is further processed with the wave maker actuators [40]. The analogue-to-digital and digital-to-analogue conversions are realized with 12-bit converters and signal matching circuits [40]. The control algorithm was implemented as discrete-time and interrupt-driven with the interrupt every 62 ms. It was successfully launched and could be evaluated within the validation process.

Validation of the Solution
The validation was realized for the real object-the deepwater towing tank, equipped with the flap-type wave maker. The facility is located in the Hydromechanics Laboratory of the Maritime Advanced Research Centre (CTO S.A.). The validation was aimed to evaluate the newly developed FL versus the hitherto PI, within the control of the energy transformation process whilst waves generation. The validation scenario included the generation, measurement and analysis of the progressive sinusoidal waves and their summation in the form of the Pierson-Moskowitz spectrum for 5th state of sea in North Atlantic for model scale equal to 1:20 [45,46]. The waves were generated at the frequencies f within the operating range, usually applied for the facility during the model tests [38].
The waves were generated using both alternative control algorithms-FL versus PI. The generated waves were measured in the axis of the towing tank, using an ultra-sound device for a wave profile measurement [61], installed to the towing carriage. The measured signal was transmitted using the Bluetooth transmission. The signal HW was acquired and recorded using the HBM Spider8 4.8 kHz data acquisition module and the personal computer, equipped with the HBM Catman Professional 4.5 data acquisition software. The measurement and registration were carried out with a sampling frequency equal to 25 Hz and with 12-bit resolution at the span of 20 V. The structural diagram of the system, used for the measurement, is presented in Figure 12. The registered signals were time-domain and frequency-domain analyzed. The performance of the process of electrical energy transformation into potential and kinetic energy of generated waves, is reflected in the amplitude of the generated wave. If the wave amplitude does not decreases along subsequent frequencies, then the amplitude-frequency characteristic is more flat. The validation scenario assumed that the control algorithm-FL or PI-that provides more flat amplitude-frequency characteristic, would be evaluated as more robust over the second one.
The numerical analysis and graphic presentation of the results were realized in the GNU Octave-the open source software, intended for numerical computation and analysis with use of the dedicated packages [62]. The GNU Octave software of 5.1.0 release and the Signal Processing package of 1.4.1 version [63] were used. The measured and analyzed amplitudes z A at the desired frequencies f were calculated into the logarithmic values, applicable for the amplitude-frequency characteristic. It was calculated in accordance with (11).
The L is the amplitude of sinusoidal progressive wave z A related to the reference value z REF A and translated into decibels. The results are presented in the following section.

Results
The progressive sinusoidal wave profiles obtained for two alternative control algorithms-FL versus PI-were measured and the results are presented in Figure 13. The wave profiles seem to be slightly more homogeneous for the case with use of the FL. However, are decidedly more consistent with the desired value of 3.5 cm for the FL one.  The harmonic spectra of the wave profiles are presented in Figure 14. The discrete logarithmic values of the amplitude-frequency characteristic L, calculated in accordance with (11), are listed in Table 3. It can be distinguished that the logarithmic values are far more homogeneous for the process realized with the use of the FL. The summation of progressive sinusoidal waves defined in the form of the Pierson-Moskowitz spectrum for 5th state of sea in North Atlantic for model scale equal to 1:20, obtained for two alternative control algorithms-FL versus PI-were measured and the results are presented in Figure 15. The wave spectrum is decidedly more consistent with the desired reference for the FL one.   The characteristics related to the summation of the progressive sinusoidal waves- Figures 15 and  17-are apparently disturbed in the frequency range below 0.45 Hz. It results from the presence of the long wave in the towing tank. The presence of the long wave is the consequence of the towing tank longitudinal dimension and limited absorption of such long waves. This type of wave and issues related to its absorption, are out of the scope of the present study.

Conclusions
The results of the research meet the anticipations. The newly implemented FL control algorithm provides better accuracy relative to the reference. It also provides more flat amplitude-frequency characteristic, versus the hitherto PI. Finally, the FL was validated as superior over the PI for control of the wave generation process.
The advantages of the FL improve the modelling of the environmental conditions on a reduced-scale. It improves the accuracy of prediction of the full-scale objects behaviour, and ultimately contributes significantly the maritime safety.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript:

APC
Article processing charges CTO S.A. Centrum Techniki Okrętowej Spółka Akcyjna (Maritime Advanced Research Centre in Polish) FL Fuzzy-logic controller PI Proportional-integral cascading controllers