Thread Tools
This thread is privately moderated by flightengr, who may elect to delete unwanted replies.
Oct 26, 2017, 09:46 AM
Better SAFE than sorry!
Thread OP
Discussion

Experimenting with SAFE Settings on AR636


This thread is for the highly-technical discussion around the finer points of modifying/customizing the settings file (SRM file) for a Spektrum AR636 receiver such that it has SAFE capabilities.

It's been recently discovered in the "E-Flite SAFE Receiver in Another Plane" thread (https://www.rcgroups.com/forums/show...-another-plane) that a great deal of capability exists in the AR636 for enabling and customizing SAFE features including self-level, bank angle limits, the infamous "throttle-to-elevator mix" in SAFE receivers, and panic mode.

The purpose of this thread is to discuss the fine details of the receiver configuration without clogging up the SAFE RX thread. When we've got this down to a science that more people can take advantage of, then we'll be able to discuss the application of these settings to other planes back in the SAFE RX thread.

DISCLAIMER: Use any of the information in this thread at your own risk! I can't promise that you won't mess up your receiver completely if you change settings. I also haven't flown a plane yet after making changes this way - I have only been experimenting on the ground!!

--------------------
EDIT June 2018
--------------------
We've learned a lot since this thread started! There is a lot of good information here, and really gets technical into the settings on the AR636 receiver that are directly related to Horizon's SAFE feature set. (There are more threads in the Radio section of the forum that get into programming the AR636 in general.)

Based on what we've learned, I've put together some summary information in this other thread in my blog:
https://www.rcgroups.com/forums/show...elect-Receiver

It's not a complete compilation of everything here, but it will get you a long way into setting up the Spektrum Programmer Software, possibly upgrading the firmware/software inside the receiver, and enabling the most popular SAFE features. There is definitely more detail among the posts in this thread.

If you found this as the first thread to talk about enabling SAFE in a plane that did not come with it, then you need to understand some more general background about properly setting up a stabilization system (SAFE or AS3X - same idea) so that it works correctly with YOUR plane and your installation. It's critical to understand that the receiver MUST move the control surfaces in the correct direction on its own, without help from your transmitter. You can't simply reverse controls on your transmitter if you find something is backwards!
Here's another thread in my blog about that:
https://www.rcgroups.com/forums/show...d-SAFE-Testing

And here's an excellent thread where people have been discussing that idea for several years, starting with the original Apprentice S receiver.
https://www.rcgroups.com/forums/show...-another-plane

Finally, if you need help with SAFE transmitter setups, see this thread in my blog.
In particular, post # 6 talks about how to configure the SAFE Select on/off switch. The manuals that come with the planes with SAFE Select usually leave out a couple of key steps.
https://www.rcgroups.com/forums/show...lane-Receivers
Last edited by flightengr; Jun 16, 2018 at 09:22 AM.
Sign up now
to remove ads between posts
Oct 26, 2017, 09:51 AM
Better SAFE than sorry!
Thread OP
Reversing a Control Surface

It's a lot easier to do this in the Spektrum Programmer software by clicking the box, but if you're looking at the SRM file anyway...
Under the "surface" section, the value of "subtrimH" is 128 or greater when the channel is reversed. A value of 128 is reversed with 0 trim.

In the "surface" section, axis 1 = ailerons, axis 6 = elevator, and axis 9 = rudder.
EDIT: Need to test more which axis is which, especially since they're not 0, 1, and 2. Not sure how I came up with 1, 6, and 9!

With the Open Stock (standard AS3X-only AR636) settings, I found this:
Axis 0 = Ailerons
Axis 1 = Elevator
Axis 2 = Rudder

With the Timber SAFE Select settings, I found this:
Axis 0 = Rudder
Axis 1 = Elevator
Axis 2 = Ailerons
Last edited by flightengr; Oct 27, 2017 at 09:04 PM.
Oct 26, 2017, 09:59 AM
Better SAFE than sorry!
Thread OP
Panic Mode

There are two steps to using Panic Mode. First, you need to configure it, and second, you need to enable it in the various flight mode(s).

