Scheduled Autonomous Flights in ArduPilot / PX4

Hi Everyone,

Does anyone have experience with scheduled autonomous flights in ardupilot ?
What actually I want is that :
Once I plan and upload a particular mission file in Multicopter.

  1. The copter should take off after every pre set time (for example every 1 hour).
  2. Complete the mission.
  3. Return to Home
  4. and Take off after 1 hour again

If there is no such feature kindly guide me some basic steps to complete this application
Like Maybe I can use drone kit / MAVSDK or something like that

Lua scripting looks like the best fit for this simple application. You can get the absolute time from the GPS, and you do not need an extra companion computer

2 Likes

You can do this with available commands. Delay with a 1hr time, Takeoff, waypoints, RTL, then a DO_JUMP to the Delay command.
This Mission Delays start for 60 sec runs the mission and repeats twice.

You could start the Mission with a UTC time instead of an elapsed time if you want. That would require 2 Delay’s and 2 DO_JUMP commands to start the Mission on the clock and then run it every x minutes/hrs.
Like this:

3 Likes

I’m just trying this in SITL and it’s disarming after the RTL.

Edit: DISARM_DELAY…

Runs good for me. Did you set the AUTO_OPTIONS and the DISARM_DELAY?
I have flown a lot of missions like this, there are some pesky parameters to setup :slight_smile:

There seems to be an issue with my 2nd mission with the DO_JUMPS but I’ll figure it out

DISARM_DELAY fixed it, but would that mean the quad blades would be spinning the whole time it’s sitting on the ground? AUTO_OPTIONS,3 is set already.

Yes if MOT_SPIN_ARM is >0.

1 Like

More of those pesky parameters. :slight_smile:

Ha! We can probably see this in the Status screen while it’s sitting in Delay with the commanded RCouts.

The simulator is great for stuff like this.

Note: the problem with my 2nd Mission above was I had 0 in the Repeat# field of the 1st DO_JUMP. Works as intended now!

1 Like

I was thinking something external, like a arduino or similar to power everything up on a schedule (or via some external signal). Maybe it could just interrupt the flight controller Vcc instead of dealing with issues related to connecting and disconnecting the main battery supply.
And set up a landing pad that charges through contacts on the landing gear.

The charging pad must be set to charge the flight battery (enough) even while it is connected and in use. A standard charger wont do this unless it has a power supply mode where you can manually set the voltage.

Thanks for the advice. But in my case this mission schedule has to be followed on daily basis. not for single use only…
In short , A fully automated flight with minimum (or almost zero) pilot input. Like a automated security guard that takeoff and visit waypoints in mission defined

Brother my requirements are 99% similar to yours. We can have discussion about these points
May be it can benefit both of us.
Some points like

    1. Arduino Power up FC and automated flight then
    1. Battery charging through contact points
    1. Charging pad concept
    1. Automated charging with no user setting input

I think Dave’s approach could be made to work, but it may not be the most practical over the long term if this is an ongoing task. Have you looked at LUA scripting? It seems to be the answer to a number of the “out of the box” tasks that get discussed here. Depending on the flight controller you’re using it may not require the addition of any hardware.

1 Like

Yes, you could configure it to work as asked with common mission commands but perhaps not the most practical over the long term.

1 Like

I think Dave’s approach might make for a good proof of concept if you are trying to make a precision landing on some sort of charging dock.

Otherwise, Lua will be your friend in the long term.

See this topic for a Lua script that calculates UTC from GPS time and week data.

2 Likes

Thanks Guys for the support… Will update you guys about LUA script soon…