Repository navigation
How to simulate a pyro-cartridge launch of a UAV in ArduPlane SITL (XX-1 example) #11
Mission-analyzer
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The task
XX-1 is launched by a pyro cartridge (angle about 45°). Three things are known: the altitude the aircraft is thrown to
(about 30 m), the speed it gains (about 37 m/s) and the cartridge action time (about 2 s). From these the acceleration
along the trajectory is about 18–19 m/s², and for a mass of 200–220 kg and an angle of 45° the thrust is about 5–6 kN and
the impulse about 11 kN·s (an estimate). How can such a launch be reproduced in ArduPlane SITL?
Which launches ArduPlane SITL provides
considered here).
--model plane-catapult) and give asimple simulation: while the output of servo channel 7 is above 1700 µs (ArduPilot's own tests set channel 7 to
2000 µs for this), an additional forward acceleration is applied to the aircraft for a fixed time:
-catapultis a catapult, 15 m/s² for 2 s (about 30 m/s ignoring friction);-bungeeis an elastic bungee cord, 7 m/s² for 4 s (about 28 m/s);-throwis a hand throw, 25 m/s² for 0.4 s (about 10 m/s).None of them is a pyro cartridge, so a home-made variant is needed for XX-1. What can be done is shown below.
Options
-catapult,-bungee,-throw)0.3·v, so the speed at the end of the launch is 24.5 / 19.3 / 9.9 m/s against a model stall speed of 30.2 m/sWhat the chosen script does
ARM is the autopilot state in which it allows the motors and servos to work (the ARM button or command; the opposite is
DISARM). The script triggers on the transition "disarmed → armed".
along the current heading, flight path angle 9°, pitch 12°. Then it switches to AUTO (to FBWA if the aircraft has no
mission).
sim:set_pose) is taken from ArduPilot's official examplesim_arming_pos.lua. The parameters areconstants at the top of the file rather than
SIM_APOS_*parameters: parameters created by a script cannot be set ina defaults file, because they do not exist yet when it is loaded.
about 37 m/s (38 m/s in the script). The flight path angle (9°) and the pitch (12°) are chosen close to equilibrium,
with an angle of attack of about 3°.
Autopilot parameters
The script needs
SCR_ENABLE=1(enables scripting),AHRS_EKF_TYPE=10andEK3_ENABLE=0(andEK2_ENABLE=0). This iswhat the ArduPilot developers themselves do in a test with a forced pose: the AHRS comes from the simulator, otherwise
the navigation filter sees a jump in position and velocity. The price: the navigation estimate follows the true state of
the simulator rather than the sensors.
Installation
Put the file into the
scriptsfolder next toArduPlane.elf(SITL loads every.luafile from it), set theparameters above (for example through a
--defaultsfile or in the console) and start SITL with your aircraft model. Ifthe parameters are set through
--defaults, start SITL with-w, otherwise values stored by an earlier run willoverride them. Connect, load a mission and press ARM: the aircraft appears in the air.
How it was checked
launch when ARMed in the air, the FBWA fallback, waiting for a position, a
set_poseerror).30 to 44 m and accelerates from 37 to 47 m/s in 30 s; there is no stall (minimum 36 m/s against a stall speed of
30.2 m/s).
this is expected, the autopilot (AUTO or FBWA) has to damp it.
Limitations
sim:set_poseworks only in SITL.SCR_ENABLE=1SITL loads every.luafile fromscripts/.Adapting it to another aircraft
time) determine the state of the aircraft at the end of the cartridge action. Take the flight path angle and the
pitch close to equilibrium (angle of attack 2–4°).
The script
License: GPL-3.0-or-later (the script follows the approach of ArduPilot's official example).
All reactions