Hydrofoil Arduplane setup sonar sensor

Hello everyone! I am currently trying to setup an electrical hydrofoil craft built from 3D-printed plastic. I am using Pixhawk Cuav V5+ and latest update of arduplane. All servos seem to work well to adjust roll, pitch and yaw. But I am having some trouble with my propellers and ESCs.

First: I use ESC: Hobbywing platinum v4. 60A with Super BEC 5-8V plugged in on the rail on the pixhawk. There is also an additional cable on the ESC for RPM that is currently not plugged in. I have 2 propellers plugged in on M1 and M2 as “Throttle”. Min/max PMW for both servo outputs are currently set to 1100 and 1900.

The problem that I have is that when pushing throttle up, the propellers first start to turn at around 1450 PMW. And the biggest concern is that they accelerate up to the right RPM very slowly. It is not responsive at all. What could the problem here be???

My second concern is that I would like to implement a sonar sensor (that I have already successfully implemented in range finder, seeing acccurate values) to control the height of the vessel. My thought (that I am not sure if it works in arduplane) is to somehow set at what height the vessel should fly, and that propellers and flaps will automaticly control to maintain this exact height, creating a smooth ride. Is there someone out there who knows how to do this? Please see pictures attached!

Thank you in advance!!!



Arduplane doesn’t support using rangefinder for altitude control (except for landing flare).

If you aren’t flying over wavy water you could configure EKF to use Rangefinder as altitude source. If you get waves bigger than few cm EKF may not like that.

you might need to look at programmable ESCs like vesc, where you can map 1000-2000 directly from 0 to max motor RPM, that way they should stay perfectly in sync and not change RPM with load or voltage.

Thank you for your input! I have tried the to make rangefinder as altidtude control, and it seems to work. I see in missionplanner that the current height changes with rangefinders values. But I do not quite understand what EKF does? The boat will only be driven in a lake, so the waves won’t be too big. But after making rangefinder the altitude source, how can I use this as an input to control the propellers or even the flaps to regulate the height? Again, thank you for your response!

Thank you for your answer. I don’t know if you misunderstood my problem, or if I misunderstood your answer. I am not in need of changing the RPM from 1000-2000 instantly, I just need a decent responsive RPM change after the throttle movement. Currently it takes a couple of seconds from the moment that I move the throttle, until the propeller has reached its rightful RPM. It seems to be slowest in the beginning. I am wondering if the problem is ESCs or if the electronics somehow has too much of a powerloss due to bad connections or something. Could it be a problem that the ESC has BEC connected to the rail on the pixhawk and also power via powermodule? I have not done any ESC calibrations etc, is that needed? I somehow don’t manage to do it in arduplane. Thank you for your time!

no when i say 1000-2000 I mean RC range of 1000-2000us

when you say RPM change are you monitoring the actual RPM or are you talking about the PWM output from the flight controller?

Have you calibrated the ESCs to get them to operate with the throttle range you have set? If you haven’t calibrated ESCs then who knows what they are doing…

The esc might not like the high drag with low rpm, it could have some kind of low power protection preventing full power at low speed like phase current limit.

I am talking about the actual RPM of the propellers. I have not yet calibrated the ESCs due to not knowing how to do it. It doesn’t seem to work under “ESC Calibration” in Arduplane somehow. Could you please describe how to properly do it in Arduplane? I am quite new to Ardupilot. If the calibration does not work, maybe I’ll try to swap ESCs.

plug The Escs one at a time into the throttle output of your receiver and calibrate them that way,

set the throttle to max, then plug in the battery in, once you hear three beeps put the throttle down to idle and it should do a long beep and it should be calibrated.

Thank you very much, I will try this!

@nores Can you provide news in the future how your project is going? I´m also interested in making ArduPilot work for an actice stabilized hydrofoiling RC boat.
I´m currently sourcing all the parts I need, so I´m a little bit behind you.

Hello Johannes! Everything is finally assembeled and I got to try it out for the first time this week. It works okay in FBWA, but I have to manually control the height with the pitch of the aft wing to make it fly. But it managed to stay up for at least 10 seconds straight. But I still had some difficulties with calibrating the ESCs. I tried with another ESC + calibration, and then the propellers worked fine, but they went both directions which was a bit annoying. I don’t know why its like this, because I have chosen min and max on the servo function to be 0 and 100. Does anyone know what the problem could be? Also, in FBWB the propellers turn constantly at a set RPM, and it does not work to stop. I have some problems with this and takeoff-mode. I would like a takeoff mode that makes the flaps go down max, and thrust until at a certain height, and then want the boat to control it self using FBWB mode (or any other mode that does this). Does anyone know hwo to solve this?

Thanks in advance!

IIRC FBWB doesn’t support dropping throttle to 0 as a command (it will drop to 0 to drop speed but will always try to maintain minimal airspeed.

I am afraid that for proper control you would need to write pretty much a complete vehicle control system either in C++ as a new vehicle type or implement all the logic in Lua.