2.1. Mechanical Design
The overall wing and mast design and placement were influenced by the requirements that the craft needed to be affordable, modular, and easy to work on/modify. Furthermore, the goal was to minimize submerging electronics, as this would lead to premature failure or the requirement to obtain costly fully waterproofed electronic parts. The chosen design uses a dual-wing configuration, with a large front wing producing most of the required lift and a smaller stabilizing wing at the rear.
Table 1 illustrates a summary of the vessel’s design specifications.
Figure 1 illustrates the wing configuration. The front wing is situated just in front of the center of gravity, while the rear stabilizer wing is smaller and situated at the very back of the vessel. The front wing is split into two individually actuated wings, allowing their angle of attack (AoA) to be controlled independently to provide roll and pitch control. The wings are actuated by servos, which are kept inside the hull to minimize contact with water. A twin-mast design was chosen to facilitate this, as it provides a hinge mount for each wing half and shafts to run linking rods between the wing half and the servo in the hull.
An underwater thruster is used to provide propulsion, as this is simpler and introduces less wear than using gearing and shafts paired with a motor mounted in the hull. The underwater thruster is mounted underneath the rear wing, at the bottom of the rear mast. The rear mast is bolted off the back of the hull and can pivot around this point, which provides yaw control of the vessel. This design was chosen over a rudder as it is more robust and simpler, especially in such a small vessel.
Wings are a key component of hydrofoil vessels, and there are numerous factors to mathematically analyze, including the lift, drag, and profile [
8]. The NACA wing profiles are well-researched aerofoil profiles that can be applied to hydrofoil crafts as well. A NACA2412 wing profile was chosen for this craft, as it is well researched and provides a good balance between lift and drag. The NACA2412 is also designed for slow velocities, which lends itself well to this hydrofoil vessel [
9]. The National Advisory Committee for Aeronautics (NACA) have developed several different aerofoil types, characterized by their four-digit code. The NACA2412 profile has a maximum camber of 2% located at a distance of 40% from the leading edge and has a maximum thickness of 12%. The percentages are based on the aerofoil’s chord length [
10]. While there may be better-performing wings for this application, which involves cruising speeds far slower than aircraft and wings submerged in water rather than air, the theoretical calculations (shown below) indicated satisfactory performance. As in-depth research, calculations, and testing of different wings to determine optimal wing type and design are not in the scope of this paper, the decision was made to simply use the NACA2412 profile.
Once the profile has been selected, there are still several other wing parameters that need to be calculated to suit the operating conditions [
11]. The standard mean chord length (SMC) is the mean distance from the front to the back of the wing, in the direction of the fluid flow. The wingspan is the width of the wing, or the size of the wing perpendicular to the fluid flow. Multiplying these values together yields the wing’s cross-sectional area. The higher this value, the more lift the wing produces, but also the more drag it produces. The aspect ratio is the ratio between the wingspan and the chord length [
8]. The higher the aspect ratio, the longer and narrower the wing is, producing less induced drag (better efficiency) but reducing structural strength. The lower the aspect ratio, the shorter and broader the wing is, producing more induced drag (less efficiency), but increasing structural strength. The SMC and wingspan can now be calculated for the front and rear wings, based on their required lift. The drag force for the designed wing can also be calculated. This is accomplished using the following equations [
11]:
where:
L is the lift force in Newtons;
is the coefficient of lift;
D is the drag force in Newtons;
is the coefficient of drag;
p is the fluid density in kilograms per cubic meter;
V is the desired velocity in meters per second;
A is the maximum projected area of the wing in square; meters
R is the aspect ratio;
b is the wingspan in meters;
is the standard mean chord length in meters.
The parameters should now be populated to calculate the area of the wing, and thus the chord length and wingspan. The coefficients of lift and drag vary depending on the angle of attack [
12]. As such, the ideal lift-to-drag ratio (maximum lift for the smallest amount of drag) varies with wing angle of attack. The angle of attack is the angle between the standard mean chord length and the fluid flow. At a 0° angle of attack, the wing is parallel with the flow and produces the least lift. As the angle of attack increases, the wing will produce more lift and more drag. For the NACA2412 profile, the optimal lift-to-drag ratio is at 4°. As such, the coefficient of lift used to determine the wingspan and chord length was 1.1854 [
12]. The lift force in the calculation should be the vessel’s weight, which allows the vessel to set the wing to the optimal angle of 4° while cruising. An aspect ratio of 4 was chosen, as this is a good balance between structural strength and efficiency. The vessel’s weight during design was estimated as 5 kg. Previous experimental testing with the thruster demonstrated that 1.39 ms
−1 was a safe and obtainable velocity. The 1000 kgm
−3 density of pure water was used in the calculation. This was chosen as a good baseline value, since the vessel will be tested in varying conditions, and so an accurate water density value cannot be obtained. Using the equations, this yields:
The front wing surface area is thus calculated as 0.0428 m2, with a wingspan of 0.414 m and a mean chord length of 0.103 m.
As the front wings are designed to pivot, the formula can be repeated to calculate the lift force and drag force of the front wings for varying angles of attack.
Careful analysis of
Table 2 demonstrated that the chosen wing size would provide adequate performance, yielding sufficient lift without inducing too much drag. Furthermore, a maximum wing travel of ±10° will provide sufficient roll and pitch control. This will yield a maximum lift force of 97.061 N (9.904 kg) and a vertical acceleration of 0.992 ms
−2.
To simplify the design, the rear wing was based on the dimensions of the front wing. A large safety factor was used, and so the rear wing has the same chord length as the front wing but half the wingspan. This yields a wingspan of 0.207 m, a chord length of 0.103 m and a surface area of 0.0213 m2. While this was an overestimate, the rear wing is designed to be adjustable, so the wing could be adjusted to produce the exact amount of lift required. Furthermore, this safety factor allowed for error mitigation if the center of gravity of the final build was misplaced or any other issues arose.
Figure 2 demonstrates one half of the front wing assembly. The front wing is split in half, with one wing per mast forming the individual actuated twin wing design. A three-prong design at the bottom of the mast, paired with a through hole, is used to provide a mount and hinge for the wing. Both pairs of wings mount to their mast using the same shared 3 mm outer diameter steel rod, which ensures the wings are coupled to one another and rotate around a shared axis. The mast has two shafts, which are used to run control wire down to the wing, connecting the servo in the hull to the wing at the bottom of the mast. A dual control wire design (one wire on each side of the wing’s rotating axis) is used to create a robust and accurate actuation method.
The wings and masts are 3D printed out of polylactic acid (PLA), which was chosen for its affordability, accessibility, and ease of use. The masts are printed in two halves, glued together with epoxy, and reinforced with a 6 mm outer diameter steel rod. Each wing is also printed in two halves and reinforced with two 3 mm outer diameter steel rods. Each mast is bolted to the main hull using four M3 bolts, which allows for different designs to be mounted easily and rapid repairs/component replacements.
A single, pivoting mast was used at the aft of the vessel to support the rear wing and thruster, which can be seen in
Figure 3. The red part denotes the mast, which was also 3D printed in three parts, glued with epoxy, and reinforced with a 6 mm steel shaft. The thruster is bolted to the bottom of the mast, with the rear wing mounted using a 3 mm steel rod. The rear wing is also bolted at the back, with an adjustable mechanism that can be used to change the angle of attack (and so the lift produced) of the rear wing. The white part at the top is the hinge, which uses an internal 6 mm steel rod to facilitate rotation. The green piece bolts the entire rear mast to the aft of the hull.
A pre-made commercial “toy” hull was used. This hull belongs to a remote-control small catamaran boat, the M41 from Traxxas, McKinney, TX, USA. This hull was chosen for simplicity, and because it offered high strength while also being light, weighing 1 kg.
The wings, masts and any other 3D printed parts were designed and modelled using AutoDesk Fusion360 (version 2605.1.52) with an education license. All the 3D printed parts were sliced using OrcaSlicer (version 2.2.0) and printed using a CR-10 SE from Creality, Shenzhen, China.
2.2. Electrical Design
The primary focus during the electrical design was to minimize cost while ensuring sufficient reliability from the sensors, processing speed from the microcontroller to provide sufficient control, and sufficient power to ensure the boat was able to rise on the foils.
A T200 thruster from BlueRobotics, Torrance, CA, USA was used to provide propulsion. This thruster has a maximum power output of 645 W, producing 66 N of thrust with a maximum flow speed of 4.5 ms−1. This is controlled by a Electronic Speed Controller (ESC) from BlueRobotics, Torrance, CA, USA and powered by a 6-cell, 7000 mAh Lithium Polymer (LiPo) battery from Zop Power, Shenzhen, China. A 300 W DC-DC buck converter from Tenstar Robot Store, Shenzhen China is used to step the battery voltage down to 5 V for the other onboard electronics.
The boat is controlled by an onboard microcontroller, which is an Arduino ESP32 T-Display-S3 from Lillygo, Shenzhen, China and is programmed using Arduino’s C++ through Platformio (version 6.1.18). A 6-axis (3-axis gyroscope and 3-axis accelerometer) inertial measurement unit (IMU) from is used to measure the orientation of the vessel. The specific IMU used is an MPU6050 from EstarDyn, Shenzhen, China, which features an onboard digital motion processor (DMP) that uses a proprietary MotionFusion algorithm that fuses the values to produce orientation and acceleration values. These values have been tested independently and have displayed sufficient repeatability, accuracy, and low drift. A waterproof A02YYUW ultrasonic sensor from DFRobot, Shanghai, China is used to measure the vessel’s height above the water. This sensor also provides a built-in, proprietary filtering algorithm that supplies a smoother and more stable value. This algorithm can be disabled, as it reduces the updating frequency of the sensor, but the decision was made to use it, as noisy and spiky data would yield poor performance in the control loops. A Neo-6M global positioning system (GPS) sensor from Ublox, Thalwil, Switzerland is used to measure the current global position and heading of the vessel. The NEO-6M uses an internal Kalman filter to smooth the raw satellite measurements and estimate the current coordinates and heading. This provides a reliable and accurate heading value, but is subject to latency, which is why it is fused with the IMU heading.
Three onboard DS3235 3.5 Nm waterproof servos from Dsservo, Dongguan, China are used to control the two wings and the rear mast (acting as a rudder). A Micro Maestro 6 Servo Controller from Pololu, Las Vegas, NV, USA provides a control interface between the microcontroller and servos.
A FS-i6x handheld transmitter from Flysky, Shenzhen, China, paired with an FS-ia6b receiver from Flysky, Shenzhen, China, is used to allow an operator on the shore to remotely control the craft and provide inputs.
Figure 4 illustrates the different electrical components and how they are wired together.
The majority of the electronics are mounted inside a sealed acrylic box to prevent water damage from any water ingress in the hull. The waterproof servos are mounted outside this enclosure, and so is the LiPo battery. Both of these are resistant to splashing and brief submersion. Additionally, the servo cable connections are kept inside the acrylic box to prevent water damage. The LiPo cable connection is covered in a removable plastic seal to prevent electrical shorts.
It should be noted that an in-depth parts list can be found in
Appendix A.
2.3. Vessel Dynamic Model
A mathematical dynamics model is important to analyze and consider before exploring different control designs and routines. This is especially important in submerged hydrofoil boats, where well-performing control routines are required to ensure smooth and stable flight. To simplify the analysis, the dynamic models will be split into three separate 2D systems: the roll dynamics, the pitch (including heave) dynamics and the yaw dynamics. This is a reasonable approximation to make, as these three control areas are typically unlinked and independent during trivial foiling.
The heave and pitch dynamics can be modelled (respectively) using the following two equations:
where:
m is the total vessel mass in kg;
z is the vertical displacement in meters (upwards positive);
is the front wing lift force in Newtons;
is the rear wing lift force in Newtons;
g is the acceleration due to gravity in meters per second;
I is the mass moment of inertia about the pitch axis in kilograms per meter squared;
is the pitch angle of the vessel (nose up positive);
is the distance from the center of mass to the front wing (fore direction positive);
is the distance from the center of mass to the rear wing (fore direction positive).
It should be noted that the effects of waves are neglected in this model, as the dynamics of a foilborne boat are largely unaffected by waves (provided the peak wave height is lower than the vessel cruising height). Rather, the waves cause sensor noise, which presents a separate problem. Only one angle is denoted for the front wings (despite the fact that they can move independently) as pitch control requires the front wings to move together, so they share the same angle. The CAD models on Fusion360 were combined and passed into an in-built tool to determine the mass moments of inertia for the complete vessel. It should be noted that these values are estimates and not fully accurate, as developing an accurate model (with the correct weights and component mounting locations) is non-trivial. It was not possible to model the hull in CAD, as a commercial hull was used and the manufacturer did not supply any CAD files or dimensions. Furthermore, it is difficult to accurately model and capture every part used and its correct weight and placement to obtain a true model in CAD of the physical vessel. As such, it should be noted that the mass moments of inertia provided are estimates. Substituting in the known constants, a mass of 5 kg, a gravity acceleration constant of 9.8 ms
−2, an estimated mass moment of inertia of 0.4707 kgm
2, a front wing distance of 0.03 m and a rear wing distance of −0.4 m yields the following simplified equations:
The lift equations can now be substituted to further simplify the dynamic models. The same constants provided in the previous wing calculations can be substituted here, which are the front wing area of 0.0428 m
2, rear wing area of 0.0213 m
3, velocity of 1.39 ms
−1, and water density of 1000 kgm
−3. Simplifying the coefficients of lift is non-trivial, as they change depending on the angle of attack of the wings. However, careful analysis of the coefficients of lift in
Table 2 demonstrates a linear behavior in the operating range of the wings. As such, the coefficient of lift can be approximated in relation to the wing’s angle of attack by using linear regression. The sum of least squares method provides a line with a gradient of 0.190 and a y-intercept of 0.3445. Now, it should be noted that the wing angle of attack is based on its orientation relative to the vessel and the vessel’s orientation. As such, the orientation of the wing to be used in the formulas is the summation of the wing’s orientation relative to the vessel and the vessel’s orientation. For the front wings,
is used to denote the relative wing orientation, which is commanded by the control routine. As mentioned, the vessel orientation is denoted by
and the rear wing relative angle is a fixed 0°. As such, the following simplified lift equations are obtained for the front and rear wings, respectively:
This can now be substituted into the original equations and simplified to yield the following heave and pitch dynamics equations, respectively:
This process can now be repeated to determine the roll dynamics equation. Only one equation is required here, as it is assumed the vessel only rotates in the roll axis but does not translate linearly. This is a reasonable assumption as the vessel does not typically move sideways during operation, and the wings are not able to prevent this in any case. It should be noted that the rear wing is not present in this model as it does not affect the roll orientation of the craft. It should also be noted that there are two variables present for the front wing angles,
for the left wing and
for the right wing. This is because roll movement of the craft requires a moment imbalance, so the two wings move separately (to produce a lift imbalance in the vessel’s roll direction). It is also assumed that the craft’s roll orientation will not affect the lift produced by the wings. This is reasonable as the control loop should always be maintaining a constant 0° roll angle. The following roll can now be modelled using the following equation:
where:
I is the mass moment of inertia about the roll axis in kilograms per meter squared;
is the roll angle of the vessel (left wing up positive);
is the left (port) wing lift force in Newtons;
is the right (starboard) wing lift force in Newtons;
is the distance from the center of mass to the left wing (port direction positive);
is the distance from the center of mass to the rear wing (port direction positive).
The same equation as before can be used to model the lift equations for the two front wings, except that the area of each wing is halved, so 0.0214 m
2. This yields the following two lift equations for the left and right wings, respectively:
This can now be substituted into the original model. The mass moment of inertia in the roll direction is 0.089 kgm
2, the left wing distance is 0.104 m, and the right wing distance is −1.04 m. This yields the following simplified roll dynamics equation:
Finally, the yaw dynamic model can be obtained. This model assumes the vessel only moves forward in a straight line, and so there is no need to consider sideways motion in the vessel. As the forward velocity of the vessel is directly proportional to the thruster power, and not of relevance to the control loops, only the yaw rotation model will be obtained. It should be noted that yaw rotation is simply caused by rotating the thruster so that it is no longer in line with the center of rotation, causing the boat to turn in the yaw. This yields the following model:
where:
I is the mass moment of inertia about the yaw axis in kilograms per meter squared;
is the yaw angle of the vessel (turning left (port) positive);
is the distance from the center of mass to the left wing (aft direction positive);
T is the thruster force in Newtons;
is the angle of the thruster or rudder. A value of 0 is in line with the axis of rotation, so no turning. Positive angle is such that the vessel will turn right.
The known values can now be substituted in, which is a mass moment of inertia of 0.449 kgm
2 and a thruster distance of 0.4 m, yielding the following model:
2.4. Software (Control) Design
Proportional Integral Derivative (PID) control loops were used to keep the craft stable once foilborne. The choice was made to use PID loops over other control methodologies as they are simple to program, computationally efficient, well-researched, and work well in a range of scenarios. Analysis of the theoretical dynamic models of the vessel show that PID control loops are applicable. The dynamic models are all time-invariant second-order systems, which lend themselves well to PID control. It should be noted that the dynamic models reveal that the system does not have any damping. While this is likely due to an over simplification of the system (for example, water will present a damping effect to the system), it is still a fairly accurate conclusion as the hydrofoil vessel is largely undamped. This can result in the control loops causing oscillation, and the vessel movements are largely undamped, causing the vessel to tip over/retain its current state unless the control routine changes the wing orientation. This will require careful tuning, and as it will later be seen in testing, required modifications to the PID loops to improve the vessel stability and performance. While there are a variety of other control methodologies that have been researched and could have been used, the scope of this paper does not involve identifying and testing the optimal control methodology, resulting in the decision to use PID loops. Furthermore, the dynamic models showed that PID loops would be a possible control loop for this application, so they were initially chosen due to their simplicity. The control tasks were split into three main parts: roll, height, and yaw.
Figure 5 demonstrates the roll control loop. The purpose of this is to keep the vessel stable in the roll axis (the axis in line with forward motion). The PID loop’s input sensor value is the craft’s current roll orientation, which is supplied by the MPU6050 IMU sensor. The setpoint is set to 0°, as the boat is currently designed to always remain level in the roll axis. The PID loop output is a PWM output, in milliseconds. It specifies the difference (in milliseconds) between the high duration of the left-wing and right-wing servos’ duty cycle. As such, a single output is mapped between two servos, providing a differential value and allowing the output to affect only the roll orientation of the craft. The PID loop runs at a frequency of 50 Hz. The parabolic modifier was added to the proportional term after initial testing demonstrated the roll response is non-linear. The hydrofoil vessel requires much higher proportional gains at high error to ensure a fast response, while requiring low proportional gain at low error to avoid oscillations. This was implemented by modifying the proportional term to be a function of error squared, instead of just error. This changes the output to a parabolic curve, instead of a linear curve, providing high gradients at high error, but low gradients at low error.
Figure 6 illustrates the height control of the craft. The purpose of this control loop is to keep the hull at a constant desired height above the water. It is also capable of controlling the boat’s pitch orientation, but it only does this in order to achieve the main goal of a constant, stable height. A cascaded PID system is used, where the outermost PID loop determines the required pitch angle and then feeds this into the pitch PID loop, which brings the vessel to that required angle. The outermost loop’s sensor input is the vessel’s current height above the water, which is supplied by the waterproof ultrasonic sensor. The sensor is coupled with roll and pitch correction calculations to ensure it provides an accurate altitude value. As the sensor only has an update rate of 100 ms, this PID loop only runs when a new sensor value is received, which occurs at a frequency of approximately 10 Hz. The setpoint is a constant fixed value in millimeters, which was pre-determined with experimental testing. This value can be modified depending on how far off the water the hull should be. The output of this control loop is the required pitch angle in radians, which is sent to the inner PID loop. A cascaded controller has been used here, as it will yield improved performance compared to using a single control loop with only one sensor reading (as opposed to both an ultrasonic and IMU sensor). The ultrasonic sensor and altitude loop should not control the wings directly. This is because the ultrasonic sensor is unable to capture the orientation of the craft, which can result in the vessel climbing/descending at the wrong angle (and thus velocity), or oscillating around the set altitude as the vessel struggles to maintain a constant neutral angle. By adding a pitch control loop with a direct pitch angle sensor value, the vessel is able to climb and descend at accurate angles (and thus velocities) and maintain a constant altitude without oscillation. The exponential modifier was applied again to the proportional gain of this loop, as the altitude response of the vessel is highly non-linear. This modifier was also required as the pitch output is restricted to a maximum of 10°. As such, the outermost loop needs to have a high output until the error becomes quite small. Once the error has decreased, the gain required is very small, as even a 1° pitch change will cause a rapid altitude change.
The purpose of the inner PID loop is to maintain the required pitch angle. The input sensor value is the current pitch angle, which is also supplied by the MPU6050. The setpoint is based on the required pitch orientation from the outermost control loop. The output is a single value and specifies the adjustment to the high period of the wing servos’ cycle time. This moves the wings together, which changes the pitch rather than the roll orientation of the craft. A parabolic modifier was not used for this control loop, as a standard PID loop was found to perform adequately while testing. This PID loop runs at a frequency of 50 Hz.
Figure 7 demonstrates the yaw control of the craft. Its purpose is to keep the heading of the craft at the required orientation. The input sensor value is the current yaw (heading) angle supplied by the MPU6050. It should be noted that the MPU6050 does not have any onboard magnetometers, and so the heading angle is not relative to true north. The yaw angle is repeatable and has minimal drift (0.5° per minute, experimentally determined), but it is not accurate. This makes the control loop capable of reliably maintaining a steady heading, but sensor fusion is used with the GPS sensor to maintain an accurate GPS heading for autonomous waypoint driving. This control loop operates at a frequency of 50 Hz. The output is in milliseconds and specifies the duration to modify the rudder servo uptime. The error calculation for this PID loop was modified, as there are two possible errors when dealing with heading. This is because the craft can rotate clockwise or counterclockwise, and the direction of the shortest angle to turn can vary depending on the situation. As such, the PID loop was updated to calculate both errors (a positive and a negative error) and only retains the error with the smallest magnitude. Testing demonstrated success using only a proportional gain, which is why this control loop does not have an integral or derivative term.
As each PID loop input (to calculate error) uses a value directly supplied by a sensor, and each sensor is using its own onboard, proprietary filtering, no additional filtering is performed on the onboard microcontroller. The sensor filtering and fusion are handled on the sensor side, and so the only sensor fusion taking place on the ESP32 is the fusion of the IMU yaw and the compass heading.
The GPS autonomous driving methodology was trivially designed to provide a simple but reliable proof of concept for autonomous driving of the small hydrofoil craft. The algorithm drives the vessel in a straight line between GPS waypoints. The onboard Neo-6M GPS sensor reports the current GPS coordinates each second. When this occurs, the microcontroller calculates the spherical distance to the desired waypoint from the current GPS location. From this, the required heading is calculated. The GPS sensor also reports the current heading each second, and so the error is then calculated based on the current GPS heading and the required GPS heading. This error is passed into the yaw PID loop by using addition to update the setpoint. This sensor fusion uses the accuracy of the GPS heading (which is also aligned with true north) to ensure the craft drives with an accurate heading, while using the higher update frequency of the MPU6050 to maintain a stable straight line until the next GPS heading update is received. Testing has indicated that there is latency in the GPS heading value while the craft is rotating rapidly in the yaw. As such, the vessel will rely exclusively on the MPU6050 yaw value until it has remained within ±20° of the yaw setpoint for 3 s. If this is not done, the GPS will output incorrect headings, which will result in excessive rotation and prevent the vessel from travelling in a direct, straight line to the target coordinate.