Safe motor arming system
Introduction to arming
Stick a propellor on the end of a powerful electric motor and you have the potential for some great fun... but also, sadly, for injury.
Our radios provide only basic protection against accidental operation (if you want some background, have a look at my blog post). Fortunately with OpenTX and EdgeTX we can minimise if not completely eliminate the hazard.
To this end, I'm going to describe a simple and flexible framework for designing a motor arming system, with emphasis on safety, and simplicity of operation. The method is well proven in my E-Soar Plus templates, available for OpenTX, EdgeTX and Ethos.
By the end of the article, you should be able to design and construct your own customised arming system. You'll also learn how to use the powerful 'Sticky' switch.
What is a 'safe' arming system?
Different people will have different ideas, but I'll throw out four conditions for an arming system to qualify as 'safe':
- The motor must be guaranteed disarmed at startup, without the need for switch checks.
- A user action, or sequence of actions, is required in order to arm
- The throttle must be in the idle position before arming can be accomplished
- While the motor is armed, it will always respond to throttle commands until it's disarmed (predictability)
Definitions of terms
First, let's define some terms used 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. (Killing is a special case, whereby the motor is disarmed immediately and unconditionally.)
- Gesture: a user action which involves moving switches and/or sticks in a particular manner.
Implementation overview
An arming system consists of two parts:
The first part is the arming logic. From the point of view of the motor, the arming system is just a switch. When the system is 'On', the motor is armed and ready to run. 'Off' means it's disarmed and stopped.
The second part consists of two mixes, one to control the motor using the throttle, and the other keep it stopped. The arming switch is used to switch between these two mixes.
The Sticky logical switch
For the arming logic, we will use a Sticky logical switch - think of this as a programmable on/off switch, where the on- and off-actions can be gestures. Before we progress, here's a quick tutorial. If you're already familiar with Sticky switches, then skip this section.
A Sticky acts like a physical on/off switch, except that the 'on' and 'off' actions can be customised. The Sticky takes two parameters, V1 and V2. These define the on and off triggers. Each trigger may be a physical or logical switch.
- When V1 transitions to On, the sticky flips to On
- When V2 transitions to On, the sticky flips to Off
A simple example, where a Sticky mimics a 2-position switch:
With the example above, moving SF down flips LS1 true. Moving it up flips LS1 false. In effect, LS1 is equivalent to 'SF↓'. Not very useful!
Things get more interesting when triggers are themselves logical switches, as this allows us to flip the sticky using gestures like 'stick in corner + pull momentary'. But before we explore further, let's explore another benefit of using a sticky...
Arming without switch checks
One of the cool things about a Sticky switch is that it's off (false) by default. This means that the motor is guaranteed to be safe until the 'on' gesture is carried out - without the need for switch checks. Avoiding switch checks is a safety benefit since switch checks are easily bypassed.
To program the arming and disarming gestures, we'll make further use of logical switches.
Example 1: arming using a complex gesture
Okay, we're now ready to create our first arming switch. Let's set ourselves the following goals:
- Arming should be difficult so it can't be done by accident
- Disarming should be easy - but not too easy
We'll use a 3-step gesture for arming, and a 1-stepper for disarming.
Arming:
- Throttle to idle
- Elevator stick back
- Pull momentary switch briefly
Disarming:
- Pull and hold momentary switch SH for 2 secs
The screenshot below shows the logical switch scheme 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: arming via 'smart' switch
Some F5J competition pilots like to use a simple 2-position switch for arming. However, there's a problem with using a regular switch: we cannot guarantee that it's in the 'Off' position (disarmed) at switch on. That disqualifies it from being 'safe'.
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 On at startup, it must be toggled Off-to-On in order to arm. [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 switch
We've seen how to program an arming switch. In this section, we learn how to apply it to the motor channel. Two mixers are needed, one to force the motor to idle, and a second to pass control to the throttle stick when the system is armed.
In the example below, CH7 is the motor channel, and L3 is the sticky arming switch.
CH7:Motor
Source=MAX Weight (−100%)
Source=Thr Weight (+100%) Switch (L3) Multiplex=REPLACE
How it works:
- The first mix ('MAX') sets the motor to motor off. This mix is always active. The weight of −100% ensures that the ESC receives a low PWM value, which is the convention for 'motor off'.
- The second mix ('Thr') passes control of the motor to the throttle stick, but only when L3 is true (motor armed). The 'multiplex' option is set to 'replace', so that when active it overrides the first mix.
Notes:
- To reverse the throttle stick (so idle is fully forward), change the weight to -100% in the second mix line.
- In the Outputs menu, Min, Max and Subtrim should be set to their default values (-100%, +100% and zero respectively).
The Override special function - not!
Some pilots use the 'Channel override' special function to turn off the motor. However it has some major drawbacks:
- It cannot be part of an integrated arming system
- It is not possible to determine if the motor is running via a logical switch since Override bypasses the logic
- It's difficult to debug since the logic is split between two menus
I don't recommend this approach. (Interestingly FrSky agree, since their Ethos operating system - while similar in many ways to EdgeTX - does not provide an override function).
Download
Arming/kill switch demo
Requirements
- For OpenTX 2.2 and above
Files
- MotorArmKill.otx (arming/kill switch operating on CH3)
Safety first!
- Use the channel monitor to test operation before connecting up the motor
- Remove the propellor for first tests
- Test, test and test again
- Remember to set the failsafe, so motor goes to idle on loss of signal
