Fuzzy Logic + Jeti = ?

Sometimes a user on forums, this time on RC-Groups, is asking for something that makes my brain tickle. This was one of those occasions.

Hi All, looking for some inspiration about how to achieve something with my DS-16.
I want to have a "snap" flight mode that is activated by a logical switch. 
It should come on when both elevator and rudder sticks are pushed beyond 90%. 
This is easy enough - just use an AND condition.

However, I want the snap condition to stay active until BOTH rudder and elevator 
are returned to below 90%. This is where it is all breaking as the AND condition 
disables the condition as soon as either control returns below 90%.

So really, I want an AND to enter the condition, but then it to decide when to 
exit the condition with an OR. Maybe could use the spare trims TR5, TR6 or a MULTI 
but I cannot get my brain around how to get it doing what I want.

So, let’s get investigating…

Fuzzy Logic + Jeti = ?

Definition of Fuzzy logic is basically that the value is not necessarily 0 or 1, it can be something in between. And yes, Jeti can do that.

The issue is.. yes, what?

Let’s have look from the simple end:

  • Push elevator-stick over 90% and use that as a switch. Easy.
  • Push rudder-stick over 90% and use that as a switch. Easy.
  • Create a logical switch, being active when both of the above is active. Easy.

Now, the issue that collides with the user’s needs is that if either elevator or rudder is lowered under the 90% the logic switch goes inactive. We need to define somehow that BOTH the elevator and rudder needs to be under 90% before logical  switch is deactivated.

Solution

In fact simple. We’ll use fuzzy logic, we have to determine that a switch can be something else than simply ON or OFF.

How to

Note: I’m using a Mode 2 radio, your switch numbering (P2/P3)may be different!

First, make a  logical switch, name it as “Snap1” with the function “if rudder stick is over 90% positive or negative”. This translates to “P3 less than -90% proportional, centralized and reversed” OR “P3 less than -90% proportional and centralized”. Note that the first is reversed!

Screen000

Control 1 is reversed:

Screen001

Control 2 is not:

Screen002

You can verify correct settings by moving rudder over 90% to left or right, logical switch “Snap1” is active.

Ok, that was Snap 1. We need more. Make another logical switch, name it “Snap2”. This needs to be active “If elevator stick is over 90% positive or negative”. This translates to “P2 less than -90% proportional, centralized and reversed” OR “P2 less than -90% proportional and centralized”. Note that the first is again reversed!

Screen003

Control 1 is again reversed:

Screen004

Control 2 is not:

Screen005

Alright. now we have the physical sticks done. Let’s get fuzzy! What we need is a logical switch “Snap3” of “Both sticks over 90% negative or positive in any combination”. If we would use that statement alone it would be easy, it would be “Snap1 OR Snap2”. But, user requested that this function should be disabled when BOTH stick have been lowered to less than 90%. So, instead of OR we will use MULTI with statement “Snap1 centralized and proportional, over 0% MULTI Snap2 centralized and proportional over 0%”.  Both controls are centralized and proportional.

Screen006

Now you can test this. Move your rudder all the way to either direction, you’ll see the value change from X to 0, same should happen if you move your elevator all the way up or down. If you move BOTH stick to over 90% at the same time you’ll notice this logical switch goes to ON instead of 0 or OFF.

Screen011

This is not enough. If you are using this function to control something and need a simple ON-OFF switch for that we need to create one more logical switch, this is finally the one named “Snap”.

Make a new locigal switch with only function of “Snap3 centralized and proportional, value over 0%”. This switch is active only when our fuzzy switch is truly ON and not when it’s state is OFF or ZERO.

Screen009

This last logical switch is the one you can use for whatever the need was.

There you have it. Fuzzy Logic + Jeti = True Love :)

6 thoughts on “Fuzzy Logic + Jeti = ?

  1. Is there any way to mimic a Sticky switch? For instance, activate a flight mode with a switch but deactivate it with a different input, like moving the elevator stick above 75%.

      1. I can't make it work like a sticky switch though. Using a logic switch you can only activate the function. I don't know of a way to activate a flight mode with one switch and deactivate it with a stick input. This is for DLGs. Using a two position spring loaded switch. Pulling the switch should activate launch mode, releasing the switch allowing it to move will activate zoom mode. Pushing over at the top with elevator should deactivate zoom mode and allow flight mode changes from a normal 3 position switch for speed, cruise and thermal modes. I know OpenTX has this ability, but I haven't been able to figure out how to do it with Jeti.

          1. Shocking Jeti doesn’t offer a sticky switch option, but please share if you figured a way around this. Thank you!

Leave a Reply to Rob Thomson Cancel reply

Your email address will not be published. Required fields are marked *