Safe motor arming system
Powerful motors can cause serious injury! (Okay, so it's the prop that does the damage, but you get my drift...).
In this article I'll demonstrate a framework for creating arming systems which are (a) super safe and (b) avoid the need for switch checks at startup. Along the way you'll learn about the clever Sticky switch provided by EdgeTX and OpenTX. So join me as we explore how to do it.
Definitions
I'll use the following terms in the text:
- Arming: an action which allows the motor to run.
- Disarming: an action which prevents the motor from running, and stops it if already running. Note that killing is a special case of disarming, whereby the motor is disarmed unconditionally.
- Gesture: a user action which involves moving switches and/or sticks in a particular sequence.
What is an arming system?
From outside the black box, an arming system behaves like a simple switch. This switch is used for two purposes. When the switch is On, the motor speed is controlled by the throttle control. When the switch is Off, the motor is forced to remain stopped.
In this article, we'll first examine how to implement the arming system. Later, we'll look at how the arming switch is used in the motor and idle mixes.
Why use a Sticky?
The arming switch can be a physical switch, or a logical switch. For this article, we're going to use a 'Sticky' logical switch because it's super cool! Why? Because a Sticky is essentially an on/off switch where the 'on' and 'off' actions can be customised, and we can use this to build safe, convenient arming systems.
The Sticky switch takes two parameter, V1 and V2. Each may be a physical or logical switch.
- When V1 transitions to True, LS goes True.
- When V2 transitions to True, LS goes False
Here's the simplest possible example, where a Sticky emulates a 2-position switch:
Of course, this is not very useful (it's equivalent to physical switch 'SF↓'). However, things get interesting when V1 and V2 are logical switches, as this allows us to program gestures like 'stick in corner'. But before we explore further, let's explore the benefits of using a sticky over a physical switch...
No more switch checks!
One of the cools things about a Sticky switch is that it's False by default. Therefore, if we use a Sticky as the arming switch, we can be sure that the motor is disarmed at startup without switch checks.
However, to take advantage of this, we must ensure that the sticky doesn't go True (armed) immediately after startup. That means that the V1 parameter must not be a physical switch (since we cannot guarantee its position at the moment of power up - at least not without switch checks).
Instead V1 should represent a user-activated gesture, like moving a stick to the corner or pulling a momentary switch. Only when that gesture is fulfilled will the Sticky go True (armed). And that means that at least V1 must be a logical switch.
Example 1: safe arming system
Okay, so that's the theory, now to the practice! We'll program a real arming system, with the emphasis on safety. For this kind of system, (a) arming should be difficult so it can't be done by accident and (b) disarming should be easy (but not so easy as to do it accidentallly whilst flying the model).
As explained above, we'll use a Sticky switch with separate arming (V1) and disarming (V2) gestures.
Arming gesture:
- Throttle to idle
- Elevator stick back
- Pull momentary switch briefly
Disarming ('killing') gesture:
- Pull and hold momentary switch SH for 2 secs
The screenshot below shows the logical switches as they're entered in Companion.
Logical switch scheme
How it works:
- L3 is the Sticky switch for arming and disarming the motor. L1 is the arming gesture, and L5 is the disarm gesture.
- L1 is the arming gesture: throttle to idle + elevator fully back + pull SH.
- L5 is the disarm gesture:
- L5 goes True briefly, after L4 has been true for 2 seconds.
- L4 is true while SH is pulled, but not while arming ('!L1')
Note that 'Thr' and 'Ele' refer to sticks (not inputs). In the mixer menu, inputs are prefixed with 'I', sticks have no prefix.
Example 2: 'smart' arming switch
Many pilots like to use a simple 2-position switch for arming. As I mentioned earlier, there's a problem with using a physical switch: we cannot guarantee that it's in the the 'Off' position (disarmed) at switch on. (Yes, we could use switch checks, but we want to avoid them.)
However, there's a trick that we can apply so that the switch reports 'Off' at startup, regardless of the actual position. To do this, we put the physical switch behind a Sticky logical switch, with further logic for the V1 (True) parameter. Here's an example showing how 2-position SF can be made smart:
L2: Edge SF↑ [0, infinite]
L3: Sticky (L2, SF↑) -- arming switch
- The arming switch L3 is False (disarmed) at startup. It'll go True (armed) when L2 triggers.
- L2 triggers a brief True pulse when SF ceases to be Off, in other words, when it transitions from Off to On.
The key here is the word 'transition'. If SF is in the On position at startup, it will have to be moved Off then On in order to arm the motor. [Credit to Jesper Frickmann for this snippet.]
Note: In practice, a condition would be added to L2 for the throttle to be at idle.
Integrating the arming system
We've seen how to program an arming switch. In this section, we learn how to apply it to the motor channel. The aims are twofold: when the motor is disarmed, the motor is forced to idle. When armed, control is passed to the throttle stick.
In the following example. the motor is CH7, the arming switch is L3
CH7:Motor
Source=MAX Weight (−100%)
Source=Thr Weight (+100%) Switch (L3) Multiplex=REPLACE
How it works:
- The mix first line ('MAX') sets the motor to motor off. This is the default state.
- The second line ('Thr') is active when L3 is true (motor armed). It passes control to the throttle stick. The 'multiplex' option must be set to 'Replace', so that the first line is ignored.
Using Channel Override special function
In theory, you could use a Channel Override special function to turn off the motor. However there are some drawbacks:
- It will not be possible to determine if the motor is running via a logical switch
- It's more difficult to debug since the logic is split between two menus
- There will be some data duplication.
I don't recommend this approach.
Download
Arming/kill switch demo
Requirements
- For OpenTX 2.2 and above
Files
- MotorArmKill.otx (arming/kill switch operating on CH3)
Safety first!
- Remember to set the failsafe, so motor goes to idle on loss of signal
- Use the channel monitor to test operation before connecting up the motor
- Test, test and test again
