This is a quick video demonstrating a new copter-fast-descent Lua script included in ArduPilot Copter-4.2 that is currently in beta testing.
(sorry about the video quality, I just taped a camera onto the copter)
The purpose of the script is to allow a multicopter to descend more rapidly than it normally could by spiraling down instead of just descending straight down. In this particular case it descended at 8m/s but it can go faster.
I should add that there is actually some debate within the dev team on whether a well tuned multicopter should have problems when they descend straight down through their prop wash but in any case, the script also shows off a few new features of Lua scripting with ArduPilot-4.2:
- Lua scripts can now create their own parameters (previously they had to always use SCR_USERx parameters) which makes it easier to remember what each parameter does
- Lua scripts can be executed from within Auto missions using the NAV_SCRIPT_TIME mission command. This command is not yet listed in Mission Planner’s command list but it can still be added using the “UNKNOWN” command option (set the “command ID” to “42702”). For this test the mission was simply a takeoff to 150m, a NAV_SCRIPT_TIME command and then an RTL.
This script also makes use of Lua script’s ability to specify the positions controller’s target position, velocity and acceleration all at the same time which means the vehicle does a better job of staying on the spiral path than a position-only control could do.
Here’s another video of the feature from a test with AttracLab who plans to use it for a 10km descent in the coming months.
Really interesting. Is this going to be incorporated into a flight mode?
No, I think we will leave this as a lua script. It is one of those feature that is interesting and useful but only to a small number of users in very special cases.
We are thinking about allowing new flight modes to be completely written in Lua but until then this feature can still be executed from within Guided or Auto mode so users can still hopefully give it a try easily.
Hello @rmackay9 ,
Is it possible to execute this Lua Script for Quadplane Vtol?? If yes how? Any youtube tutorial will be very useful… Tks
Sorry, I somehow missed your post.
It should be possible to modify the script to work with quadplanes but I’m not 100% sure. Certainly plane supports NAV_SCRIPT_TIME and Tridge and others have done videos showing all kinds of acrobatics being done in Lua
… and we’ve got a wiki page here discussing how to use Lua.
I’m just not an expert on quadplanes so I don’t have all the answers I’m afraid…
Thank you for your response… Regarding the Quadcopter descent speed, What is the Safe maximum normal down speed in Auto mode?? I ask this question because some times I need to do RTL at 350 m or higher (for safety reason)… And in this case I need to do high down speed (just “Ordinary down speed” without Lua script…) . I have tried 3 m/s, is still ok,
but I prefer to have 5m/s or more if it is safe…
Any advice??? Tks…
I think it depends upon how good the tune of the vehicle is and in particular whether the motor thrust scaling has been done. I’ve seen videos from Leonard of a large vehicle descending at 5m/s without any problems but I’ve seen other vehicles become quite unsteady at even 2m/s.
I think if your vehicle is able to descend at 3m/s that’s quite good. Maybe just try higher speeds and see how it does?
I suspect that if the descent is not straight down then the vehicle will be able to descend more quickly but this is inconvenient.
Hi @rmackay9 ,