An Iterative Reﬁning Approach to Design the Control of Wave Energy Converters with Numerical Modeling and Scaled HIL Testing

: The aim of this work is to show that a signiﬁcant increase of the e ﬃ ciency of a Wave Energy Converter (WEC) can be achieved already at an early design stage, through the choice of a turbine and control regulation, by means of an accurate Wave-to-Wire (W2W) modeling that couples the hydrodynamic response calibrated in a wave ﬂume to a Hardware-In-the-Loop (HIL) test bench with sizes and rates not matching those of the system under development. Information on this procedure is relevant to save time, because the acquisition, the installation, and the setup of a test rig are not quick and easy. Moreover, power electronics and electric machines to emulate turbines and electric generators matching the real systems are not low-cost equipment. The use of HIL is important in the development of WECs also because it allows the carrying out of tests in a controlled environment, and this is again time- and money-saving if compared to tests done on a real system installed at the sea. Furthermore, W2W modeling can be applied to several Power Take-O ﬀ (PTO) conﬁgurations to experiment di ﬀ erent control strategies. The method here proposed, concerning a speciﬁc HIL for testing power electronics and control laws for a speciﬁc WECs, may have a more general validity.


Introduction
Although the development of WECs has been a popular research topic since the 1970s, technologies for ocean wave energy harvesting are not yet technically mature enough to contribute to clean electricity production along with other established renewable sources. Despite large investments, many Research & Development (R&D) projects have never reached production stage or commercial status. It is essential to adopt a scaled approach to WECs' development ensuring that components are tested onshore before experimenting the system in the sea [1,2].
In recent years, the International Electrotechnical Commission (TC 114) has been working on standards for marine energy conversion systems that are defining best practices for WEC's R&D. The Implementing Agreement for a Co-operative Programme on Ocean Energy Systems (OES IA) has also released reports on guidelines for the development of WECs aiming to avoid duplication of effort, ensure effective engagement, and allow the comparison of different systems [3][4][5][6][7]. Figure 1 shows the flowchart of the proposed procedure. As it is independent of the PTO, it can be applied to different kind of WECs, both with rotating and linear electric machines. Here we will focus on systems where a rotating generator is used. Furthermore, with a scaling process the same test rig for the electric PTO tests can be used for WECs with different power rates.

The Proposed Procedure
Energies 2020, 13, x FOR PEER REVIEW 3 of 20 Another problem is modeling a turbine as small as the one needed in this work. Ducted air turbines with a power rate of around 4 kW, the one needed for the real scale WEC considered here, are not in the market. Furthermore, the turbine characteristics needed are not always available. Hence, the turbine modeling in this case is not a direct and easy task. Figure 1 shows the flowchart of the proposed procedure. As it is independent of the PTO, it can be applied to different kind of WECs, both with rotating and linear electric machines. Here we will focus on systems where a rotating generator is used. Furthermore, with a scaling process the same test rig for the electric PTO tests can be used for WECs with different power rates.

The Proposed Procedure
It should be noted that when the primary PTO is designed for the real size, rarely it fits exactly the size of the test rig available. Then, within the allowed range of test equipment, the WEC model needs to be scaled before being used for the electric PTO tests and simulations. More details about the scaling can be found in [18], while the scaling applied to the case study here presented will be shown in Section 4.5. Regarding the procedure, once the primary PTO has been chosen or defined, typically the primary PTO is tested by means of scaled prototypes in the wave flume. This allows primary PTO numerical modeling. Hence, it is possible to simulate the whole WEC focusing on the electric PTO to design it and the control. Now, can the whole model be considered valid? With large prototypes, it is possible to give an answer to this question, but generally, the cost of suitable WEC prototypes is too high to justify the necessary validation tests with real systems. The problem can be mitigated with the use of HIL testing to validate at least the electric PTO model. Then, it can be validated comparing the simulations with HIL tests results. If the model is not validated, it can be revised until the difference between tests and simulations results are not below a maximum tolerated value. Once the numerical model of the electric PTO has been validated, the optimum control law of the system can be found with an iterative final step by means of simulations. This iterative step can be carried out more easily and faster with simulations than using a HIL.
The control is optimized with nested iterative cycles where it is possible to change a parameter of the system (e.g., the turbine diameter, the moment of inertia with a flywheel, and so on), and the control law. The parameter values range and step, as well as the set of control laws, are fixed before the tests to limit the number of simulations, in turn limiting to an acceptable time-length the duration of the whole simulations set for this optimization step. It should be noted that when the primary PTO is designed for the real size, rarely it fits exactly the size of the test rig available. Then, within the allowed range of test equipment, the WEC model needs to be scaled before being used for the electric PTO tests and simulations. More details about the scaling can be found in [18], while the scaling applied to the case study here presented will be shown in Section 4.5.
Regarding the procedure, once the primary PTO has been chosen or defined, typically the primary PTO is tested by means of scaled prototypes in the wave flume. This allows primary PTO numerical modeling. Hence, it is possible to simulate the whole WEC focusing on the electric PTO to design it and the control. Now, can the whole model be considered valid? With large prototypes, it is possible to give an answer to this question, but generally, the cost of suitable WEC prototypes is too high to justify the necessary validation tests with real systems. The problem can be mitigated with the use of HIL testing to validate at least the electric PTO model. Then, it can be validated comparing the simulations with HIL tests results. If the model is not validated, it can be revised until the difference between tests and simulations results are not below a maximum tolerated value. Once the numerical model of the electric PTO has been validated, the optimum control law of the system can be found with an iterative final step by means of simulations. This iterative step can be carried out more easily and faster with simulations than using a HIL.
The control is optimized with nested iterative cycles where it is possible to change a parameter of the system (e.g., the turbine diameter, the moment of inertia with a flywheel, and so on), and the control law. The parameter values range and step, as well as the set of control laws, are fixed before the Energies 2020, 13, 2508 4 of 19 tests to limit the number of simulations, in turn limiting to an acceptable time-length the duration of the whole simulations set for this optimization step.
The procedure can be re-iterated for the same system if a component with different features (e.g., type of turbine) can be chosen from a set of suitable ones.
The following sections show a case study as an example of how to apply this procedure. Here are shown only some iterations to improve the efficiency of the system, just to give an example of how it is possible to tend toward an optimum solution.
The same HIL test rig has been applied to develop other WECs with high Technological Readiness Level (e.g., for the development of different WECs named REWEC3, OWC Spar-buoy, Ocean Energy buoy, and ISWEC [19,22]). Good results were also obtained to set a predictive control for the full-scale biradial turbine of the Mutriku OWC plant [27]. Figure 2 shows the HIL used for this work. The test bench is composed by two sections: the first one is that of the emulated parts (primary PTO in this case), the second one contains the embedded real components, in particular the generator, the AC/AC power converter and the controller. The procedure can be re-iterated for the same system if a component with different features (e.g., type of turbine) can be chosen from a set of suitable ones.

