BRD_SAFETY_MASK which outputs are which?

I’m trying to disable the output for my landing gear when disarmed using the BRD_SAFETY_MASK param. I can’t find any explanation of which outputs correspond to which outputs on the Cube carrier board. I know there are 14 total; 8 for motors, then another 6 pwm outputs. But how is the ordering of them? Looks like:
d497d60fed1ba5ac647521f61718def8c864a469

The one I am trying to disable while disarmed is the #6 highlighted by white. Would this be output #14 for the bitmask? This would assume outputs start with the motor outputs 1-8 then 1-6 highlighted in white corresponding to 9-14. Right?

indeed,
Blacks 1-8
Whites 9-14

1 Like

I don’t think BRD_SAFETY_MASK works the way you would like it to work.

BRD:SAFETY_MASK: A bitmask which controls what outputs can move while the safety switch has not been pressed

If you include your landing gear channel in this bitmask, landing gear movement would be enabled before the safety switch has been pressed.

Thinking about it a bit more, I’m not sure there is a way to disable Copter landing gear (disarmed) without scripting. I hope someone proves me wrong.

I can envision a script that would not only prevent landing gear movement while disarmed but also assert a prearm flag to prevent arming with the gear switch up.

It sounds like you’ve got a PR ready to go Yuri :slight_smile:

Would you (or the community) like a native feature like that? Worth submitting a PR to the source code rather than using a script?

I don’t have anything written, but I can’t imagine it would be difficult via script or C++.

A real PR is beyond my programming skills, but I can follow your scripts once you write them.
Thinking about it , this is like a couple of different cases, maybe best with a script…
Although it wouldnt be bad as an Option in the firmware and probably not a big code change. That would suit companies that do many builds and would like to set read-only firmware defaults for their aircraft.

  1. drone crew grabs their multirotor out of the shipping box, landing gear is retracted for transport, connect battery and lower the landing gear before setting it on the ground. Also have to retract after disarming to pack everything away → need to operate landing gear anytime
  2. drone newbie accidentally retracts gear before launching, damages payload → disallow landing gear changes when not flying
  3. should there be a delay? landing gear can be changed while disarmed within the first xyz seconds of powering up, or only after xyz seconds after disarming

We’re getting into a few scenarios and more complexity :frowning:
I’m sure the Devs are fully loaded with more critical things.

I feel like I’m overthinking it now, the current LGR params arent too bad.

I think the “right” answer is to enable a WOW switch in Copter (I think it’s Plane only right now).

Otherwise, a script is the way to go. How’s that for a compromise?

Weight on Wheels and others are already there in copter too

Well that’s easy then!

Plus, a WOW switch doesn’t even really need to be enabled in firmware. Just have it interrupt the power circuit to the gear when actuated. KISS.

In the script, I think a double switch actuation would suffice for disarmed behavior.

In other words, if the gear is up for transport and needs to be lowered for launch, flick the switch twice within one second. Otherwise, no change (other than a text warning).

1 Like

I’m not sure we’re talking abut the same thing, but I have what I am wanting working on two copters and via very simple means of:

After changing this parameter (a bitmask,) I am no longer able to accidentally flip my landing gear switch while the safety switch is not enabled, in other words, before launching or while on the ground. I’ve disabled “Output14” which corresponds to the black on white “6” on the outputs on the back of my carrier board:

This is all I was wanting to do, and satisfies my needs. I think in my post, I used the term “armed” in lieui of what I meant, which was with the safety switch not depressed. It satisfies my needs, but I think your idea to work it into an actual “armed” state, since lots of people don’t use the hardware safety switch, would be great and maybe better even for people who do. To me it seems like it would be a useful and much appreciated feature that might save a lot of people a lot of money into landfill waste. :+1:

1 Like