To configure panic mode, these are the settings:

Quote:
"panic": {
"envelope": {
"0": {
"neg": 20,
"pos": 20
},
"1": {
"neg": 20,
"pos": 10
}
},
"source": 3
},
Source is a bitmap variable that works as follows:
Start with a number 1 through 5 representing the radio channel you want to use for the panic function. 1 = Gear, 2 = Aux 1, 3 = Aux2, 4 = Aux3, 5 = Aux4.

Next, add 128 if you want to reverse the function inside the receiver. If you reverse it inside the receiver, then you do NOT need to reverse that channel on your transmitter. If you don't add 128, it will work like the original Apprentice S receiver where you need to reverse the channel on your transmitter to make panic work on the button. That means panic will activate at +100%. If you do add 128, panic activates at -100% instead.

Additionally, the Mini Apprentice and then Sukhoi Gen2 add 64 to source as well. Those manuals mention that you can use the panic function to "flare up on landing". I was unable to find any difference when bench testing with this feature on or off.

After you have set up the source, you can adjust the "envelope". Section 0 is ailerons (roll), and section 1 is elevator (pitch). For elevator, "neg" is up elevator and "pos" is down elevator. It's typical for these settings to be set such that you have less down elevator movement (smaller number for "pos") to make it harder to nose down while in panic mode.

The next task of enabling the panic function in a certain flight mode is covered later in "Autopilot Feature Settings".
Last edited by flightengr; Oct 26, 2017 at 08:19 PM.
Oct 26, 2017, 10:00 AM
Better SAFE than sorry!
Thread OP
Mounting Orientation

This would also be a lot easier to change via the Spektrum Programmer software, but for some reason this portion of the software is disabled when you're working with a SAFE Select receiver.

The settings for mounting orientation, located in the "system" section of the file, are as follows:
Pins Toward Nose, Label Toward Sky axis2aircraft = 36, axisDirection = 4
Pins Toward Nose, Label Toward Ground axis2aircraft = 36, axisDirection = 2
Pins Toward Nose, Label Toward Left axis2aircraft = 24, axisDirection = 6
Pins Toward Nose, Label Toward Right axis2aircraft = 24, axisDirection = 0
Pins Toward Tail, Label Toward Sky axis2aircraft = 36, axisDirection = 7
Pins Toward Tail, Label Toward Ground axis2aircraft = 36, axisDirection = 1
Pins Toward Tail, Label Toward Left axis2aircraft = 24, axisDirection = 3
Pins Toward Tail, Label Toward Right axis2aircraft = 24, axisDirection = 5

Here are some more combinations for orientations where the pins face toward either side of the airplane:
https://www.rcgroups.com/forums/show...&postcount=145
Last edited by flightengr; Jul 13, 2018 at 07:06 AM.
Oct 26, 2017, 10:14 AM
Better SAFE than sorry!
Thread OP
Autopilot Feature Settings

At the beginning of the file, you'll see a lot of settings in a section called "autopilot" that configure the various SAFE features in each flight mode.

The first part of the "attitude" section looks like this:

Quote:
"attitude": {
"0": {
"0": {
"envelopeNeg": 75,
"envelopePos": 75,
"feature": 238
},
"1": {
"envelopeNeg": 25,
"envelopePos": 25,
"feature": 238
}
},
You'll notice that there are five sections like the above, numbered 0-4. The normal three receiver flight modes that you see through the Spektrum Programmer are modes 0-2. When you have assigned a true flight mode switch (not the SAFE Select on/off switch), then mode 0 is at +100% on your transmitter, mode 1 is at 0%, and mode 2 is at -100%.

The settings for envelope represent the bank angle that's allowed in each direction for this mode. For unlimited bank angle (no restrictions), set the envelope to 0. Otherwise, this number is an angle in degrees. If you don't want to roll or pitch the plane more than 45 degrees for example, you'd set these numbers to 45. Section 0 is aileron (roll) and section 1 is elevator (pitch).

The value of "feature" is a bitmap variable, with the bits set as follows. (last edited 4/13/2018)
128 - 1 = Failsafe to SAFE control, 0 = Failsafe to conventional settings
64 - 1 = Self-Level Enabled
32 - 1 = Bank-Angle Limit Enabled
16 - Unused? always 0 in HH configs
8 - 1 = Enable low end of THR > ELE mix
4 - 1 = Enable high end of THR > ELE mix
2 - 1 = Panic Enabled
1 - Unused? always 0 in HH configs

There's no way to turn off AS3X using "feature".

Bit 128 affects the behavior of failsafe, when the receiver loses the signal from the transmitter. With it set to 1, the receiver will use SAFE to try to control the plane a little more intelligently. The Apprentice S receiver would try to circle and come down slowly - not sure what the AR636 would do. With it set to 0, it will use the conventional method of either reverting the control surfaces to the position that's preset when you bind the receiver (usually your sticks are centered at that time, so it would center the controls) or else hold their last position. You can select either bind preset or hold using SPS. SPS applies the same setting to all three flight modes, but it looks like you could set this on a per-flight-mode basis if you choose to. HH tends to set this to 1 (SAFE) on all of their SAFE-enabled setups.

Very strange things happen if you turn on either bits 8 or 4 when bit 64 (self-level) is not turned on as well. The elevator does some very wacky things if you turn on 8 or 4 when 64 is turned off. It looks like the only valid configurations are to turn on all three of those bits together, or else turn off both 8 and 4. When bits 8 and 4 are off, there is no THR > ELE mix at all.

I also notice two other behaviors when the THR > ELE mix is disabled this way (turn off bits 8 and 4). First, the travel/rate is not influenced by the bank angle limit (envelope settings). I only see that proportional response when then bits 8 and 4 are on. Second, with bits 8 and 4 off, when you hit the bank angle limit, the control surface jumps very rapidly to start preventing you from exceeding the limit. When bits 8 and 4 are on, the control surface will move very gradually as you approach the bank angle limit, becoming level with the wing/h-stab when you get to the limit.

So I think bits 8 and 4 turn on some additional "beginner friendly" features in addition to the THR > ELE mix.

These look to be valid values for "feature" for various SAFE features:
238 - Self-Level Enabled, Bank Angle Limit Enabled, THR > ELE Mix Enabled, "Soft Approach" to Bank Angle Limit / Reduced Rate Enabled, Panic Enabled
236 - Self-Level Enabled, Bank Angle Limit Enabled, THR > ELE Mix Enabled, "Soft Approach" to Bank Angle Limit / Reduced Rate Enabled, No Panic

226 - Self-Level Enabled, Bank Angle Limit Enabled, Panic Enabled
224 - Self-Level Enabled, Bank Angle Limit Enabled, No Panic

162 - Bank Angle Limit Enabled, Panic Enabled
160 - Bank Angle Limit Enabled, No Panic

130 - No SAFE features, Panic Enabled
128 - No SAFE features, No Panic


238 is the setting for the classic Beginner Mode, 162 is classic Intermediate Mode, and 130 is classic Experienced Mode from the Apprentice S and Mini Apprentice.
Last edited by flightengr; Apr 13, 2018 at 07:31 AM.
Oct 26, 2017, 10:31 AM
Better SAFE than sorry!
Thread OP
The Infamous THR > ELE Mix

It's been a standard practice for HH to include a throttle-to-elevator mix in a SAFE enabled mode, which automatically helps the pilot control the pitch of the plane based on the amount of throttle being applied. For more experienced pilots who prefer to fly with SAFE just for the self-level feature, this mix can become a bit intrusive.

The THR > ELE mix is configured in this section of the file.

Quote:
"pitchOffset": -1,
"thr2pitch": {
"0": {
"angle": 8,
"threshold": 30
},
"1": {
"angle": -3,
"threshold": 75
}
},
"thr2pitchLinear": 255,
"thrustLimit": 100
To adjust the THR > ELE mix, you can modify both the angle and the threshold. The angle has to do with how much elevator input up (-) or down (+) is added by the mix.

The mix has two adjustment points. When the throttle is below the threshold specified in section 0 (on a scale of 0% to 100%), then the angle in section 0 is applied. Similarly, when the throttle is above the threshold specified in section 1, the angle of section 1 is applied.

To disable the mix, you have two options. You can set both angles to 0, which effectively disables it because it will do nothing. Alternatively, the settings found when HH disables it, they set angle to -1 and threshold to 255.

I think there's still some more experimentation to be done here, especially around "pitchOffset", "thr2pitchLinear", and "thrustLimit".
Oct 26, 2017, 10:34 AM
Better SAFE than sorry!
Thread OP
Toggle Between Standard Three Flight Modes and SAFE Select On/Off

When the receiver is in the normal SAFE Select mode with an on/off switch, you'll see these settings in the file.
Quote:
"defaultSafeLimitedFlightMode": -1,
"flightModeSwitch": 255,
"gyroThresholdEnable": 1,
"safeLimitedFlightModeSwitch": 4,
"safeLimitedFlightModesDisabled": 0,
The defaultSafeLimitedFlightMode indicates which of the receiver's three flight modes is the one with SAFE enabled. It's -1 for flight mode 0, or -3 for flight mode 2. HH wasn't consistent in how they set this up for every model. When it's -1, SAFE is on when the transmitter is sending +100 on the selected channel. When it's -3, SAFE is on at -100%.

The value of safeLimitedFlightModeSwitch chooses the channel for the switch, which is a number from 4-8 for channels 5-9 (Gear - Aux4). In my example above, it's set to 4, which is the Gear channel (channel 5).


When the receiver is set up for the normal three flight modes, those settings look like this:
Quote:
"defaultSafeLimitedFlightMode": -1,
"flightModeSwitch": 4,
"gyroThresholdEnable": 1,
"safeLimitedFlightModeSwitch": 255,
"safeLimitedFlightModesDisabled": 1,
Now the safeLimitedFlightModeSwitch is disabled (set to 255), the safeLimitedFlightModesDisabled setting is turned on (1), and the value for the channel for the flight mode switch channel is now listed as flightModeSwitch.
Last edited by flightengr; Oct 26, 2017 at 10:45 AM.
Oct 26, 2017, 12:32 PM
Registered User
I have an original SU-29 rx.
Can it be modified to eliminate the pitch up/down feature?

Thanks for starting this blog. Great idea.
Oct 26, 2017, 12:55 PM
Better SAFE than sorry!
Thread OP
As far as I know, the receiver in the original version of the Sukhoi - the one with 3D SAFE - had a high possibility of breaking if you simply plugged in the programming cable. That one wasn't meant to be modified.

It's really hard to say when the above features were added to the AR636 software. So far, this stuff is only being discussed in the context of the SAFE Select and more recent SAFE implementations from 2016 on.
Oct 26, 2017, 07:54 PM
Registered User
mdmyers's Avatar
Quote:
Originally Posted by flightengr
Panic Mode

There are two steps to using Panic Mode. First, you need to configure it, and second, you need to enable it in the various flight mode(s).

To configure panic mode, these are the settings:
.
.
.
After you have set up the source, you can adjust the "envelope". Section 0 is ailerons (roll), and section 1 is elevator (pitch). For elevator, "neg" is up elevator and "pos" is down elevator. It's typical for these settings to be set such that you have less down elevator movement (smaller number for "neg" "pos") to make it harder to nose down while in panic mode.

The next task of enabling the panic function in a certain flight mode is covered later in "Autopilot Feature Settings".
Hey Flight, in going through the Panic mode section I'm thinking the correction above in red needs to be made?
Oct 26, 2017, 08:20 PM
Better SAFE than sorry!
Thread OP
Yes, you're right. Thanks!
Oct 26, 2017, 08:28 PM
Registered User
SystemsGuy's Avatar
Great work flight - here are the configurable parameters that were released in an earlier release of the programmer.

SAFE Parameters, "3 Mode" version

Features per mode, boolean :
Roll -> Panic
-> Envelope
-> Throttle to Pitch
-> Angle Demand
Pitch-> Panic
-> Envelope
-> Throttle to Pitch
-> Angle Demand

Panic - -> Panic Source ->Channel -> "Reverse, Boolean"
Panic --> Panic Delay , Boolean?

Panic -> Roll Angle, two values, Left/right?
Panic -> Pitch Angle, two values, Fore/Aft? (nose up/nose down?)

Throttle to Pitch ->
Low Throttle -> Threshold (%)
Low Throttle -> Angle (degrees)?

High Throttle -> Threshold (%)
High Throttle -> Angle (degrees)?

Safe Envelope, Per flight mode, max 3?
Roll -> Left/Right, degrees, max 90?
Pitch -> Fore/Aft, , degrees, Max 90?
Latest blog entry: FrSky Long Range!
Oct 27, 2017, 12:44 PM
Registered User
Hi flightengr,
thanks for all your posts and investigations you did.
I have some doubts about the envelope settings described here.
My Conscendo S has AR636A v2.10. SAFE. The Roll real envelope is about +-45 /+- 80 / unlimited (B/I/E mode) but settings in the Conscendo S.srm file for Roll are +-60 /+-60 /+-0. This does not correspond to each other.
Frank
Last edited by fr.masin; Oct 27, 2017 at 01:39 PM.
Oct 27, 2017, 12:55 PM
Registered User
The THR->ELE Mix (Beginner mode) is mystic for me. My Conscendo S do this:
-75% engine starts
-75% to 0% elevator slightly up
1% to 4% elevator leveled (going DOWN from previous position)
5%-75% elevator up (more then slightly)
75% Full thrust
Settings in Conscendo S.srm file are -6 > 50; -16 > 51
Frank
Last edited by fr.masin; Oct 27, 2017 at 01:13 PM.
Oct 27, 2017, 08:27 PM
Better SAFE than sorry!
Thread OP
Quote:
Originally Posted by fr.masin
Hi flightengr,
thanks for all your posts and investigations you did.
I have some doubts about the envelope settings described here.
My Conscendo S has AR636A v2.10. SAFE. The Roll real envelope is about +-45 /+- 80 / unlimited (B/I/E mode) but settings in the Conscendo S.srm file for Roll are +-60 /+-60 /+-0. This does not correspond to each other.
Frank
I'm not sure what to make of that... you're right - from the looks of things in the file, the roll envelope should be the same in B and I modes.

I was testing my Timber without the wing attached and only working with the elevator. At least on the Timber, the envelope settings for pitch were reasonably close to degrees from what I observed as I tilted the plane.

Quote:
Originally Posted by fr.masin
The THR->ELE Mix (Beginner mode) is mystic for me. My Conscendo S do this:
-75% engine starts
-75% to 0% elevator slightly up
1% to 4% elevator leveled (going DOWN from previous position)
5%-75% elevator up (more then slightly)
75% Full thrust
Settings in Conscendo S.srm file are -6 > 50; -16 > 51
Frank
For the THR > ELE mix, the thresholds are looking at a scale of 0% to 100% throttle, like the programmable Gen2 transmitters display on the screen. As you're describing the movement there, you're using the scale from -100% to +100% that you normally see from the transmitter.

So what you're describing for the elevator movement actually fits what the mix is describing, except for the very small gap from +1% to +4% (which is very close to 51% on a scale from 0% to 100%). The elevator is up a little below mid-stick, and it's up more than a little above mid-stick.

What the values of -6 and -16 really mean - degrees, % units, or whatever - I haven't figured out yet. I just know a bigger number means "more".


Quick Reply
Message:
Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Help! Turnigy TGY9X Unable to set fail safe on any channel luckyflyer Radios 2 Jun 06, 2016 06:49 PM
Discussion Setting up Fail safe on Eagle tree Vector Cary Pond FPV Talk 4 Sep 15, 2015 07:17 PM
Help! How to set fail/safe on DJI WK-M with Futaba Go4it Multirotor Drone Talk 3 May 10, 2012 04:58 PM