HIL Test Bench
The following sections show a case study as an example of how to apply this procedure. Here are shown only some iterations to improve the efficiency of the system, just to give an example of how it is possible to tend toward an optimum solution.
The same HIL test rig has been applied to develop other WECs with high Technological Readiness Level (e.g., for the development of different WECs named REWEC3, OWC Spar-buoy, Ocean Energy buoy, and ISWEC [19,22]). Good results were also obtained to set a predictive control for the full-scale biradial turbine of the Mutriku OWC plant [27] . Figure 2 shows the HIL used for this work. The test bench is composed by two sections: the first one is that of the emulated parts (primary PTO in this case), the second one contains the embedded real components, in particular the generator, the AC/AC power converter and the controller. The emulator includes the AC/AC frequency converter, the 3-phase motor, an optional flywheel, a data acquisition card (DAQ), and a PC with a dedicated software for real-time application (dSPACE with ControlDesk [28], in this case).

HIL Test Bench
The block with real components includes a generator, a power converter and a Programmable Logic Controller (PLC) that run the system control law. This section is the apparatus that connects a real WEC installed in the sea with the grid, but it can be replaced by other kind of control units based on microcontrollers and FPGAs. In the real system, the motor shaft is joined to that of the generator by a gearbox or a joint, and the system inertia can be increased up to 8 kgm 2 by adding a flywheel.

Wave Energy Converter Emulator
Preliminary wave flume tests, carried out scaling the device with Froude law, are frequently used to set up an interpretative model at the first stages of design, to calibrate the system hydrodynamic and the mooring. In the numerical model, the floating body hydrodynamic characteristics were found with ANSYS Aqwa, and the air flow pattern is the same described in [26]. Please note that he turbine head losses simulated at lab scale are specific for the tests and the turbine modeling needs to be completely different at larger scales, hence the model must be integrated by a specific module for the turbine. Actually, air behaves as incompressible at low scale, and hence the numerical model should model, at large scale, also the compressibility effects.
The developed hydrodynamic MATLAB-Simulink software emulates, in the time domain, the hydraulic response of the (moored) WEC behavior under realistic sea states, the pressures in the chambers and the air flow for a given turbine head loss [26]. The behavior of the turbine (head loss) The emulator includes the AC/AC frequency converter, the 3-phase motor, an optional flywheel, a data acquisition card (DAQ), and a PC with a dedicated software for real-time application (dSPACE with ControlDesk [28], in this case).
The block with real components includes a generator, a power converter and a Programmable Logic Controller (PLC) that run the system control law. This section is the apparatus that connects a real WEC installed in the sea with the grid, but it can be replaced by other kind of control units based on microcontrollers and FPGAs. In the real system, the motor shaft is joined to that of the generator by a gearbox or a joint, and the system inertia can be increased up to 8 kg·m 2 by adding a flywheel.

Wave Energy Converter Emulator
Preliminary wave flume tests, carried out scaling the device with Froude law, are frequently used to set up an interpretative model at the first stages of design, to calibrate the system hydrodynamic and the mooring. In the numerical model, the floating body hydrodynamic characteristics were found with ANSYS Aqwa, and the air flow pattern is the same described in [26]. Please note that he turbine head losses simulated at lab scale are specific for the tests and the turbine modeling needs to be completely different at larger scales, hence the model must be integrated by a specific module for the turbine. Actually, air behaves as incompressible at low scale, and hence the numerical model should model, at large scale, also the compressibility effects.
The developed hydrodynamic MATLAB-Simulink software emulates, in the time domain, the hydraulic response of the (moored) WEC behavior under realistic sea states, the pressures in the chambers and the air flow for a given turbine head loss [26]. The behavior of the turbine Energies 2020, 13, 2508 5 of 19 (head loss) was then added to the MATLAB-Simulink model, and everything was compiled in dSPACE, which allow interfacing the real and simulated parts of the HIL. The model still needs the turbine speed, which is read by a dSPACE real-time Interface RTI1104t, which is also used to apply the output torque to the shaft.
This approach allows emulating any energy converter using a rotating generator. The WEC is then practically emulated using a Leroy-Somer squirrel-cage induction motor type LSES 160 LUR 6-pole [29]. The specifications of the motor are the following: voltage 400 V (delta connection), maximum speed 1800 rpm, rated speed 1468 rpm @ 50 Hz, power: 15 kW. The drive can be used with motors with a maximum speed of 3000 rpm, withstanding power surges up to 28 kW.
An ABB ACS800 back-to-back converter connects the generator to the mains, allowing the remote control of the speed and torque by sending and analog speed/torque reference signal to the converter input. A Beckhoff CXI020 PLC controller with a series of digital and analog signal boards, which are suitable for installation on a marine energy system, implements the control. The generator and the controller communicate through several analog and digital inputs/outputs channels. The inputs of the PLC are the speed of the generator (ω r ), the mechanical torque (T m ) and electrical power (P e ), while its outputs are a torque or speed set-point, depending on the implemented control.

