Skip to content

Conversation

hali9
Copy link
Contributor

@hali9 hali9 commented Mar 23, 2019

Implement spoilers #4530
Need changes in inav-configurator.

@DzikuVx
Copy link
Member

DzikuVx commented Mar 23, 2019

@hali9 2.2 will have logic conditions that allows to activate and deactivate any servo mix rule. The code is already there, and most of configurator is there as well. This means that it will be able to do spoilers, flaps and many other things. Including flaps.
Besides, spoilers can be made with any RC channel passed as separate smix rule.

@DzikuVx
Copy link
Member

DzikuVx commented Mar 23, 2019

This also means that some of the flight modes will disappear. Including Flaperon

@hali9
Copy link
Contributor Author

hali9 commented Mar 23, 2019

@DzikuVx How can I achieve the flap function using logic condition?
If I understand this correctly, condition logic turns on or off the smix in mixer.
When I have:
smix 2 4 14 -100 0 0
smix 3 5 14 100 0 0
set has_flaps = ON
set flaperon_throw_offset = 250
then using condition logic I should change to:
smix 2 4 15 -100 1 0 //15-RC channel 9
smix 3 5 15 100 1 0 //1-condition to enable flaps
I must use one additional aux channel 9 with potentiometer to set up flap offset, which must be set before the flight.

@DzikuVx
Copy link
Member

DzikuVx commented Mar 24, 2019 via email

@hali9
Copy link
Contributor Author

hali9 commented Mar 27, 2019

@DzikuVx ONE input is good idea, but I think it is not enough, because:
Now I can set BOXFLAPS to aux (channel 5) from 1400 to 1500 (I use 2-position switch with mix 3-position switch, so I have 6-position switch) and I have on this aux also manual, acro, angle, horizon and alt.
So using logic condition is impossible to set this, because there is not between operator.
There is a CONDITION_MID but it has range for 3-position switch.
And because there is no such operator, you can not do it for spoilers to work together with the flaps.

So I think there are several solutions:

  1. Create between operator instead of LOW. MID, HIGH
    But it may be difficult to be because it has two values ​​and the conditon logic compares with one value.
  2. Create new type boxaux (also instead of LOW. MID, HIGH), and condition is true when selected aux is true.
  3. Permit in smix to put more that one condition using & operator. This allow to enable/disable smix by ch5>1400 and ch5<1500. For example:
    logic 2 ch5>1400 (2 is 10 in binary moving)
    logic 3 ch5<1500 (3 is 100 in binary moving)
    so put 6 (110 in binary) to smix condition and it mean that logic 2 an 3 must be true.
    This same solution is in cli serial.

@DzikuVx
Copy link
Member

DzikuVx commented Mar 27, 2019

I'm not saying that current set of conditions is perfect, but it is enough to satisfy majority of the cases in a general way. What you need can be done (like you wrote):

  • BETWEEN operator -> very simple and I invite you to code it if you want
  • ability to put LCs as operands for LCs. Also simple to do and I also have an intention of doing this.

@hali9 hali9 mentioned this pull request Mar 27, 2019
@hali9
Copy link
Contributor Author

hali9 commented Mar 30, 2019

This is possible to do using logical conditions #4561, so close this.

@hali9 hali9 closed this Mar 30, 2019
@hali9 hali9 deleted the spoilers branch March 30, 2019 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants