Move servo on flightmode (Plane)?

Hi,

I want to open a camera lid with the servo when putting the plane into Auto flightmode.
I use RC-channel 5 out on the receiver for six flightmodes, one is auto.
I want to close the lid when putting the plane into any other flightmode.

How do I do that? DO_SET_SERVO in flight planner?

Or read channel 5 and if that is in flight mode auto, then open lid?

If the RC-transmitter dies, the plane enters RTL and then the switch dont matter. The best is if the controllers flight mode controls the camera lid. If Controller is in automode, lid should be open. If not, lid should be closed.

Regards
MickeM

I am admittedly new to Ardu, but what you described could be achieved directly in the radio. I have a Taranis with OpenTX and the action you described could easily be done by assigning a Special Function to your mode switch.

Yes you are completely right. Its the easiest way, after skipping the lid. :wink:

But… we have experienced memory loss when following our inthehead-checklists and been flying around taking a lot of photos… of the lid. :slight_smile:

But the worst is when we forget to close the lid, lands on dirty or dusty places and the lens gets full of dust/dirt. On the other hand, the lens dont move since it is a fixed one, but it gets dirty anyway. Before the lens moved and dust in lenses mechanics = no good.

Thats why we want to use any automatic way there is to do this using the auto-switch or auto-mission-flight mode. But how…

No one knows how to use flightmode Auto to also control a servo (open lid)?
And also when disengaging auto to any other flightmode to control the same servo (close lid)?

imho using flightmode auto as a condition for lid operation won’t really help if you’re doing takeoff and landing in that mode too.
maybe take a look at automatic landing gear functions https://github.com/ArduPilot/ardupilot/pull/7893
likely this can be used to set altitudes as a condition for autonomous lid operation.

mind this is in master, but not in stable firmware yet.

Like this:

  1. When the plane is on the table, the stand or the ground when getting ready, the flight mode Manual is on and the lid is closed.
  2. Then the “launcher” lifts up the plane, changes to flight mode auto, the lid opens and the plane can be hand launched.
  3. Lid is open when flying.
  4. And when it is time to land, we switch over to FBWA, lid closes, and we land manually with FBWA.

That was the plan. The lid wouldnt be forgot closed, as have happen before some times when its only on a switch.

That altitude-trigging “landing gear” (camera lid) sounds interesting. But I dont get what to do, messy thread and too much code for me.