Programming the PLC
The PLC runs the control routine that handles the analog and digital inputs. It can be customized to implement various strategies for different WECs. A state machine program ( Figure 3) is implemented in the PC used for PLC programming. It goes through a series of safety check procedures and grants the operation, through a set of various control algorithms if no alarms are triggered. In this case, the output of the control routine is the electric torque (T e * ) that is applied to the generator to get the required turbine speed. This reference torque is sent to the back-to-back converter where the current control loops follow this set-point as well as control the voltage on the DC link and the injected grid power.
Energies 2020, 13, x FOR PEER REVIEW 5 of 20 was then added to the MATLAB-Simulink model, and everything was compiled in dSPACE, which allow interfacing the real and simulated parts of the HIL. The model still needs the turbine speed, which is read by a dSPACE real-time Interface RTI1104t, which is also used to apply the output torque to the shaft. This approach allows emulating any energy converter using a rotating generator. The WEC is then practically emulated using a Leroy-Somer squirrel-cage induction motor type LSES 160 LUR 6pole [29]. The specifications of the motor are the following: voltage 400 V (delta connection), maximum speed 1800 rpm, rated speed 1468 rpm @ 50 Hz, power: 15 kW. The drive can be used with motors with a maximum speed of 3000 rpm, withstanding power surges up to 28 kW.
An ABB ACS800 back-to-back converter connects the generator to the mains, allowing the remote control of the speed and torque by sending and analog speed/torque reference signal to the converter input. A Beckhoff CXI020 PLC controller with a series of digital and analog signal boards, which are suitable for installation on a marine energy system, implements the control. The generator and the controller communicate through several analog and digital inputs/outputs channels. The inputs of the PLC are the speed of the generator (ωr), the mechanical torque (Tm) and electrical power (Pe), while its outputs are a torque or speed set-point, depending on the implemented control.

Programming the PLC
The PLC runs the control routine that handles the analog and digital inputs. It can be customized to implement various strategies for different WECs. A state machine program ( Figure 3) is implemented in the PC used for PLC programming. It goes through a series of safety check procedures and grants the operation, through a set of various control algorithms if no alarms are triggered. In this case, the output of the control routine is the electric torque (Te * ) that is applied to the generator to get the required turbine speed. This reference torque is sent to the back-to-back converter where the current control loops follow this set-point as well as control the voltage on the DC link and the injected grid power.

Wave-to-Wire Model
To follow the conversion path from the sea waves energy to the electrical one on the grid the W2W model [31,32] is commonly used (Figure 4).

Wave-to-Wire Model
To follow the conversion path from the sea waves energy to the electrical one on the grid the W2W model [31,32] is commonly used (Figure 4). Generally, the control block reads variables of the generator (e.g., rotor speed and torque) and the power electronics (e.g., output voltage and frequency) and responds with command signals to set the controlled variables to the desired values. In this case study, it will be shown how to control the rotor speed of the generator measuring the same speed and the shaft torque (evaluating with different laws the electric torque).
Once drawn the specific W2W diagram, which models the WEC at a high level of abstraction, it is possible to translate it, block by block, into a numerical model. The hydrodynamic model of the WEC is a set of MATLAB scripts and functions, where in our case the pneumatic behavior in each chamber is computed taking into account the coupling between the overall system dynamics and the turbine rigidity (in the uncoupled model, the floating body oscillations are given by the incident waves only).
The input of the resulting W2W model shown in Figure 5 is a regular sea state defined by the peak period Tp, the significant wave height Hs, and the turbine head loss. Please note that to have an accurate W2W model, it is reasonable that the OWC block has a fully coupled approach, where the primary PTO pneumatic output power is influenced by the following elements in the whole conversion system. The pressure drop across the turbine Δp is an input of the OWC model, the rotational speed ωr of the generator is an input of the air turbine model, and the load torque Te due to the electric load of the generator (B2B converter and electric grid) is an input of the drive train model. When the pneumatic power of the air flow generated by the OWC is higher than the turbine load, the turbine Generally, the control block reads variables of the generator (e.g., rotor speed and torque) and the power electronics (e.g., output voltage and frequency) and responds with command signals to set the controlled variables to the desired values. In this case study, it will be shown how to control the rotor speed of the generator measuring the same speed and the shaft torque (evaluating with different laws the electric torque).
Once drawn the specific W2W diagram, which models the WEC at a high level of abstraction, it is possible to translate it, block by block, into a numerical model. The hydrodynamic model of the WEC is a set of MATLAB scripts and functions, where in our case the pneumatic behavior in each chamber is computed taking into account the coupling between the overall system dynamics and the turbine rigidity (in the uncoupled model, the floating body oscillations are given by the incident waves only).
The input of the resulting W2W model shown in Figure 5 is a regular sea state defined by the peak period T p , the significant wave height H s , and the turbine head loss. Please note that to have an accurate W2W model, it is reasonable that the OWC block has a fully coupled approach, where the primary PTO pneumatic output power is influenced by the following elements in the whole conversion system.

