Hardware in the loop experiments with ship propulsion systems in the towing tank Scale effects, corrections and demonstration

Standards for environmental impact, safety and operational performance of ships are becoming increasingly strict. In order to meet these standards, the performance of new ship designs must be predicted with an increasing level of detail and confidence. As present prediction methods lack realistic, dynamic behaviour of the ship ’ s propulsion plant, there is a need for more advanced methods. In this paper, an open water test with Hardware in the Loop (HIL) functionality is proposed. HIL open water tests combine software and hardware components to emulate realistic behaviour of the ship ’ s propulsion plant in the towing tank. It is known, however, that experiments in the towing tank are subject to viscous scale effects. In addition to this, shaft dy- namics are distorted by a number of scale effects occurring inside the scale model propulsion system. In this paper, it is demonstrated with measurements that if corrections for these scale effects are applied, the dynamic interaction between the propeller and simulated engine system can be accurately emulated in the ship model basin.


Introduction
During the development of new industrial equipment, the designer usually tests a prototype to ensure that it meets a range of requirements. First and foremost, the requirements on functionality by the end-user are generally agreed upon by contract. Additionally, there are regulatory demands on safety, while environmental impact during operation, too, is more and more under scrutiny. For large industrial installations, however, producing a full-scale prototype solely for testing is, in general, prohibitively expensive. Ships are evident examples of such large installations. Taking a merchant ship as an example, building a full-scale prototype is not an option, yet there are numerous requirements that need to be satisfied. The future owner of a merchant ship, for instance, will often require that limits of acceptable performance (such as ship speed, bollard pull and fuel consumption) are included in the sales contract. At the same time, classification societies impose safety requirements by setting standards to structure and machinery, while regulatory bodies, such as the International Maritime Organisation (IMO), put limits on the ship's emissions. The consequences of not meeting these requirements can be dire, so designer and yard generally undertake considerable efforts to predict the performance of a new design. Moreover, as requirements are becoming increasingly strict and hence, more difficult to meet, there is a need for more holistic prediction methods for operational ship performance than the methods currently available. This is quite a challenge: interaction between a ship and its environment is a highly complex subject, while the systems found on board are becoming increasingly complex, too.
Hardware in the loop (HIL) experiments potentially offer the possibility to reproduce complex dynamic behaviour of a full scale ship propulsion system without requiring a full scale prototype. Also referred to as hybrid tests, HIL combines physical models or prototypes and numerical simulations into a single test setup. In other industries, HIL is a widespread method to test industrial machinery. In the field of power engineering, Li et al. (2006) used HIL to evaluate a new control algorithm for wind turbines. As another example, Roinila et al. (2019) demonstrated how a HIL setup can emulate electrical grids on board aircraft, concentrating on the frequency response of power distribution systems.
HIL has already been applied in the maritime field, too. Skjetne and Egeland (2006) conducted HIL tests for certification of marine control systems, while Johansen et al. (2005) used the same technique to conduct factory acceptance tests of such a system. In a similar fashion, Altosole et al. (2007) tested the propulsion control system of aircraft carrier "Cavour", while Martelli and Figari (2017) described a similar approach. Concentrating on electrodynamics, Nounou et al. (2018) conducted HIL tests on a scale model of the propulsion system of a naval ship. They emulated load and drive using two electric motors, controlled by simulation models of the ship, propeller and propulsion machinery.
More recently, different applications of HIL in the context of ship design have been reported, including physical models of the ship's hull and environment. Ueland et al. (2018) described a hybrid test in which simulated external forces were applied on a scale model barge in a basin, with the aim of studying the forces from mooring lines and associated machinery. Other than mooring equipment, one could also emulate propulsion machinery. As was demonstrated by Campora and Figari (2003) and Geertsma et al. (2017), ship propulsion system dynamics can be adequately simulated by a numerical model, so emulating realistic propulsion plant behaviour seems feasible. Noting this, Vrijdag (2016) gave an overview of the possibilities of a HIL experiment combining a physical hull and environment and a simulated engine room. Based on the aforementioned publications, Huijgens et al. (2018)  Schematic drawings of the full scale propulsion system considered in this paper and the corresponding experimental setup (from here on referred to as the HIL setup) are given in Figs. 1 and 2. In the full scale ship, drive torque is developed by a diesel engine and passed to the propeller through a gearbox. Fuel injection is governed by a PI shaft speed controller. If fluctuations in propeller load torque cause the shaft speed to change, the speed controller adjusts the fuel rack setting, bringing the shaft speed back to its set value.
In the HIL setup, on the other hand, drive torque is simulated by a numerical model of the diesel engine and gearbox, running on a simulation computernote that this could be any other kind of driving machine. The simulated drive torque is communicated to a motor drive, which commutates the electric propulsion motor. The electric motor in turn drives the scale model propeller. The balance of propeller load torque, friction torque and motor drive torque results in dynamic response of shaft speed. Shaft speed is measured and subsequently fed back to the simulation computer. Using the measured shaft speed and prime mover torque of the previous iteration, the combined numerical models of the diesel engine, gearbox and shaft speed governor simulate a new torque, after which the loop is reiterated. To reduce the complexity of the experimental setup, ship motions are not considered in this paper, although these motions can be reproduced using the setup shown in Fig. 2.
Similar ideas to include propulsion system dynamics in ship model scale experiments have been reported in literature. Experiments using a HIL scale model with a controllable pitch propeller (CPP) in waves were, for instance, demonstrated by [Tanizawa et al., 2013a[Tanizawa et al., , 2013b. They reported oscillating motor torque and speed due to interaction between the simulated engine and physical waves in a model basin, with a shifted mean operating point due to scale effects on viscous skin friction. Thus, as a next step, Kitagawa et al. (2014) included a thrust fan for dynamic correction for viscous skin friction. Kitagawa et al. (2015) subsequently introduced a correction on measured propeller torque to account for scale effects on wake fraction, corresponding to the ITTC performance prediction method (Recommended procedu, 2014b). They then proceeded to predict average engine torque and speed in a range of wave fields. Later, Kitagawa et al. (2018) predicted dynamic behaviour of the diesel engine by showing time traces of torque, speed and power. They also expanded the diesel engine model by introducing a torque limiter in the governor. An advanced correction, taking into account scale effects also on rudder effectiveness, was demonstrated by Ueno and Tsukada (2015). They introduced realtime corrections on propeller speed and auxiliary thrust, resulting in an improved correspondence between model scale and full scale ship motions. Considering these publications, one can conclude that methods to correct for viscous scale effects on static propeller and rudder performance have been extensively  Apart from static distortions by viscous scale effects, one can also expect dynamics distortions of propeller torque and thrust. Interactions between the propeller and appendages, such as struts and rudders, may trigger vortex shedding around the propeller. In turn, this causes fluctuations of propeller torque and thrust, with a possible effect on shaft dynamics. However, different viscosity and vapour pressures between full scale and model scale situations may result in different vortex behaviour. Noting this, Krasilnikov et al. (2015) compared CFD simulations and scale model experiments with podded propellers, paying attention to scale effects on propeller-pod interaction and resulting vortex behaviour. They concluded that scale effects on factors which are a result of propeller-pod interaction, such as relative rotative efficiency η r and wake fraction w, are very limited. Although Krasilnikov et al. indicate that these factors do not completely characterise the complex interaction between propeller and pod, their limited variation with scale does indicate that such dynamic distortions are of a limited magnitude. In addition, Bertram (1999) stated that scale effects on vortex shedding and flow separation are sufficiently small to allow accurate manoeuvrability experiments with scale model ships. Thus, one can conclude that scale effects on dynamic propeller performance are very limited, at least in the frequency range relevant for ships with displacement hulls.
Considering this, hydrodynamic scale effects are outside the scope of this paper, and Froude scaling is attained for reasons of clarity. If one were to apply the HIL techniques proposed here in manoeuvrability tests with free-sailing models, realtime corrections for skin friction rudder effectiveness as demonstrated by Ueno and Tsukada (2015) and Ueno et al. (2017) would need to be applied, too.
Dynamic scale effects, on the other hand, affect the dynamic behaviour of the propulsion system. The mechanisms behind these scale effects have received only limited attention in past literature, although they are relevant when considering the dynamic interaction between machinery and environment. The aim of this paper is therefore to shed more light on this subject. Dynamic scale effects can occur on the load side and the drive side. For example, distortions of flow settling times around the propeller blades may cause dynamic distortions of propeller torque, while different dynamic properties of the drive system may cause distortions of shaft dynamics. However, as dynamic distortions of hydrodynamic propeller torque and thrust are expected to be very limited, this paper concentrates on dynamic scale effects on the drive side.
Dynamic scale effects can be illustrated by comparing the shaft dynamics of the HIL setup with the shaft dynamics of the full scale prototype which it representsthe term shaft dynamics here refers to the dynamic behaviour of load and drive torque and the resulting angular acceleration and speed of the propulsion shaft. However, this comparison can become rather involved, as one must apply scale factors for geometry and time. To eliminate these scale factors, the concept of ideal scale model is introduced. The ideal scale model is a downscaled, virtual prototype, assuming that no scale effects occur. Comparing the dynamic behaviour of the ideal scale model to that of the practical scale model, or HIL scale model, dynamic scale effects can be illustrated in a clear manner.
The mechanisms behind dynamic scale effects can be pinpointed by examining the differences between the propulsion systems of the ideal and practical scale models. As appears from Figs. 1 and 2, the practical scale model contains components that are not present in the ideal scale model. Moreover, components that are present in both the ideal and practical scale models may have different physical properties. In specific, three causes for dynamic scale effects can be distinguished: 1 the electric drive, only present in the scale model, might introduce additional, unwanted dynamics; 2 different types and sizes of drive machinery and bearings may cause incorrectly scaled friction; 3 the geometry of the drivetrain is not the same, leading to an incorrectly scaled moment of inertia.
This paper aims to identify the components and mechanisms relevant for these three issues. In Section 2, mathematical descriptions are introduced to analyse the shaft dynamics of the ideal and practical scale models. In the same Section, the expected scale effects are illustrated in the frequency domain. These mathematical descriptions are subsequently used in Section 3 to establish methods to correct for dynamic scale effects during HIL experiments. Finally, Section 4 compares simulations and actual measurements from HIL open water experiments, demonstrating that the proposed corrections indeed allow to conduct HIL open water experiments with correctly scaled shaft dynamics. With that, this paper introduces a scientifically substantiated tool for experimental research on the intersection of marine engineering and hydrodynamics.
All measurement data presented in this paper were published in a dedicated folder on the 4TU.ResearchData repository (Huijgens, 2020). Every Figure containing measurement data is accompanied by a reference to the relevant data files. Data were recorded using the dSPACE ControlDesk and MATLAB software packages. Data files have the MAT format (.mat). In addition to these data files, the repository contains MATLAB scripts that can assist with visualising the stored measurement data.

Mathematical description of scale models and scale effects
In this paper, a diesel-mechanical propulsion system serves as the ideal scale model. Dynamic scale effects are illustrated and analysed by comparing the shaft dynamics of this ideal scale model to the shaft dynamics of the HIL setup. Section 2.1 introduces non-linear mathematical descriptions of these ideal and practical scale models. These mathematical descriptions are subsequently linearised in Section 2.2. These linearisations are used in Section 2.3 to identify and illustrate dynamic scale effects during HIL experiments. Later, in Section 3, the linear descriptions are used to derive solutions for dynamic scale effects, as they will be demonstrated in Section 4.  Fig. 3 shows the block diagram of the diesel mechanical propulsion system. The diagram shows the eight items that constitute the non-linear description of the ideal scale model: 1 shaft speed governor fuel rack response on the measured engine speed error; 2 diesel engine torque response on engine speed and fuel rack position; 3 shaft speed sensor response; 4 gearbox torque and speed conversion; 5 friction torque inside the engine, gearbox, bearings and power takeoff (PTO); 6 inertia of the complete drive train I tot,id ; 7 hydrodynamic propeller load as a function of shaft speed and propeller advance speed; 8 integration of the shaft acceleration.
The balance between the load and drive terms in this system divided by the total moment of inertia determines the dynamic response of the propeller shaft. The corresponding equation for propulsion shaft dynamics is given in Eq. (1).
The inertia of the water entrained between the propeller blades is dynamic, rendering the total inertia of the propulsion system I tot,id time-variant. However, the complex subject of added inertia is outside the scope of this paper; from here on, the moment of inertia of the propulsion plant is assumed to be constant. Eq. (1) forms the link between the individual items listed before. These items will be expressed in mathematical terms in this Section. Parameters for the diesel-mechanical propulsion system considered in this paper are given in Table B.5; the environmental conditions are given in Table B.6. The geometric scale factor λ equals 17.9, while time is scaled according to Froude similarity. The first item in the list was the shaft speed governor, which controls the speed of the propulsion engine. This is a PI governor, as is common in modern merchant ships (Bondarenko and Kashiwagi, 2010). Before giving a mathematical description of this controller, some attention is paid to the input and output signals. One could directly supply measured and set shaft speed, expressed in rpm, to the speed controller, and define the output as a fuel rack setting in mm. In practice, however, the input and output signalsmeasured shaft speed n e and fuel rack setting FRare often scaled between minimum and nominal values for n e , and between minimum and maximum values for FR. This scaling to standardised shaft speed n = e and standardised fuel rack setting FR = is described by Eqs. (2) and (3), and illustrated by Figs. 4 and 5. As such, governor settings for diesel engines are more or less standardised. Eq. (4) shows how the PI controller calculates a standardised fuel rack command from measured and set standardised shaft speeds.
if n e ≤ n e,min n e − n e,min n e,nom − n e,min , otherwise Eq. (4) shows that the PI controller has a static gain term and a timedependent integration term. When conducting scale model experiments, time scaling must be taken into account for all time-dependent phenomena, including operations inside the shaft speed controller. This means that, while K p,ω does not require scaling from full scale to model scale, K i,ω does. Eq. (5) shows how shaft speed controller settings are scaled from full scale to model scale, assuming Froude time scaling.
As the next item, the diesel engine is represented by a fuel rack map, which maps engine brake torque M b as a function of engine speed n e (in rpm) and fuel rack setting FR (in mm). Such a fuel rack map is mathematically described by Eq. (6), and visualised by Fig. 6. The general shape of the fuel rack map and the negative value for g around the nominal engine operating point is in line with past publications (Schulten, 2005;Vrijdag and Stapersma, 2017). Dynamic behaviour of the turbocharger is neglected, which means that delays in available air for combustion are not taken into account. In reality, a considerable, stepwise increase of injected fuel may cause the air-to-fuel ratio to drop to a level where not all fuel is burnt, temporarily limiting engine torque. In practice, however, this dynamic limit is usually accounted for by Fig. 3. Block diagram of the ideal scale model from speed setting to shaft speed. In this paper, a diesel-mechanical propulsion system is considered such as drawn in Fig. 1. The ideal scale model is the full scale propulsion system, scaled down without scale effects.  limiters in the speed governor . Here, it is assumed that the settings of the speed governor result in a sufficiently smooth response of the fuel rack setting on disturbances, rendering a model based on a fuel injection map sufficient to assess shaft dynamics. It can be argued that the model used here is rather simple, and that much more elaborate engine models are available. As a key benefit, however, the model used here can be linearised relatively easily, as will prove very useful in Section 2.2. Moreover, improving existing prime mover simulation models is outside the scope of this paper; no further attention is paid here to the validity of the diesel engine model.
The third item is the shaft speed sensor. Here, it is assumed that this component does not introduce any additional propulsion shaft dynamics. Therefore, it is not separately included in the non-linear description. Next, the multiplication of drive torque and shaft speed in the gearbox is modelled. Drive torque M d equals the brake torque of the diesel engine M b , multiplied by the gearbox box reduction ratio i gb . This relation is expressed by Eq. (7).
Shaft speed is converted by the same factor, though in the opposite direction. The fifth listed item is the friction torque inside the engine, gearbox, bearings and PTO. Friction torque of the diesel-mechanical propulsion system is a subject in the field of tribology, which is outside the scope of this paper. Considering this, friction inside engine, gearbox and bearings is not considered, as is the case for torque absorbed by PTO machinery such as shaft generators.
Another important parameter with respect to shaft dynamics is the moment of inertia of the drive train, listed as item number six. The total moment of inertia, I tot,id , is the sum inertia of the diesel engine, gearbox and shaft (I mech,id ), inertia of the propeller (I prop,id ), and inertia of the water entrained between the propeller blades (I H2O ). Values for I mech,id and I prop,id can be obtained from manufacturers. On the other hand, entrained mass and the resulting added inertia are a much more complicated, hydrodynamic phenomenon. Considering its complex nature, added inertia is not further considered in this Section. It will however be taken into account in Section 4. Propeller load torque is described by Eq. (8), in line with Kuiper (1992). Torque coefficient K Q is a function of advance ratio J, which in turn is a function of shaft speed ω s , propeller advance speed v a and propeller diameter D, as is shown in Eq. (9). The exact relation between K Q and the mentioned variables depends on the propeller geometry; here, a Wageningen C4-40 controllable pitch propeller with a design P/D ratio of 1.0 and an actual P/D setting of 1.3 is considered. The coefficients for this propeller, including K Q , were reported by Dang et al. (2013). Note that this pitch is kept constant throughout the simulations and experiments described in this paper, despite the choice for a controllable pitch geometry. Interaction between the hull and propeller is outside the scope of this paper, which implies that the propeller operates in open water. Relative rotative efficiency η r of the propeller is therefore taken as 1, and not further included in the mathematical descriptions. In general, the interaction between the hull and propeller is not taken into account in open water experiments. To study this interaction, a scale model hull must be introduced. The hydrodynamic interaction between hull and propeller is subject to scale effects, too; methods to correct for these effects have been demonstrated in past literature (Ueno and Tsukada, 2016). Yet, as this paper concentrates on scale effects on shaft dynamics rather than hydrodynamics, disturbances of the inflow caused by the presence of the hull are not considered in detail here. The wake fraction is assumed to be static at 0.25, as follows from the conditions given in Table B.5.
Finally, the balance between the combined load and drive torque components result in a shaft acceleration, depending on the total moment of inertia of the drive. The integral of this shaft acceleration equals the propeller shaft speed. The fluctuations in load and drive torque and the resulting fluctuations in shaft acceleration and shaft speed are the variables of interest in this paper.

Practical scale model: HIL setup
The aim during HIL open water experiments is to emulate the shaft dynamics of the ideal scale model, described in Section 2.1.1. As was indicated earlier, this can be problematic as the HIL setup, or practical scale model, is physically different from the ideal scale model. These differences can be pinpointed in the block diagram shown in Fig. 7.
As a first difference, the governor, engine and gearbox are no longer physically present, but included as simulations. Second, an additional subsystem is introduced: the closed electric loop. This loop represents the electric propulsion drive, which is to emulate the ideal propulsion system. Third, friction, moment of inertia and hydrodynamic propeller load are still physically present, but may be different from the ideal scale model.
The first difference, simulating rather than physically including the diesel-mechanical propulsion system, will not receive further attention here. As was mentioned in Section 2.1.1, validating the simulation model of the diesel-mechanical propulsion system is outside the scope. It is assumed that the non-linear descriptions and resulting simulation models are accurate, and that simulating rather than physically including components does not change dynamic behaviour.
The other two differences, on the other hand, may have considerable effects on propulsion shaft dynamics. In previous Sections, dynamic behaviour of the electric propulsion drive was already mentioned as a possible source of dynamic distortions. In addition, changes in friction torque, moment of inertia and hydrodynamic propeller load were mentioned to influence shaft dynamics, too. Considering this, the practical scale model is essentially a modified and expanded version of the ideal scale model: a number of components are added, while the physical properties of components also present in the ideal scale model may be different. The components which are simulated in the practical scale model remain identical.
First, the closed electric loop is described here, starting with the electric motor. Permanent magnet synchronous machines (PMSM) are particularly suited for the HIL setup's electric propulsion system because of their compactness, and because their torque can be controlled relatively easily. Drive torque of these machines is proportional to winding current by torque constant k t , which is referred to as the motor torque constant. This relation is expressed by Eq. (10).

Fig. 6.
Fuel rack map visualising the relation between engine speed, fuel rack setting and engine torque for the diesel engine in this paper.
Parameters for the electric drive considered in this paper are given in Table B.7. The relation between voltage, speed and current of the PMSM is described by Eq. (11). Terminal voltage u has a maximum value u max .
Using the law of conservation of energy, one could show that torque constant k t and back EMF constant k e have practically equal values. Both variables will therefore be represented by k t from here on.
The aim of the dynamic open water experiment is to emulate drive torque of an ideal propulsion system. This means that torque and therefore winding current of the electric motor must be precisely controlled. To this end, a PI controller for current is introduced. The current controller regulates voltage based on the difference between measured current to the current set point; Eq. (12) gives a mathematical description of this operation.
R and L are the terminal resistance and inductance of the electric motor, respectively. Often, the current controller and sensor are integrated into the motor drive, which also commutates the motor. Since motor drives contain proven, off-the-shelf technology, it is assumed that commutation and current measurement is done sufficiently fast to avoid dynamic distortions. This means that the current sensor block, shown in Fig. 7, is not separately described.
The physical components in the HIL setup, located on the right in Fig. 7, are governed by the same equations as in the ideal scale model. However, parameters in these equations such as moments of inertia and friction coefficients may have different values. This, too, results in dynamic distortions, as will be demonstrated in Section 2.3. Table B.8 gives the inertia components for the ideal and practical scale models. The analysis in Section 2.3 relies on linear descriptions of both the ideal and practical scale model, which will be derived in Section 2.2.

Linearised ideal scale model
In order to facilitate the linearisation of the given mathematical descriptions, a number of simplifications is introduced. A first simplification is made to the prime mover model. As was mentioned earlier, this paper concentrates on dynamic distortions introduced by hardware components, such as the additional electric loop, rather than the accuracy of the diesel engine's simulation model. Therefore, the prime mover is modelled as a static gain in the linear descriptions.
Two assumptions are made to facilitate the linearisation of the given mathematical descriptions. First, the total moment of inertia of the shaft, gearbox, propeller and entrained water, I tot,id , is assumed to be constant, which means that changes in entrained water mass in the propeller are neglected here.
Second, it is assumed that the (simulated) gearbox does not introduce additional dynamic behaviour. Furthermore, the gearbox ratio is static and does not introduce any additional dynamics. This ratio is therefore eliminated from the linear descriptions. This means that there is no longer distinction between propeller and engine speed, and shaft speed can be referred to by ω without indices e or s.
Before proceeding to the linear descriptions, some attention is paid to notation. Stapersma and Vrijdag (2017) proposed a linear model of torque of a controllable pitch propeller operating behind a ship. In their linearisation, they used operator δ to signify a small excursion from the equilibrium value (for sinusoidal fluctuations, this is the oscillation amplitude), and superscript * to indicate a normalised value. This notation is assumed here, too. As an example, Eq. (13) illustrates how ω relates to δω * .
Using this notation and the aforementioned simplifications, the nonlinear descriptions given in Section 2.1.1 are linearised. The general, non-linear equation for shaft dynamics, given in Eq. (1), can be linearised as shown in Eq. (14).
Linearisation implies that non-linearities such as the fuel rack limits shown in Fig. 5 are neglected. Yet, these non-linearities are introduced in the HIL experiment by the experimenter, and are not the result of scale effects. As the linear descriptions will be used to analyse scale effects in the frequency domain, non-linearities in the prime mover simulation model can be neglected in these descriptions. Linearising the shaft speed loop allows to introduce shaft speed time constant τ ω , which was derived by Stapersma and Vrijdag (2017). τ ω is calculated as shown in Eq. (15).
For the time being, the prime mover is modelled as a static gain. In essence, this means that the fuel rack map as explained in Section 2.1.1 is not included in the linear description here, and the output of the current controller function C ω equals drive torque M d . This results in a simpler and more generic linear description. As an important advantage, this facilitates the mathematical analysis with the aim of finding corrections for scale effects.
Propeller torque M prop,hydro can be linearised, too. Stapersma and Vrijdag (2017) proposed a method to linearise the non-linear propeller load torque, as given in Eq. (8), to the form given in Eq. (16).
This linearisation of propeller load torque will be used here, too. Propeller derivative b expresses the change of normalised torque coefficient δK * Q with changing normalised advance ratio δJ * , as is shown in Eq. (17). For a further elaboration on propeller derivatives, reference is made to Stapersma and Vrijdag (2017) The equation for linearised propelled load torque, Eq. (16), can be substituted in the equation for linearised shaft dynamics, Eq. (14), resulting in Eq. (18).
After Laplace transform and some reordering, Eq. (18) can be written as shown in Eq. (19).
In the non-linear description in Section 2.1.1, engine torque depends on the fuel rack position and on shaft speed. In order to keep the linear description as simple and generic as possible, this interaction will not be taken into account in this Section. It will however be included in the simulations and measurements reported in Section 4. From Eq. (19), two normalised Laplace transfer functions can be derived: one for shaft speed response on drive torque, and one for shaft speed response on advance speed. Both are given in Eq. (20).
Next, the shaft speed controller described in Eq. (4) is linearised. As was indicated earlier, the scaling of the input and output signals is not included in the linear model. This means, first of all, that the behaviour of the linear model valid only for shaft speeds and fuel rack settings within their respective minimum and maximum values. Second, controller settings K p,i and K i,i need to be scaled. This scaling factor is the same for both settings, and depends on the nominal values in the linear and non-linear models.
In general, the conversion factor for controller settings in different controllers and reference conditions depends on the equilibrium values of the process variables, as shown in Eq. (21). x is the variable to be controlled, while y is the output variable of the controller.
The aim here is to convert shaft speed controller settings for the nonlinear ideal scale model to settings for a linear model, based on the notation given in Eq. (13). Consequently, the variables x and y in Eq. (21) are engine speed and torque, respectively. In the specific case of the shaft speed controller described in Section 2.1.1, engine speed and torque are scaled between minimum and maximum values. These ranges must be taken into account in the conversion of controller settings, as is shown in Eq. (22).
Moreover, deviations from the equilibrium are expressed in fractions of one in the linear description, implying that equilibrium values x 0,converted and y 0,converted are equal to one. Taking this into account as well as the scaling ranges, Eq. (23) shows how the speed controller settings can be converted for use in the linear descriptions.
Using these scaled settings, the shaft speed controller described in Eq. (4) can be linearised. The resulting Laplace transfer function is given in Eq. (24). Table B.9gives values for the parameters of the linearised ideal scale model, corresponding to the conditions described in Table B.5. Fig. 8 gives a visual representation of the linearised ideal scale model, in which each block represents one of the Laplace transfer functions derived in this Section. The corresponding Laplace transfer function for response of shaft speed on set speed, δω * /δω * set , is given in Eq. (25).
The Laplace transfer function given in Eq. (25) represents the response of shaft speed on speed setting of the ideal scale model. It has one zero and two poles, which determine how gain and phase evolve as the input frequency increases. Generally, at very low frequencies, the absolute gain equals 1 and the phase equals 0, as the propulsion system can easily follow the set point. However, as the frequency of the set speed fluctuations increases, the gain asymptotically decreases to 0 and the phase to − 90 • , as the propulsion system can no longer attain the set speed and starts to lag behind. This effect will become apparent in Section 2.3.
As a next step, Section 2.2.2 derives the linear description of the practical scale model, allowing a comparison of both scale models to be made in Section 2.3.

Linearised practical scale model
In Section 2.1.2, it was shown that the practical scale modelor HIL setupis in fact a modified and expanded version of the ideal scale model. Introducing the mentioned additional components into the diagram shown in Fig. 8, one obtains the diagram shown in Fig. 9. Fig. 9 introduces three new transfer functions: Q * u , Q * ω and C i . The first two describe the response of motor winding current on voltage and shaft speed, respectively, while the third represents the current controller. First, the response of motor current is linearised. After reordering and normalising, the relation between voltage, speed and current of the PMSM given in Eq. (11) can be written as shown in Eq. (26).
Eq. (28) shows that there are two input signals that cause response of current i and hence, drive torque M d : terminal voltage u and shaft speed ω. These responses can be represented by two separate systems, Q * u and Q * ω , which are given in Eq. (29).
Current and voltage corresponding to the equilibrium point considered in this Chapter are given in Table B.10. With the relation between current, voltage and speed now expressed as Q * u and Q * ω , the description of the current controller given in Eq. (12) can be linearised. Recalling that the controller settings can be converted according to Eq. (21), Eq. (30) gives the Laplace transfer function of the linearised current controller.
Using the transfer functions derived in this Section and the block diagram given in Fig. 9, the dynamic behaviour of δω * / δω * set of the HIL setup can be derived. The resulting transfer function is shown in Eq. .
The Laplace transfer function given in Eq. (31) represents the response of shaft speed on speed setting of the practical scale model. Based on Figs. 8 and 9, one could think of additional relevant transfer functions. A more detailed account on these transfer functions and their relation to Eq. (31) will be given by Huijgens (2021), expected to be published early 2021. Dynamic similarity is achieved until a given frequency if the gain and phase of Eq. (31) equals the gain and phase of Eq. (25) until that given frequency. In other words, the shape of the Bode diagram must be the same.
However, this is not at all self-evident, as the transfer functions for the ideal and practical scale models are not the same. Moreover, the parameters in both transfer functions may be different. The resulting scale effects on the dynamic response of torque and speed are the dynamic scale effects that form the subject of this paper. In Section 2.3, these scale effects will be analysed and demonstrated in the frequency domain.

Analysis of dynamic scale effects in the frequency domain
By comparing the propulsion systems shown in Figs. 3 and 7, three causes for dynamic scale effects can be identified: dynamic response of the electric drive, incorrectly scaled friction torque and incorrectly scaled moment of inertia. These three effects are illustrated using Bode diagrams of linear simulations in Sections 2.3.1 through 2.3.3. To conclude the analysis of dynamic scale effects, Section 2.3.4 introduces the criteria on shaft dynamics for accurate HIL experiments. These criteria will be used in Section 4 to assess whether or not the considered HIL setup and proposed solutions for dynamic scale effects result in accurate emulation of the actual ship's propulsion system.

Distortions of shaft dynamics by the electric drive
A first difference between the ideal and practical scale model is the additional electric loop, which converts simulated drive torque into physical drive torque. To correctly emulate torque of the prime mover, the torque command from the simulator must be converted into physical drive torque sufficiently fast. The torque of the electric motor in the HIL setup is proportional to the current in the motor windings, so fast torque response can be achieved by controlling winding current. To this end, a current controller is introduced, as is also shown in Fig. 7.
In order to achieve precise current control, the proportional and integral gains of the current controller, K * p,i and K * i,i , must be properly tuned. The significance of these settings is explained in Section 3. As a first indication of the importance of current controller tuning, Fig. 10 shows the effect of choosing arbitrary controller settings. Fig. 10 presents a Bode diagram with shaft speed response on speed setting both for the ideal scale model and a practical scale model with electric propulsion system. Mechanical parameters for the practical scale model are given in Table B.9, while the additional electric drive has the equilibrium values given in Table B.10. At this point, no guidance is available for tuning the electric drive of a dynamic open water setup. As such, both K * p,i and K * i,i are arbitrarily set to a value of 1.     Table B.9.
Clearly, this results in considerably distorted shaft dynamics, indicating that proper settings are an absolute requirement for dynamic similarity. Considering this, Section 3 introduced tuning guidance for the current controller.

Scale effects on friction
Shaft dynamics also depend on the equilibrium torque of the propulsion drive. To illustrate this, a practical scale model is simulated which is nearly the same as the ideal scale model described by Table B.9. The only difference in this case is that the equilibrium torque M d,0 is increased with 10% to 4.956 Nm due to friction in the model drive. As can be seen in Fig. 11, this too results in distorted shaft dynamics, although to a limited extent compared to other scale effects. In Section 3, a method is proposed to compensate for model scale friction.

Scale effects on moment of inertia
An incorrectly scaled moment of inertia of the propulsion systems may result in dynamic distortions, too. Fig. 12 illustrates this by comparing shaft speed response of the ideal scale model and a practical scale model which has a considerably smaller moment of inertia. Whereas the ideal moment of inertia I tot,id equals 0.0297 kgm 2 , practical inertia I tot,p is 0.0029 kgm 2 , or only 9.8% of the ideal value. As will be shown later on, the latter value corresponds to the actual HIL setup considered in this paper. Apart from a different moment of inertia, parameters and equilibrium values are the same. Again, shaft dynamics appear to be distorted. Section 3 contains an elaboration on these distortions, and proposes a method to compensate for incorrect moment of inertia.

Criteria for accurate emulation of shaft dynamics
Ideally, the response of the propeller shaft on all input disturbances would be exactly equal for the ideal and practical scale model. In practice, scale effects introduce distortions of shaft dynamics, and the aim in this paper is to derive methods to avoid or correct these distortions.
To assess the performance of the formulated solutions, the response of shaft speed on speed setting for the ideal and practical scale models is compared. This is primarily done using Bode diagrams of the linear descriptions, as these allow to assess dynamics over a wide range of frequencies using only simulation models. Bode diagrams also allow to mathematically formulate criteria for dynamic similarity. Here, dynamic similarity of shaft dynamics is achieved if the gain of the practical scale does not differ from the ideal gain by more than 5% of the ideal DC gain, and the phase does not differ more than 10 • . These criteria are expressed by Eq. (32).
The frequency interval in which these criteria are met is from here on referred to as the similarity range. For accurate HIL experiments, the similarity range should completely cover the relevant frequency range, which is the frequency range in which interaction between the simulated system and external disturbances is expected. In Section 4, the relevant frequency range will be defined, and the criteria stated here will be used to assess whether or not the proposed solutions for dynamic scale effects result in accurate HIL open water experiments.

Corrections for dynamic scale effects
Ideally, the shaft dynamics of the practical scale model should be exactly the same as for the ideal scale model. This implies that the Bode diagram for the practical scale model, as shown in Figs. 10 through 12,   Fig. 12. Bode diagram of linearised response of shaft speed δω * on set speed δω * set with distortions due to incorrect moment of inertia. Response is shown of the ideal scale model and a practical scale model with a moment of inertia which is 9.8% of its ideal value. Apart from the moment of inertia of the practical scale model, parameters for both scale models are given in Table B.9.
should completely coincide with the Bode diagram for the ideal scale model. To obtain such dynamic similarity, the dynamic scale effects must be corrected for. Sections 3.1 through 3.3 introduce tuning guidance for the electric drive and corrections for friction and inertia, such that dynamic scale effects are reduced to a minimum.

Tuning of the electric drive
The electric loop inside the HIL setup is an additional subsystem with its own transfer function. As such, it introduces additional poles and zeros. Comparing Eqs. (31) and (25), one finds that the electric loop introduces one additional zero in the numerator of the transfer function, and two additional zeros in the denominator. Zeros in the denominator will from here on be referred to as poles, while zeros in the numerator will be referred to as zeros. The poles and zeros corresponding to the electric loop will be referred to as electric poles and zeros, while the poles and zeros corresponding to the ideal propulsion system will be referred to as mechanical poles and zeros.
As poles and zeros determine the dynamic behaviour of the system, the locations of the additional, electric poles and zeros should be chosen such that they have a negligible influence on shaft dynamics. With this in mind, it is recommended that one electric pole and the electric zero are made to coincide such that they cancel each other out. Furthermore, it is recommended that the remaining electric pole is moved to a frequency sufficiently high such that it does not influence the dynamics caused by the mechanical poles and zeros. Specifically, a frequency margin of at least two decades between the remaining electric pole and the mechanical pole with the highest frequency is recommended. This approach is shown in a simplified manner in Fig. 13.
These recommendations regarding pole and zero locations materialise in recommended settings for the PI current controller. One could determine the poles and zeros for Eqs. (25) and (31), and substitute and isolate the current controller settings K * p,i and K * i,i . Doing so, one would find that the aforementioned conditions regarding pole and zero locations are met if the current controller settings are chosen as shown in Eqs. (33) and (34).
In case the planned experiment includes multiple static operating points, the minimum current controller settings are determined by the operating point that requires the largest value for K * p,i and thus K * i,i .

Friction compensation
Friction can be compensated by a-priori identification of friction torque as a function of shaft speed. For the experiments described in this paper, friction was determined rather than torque; as was shown in Eq. (10), current and motor torque are directly proportional in a PMSM.
Friction current is measured at a range of speeds, after which friction current i fr is estimated by fitting a function with the form shown in Eq. (35).
Fig. 14 shows current measurements on a submerged shaft without propeller and streamlined fairings. The speed of the shaft is varied between 50 and 1000 rpm in positive direction. Polynomial regression on these measurements results in a polynomial fit with an R 2 of 0.986, indicating that the fit adequately describes friction current. The corresponding coefficients are given in Table 1. Based on these coefficients, a real-time correction for friction was introduced during the experiments described in this paper, ensuring that friction torque inside the practical scale model did not affect shaft dynamics.
It is recommended that this identification is performed prior to every experimental run, after the shaft has been rotated practically unloaded for at least 1 min. This can be achieved by lifting the propeller out of the water, or by dismounting the propeller. In the course of the research project described in this paper, the degree at which the friction curve is time variant was not studied in detail.

Inertia correction
The ship and HIL setup are powered by different kinds of propulsion systems: whereas the real ship is powered by a diesel-mechanical propulsion system, the scale model has an electric drive. These systems have entirely different geometries, and therefore, different moments of inertia. Thus, in order to avoid distortions of shaft dynamics, a correction for inertia is necessary. This correction will receive more attention than the solutions for the other dynamic scale effects, as it is considerably more involved.
Paying attention to the different components of moment of inertia, the shaft dynamics of the ideal scale model can be mathematically expressed as in Eq. (36). I d , I prop and I H2O refer to the moments of inertia of the propulsion motor and shafting, propeller and added mass, respectively. I d and I prop are determined by the geometry and material density of the drive and propeller, which are constant. I H2O , on the other Fig. 13. To avoid dynamic distortion, the electric poles s 1,i and s 2,i and electric zero z i must be cancelled out and moved away from the mechanical poles and zero.

Fig. 14.
Polynomial regression of measured friction current at shaft speeds between 50 and 1000 rpm. In the shown measurement run, the shaft was completely submerged, with the propeller, streamline caps and fairing dismounted. The dark gray points indicate the averaged measured current per 0.1 rad/s increment of shaft speed. The polynomial fit has an R 2 of 0.986; Table 1 shows the corresponding coefficients. This Figure is based on the data in cal_085.mat, stored in the measurement data repository (Huijgens, 2020).
hand, depends on the water entrained between the propeller blades, which may change with advance speed, propeller speed, propeller pitch and number blades.
As the geometries and materials of the full scale and model scale propulsion systems are not the same, this is not self-evident. In the practical scale model, shaft dynamics are governed by Eq. (37). ( Note that the subscript has changed for the first two inertia terms, with p denoting the practical scale model. The inertia of the water entrained between the propeller blades, or added inertia I H2O , can be subject to distortions as well. Such distortions would be mainly the result of viscous scale effects on flow around the propeller blades. However, these effects are very limited compared to the other scale effects considered in this paper. At the same time, entrained moment of inertia constitutes a highly complex hydrodynamic subject, and efforts to formulate a definitive estimation method for this parameter have so far remained inconclusive. Often, the estimation methods proposed by, among others, Lewis and Auslaender (Lewis and Auslaender, 1965), Burrill and Robson (Burrill and Robson, 1962) and Schwanecke (1963) are relied upon, although their applicability on modern propellers is disputed (Krüger and Abels, 2017). In brief, the subject of entrained inertia justifies a research project on its own. Considering the complexity of this subject and the limited magnitude of the associated scale effects, no detailed attention is paid to entrained inertia. Their values are hence the same for the ideal and practical scale model, allowing the indices id and p to be dropped for I H2O .
These differences in moment of inertia result in distortions of shaft dynamics as shown in Fig. 12. Thus, in order to conduct accurate HIL open water experiments, one must apply a correction for moment of inertia. Eq. (38) gives a mathematical expression for the required correction of inertia, starting from the differential equation for the practical scale model. It is assumed that the dynamic behaviour of the electric drive and friction torque are corrected here, which means that M fr,p can be neglected.
I c is referred to as the inertia correction, required to correct the practical scale model inertia to its ideal value. To achieve dynamic similarity, the left hand side of the differential equation for the corrected practical scale model, given in Eq. (38), must be equal to the left hand side of the differential equation for the ideal scale model, given in Eq. (36). This requirement is written out in Eq. (39). ( Eq. (39) can be developed into Eq. (40), isolating I c .
= I mech,id − I mech,p I c can be positive or negative, a positive value indicating that the practical moment of inertia is too small. There are three different methods to put this mathematical correction into physical practice. As a first option, one could physically change the moment of inertia, for example by means of a flywheel. This flywheel would have a moment of inertia equal to I c . However, physical modifications of the setup are impractical for several reasons. Limited accessibility of components inside the open water setup as well as spatial constrains render the mounting and exchanging of flywheels rather labour intensive. Moreover, there are no flywheels with negative inertia, allowing only corrections in positive direction. Physical flywheels are therefore not considered here.
A second option is to emulate shaft speed instead of drive torque, as was demonstrated by Tanizawa et al. (2013a). In their setup, shaft acceleration is calculated each simulation step, based on measured propeller torque, simulated drive torque and the inertia of the simulated (ideal) propulsion system. The acceleration is then integrated, resulting in a simulated shaft speed, which is then communicated to the motor drive. In the resulting closed shaft speed loop, the moment of inertia of the practical scale model is implicitly corrected. Yet, this approach has two important disadvantages. Emulating shaft speed requires an additional shaft speed loop, which in turn also introduces another possible source of dynamic distortions. More importantly, however, shaft speed emulation relies on propeller torque measured by a torque sensor. Such torque sensors are not designed to accurately measure torque at high frequencies, limiting the accuracy of such sensors in dynamic model basin tests. Although these sensors are generally able to accurately measure fluctuations of torque in the frequency range of incoming waves, and are thus suitable for present-day open water experiments, future HIL experiments may concentrate on disturbances at higher frequencies, such as dynamics caused by blade passing. Those frequencies may be near the eigen frequency of the shaft assembly with torque sensor, causing distorted measurements at such frequencies. Without elaborating on this subject here, it can be stated that shaft speed emulation is not the optimal solution for HIL open water tests.
The third option is to emulate drive torque with an additional torque term which accounts for the error in inertia. This correction term is referred to as the torque correction M d,corr , shown separately in Eq. (41). The correction term consists of shaft acceleration dω/dt and an inertia correction I c , which could be considered a "virtual flywheel". Fig. 15 shows how the numerical inertia correction is applied in a HIL open water experiment. Note that the diagram also includes the friction torque compensation. Furthermore, the shaft speed calculation module is a separate software module which converts the time measured between encoder pulses into a calculated shaft speed. For the experiments Table 1 Polynomial regression coefficients for friction current resulting from the measurements shown in Fig. 14. These coefficients were obtained with a submerged shaft and with the propeller, streamline caps and fairing dismounted. The polynomial assumes the format given by Eq. (35).  Table 2 Recommended minimum settings of the current controller recommended according to Section 3.1, and current controller settings that were actually used for HIL experiments. The minimum settings are based on the equilibrium values given in Table B.11. Both absolute settings and normalised settings (with asterisk) are given. 1 calculation of the discrete derivative (discrete differentiation); 2 filtering; 3 multiplication with I c .
The first step is described by Eq. (42). In essence, the discrete derivative equals the difference in measured shaft speed ω m between two time steps, divided by the length of the time step Δt. Here, the time step is the step size of the simulator.

Δω m Δt
This derivative equals the shaft acceleration, which can be used to calculated the torque correction. However, the operation of discrete differentiation considerably increases the noise of the signal. This noise may conceal the relevant, physical dynamics, and even lead to numerical errors in the simulation model. The noise in the measured shaft speed signal and thus, the calculated acceleration depends on the properties of the shaft speed sensor and the shaft speed calculation module, shown in Fig. 15. Two important properties in this respect are a precisely constant spacing of the encoder pulses, and a high sample frequency of the shaft speed calculation module.
To limit measurement noise, the calculated shaft acceleration is filtered by an Infinite Impulse Response (IIR) filter. Such a filter is simple to implement and requires only limited computational effort; for a detailed elaboration on IIR filters and other discrete filters, reference is made to Balmer (1998). Eq. (43) gives the difference equation of the IIR filter, applied on measured shaft speed ω m .
ω m,f (n) = a 0 ⋅ ω m (n) + (1 − a 0 )⋅ω m,f (n − 1) Here, a 0 equals the filter coefficient, determining the extent to which the signal is filtered. Heavy filteringor a low setting for a 0 -results in a smooth signal. However, this also limits the frequency range in which the numerical inertia correction is accurate. Keeping this trade-off in mind, a value for a 0 must be chosen sufficiently low to reduce noise to an acceptable level, yet sufficiently high to avoid unacceptable distortion of shaft dynamics by the filter. In the next step, a mathematical description is introduced to predict this effect of the IIR filter on shaft dynamics.
As a final step, the filtered discrete derivative of shaft speed is multiplied by the inertia correction factor I c . While introduced to reduce dynamic distortions caused by the scale effect on moment of inertia, these three operations introduce additional dynamic response. To predict whether these additional dynamics remain within acceptable limits, a linear description of the shaft dynamics including this numerical correction was derived. The result of this derivation is given in Eq. (44), which describes the response of shaft speed on simulated drive torque, including the numerical inertia correction, in the discrete domain.
Eq. (44) is in fact the discrete equivalent of Eq. (20a), introducing a discrete correction algorithm for moment of inertia. Eq. (44) will be used in Section 4 to predict the performance of the numerical inertia correction in a simulated environment.

Results and discussion
The findings in this paper are validated by comparing simulations and measurements on the ideal and practical scale models, as is visualised in Fig. 16. In Section 2, non-linear descriptions of the ideal and practical scale models were formulated and subsequently used to derive linear descriptions. These non-linear and linear descriptions were then used to identify and illustrate scale effects on dynamic shaft behaviour. Following this, solutions for these scale effects were proposed in Section 3, resulting in non-linear and linear descriptions of the corrected, practical scale model. These stages are represented by dashed lines in the drawing.
To validate the mathematical descriptions, non-linear and linear simulations of the practical scale model are compared to HIL measurements without numerical inertia correction. This comparison is made in Section 4, and is indicated by number 1 in Fig. 16. In Section 4, the performance of the proposed corrections is verified by comparing simulations of the corrected scale model and ideal scale model to HIL measurements with the proposed corrections applied. This comparison is indicated by number 2 in Fig. 16.

Validation of mathematical descriptions
As is indicated by step 1 in Fig. 16, the mathematical descriptions are validated by comparing simulations based on these descriptions with experimental measurements. Here, only the linear descriptions will be evaluated, as these follow from the non-linear descriptions. Validation of the linear descriptions thus implies validation of the non-linear descriptions.
The diagrams in Figs. 8 and 9 show two input signals: shaft speed setting ω set and propeller advance speed v a . On the output side, two relevant signals can be pointed out: shaft speed ω and (simulated) drive torque M d,set . The response of each output on each input predicted by the linear descriptions will be compared to the measured response. First, however, the response in current i on current set point i set will be evaluated.

Closed current loop response
A first set of experiments was conducted to investigate whether the response of current i on current set point i set corresponds with the mathematical descriptions derived in Section 3. The original plan was to systematically vary the current controller settings, allowing comparison of the observed trends in dynamics with predictions by simulations. However, this was not possible, as the range of the current controller settings in the motor drive is limited by the manufacturer.
Despite this limitation, the response of current on set current was evaluated with simulations and measurements. This showed a considerable difference between the mathematical description and the actual behaviour of the electric drive, as is indicated by Fig. 17. A possible explanation for this difference could be that the mathematical description of the electric motor and control loop, on which these simulations are based, is incorrect. However, the descriptions derived in Section 2 are in line with literature. Among others examples, Martinez-Alvarado et al. (2014) reported the use of a BLDC motor to power a small scale air thruster, basing their mathematical descriptions on the same fundamental equations as those used in this paper. Although the extensiveness of the BLDC models varies from source to source, these differences in implementation cannot explain the substantial discrepancy between measured and simulated current response.
As a more likely hypothesis, there may be an additional, dynamic system in or around the HIL setup, unaccounted for in the mathematical description. The following systems could be thought of in this respect: 1 dynamics and discrete effects of subsystems inside and around the motor drive; 2 dynamic response of the power supply.
The dynamic response of subsystems inside the motor drive and power supply could not in all cases be identified due to limited time, Fig. 17. Simulated and measured response of current i on current setting i set . The current controller has the actual settings given in Table 2. This Figure is based on the data in exp_174. mat, exp_175.mat, exp_176.mat, exp_177.mat, exp_178.mat, exp_179.mat, exp_180.mat, exp_181.mat and exp_182.mat, stored in the measurement data repository (Huijgens, 2020). material and accessibility. An example of such a subsystem is the current sensor, which may introduce a phase delay in the current control loop, but is inaccessibly mounted inside the motor drive. As another example, components such as transformers and sliding contacts in the 380 V supply rail along the towing tank may introduce unknown dynamic behaviour.
The identification of the exact source of these unexpected dynamics is reserved for a future experimental campaign. Thus, the tuning guidance derived in Section 3.1 remains invalidated, even though the underlying mathematical descriptions are in line with literature. Yet, the results shown in Fig. 17 are very relevant, as they demonstrate the importance of verifying the dynamic response of the electric drive prior to conducting HIL experiments. As can be seen, the phase delay of the electric drive may become an issue already at frequencies two orders of magnitude lower than one would expect.
In any case, the unexpected response of the considered electric drive is not as problematic as it may seem. In Section 4.1.2, it is shown that the mathematical descriptions of the shaft speed loop, derived in Section 2, still accurately represent the response of the HIL setup.

Closed shaft speed loop response
The HIL experiments to validate the mathematical descriptions of shaft speed loop are conducted with the actual current controller settings given in Table 2 and the friction compensation applied, while the moment of inertia is not corrected. This results in measurements that can be reproduced relatively easily. In the linear descriptions introduced in Section 2.2, the fuel rack map was not taken into account, facilitating the mathematical analysis. During the HIL experiments, however, the fuel rack map was included. Thus, for a correct comparison, the fuel rack map must be introduced into the linear descriptions. Doing so for all inputs and outputs mentioned earlier, one obtains the transfer function given in Eqs. (45) through (48), which also include engine derivative g.
To validate these linear descriptions, their predicted response is compared with results from actual HIL experiments. These experiments are conducted both in calm water and waves, which allows to individually evaluate the response of shaft speed ω and simulated drive torque M d,set on shaft speed setting ω set and propeller advance speed v a . First, the response on speed setting is analysed, followed by an analysis of the response on waves, which can be modelled as sinusoidal fluctuations of advance speed.
Values for δω * , δω * set and δM * d,set can be directly calculated from the measured shaft speed and set points for shaft speed and drive torque, stored in the data repository (Huijgens, 2020). In Eq. (13), it was shown how normalised values can be calculated for a given equilibrium point. For δv * a , however, calculating these normalised values is a somewhat more involved, as v a is not directly measured. Instead, the data repository contains measured wave heights, from which v a can be determined as shown in Eq. (49).
Eq. (49) merely expresses the amplitude of the advance velocities; as such, the trigonometric term containing time and frequency can be omitted. The theory supporting Eq. (49) was explained by, for instance, Molland (Molland, 2008). Wave heights were measured with a wave probe located close to the propeller. The wave probe essentially consisted of two submerged electric wires with a known resistance; by measuring the voltage potential across these wires, the water level was determined. Recalling that the equilibrium advance speed equals the speed of the towing tank carriage, δv * a can be calculated. Note that there is a 90 • phase lag between the observed water level and δv * a . To evaluate whether or not the response obtained during HIL is accurate, the relevant frequency range is important. The relevant frequency range depends on the considered environment and thus, the wave field. Therefore, attention is paid to the considered wave spectrum first.
In this paper, the wave spectrum described by Pierson and Moskowitz (1964) is assumed. Rather than reproducing entire wave spectra, regular waves were generated with wave heights and modal frequencies corresponding to different wind speeds. Modal wave frequencies ω p of up to 5 rad/s at model scale were considered; above these frequencies, the energy carried by the waves becomes negligible. At an equilibrium propeller advance speed of 1.73 m/s in head waves, this results in a maximum wave encounter frequency ω E of 9.4 rad/s. This in turn means that practically all wave energy is carried at encounter frequencies below 12.7 rad/s. Table 3 lists the properties of the regular waves during the HIL experiments. Realistic significant wave heights and modal wave frequencies were chosen within the capabilities of the wave generator at the Delft University of Technology (TU Delft). However, before evaluating the response on waves, the response on fluctuating shaft speed was analysed, as this input can be controlled more easily during HIL experiments.
Considering the relevant frequency range following from this wave spectrum, the speed setting is fluctuated with frequencies of 0.67 rad/s, 2.66 rad/s and 10.63 rad/s. As a reference, these frequencies correspond to 0.025 Hz, 0.1 Hz and 0.4 Hz at full scale. As such, both low frequencies and frequencies near the end of the relevant frequency range are covered. Figs. 18 and 19 show linear simulations of the response on fluctuating shaft speed setting and HIL measurements in which the speed setting was sinusoidally varied with an amplitude of 4% of the equilibrium setting. Comparing linear simulations with measurements, one finds that the criteria given in Eq. (32) are met for all measured frequencies. Consequently, the linear and non-linear descriptions of the practical scale model without inertia correction are indeed valid, at least for the response on shaft speed setting. Note that this validation applies to both the shaft speed loop of the practical scale model and the ideal scale model: their transfer functions are the same, with differences occurring only in the values parameters.
It can be argued that sinusoidal variations with such a limited amplitude as in Figs. 18 and 19 are not sufficient as a validation, as they do not provide insight into the non-linear behaviour of the shaft. Moreover, as frequencies higher than 10.63 rad/s are not considered, the response on very small time scales remains invalidated. With this in mind, the response of engine speed on an 11.1% step change in engine Table 3 Parameters of different regular wave fields during HIL experiments, with corresponding wind speeds according to Pierson and Moskowitz (1964). The fluctuations of normalised propeller advance speed δv * a are calculated from an equilibrium advance speed of 1.73 m/s and a propeller hub immersion depth of 0.418 m.

Wave index
Aw  Fig. 20. A delay of several milliseconds can be observed, caused by the relatively slow response of the electric loop. Still, it can be visually verified that measurements and non-linear simulations are well aligned. Although this analysis is not as quantitative as the analysis of the Bode diagrams, it can be concluded that the mathematical descriptions are valid also for nonlinear phenomena in the propulsion system, while dynamics on small time scales are accurately described, too. This leaves the linear descriptions for response on fluctuating v a to be validated. Due to the limited amount of time available in the towing tank, this response was validated only with the numerical inertia correction applied, as will be shown in Section 4.2.

Validation of numerical inertia correction
As was indicated in Fig. 16, the second validation step concentrates on the performance of the proposed corrections. Particular attention is paid here to the numerical inertia correction. This is done for both the response on shaft speed setting and incoming waves. The response of shaft speed and simulated drive torque on fluctuating shaft speed setting is plotted in Figs. 18 and 19, showing a good correspondence between measurements and linear predictions. This indicates that the numerical inertia correction, as described by Eq. (44), indeed results in accurate emulation of the shaft dynamics of the ideal scale model, at least for the response on shaft speed setting. The step response shown in Fig. 20 shows that this also holds for non-linear behaviour and behaviour on small time scales.
Second, the performance of the HIL setup with numerical inertia correction was validated in waves. To this end, measurements were conducted with the waves described in Table 3, and compared to linear predictions of torque and speed response. Note that these linear descriptions were validated in Section 4.1.2. The resulting measurements and linear simulations are shown in Figs. 21 and 22. Compared to the frequencies of speed setting fluctuations, these waves have a considerably smaller frequency spread. This is the result of the limitations of the wave generator and the choice for realistic peak frequencies and significant wave heights at a fixed advance speed in head waves. Validation in a wider frequency range could be obtained by conducting   mat, exp_235.mat, exp_236.mat, exp_237.mat and exp_238.mat, stored in the measurement data repository (Huijgens, 2020). experiments also in quartering waves and at higher equilibrium advance speeds; such additional experiments are left for future measurement campaigns. The Figures show that for the considered wave encounter frequencies, the predicted gains align very well with measurements for both speed and torque response. For the phase, however, a considerable error can be observed.
These phase errors are practically the same for speed and torque, and increase with frequency. An almost certain explanation for this error is a flaw in the measurement setup: the wave probe was located slightly behind the propeller, causing wave peaks and thus, advance speed peaks to be measured slightly later than their moment of arrival at the propeller. This in turn resulted in a phase error in positive direction. Indeed, all phase errors seem to correspond to a rearward offset of the wave probe of approximately 0.07 m, as Table 4 indicates. Thus, these errors can be attributed to imprudent mounting of the wave probe rather than an inaccuracy in the numerical inertia correction algorithm.
In fact, a certain forward offset of the wave probe relative to the propeller is recommended in future experiments, as such an offset would minimise the interaction between the propeller and measurement probe. Moreover, as measurements in this paper show, the phase delay caused by such an offset can be accounted for relatively easily during postprocessing.

Conclusions and recommendations
Hardware in the Loop has the potential to increase insight into the complex interactions between propulsion machinery and hydrodynamic phenomena around ship's hulls and propellers. Yet, a detailed analysis of the requirements to HIL setups for accurate emulation of propulsion machinery still lacks. This paper aims to provide this analysis in three steps, as the title implies. First, the challenges of HIL experiments in the ship model basin were identified in Section 2. Second, solutions to these challenges were formulated in Section 3. Finally, the simulations and measurements in Section 4 demonstrated that HIL can indeed be used to accurately emulate ship propulsion dynamics in the ship model basin.
The simulations and measurements shown in Section 4 allow to draw two conclusions. First, the linear and non-linear mathematical descriptions for the shaft speed loop introduced in Section 2 are valid descriptions of the speed controlled ship propulsion system. Thus, linear and non-linear simulations can be used to predict the dynamic response of such a system at model scale and full scale, also at small time scales.
Second, the proposed corrections allow to accurately emulate the shaft dynamics of the ideal scale model. Fig. 18 through 22 show that for both small sinusoidal fluctuations and large step changes in different  mat, exp_235.mat, exp_236.mat, exp_237.mat and exp_238.mat, stored in the measurement data repository (Huijgens, 2020).

Table 4
Observed differences between measured and simulated phase angles, following from Figs. 21 and 22. In addition to the observed differences, the right column shows the expected differences based on a 0.07 m rearward offset of the wave probe.

Wave index
Observed ϕ  kinds of input signals, all output signals respond as predicted by the mathematical descriptions of the ideal scale model. As these mathematical descriptions were validated in Section 4.1.2, this proves that the HIL experiments indeed accurately emulate the ideal scale model. An important concept in this respect is the relevant frequency range, or the range in which interaction between the simulated machinery and external disturbances is expected. In this paper, the upper limit of this range is set at 12.7 rad/s, based on the Pierson-Moskowitz wave spectrum. The measurements presented in Section 4 indicate that the considered HIL setup is indeed capable of achieving dynamic similarity up to this frequency. Yet, the relevant frequency range is not a static given, as it depends on the considered environment, the ship's speed and the factor for time scaling. For experiments at smaller geometric scales or in the cavitation tunnel, dynamics at smaller time scales may be relevant. Moreover, it was shown that the accuracy of the HIL setup depends on the dynamic response of the electric drive as well as the properties of the installed sensors. As such, not every setup may be suitable to conduct any experiment. In general, the relevant frequency range should be determined and compared to the dynamic response of the HIL setup before a HIL measurement campaign. Thus, it can be ensured that all relevant dynamic interactions are accurately emulated.
As a general conclusion, it can be stated that accurate HIL experiments in the ship model basin are possible. The presented HIL setup allows to investigate complex interactions between machinery and environment with an unprecedented level of detail, including dynamic interactions that were traditionally neglected. There are numerous complex phenomena that could be investigated this way, such as the interaction between machinery and ventilating propellers, or the performance of novel propulsion technologies in rough seas. As such, HIL in the model basin has to potential to improve the understanding of complex phenomena in and around the ship, and accelerate the development and acceptance of the ship propulsion systems of the future.
Finally, a general recommendation regarding HIL in the ship model basin is formulated. Introducing hardware in the loop into traditional experiments in the ship model basin adds a new layer of information to such experiments. At the same time, HIL requires relatively limited additional investment. Considering the increasing need for new technologies in the maritime industry and the uncertainties regarding the performance of these technologies in complex, dynamic environments, HIL can likely accelerate technological development and uptake within the maritime industry. It is therefore recommended to apply HIL in all future model basin experiments with dynamic environments.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.    Table B.8 Moments of inertia of the ideal and practical scale model propulsion systems. These values correspond to the downscaled dieselmechanical propulsion system and the actual HIL setup used to emulate this propulsion system. The moment of inertia of the HIL setup is considerably smaller because of lighter propeller material, a more compact propulsion motor and the absence of gear reduction. Added inertia I H2O is estimated according to Burrill and Robson (1962