Problem activating QuikTune Lua script

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):

Skärmbild 2024-04-26 114136

I do get the parameters as shown here:

I also get a message when booting:

Skärmbild 2024-04-26 114306

I am using a Mateksys F765 Wing WLITE flight controller with ArduRover 4.5.1.

I don’t know if this is user error on my side, or some kind of problem related to my flight controller or the ArduRover software.

Here is an image of my boat, just for inspiration:

2 Likes

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).

1 Like

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.

Everything else with my setup works fine.

Need to be in circle mode. I can confirm the script works exactly as advertised if you follow the instructions carefully.

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.

Need a .bin log to troubleshoot further.

Went to a lake to test the boat this morning. Still not able to activate the script. The boat was running in Circle mode. Here is a log file: https://drive.google.com/file/d/1Z6MK41LP2QL_o3KXgRrp99GutkQBsULn/view?usp=drive_link

In copter you have to turn on Quik and script enable after setting you RC to 300 then you reboot, after rebooting the hud will tell you it’s loaded.

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?

Sorry about that, it should work now!

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.

Here is a new log file after I set RC9_TRIM to 1500: https://drive.google.com/file/d/18Rmi3UwzVXAXNLE3qbMp4_lH1lpq0a8n/view?usp=drive_link

I don’t get any GCS messages.

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.

@rmackay9 any insight?

I’ve tested latest master with Quicktune on my F7 (MRo 2.1-777) flight controller. No issues running the Quiktune script.

@Axbri, could you set SCR_DEBUG_OPTS to 11? This will give additional debugging output on the state of the script.

1 Like

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.

I tried setting SCR_DEBUG_OPTS to 11 and got this output:

Skärmbild 2024-04-29 091357

No Lua-related messages after arming, when I put the boat in circle mode and tried flicking the RC9 switch. This test was on land again.

Link to the new log file: 2024-04-29 09-10-48.bin - Google Drive

Can you try setting LOG_DISARMED to 1? That way, the logfile will show the time before arming.

That could possibly indicate the scripting crashed/stopped on arming. It might be an out-of-memory issue, but ArduPilot should have caught that.

Here is a new log-file with LOG_DISARMED set to 1