Wave-to-Wire Model
To follow the conversion path from the sea waves energy to the electrical one on the grid the W2W model [31,32] is commonly used (Figure 4). Generally, the control block reads variables of the generator (e.g., rotor speed and torque) and the power electronics (e.g., output voltage and frequency) and responds with command signals to set the controlled variables to the desired values. In this case study, it will be shown how to control the rotor speed of the generator measuring the same speed and the shaft torque (evaluating with different laws the electric torque).
Once drawn the specific W2W diagram, which models the WEC at a high level of abstraction, it is possible to translate it, block by block, into a numerical model. The hydrodynamic model of the WEC is a set of MATLAB scripts and functions, where in our case the pneumatic behavior in each chamber is computed taking into account the coupling between the overall system dynamics and the turbine rigidity (in the uncoupled model, the floating body oscillations are given by the incident waves only).
The input of the resulting W2W model shown in Figure 5 is a regular sea state defined by the peak period Tp, the significant wave height Hs, and the turbine head loss. Please note that to have an accurate W2W model, it is reasonable that the OWC block has a fully coupled approach, where the primary PTO pneumatic output power is influenced by the following elements in the whole conversion system. The pressure drop across the turbine Δp is an input of the OWC model, the rotational speed ωr of the generator is an input of the air turbine model, and the load torque Te due to the electric load of the generator (B2B converter and electric grid) is an input of the drive train model. When the pneumatic power of the air flow generated by the OWC is higher than the turbine load, the turbine The pressure drop across the turbine ∆p is an input of the OWC model, the rotational speed ω r of the generator is an input of the air turbine model, and the load torque T e due to the electric load of the generator (B2B converter and electric grid) is an input of the drive train model. When the pneumatic power of the air flow generated by the OWC is higher than the turbine load, the turbine rotates applying a torque T m to the generator (drive train), which produces a sinusoidal electricity at a Energies 2020, 13, 2508 7 of 19 frequency f gen proportional to the rotational speed ω r , with a generated power P gen . The B2B converter is the interface with the electrical grid. It converts the AC input at f gen to an AC output synchronized with the voltage at 50 Hz of the grid. P el is the power at the output of the whole WEC.
The control loop is closed to set the rotational speed at the desired value, which depends on the applied control law. Then, ω r is also the input of the controller, who generates a control signal T e * , giving information to the B2B converter on the load torque (or electrical torque) T e needed to have the desired rotational speed.
In real systems the load of the turbine is the electric PTO (generator-power converter-grid) which includes a feedback control to regulate the turbine rotational speed. Then, in practice a complete WEC is a closed-loop controlled system, which is not implemented in hydraulic lab test in small scale.
In a HIL test rig, the primary PTO must be emulated by a numerical simulator that provides the dynamic response in the time domain. These types of models usually provide the dynamic response of the WEC for a constant load on the generator. Obviously, in reality, the floating body oscillations, with its non-linear mooring, and the pressure in the chambers, depend on the real turbine head loss, which will only be defined during the HIL tests. However, models often do not take into account the physical constraints, response times and delays, and the characteristics of real equipment under normal and extreme sea-operating conditions [22]. One must ask whether this approximation is acceptable. Here, the problem was solved with the validation of a numerical model through wave flume tests with a dummy turbine [25,26]. The numerical model is calibrated to find the expected air flux induced by the incident waves, taking into account the hydrodynamic effects, for a few tested turbine head losses. Then, the numerical model is adapted to run based on a real-time input, the rotational speed. In the case taken as an example, we implemented this function with a Look-Up Table (LUT) to ensure that the air flow is obtained in real time. This made it possible to carry out closed-loop HIL tests considering the effects of time dependent turbine load on the primary PTO.
Except for the first stage of the primary PTO (OWC model), all the other parts of the systems were modeled with Simulink using LUTs and mathematical equations in order to evaluate the same variables which can be measured by the HIL bench.
Hereafter, the Simulink models will be depicted with formulae and gains applied by math and gain blocks, respectively. More information on Simulink's symbolic notations can be found in [33].

Air Turbines Modeling
The turbine modeling is an important step to obtain a valid model of the whole OWC. Here, to model the turbine in Simulink avoiding expensive experimental and complex 3D Computational Fluid Dynamics (CFD) simulations, a literature review was fundamental in finding equations and formulae to obtain the power and torque characteristics of different kind of turbines [34][35][36].
Considering the following nomenclature: l blade length; n number of blades; b chord length; r turbine rotor radius; A area of turbine duct; ρ air density; V x air speed at the turbine inlet; ω r rotational speed; K = ρbln/2 characteristic constant; ϕ = V x /rω r flow coefficient; ∆p pressure drop across the turbine; Q flow rate; T m mechanical torque; T e electrical torque; J moment of inertia; P rot mechanical power at the shaft; P pneu pneumatic power at the inlet; C a input coefficient; C t torque coefficient; η efficiency, the equations for the turbine are given by [37]: (1) Energies 2020, 13, 2508 Then, the turbine efficiency can be evaluated as follows: The Simulink model of the turbine is shown in Figure 6. Considering the scaling applied (see Section 4.5) to match the model with the HIL, it is necessary the reverse scaling of inputs and the scaling of outputs to match the air turbine model with other blocks of the whole model. The scaling is simply made by means of proportional gain blocks (triangular).      To model the Impulse turbine ( Figure 8) it was used the efficiency vs. the flow coefficient characteristic. The saturation block limits the input values given by the "Non-dimensional Air Flow Formula" used to compute the flow coefficient  (here u(1) is the air speed, u(2) is the rotor speed, and D is the turbine rotor diameter). This limitation is needed to match the input range of the following LUT of the turbine efficiency vs. .  To model the Impulse turbine ( Figure 8) it was used the efficiency vs. the flow coefficient characteristic. The saturation block limits the input values given by the "Non-dimensional Air Flow Formula" used to compute the flow coefficient ϕ (here u(1) is the air speed, u(2) is the rotor speed, and Energies 2020, 13, 2508 9 of 19 D is the turbine rotor diameter). This limitation is needed to match the input range of the following LUT of the turbine efficiency vs. ϕ.

