Thursday, 23 April 2015

Thoughts on programming motor control

Glider pilots love props! Well that seems to be the conclusion, judging from the requests to add motor support to my F3F and F3J setups. With my Multiplex Cularis ripe for conversion, I decided to take on the challenge.

The key issues with any power conversion are: (1) safety (2) preventing conflicts between motor and other functions and (2) providing a safe arming/disarming function. In this post, I'll describe my thoughts on how to tackle the project.

Motor Safety

An electric motor can generate a lot of power at the flick of a switch, so it's important that it always behaves predictably, irrespective of the flight mode. To this end my setup will abide by a simple rule:

Once the motor is armed, the motor state depends solely on one control.

In other words, when you push the motor control one way, the motor always fires up. Push it the other way and it always stops. It doesn't matter what flight mode you're in, motor always has priority.

Using flight modes to resolve conflicts

Giving motor priority over all other functions is all very well, but how do you deal with conflicts? For example motor and crow brakes should never be deployed simultaneously. A well designed system should prevent this without too much additional complexity.

A simple solution is to use flight modes, using OpenTx's flight mode priority mechanism to resolve conflicts. The first step is to have a dedicated 'Power' flight mode of highest priority. Likewise, crow brakes should be linked to a dedicated 'Landing' flight mode, of lower priority. Switching on the motor will activate Power mode, deactivating Landing mode and automatically releasing the crow brake.

One benefit of this approach is that it involves little or no extra programming, just the correct ordering of the flight modes. Another benefit is that a consistent aerodynamic environment is assured when under power.

Arming and disarming

A secure system of arming and disarming the motor switch is essential. The arming state must be independent of the flight modes.

Choosing a widget to control the motor.

The throttle stick is normally assigned to crow, so the only remaining choices for motor control are a switch or a side lever. Neither option is ideal - my setup will use a spare 3-position switch providing off/half power/full power.

Worth noting that the forthcoming FrSky X9E will also offer sliders.


Many of the required elements are already present in some form in my F3J setup, so I will base the new setup on this. Testing will be done using my MPX Cularis.

[update 8 May - ready for flight tests (MPX Cularis)]
[update 9 May - first flight tests completed]


Matthew Brett said...

Those safety switches I sent you a while back might be handy for the motor arm here - since they are "unknocable" they definitely fit your criteria for being very difficult to arm accidently.

Marco De Fazio said...

Mike, thanks for all the help with your website and blog, i have learned a lot from you.

There is a simple way of using the throttle stick to safely operate both the motor and the crown:

i use an arming switch, through a "sticky" the motor will arm only when the throttle is fully down, moving the switch kills the motor independently of the throttle stick position. the crown will then be engaged only when the throttle stick is fully up. Again moving the switch kills the crown but the motor will not be armed unless the throttle stick is moved again in fully down position. if not armed the throttle is set to be at -100%.

this is the logic switch:

L1 sticky L2 sg- sg- 0.0 0.5
L2 a~x [I3]Thr -100 --- 0.0 0.0
L3 a~x [I3]Thr 100 --- 0.0 0.0
L1 sticky L3 sgUP sgUP 0.0 0.5

and the mixes for the motor

CH7 [I3]Thr Weight(100) Switch L1 (motor)
R MAX Weight(-100) Switch (!L1)

for the crown is the same:

CH10 [I3]Thr Weight(-100) Switch L4) Curve(1) (crown)
R MAX Weight(0) Switch (!L4)



RC Soar said...

Thanks Matt and Marco.
Marco, that's a neat solution for sharing the throttle stick - just tried it and it works fine (small typo, the fourth line should be L4).