I am trying to use the QuikTune Lua script on my newly built catamaran boat. But I cannot get the script to run. I have tried both activating it with a switch on my radio and using the Aux functions in MissionPlanner with no luck. I don’t get any output at all when I try to activate the script, no error messages.
I have enabled scripting and placed the script in the correct folder (I hope):
Your RTUN_RC_FUNC param is set to 301 (Scripting2), so you need one of your RC controller channels (with a 3-way switch) via RCx_OPTIONS set to 301 (Scripting2).
I have tried both 300 and 301 (Scripting 1 and 2). I do set the RC9_OPTIONS to the same value. I have verified in the radio tab that RC9 is moving when I move the 3-position switch on my radio. I have also tried using other switches/channels just in case. Nothing seems to be able to trigger the script.
I have tried while armed and in circle mode. I don’t get any output in the messages/console. I would at least expect an error message. I get the “Rover quiktune loaded” at boot, but nothing more.
I tried to download your log, but a need to “Request Access” first. Can you open up the sharing permissions so we can download it without needing a Google login?
Looking at your log, you’ve mapped the Autotune to both RC5 and RC9. Looking at the RC5 channel, it remains constant at 1000PWM for the whole log. RC9 is fine though.
My best guess is that Ardupilot is (internally) mapping the first matching channel to the scripting subsystem. Whether to call this a bug or user error, I’m not sure … Weird things do happen if multiple RC channels are mapped to the same function.
So, set RC5_OPTION to 0, then try again just with RC9.
That was a mistake. I should have set RC5_OPT to 0 when I switched to RC9 instead. I tried both of them.
I tried now with only RC9 set to 300. It still does not work. There must be something else wrong. I did the test on land this time, but the boat was armed and in circle mode. I expect some kind of output in the messages/terminal in MissionPlanner if it would work, right?
Continue to upload logs for troubleshooting. Otherwise we are only guessing.
You should see the boat begin making circles centered around the point where you initiated circle mode. When RC9 is set to the middle position, you should see some GCS message output about tune progression.
In your only log to date, RC9_TRIM is set to 987. I think you want that at 1500 to register a middle position.
It’s user error. How are you to know what user intent is? Which channel should be followed by the driver? The last one to change? The first one to change? The first indexed? No matter the developer decision on handling duplicate inputs, one could always argue that it’s a bug. Where ArduPilot could help is providing a warning message that multiple channels are set to identical functions.
This test/logfile was done on land. I have a bit of a drive to get to a suitable lake where I can test the boat in water. I would like to see some kind of message that the tuning starts before going to the lake.
I have also tried using the Aux-function → Scripting1 buttons in MissionPlanner. It does not work either.
I don’t see anything else glaringly wrong, but I do see that you’re using an F7-based autopilot, and I wonder if you’re running into memory issues that aren’t being reported.
Good to know about the F7. I ran the script in SITL with as close a boat configuration as I could get to @Axbri’s without breaking the sim, and it worked as well.
I’ve run the script multiple times (simulated and real) throughout its life cycle to date and never had an issue like this one.