Drive Train Modeling
The following well-known equation of rotating mechanical systems considering the viscous friction can be used to model the generator: where Tfriction is the resistive frictional torque. Figure 9 shows the Simulink model of the drive train, scaled to match the nominal torque of the WEC emulator in the HIL. It calculates the rotor speed inverting Equation (6) and the electrical power multiplying the rotor speed by the electrical torque.

Drive Train Modeling
The following well-known equation of rotating mechanical systems considering the viscous friction can be used to model the generator: where T friction is the resistive frictional torque. Figure 9 shows the Simulink model of the drive train, scaled to match the nominal torque of the WEC emulator in the HIL. It calculates the rotor speed inverting Equation (6) and the electrical power multiplying the rotor speed by the electrical torque.

Control Laws
Two possible control strategies were implemented to set the torque applied to the electric generator: (i) Maximum Power Point Tracking (MPPT) which can be done using the Topt function shown in Figure 10; (ii) a torque control where the current rotor speed is compared to a reference value to maintain constant the speed. Typically, the former is an instantaneous control that can be effectively applied to systems with low inertia. The latter is a sea-state control that needs an offline calculation of the optimum reference speed for each sea state and is more suitable for high inertia systems. In our system, the inertia has an intermediate value, and then we cannot say in advance what is better Error! Reference source not found.. Thus, we chose to test both to find the optimum (the one that gives the highest power at the output given the same input). Issues related to peak-toaverage power ratio and the need for overrating the power converters are not considered in this work but are well discussed in Refs. [20,39].

Control Laws
Two possible control strategies were implemented to set the torque applied to the electric generator: (i) Maximum Power Point Tracking (MPPT) which can be done using the T opt function shown in Figure 10; (ii) a torque control where the current rotor speed is compared to a reference value to maintain constant the speed. Typically, the former is an instantaneous control that can be effectively applied to systems with low inertia. The latter is a sea-state control that needs an offline calculation of the optimum reference speed for each sea state and is more suitable for high inertia systems. In our system, the inertia has an intermediate value, and then we cannot say in advance what is better [38]. Thus, we chose to test both to find the optimum (the one that gives the highest power at the output given the same input). Issues related to peak-to-average power ratio and the need for overrating the power converters are not considered in this work but are well discussed in Refs. [20,39].
effectively applied to systems with low inertia. The latter is a sea-state control that needs an offline calculation of the optimum reference speed for each sea state and is more suitable for high inertia systems. In our system, the inertia has an intermediate value, and then we cannot say in advance what is better Error! Reference source not found.. Thus, we chose to test both to find the optimum (the one that gives the highest power at the output given the same input). Issues related to peak-toaverage power ratio and the need for overrating the power converters are not considered in this work but are well discussed in Refs. [20,39].

Scaling, Compensations, and Adaptations
One of the key problems of this kind of tests is that the WEC considered does not match the laboratory equipment (inertia, rated generator speed and torque, inverter nominal power). For this reason, the Simulink model has to be adapted to account for the differences with the test bench, in order to get a consistent relationship between the HIL and the models of the 2-chambers OWC considered here.
The scaling of the model should be done in order not to modify the proportionality of the forces with those of the real prototype (inertial, gravitational, viscous, elastic, and pressure). This is not feasible when the scale factor is not unitary, but in all other cases the dominant forces in the system can be found and relationship maintained.
The wave behavior is dependent by the gravity; for this reason, the Froude's law is used, to keep the strong relationship between gravitational and inertial forces in the scaled model. Froude scaling is typical for WECs scaling (e.g., [40][41][42]). The used scaling, compensations, adaptions, and the customization for this case are shown in Figure 11. The scaling factor λ is set to adjust the nominal torque of the turbine model T n,turbine to the one of the test bench T n,testbench . Consequently, it can be calculated by the relation: T n,testbench = T n,turbine ·λ 4 .

of 19
Energies 2020, 13, x FOR PEER REVIEW 12 of 20 Figure 11. Scheme of the methodology for scaling, compensations, and adaptations that must be applied to the original model for the two-chambers OWC here considered.

