With much of the code and working and sensors talking to my Arduino board, it was time for some real world testing this past weekend. I always try to find as much information online regarding sensor characteristics or what has worked for others, but at some point there is no substitute for empirical data.
At the heart of the feedback loop is our ability to measure altitude. We will be measuring altitude with a waterproof sonar sensor similar to those used in automotive bumpers. There is lots of data online about sensing all sorts of items including still / non-turbulent water. There is very little data online however, about the sensor's ability to accurately measure range to turbulent water. Not wanting to take my laptop out on the UFO for a live test, I decided to use my hot tub (jets going full throttle) to simulate very turbulent, moving water like we might see on a rough day on a UFO.
The results were good news / bad news. The good news was that the sensor seemed totally unbothered by the turbulent water (vs. flat water). The bad news is that the sensor's ability to give accurate readings drops off a cliff as the sensor becomes off perpendicular from the turbulent water. Some of this can be solved with filtering and throwing out values that are clearly nonsensical on the high or low side. But reality is that we will need multiple sensors mounted at different roll angles. We will then choose which one to read based on the heel angle of the boat. Luckily, we have a good IMU on board with accel's and gyro's that should help us pick.
I chose three sensors based on a +/-20 degree field of regard for the sensors and a max roll angle of +/-30 degrees for the UFO based on boat dimensions and a 1m ride height. Additionally, if the altitude sensor function in the code does not return a sensical value, I will have the PID loop operate under the assumption that elevation is unchanged or perhaps just max out flap camber. Typically, when heeled to windward, you want all the lift you can get and if you are heeled far to leeward you need to bring the boat back down off the foils and start over anyway.
Last thought, if the multi-sonar sensor approach seems too impractical a radar or laser/optical altimeter could also be used. These sensors are more expensive but tend to have much wider fields of regard. There are a few available with good documentation for Arduino and that operate at K or Ka band. X-band is impractical as GPS carrier signals are in the X-band and we may run into RF co-existence / self-jamming issues (should a GPS ultimately be necessary). As a bonus we could use a doppler radar / lidar to also get boat speed through water.
Thanks for reading!