Simulink Models of the Electric PTO
Following the procedure described in Section 3 and drawing the block diagram of Figure 12, we obtained the Simulink model of the electric PTO of the wave converter considered here, as depicted in Figure 13. The pneumatic power is given by a 2D LUT; the Torque Control Law block supplies the electric torque reference for the generator from the rotational speed of the turbine; the drive train block models the electric generator, while the turbine model (Impulse in Figure 13) block models the chosen turbine giving the mechanical torque applied by the turbine to the shaft from the air speed and the rotational speed. Figure 11. Scheme of the methodology for scaling, compensations, and adaptations that must be applied to the original model for the two-chambers OWC here considered.
To use the pneumatic power scaled to the HIL range, variables and constants are modified by applying Froude's law at the output of the original blocks, while at the input the same must obviously be scaled using the inverse formulae.
Other adjustments are needed to match the values of some variables, such as the rotational speed (ω n in Figure 11) or the torque reference, with the electric signal that represents them at the dSPACE and the PLC interfaces. V FS in Figure 11 is the full-scale range of the rotational speed signal.
The same consideration was made for the simulated torque signal. Torque compensation was applied, due to the different inertia and different nominal rotational speed of the test rig and the ones of the converter under test.

Simulink Models of the Electric PTO
Following the procedure described in Section 3 and drawing the block diagram of Figure 12, we obtained the Simulink model of the electric PTO of the wave converter considered here, as depicted in Figure 13. The pneumatic power is given by a 2D LUT; the Torque Control Law block supplies the electric torque reference for the generator from the rotational speed of the turbine; the drive train block models the electric generator, while the turbine model (Impulse in Figure 13) block models the chosen turbine giving the mechanical torque applied by the turbine to the shaft from the air speed and the rotational speed. The power converter is assumed ideal. This is acceptable because its efficiency is high and will only depend on the power rate, and the small delay of around 1.5 cycles of the switching frequency [43], is negligible compared to the slow dynamics of the system. Thus, it is represented by the control loops implemented on it. As can be seen, the whole model consists of two subsystems, one to fully simulate the electric PTO (top), and one for the HIL where the drive train is real (bottom) and the rotor speed can be measured. Then, in the Test Bench Model there is not the drive train block, but there are two blocks of the hardware dSPACE real-time Interface RTI1104t to set the torque and to read the rotor speed. The speed coming from the interface is adapted according to the scheme of Figure 11 and converted in rad/s, while the torque computed by the Impulse Turbine TB block needs to be calibrated and adapted, still using the scheme of Figure 11. In the Test Bench Model, the Torque Control Law TB to evaluate Te * is not strictly necessary, because this signal is really generated by the PLC. We put this block only to easily export the signal data in MATLAB.
The gain block with the optimization parameter comes from a verification step that required a revision of the model according to the procedure of Figure 1, as will be shown in the following section.
In addition to MPPT implemented by the Torque Control Law block in Figure 13 applying the optimum torque function of Figure 10, we considered other two kinds of control laws to set a constant speed: an on-off strategy (Figure 14), and a Proportional-Integral (PI) regulator ( Figure 15).
For the on-off control, a Simulink Relay block is used to switch between an electrical torque evaluated dividing the mechanical power by the rotor speed and a null torque. The hysteresis coming from different thresholds for the switch on and the switch off is also used to filter the noise added to the rotor speed signal.  The power converter is assumed ideal. This is acceptable because its efficiency is high and will only depend on the power rate, and the small delay of around 1.5 cycles of the switching frequency [43], is negligible compared to the slow dynamics of the system. Thus, it is represented by the control loops implemented on it. As can be seen, the whole model consists of two subsystems, one to fully simulate the electric PTO (top), and one for the HIL where the drive train is real (bottom) and the rotor speed can be measured. Then, in the Test Bench Model there is not the drive train block, but there are two blocks of the hardware dSPACE real-time Interface RTI1104t to set the torque and to read the rotor speed. The speed coming from the interface is adapted according to the scheme of Figure 11 and converted in rad/s, while the torque computed by the Impulse Turbine TB block needs to be calibrated and adapted, still using the scheme of Figure 11. In the Test Bench Model, the Torque Control Law TB to evaluate Te * is not strictly necessary, because this signal is really generated by the PLC. We put this block only to easily export the signal data in MATLAB.
The gain block with the optimization parameter comes from a verification step that required a revision of the model according to the procedure of Figure 1, as will be shown in the following section.
In addition to MPPT implemented by the Torque Control Law block in Figure 13 applying the optimum torque function of Figure 10, we considered other two kinds of control laws to set a constant speed: an on-off strategy (Figure 14), and a Proportional-Integral (PI) regulator ( Figure 15).
For the on-off control, a Simulink Relay block is used to switch between an electrical torque evaluated dividing the mechanical power by the rotor speed and a null torque. The hysteresis coming from different thresholds for the switch on and the switch off is also used to filter the noise added to the rotor speed signal. The power converter is assumed ideal. This is acceptable because its efficiency is high and will only depend on the power rate, and the small delay of around 1.5 cycles of the switching frequency [43], is negligible compared to the slow dynamics of the system. Thus, it is represented by the control loops implemented on it.
As can be seen, the whole model consists of two subsystems, one to fully simulate the electric PTO (top), and one for the HIL where the drive train is real (bottom) and the rotor speed can be measured. Then, in the Test Bench Model there is not the drive train block, but there are two blocks of the hardware dSPACE real-time Interface RTI1104t to set the torque and to read the rotor speed. The speed coming from the interface is adapted according to the scheme of Figure 11 and converted in rad/s, while the torque computed by the Impulse Turbine TB block needs to be calibrated and adapted, still using the scheme of Figure 11. In the Test Bench Model, the Torque Control Law TB to evaluate T e * is not strictly necessary, because this signal is really generated by the PLC. We put this block only to easily export the signal data in MATLAB.
The gain block with the optimization parameter comes from a verification step that required a revision of the model according to the procedure of Figure 1, as will be shown in the following section. In addition to MPPT implemented by the Torque Control Law block in Figure 13 applying the optimum torque function of Figure 10, we considered other two kinds of control laws to set a constant speed: an on-off strategy (Figure 14), and a Proportional-Integral (PI) regulator ( Figure 15). The PI regulator in Figure 15 is set to implement the function: where ωsp is the constant set-point of the rotor speed, ωr(t) is the actual rotor speed, Kp and Ki are the proportional and the integral coefficients, respectively.

Experimental Results
First, a set of tests was conducted to assess which turbine is the most suitable for the OWC being studied. In this case, given the turbines in Table 1, the best choice was the Impulse turbine, because it led to obtain the highest average powers at the shaft with all the considered sea wave conditions.
Before the second phase of the work, a test protocol to plan the experimental test following the algorithm in Figure 1 was prepared. It is presented in Table 2. For each case of Table 2, the test was repeated considering the six sea states in Table 3.

TABLE 2.
Test plan applying different control laws with the Impulse turbine.

Test ID Description #1
MPPT control law (torque vs. rotational speed)

#2
Adjustment of the control law adopted for #1 tests to get the maximum output power at the grid #3 Constant speed control with on-off law #4 Constant speed control with PI Table 3. Sea states applied to each control law of the test plan in Table 2. The next phases were carried out to get a clearer correlation between the simulations and the HIL experiments. Each test described was repeated for all the sea states listed in the right-hand column.

Sea state ID (Regular Waves
The main goal was to verify that the models are sufficiently accurate for future design and The PI regulator in Figure 15 is set to implement the function: where ωsp is the constant set-point of the rotor speed, ωr(t) is the actual rotor speed, Kp and Ki are the proportional and the integral coefficients, respectively. Figure 15. Detail of the PI regulator.

Experimental Results
First, a set of tests was conducted to assess which turbine is the most suitable for the OWC being studied. In this case, given the turbines in Table 1, the best choice was the Impulse turbine, because it led to obtain the highest average powers at the shaft with all the considered sea wave conditions.
Before the second phase of the work, a test protocol to plan the experimental test following the algorithm in Figure 1 was prepared. It is presented in Table 2. For each case of Table 2, the test was repeated considering the six sea states in Table 3.

TABLE 2.
Test plan applying different control laws with the Impulse turbine.

Test ID Description #1
MPPT control law (torque vs. rotational speed)

#2
Adjustment of the control law adopted for #1 tests to get the maximum output power at the grid #3 Constant speed control with on-off law #4 Constant speed control with PI Table 3. Sea states applied to each control law of the test plan in Table 2. The next phases were carried out to get a clearer correlation between the simulations and the HIL experiments. Each test described was repeated for all the sea states listed in the right-hand column.
The main goal was to verify that the models are sufficiently accurate for future design and optimization purposes. For this reason, we compared simulations with measurements. For example, For the on-off control, a Simulink Relay block is used to switch between an electrical torque evaluated dividing the mechanical power by the rotor speed and a null torque. The hysteresis coming from different thresholds for the switch on and the switch off is also used to filter the noise added to the rotor speed signal.
The PI regulator in Figure 15 is set to implement the function: where ω sp is the constant set-point of the rotor speed, ω r (t) is the actual rotor speed, K p and K i are the proportional and the integral coefficients, respectively.

Experimental Results
First, a set of tests was conducted to assess which turbine is the most suitable for the OWC being studied. In this case, given the turbines in Table 1, the best choice was the Impulse turbine, because it led to obtain the highest average powers at the shaft with all the considered sea wave conditions.
Before the second phase of the work, a test protocol to plan the experimental test following the algorithm in Figure 1 was prepared. It is presented in Table 2. For each case of Table 2, the test was repeated considering the six sea states in Table 3. Table 2. Test plan applying different control laws with the Impulse turbine.

#2
Adjustment of the control law adopted for #1 tests to get the maximum output power at the grid #3 Constant speed control with on-off law #4 Constant speed control with PI The next phases were carried out to get a clearer correlation between the simulations and the HIL experiments. Each test described was repeated for all the sea states listed in the right-hand column.
The main goal was to verify that the models are sufficiently accurate for future design and optimization purposes. For this reason, we compared simulations with measurements. For example, Figure 16 shows measured and simulated power, torque and rotor speed for an Impulse turbine and H s = 1.6 m. As shown, the match between measurements and simulations is very good.
Thus, to increase the power at the generator output (drive train) the rotational speed can be lowered to be closer to the optimum, applying to the drive train a higher electrical torques, by setting Kadjust > 1.
To better analyze what happens changing Kadjust, the mean power measured during the tests can be taken as reference.
Let <Ppneu> be the mean pneumatic power at the turbine inlet, <Pmech> the mean power at the shaft of the turbine and <Pel> the mean power at the output of the electric generator, then these powers change with Kadjust. For each sea state, an optimum value of Kadjust can be found to obtain the maximum efficiency of the whole converter. For example, considering the conditions of Figure 16, the <Pel> can be increased from 3.2 kW to 4 kW changing Kadjust from 1 to 2.8 as shown in Figure 17. This value results the one that gives the highest mean generator power when Hs = 1 m, then optimizing the applied control law only for a specific sea-state.
The constant speed control with on-off law has been demonstrated to be the less efficient, while the MPPT is the best. Tables 4 and 5 show the results obtained with the MPPT control and the constant speed control with PI regulator, respectively. Using the constant speed control with a PI regulator, the total efficiency is lower, around 10% less, than the one obtained with the MPPT for all the sea states. In addition, the MPPT is an adaptive control type and is to be preferred because on the opposite of the fixed speed control, it is not sea-state dependent.
With the MPPT control, Kadjust can be changed to maximize the <Pel>. At each wave height, the optimum Kadjust is different. Then, the control law is dependent on the incident wave. The test with the HIL showed that applying the MPPT control for the torque as obtained from the characteristics in Figure 10 for an Impulse turbine (setting K adjust = 1 in the model of Figure 13), the rotational speed is always higher than the optimum one (e.g., as shown in Figure 16 with H s = 1 m). The rotor speed cannot vary rapidly as the optimum one due to the inertia (in this case, at the real scale, it is 0.1 kg·m 2 ).
Thus, to increase the power at the generator output (drive train) the rotational speed can be lowered to be closer to the optimum, applying to the drive train a higher electrical torques, by setting K adjust > 1.
To better analyze what happens changing K adjust , the mean power measured during the tests can be taken as reference.
Let <P pneu > be the mean pneumatic power at the turbine inlet, <P mech > the mean power at the shaft of the turbine and <P el > the mean power at the output of the electric generator, then these powers change with K adjust . For each sea state, an optimum value of K adjust can be found to obtain the maximum efficiency of the whole converter. For example, considering the conditions of Figure 16, the <P el > can be increased from 3.2 kW to 4 kW changing K adjust from 1 to 2.8 as shown in Figure 17. This value results the one that gives the highest mean generator power when H s = 1 m, then optimizing the applied control law only for a specific sea-state.

Conclusions
In this paper, a method to perform experiments coupled to numerical analysis on the electrical PTO of a WEC at the early stages of development has been thoroughly investigated.
The relevance of this paper mainly stays on the proposed methodology, which links wave flume ( Figure 18) and HIL ( Figure 19) tests carried out at different scales: hydraulic models based on physical model tests in the wave flume (e.g., in scale 1:20) should not be built around a closed dummy The constant speed control with on-off law has been demonstrated to be the less efficient, while the MPPT is the best. Tables 4 and 5 show the results obtained with the MPPT control and the constant speed control with PI regulator, respectively. Using the constant speed control with a PI regulator, the total efficiency is lower, around 10% less, than the one obtained with the MPPT for all the sea states. In addition, the MPPT is an adaptive control type and is to be preferred because on the opposite of the fixed speed control, it is not sea-state dependent. With the MPPT control, K adjust can be changed to maximize the <P el >. At each wave height, the optimum K adjust is different. Then, the control law is dependent on the incident wave.

Conclusions
In this paper, a method to perform experiments coupled to numerical analysis on the electrical PTO of a WEC at the early stages of development has been thoroughly investigated.
The relevance of this paper mainly stays on the proposed methodology, which links wave flume ( Figure 18) and HIL ( Figure 19) tests carried out at different scales: hydraulic models based on physical model tests in the wave flume (e.g., in scale 1:20) should not be built around a closed dummy turbine model, but should be interpreted by a model that can be coupled to a HIL test rig (e.g., in scale 1:5). method can be useful to design the power conversion equipment also thanks to accurate development of the WEC's control strategies. Although the method is in principle extendible to irregular wave conditions, the actual applicability under irregular sea states has not yet to be proved.
About the OWC considered here, the following main results were obtained.


The pneumatic power (as the electrical and mechanical ones) significantly depends on the turbine working conditions (a fully coupled modeling approach is important for this type of device).  The MPPT control is more effective in following the optimum rotational speed than a torque control where the actual rotor speed is kept as much as possible equal to a set-point.  The control law depends on the incident wave. Then, we can say that to improve the efficiency of the system, the OWC should be equipped with a system that measures the incident wave.
The work here presented may be extended and applied to a more advanced design (e.g., considering a predictive strategy with artificial neural network) of the control system for the OWC taken as reference, to improve its performance. The usefulness of the HIL test rig is in fact demonstrated not only by the study case of this work, but also by the works in [19] and [22] for different WECs at the design stage. More recently, it has been validated also for a real [27], but it was never defined and structured as in the present work.    The proposed procedure, schematically presented in Figure 1, has been described also with an example, considering some iterations to improve the power at the output of the generator. The aim was to significantly increase efficiency at an early design stage through the choice of the turbine and the control regulation. To do this, we needed to solve several aspects of coupled modeling, and the procedure described in this paper is our best solution for this combined hydrodynamic-electrical approach.
The experiments allow one to verify the validity of the modeling technique applied with the pneumatic power generated by 3D hydro-pneumatic simulations, and to demonstrate that the method can be useful to design the power conversion equipment also thanks to accurate development of the WEC's control strategies. Although the method is in principle extendible to irregular wave conditions, the actual applicability under irregular sea states has not yet to be proved.
About the OWC considered here, the following main results were obtained.
• The pneumatic power (as the electrical and mechanical ones) significantly depends on the turbine working conditions (a fully coupled modeling approach is important for this type of device).

•
The MPPT control is more effective in following the optimum rotational speed than a torque control where the actual rotor speed is kept as much as possible equal to a set-point.

•
The control law depends on the incident wave. Then, we can say that to improve the efficiency of the system, the OWC should be equipped with a system that measures the incident wave.
The work here presented may be extended and applied to a more advanced design (e.g., considering a predictive strategy with artificial neural network) of the control system for the OWC taken as reference, to improve its performance. The usefulness of the HIL test rig is in fact demonstrated not only by the study case of this work, but also by the works in [19] and [22] for different WECs at the design stage. More recently, it has been validated also for a real [27], but it was never defined and structured as in the present work.