EdgeTX / edgetx

EdgeTX is the cutting edge open source firmware for your R/C radio
https://edgetx.org
GNU General Public License v2.0
1.5k stars 316 forks source link

New type of delay. #5118

Open nikpoz opened 1 month ago

nikpoz commented 1 month ago

Is there an existing issue for this feature request?

Is your feature request related to a problem?

This is a new feature request, not related with a bug or issue.

Describe the solution you'd like

While the MT12 has an delay up and delay down feature, it would be great if another kind of delay could be added. The current dalay controls the possitive or negative values related on mid possition. When a delay up for example is set, then for the channel values above mid the delay is used. The kind of delay I would like to maybe see in the future works like this: "Speed input" : sets the desired value when some user input is present on the channel. Use this value in both possitive and negative values related to channel midpoint. Speed input should effect how quick the user input is passed, for example to a servo, altering the speed servo moves to complete the move requested. "Speed return" : sets a speed on the channel, during the "return to mid"move. When user demands no other input, for example from a stick, servo should use this value while returning to neutral possition. This is a feature that can be set on many programmable servos, named usually "dumping" and it would just be great if we could expoit its advantages.

Describe alternatives you've considered

No response

Additional context

No response

pagrey commented 1 month ago

Maybe I don't understand what you are trying to do but the radio doesn't know when you give the stick input, for example flaps on the throttle channel +100 might be "no user input." For the other channels the springs normally hold them about zero but the radio just knows the position.

If you want to change the speed after the stick is what you define as no stick input just use a logical switch to define that stick position and then add a mix with a different delay based on that stick position. You can add any number of mix lines to change the delay or speed based on the position of the control.

For example L01 true if the absolute value of Ail is greater than zero. Create a mix that sets the channel slow or 3s when L01 is true and slow 0s when L01 is false. When you are moving the stick it is slow, when you let it go or move to center it moves fast.

It seems like a bit of work with logical switches and mixes will get it done just about any way you want.

nikpoz commented 1 month ago

Sounds good! I'll give it a go and let you know if achieved what I needed. Thanks a  lot!

3djc commented 1 month ago

You can do it with current etx, but it is cumbersome.

inventor7777 commented 1 month ago

Isn’t this already present when combining delay and slow modes? (I also have an MT12)

pagrey commented 1 month ago

The request involves the rate (delay/slow) changing depending on the control input which isn't just delay and slow. As said, it is a bit cumbersome. Not bad on companion, hopefully that's up and running for the MT12 soon.

inventor7777 commented 1 month ago

Oh, that makes more sense. So basically what you’re saying is that the value of a channel (e.g throttle) can be used as a delay? If so, I also want this feature.

pagrey commented 1 month ago

EdgeTX allows you to do just about anything which can be great and also difficult to learn. The EdgeTX User Manual is a good place to start and the EdgeTX Clinic is also a great place to learn about how inputs, mixes and outputs work.

MicheleVilla commented 1 month ago

Nikpoz perhaps meant this: the rest position of the stick is at the center, when it moves away from the center towards + 100 or -100 (that is, if it goes towards the extremes) we can define it UP when it returns to the center we can define it DOWN basically we calculate the absolute value of the stick position then we choose whether to apply the delay when it increases or when it decreases extending the discussion, one could define a resting position and when one moves away from it one condition applies while when one approaches it another applies. currently it is considered UP if it goes from -100 to 100 and down if it goes from 100 to -100

I assume though that the whole thing is a bit complicated to make

nikpoz commented 1 month ago

Yes , this is what I meant....Apologies if my description was poor.

MicheleVilla commented 1 month ago

By dividing the mixer in two one with function >0 and slowdown on UP the other with function < 0 and slowdown DOWN maybe you get the same thing ?

3djc commented 1 month ago

I wonder if we could have this feature with an 'center based' checkbox, that would determine up/down related to center

pagrey commented 1 month ago

This is to replace one logical switch and a single extra mixer line. The terms increase and decrease with absolute value make sense to me since that's how the logical switches are defined. For most people up and down makes sense but then center based doesn't make sense.

It seems like a simple example in the guide would work. I'd hate to see the UI become more and more complicated because people don't want to learn how to do two lines of setup.

chofchop commented 3 weeks ago

I would like to join this discussion at a later date.

I also agree with nikpoz and MicheleVilla.

Generally, when |x| increases, it is set as "servo turn speed", and when |x| decreases (when approaching neutral), it is set as "servo return speed".

To run this with EdgeTX 2.10.1, I split the mixer into x>0 and x<0 and set the turn speed to 3 seconds and return speed to 0 seconds. The result is as shown in the video, there is a delay when crossing neutral, It is of no use.

https://github.com/EdgeTX/edgetx/assets/154777776/a4957d07-7f7e-44f3-b101-dcc4b9411c33

pagrey It seems like a simple example in the guide would work. I'd hate to see the UI become more and more complicated because people don't want to learn how to do two lines of setup.

I basically agree with you, but isn't this an EdgeTX issue? If you know of a better "two lines of setup" please let me know.

pagrey For most people up and down makes sense but then center based doesn't make sense.

I don't think that's the case. For center-based servo channels such as rudder and aileron, setting the turn and return speed is an extremely basic and important function.

pagrey commented 3 weeks ago

This is a primary control. If you want a different speed then just move the control at the speed you want. Delay and speed are for outputs that don't have direct control over speed like switches for flaps or for outputs that you just want to set quickly and get back to primary control. I'd be interested to hear a use case where you can't just move the control at the desired rate? The more I think about it the less I understand what the possible use for this is.

inventor7777 commented 3 weeks ago

@chofchop while unrelated, how did you make the bezels on your MT12 screen black? Did you create your own sticker, or did you buy it? Or is it just an OLED replacement?

I’m saying that because I know that when the standard screen is set to inverted, the bezels stay white.

pfeerick commented 3 weeks ago

I this one of the issues here is may be that is something that appears to be more common in surface transmitters, so is a foreign concept to us. Recent got a Flysky NB4+ so will be coming to grips with some of the surface specific options myself now ;)

@inventor7777 That looks like an OLED replacement display, has the sharp whites and blacks that you can't have if you run normal LCD inverted ;) You can also make out the frame of the display at the botton ;)

pagrey commented 3 weeks ago

Details of an OLED conversion are here and here.

chofchop commented 3 weeks ago

This is a primary control. If you want a different speed then just move the control at the speed you want.

As you say. I think I should too. But only some experts can do it, and many people need electronic assistance.

I'd be interested to hear a use case where you can't just move the control at the desired rate?

Since nikpoz started talking about MT12, I will give an example of a steering servo for an RC car. For optimum cornering in a racing car, not only the timing and amount of steering, but also the speed of steering are important. Top drivers do this with their own hands, but it is difficult for the average person, so they rely on the radio's "assist function." It is similar to using EXPO or custom curves.

pagrey commented 3 weeks ago

This is going to do nothing to help your driving, you might look into a gyro. Delayed or slow steering for racing, that's a new one.

chofchop commented 3 weeks ago

It's completely different from a gyro. In any case, the concept of servo speed has been around for decades, and it is true that there are many people who need it.

philmoz commented 3 weeks ago

Define 2 curves, one for 'up' and one for 'down': screenshot_tx16s_24-06-24_13-08-08

Define 2 inputs for the desired channel, one uses the 'up' curve, the other the 'down' curve (AilP and AilN here): screenshot_tx16s_24-06-24_13-08-35

Define two mix lines, one for the 'up' input and one for the 'down' input, mix lines are added: screenshot_tx16s_24-06-24_13-08-47

Set slow up and slow down on each mix line as needed.

chofchop commented 3 weeks ago

philmoz, Thank you, I did what you said and got the desired behavior. I don't have time right now, so I will report in detail later.

inventor7777 commented 3 weeks ago

@pfeerick and @pagrey thanks for the links and info.

chofchop commented 2 weeks ago

@philmoz ,I thought the method you taught me worked at first, but apparently it's still not enough. There is no problem when the return speed is 0 (no deceleration), but if slow down the return, a problem will occur when cross the center. For example, set the turn speed to 0sec. and the return speed to 3sec., it will look like the following video.

https://github.com/EdgeTX/edgetx/assets/154777776/072ae52e-2529-4e0c-96f1-ceb4cb1cb6b1

There is no problem when operating only one side from the center, but if cross the center, the settings on the other side of the mixer line will be applied. Do you think there is any good way to solve this? I think there are very few situations where we have to slow down the return speed, but I think the problem is not that, but rather that we can't get the expected behavior.

philmoz commented 2 weeks ago

For example, set the turn speed to 0sec. and the return speed to 3sec., it will look like the following video.

Is that realistic - I thought you wanted to have a slow turn and return?

On my MT12, if I set both slow up and slow down, then it behaves as expected (as far as I can tell).

Also keep in min the slow speeds are for full travel from -100 to +100. Since you are setting slow speeds for only half the range you may need to adjust your values accordingly.

MicheleVilla commented 2 weeks ago

there are two types of command one can be a two-position switch that goes from -100 to + 100 in this case the movement from -100 to +100 can be considered UP while the movement from +100 to -100 can be considered down But in the case of a 3-position switch (or a stick) and therefore everything that has a central position in my opinion it makes more sense to consider UP everything that moves away from 0 ( |x| increases) and DOWN everything that returns towards 0 (|x| decreases) This reasoning is valid not only for slowing down, but also for delay Of course all this in theory

chofchop commented 2 weeks ago

Is that realistic - I thought you wanted to have a slow turn and return? On my MT12, if I set both slow up and slow down, then it behaves as expected (as far as I can tell).

I think the common usage is to slow down only the turn without slowing down the return. In this usage Your settings give me the desired behavior. The problem does not occur if the turn and return are set to the same speed.

What I'm trying to say is not whether there is a practical problem, but that I can't find a way to achieve the expected behavior.

The concepts of "servo turn/return speed" did not exist in EdgeTX. It would be nice if something similar could be done with the input or mixer line, but it doesn't seem possible, so I'd like you to consider this as a new feature, as nikpoz said.

chofchop commented 2 weeks ago

Let's get back to the main topic.

what @nikpoz first proposed, @3djc's center based, @MicheleVilla's |x| base, and my turn/return speed, these are all referring to the same function. Unfortunately, this function does not seem to be possible with the current EdgeTX, so we request that it be implemented as a new feature.

inventor7777 commented 2 weeks ago

This makes much more sense now that I’ve reread it with that in mind. I myself would also like this feature.

philmoz commented 2 weeks ago

The curves solution works when speed up >= speed down; but not the other way around.

Here is a solution using logical switches and mix lines that works regardless of how speed up and down are set (at least it does on my MT12).

Create a logical switch to detect when the output channel is positive - the important part is using the output channel not the input: screen-2024-06-26-102807

Create two mix lines, both switched with the logical switch. The second one should invert the switch. The first line is positive steering, the second is negative. The second mix line is set to replace mode. screen-2024-06-26-102755

Set the speed up and speed down on the two mix lines.

This will then use the positive speed up/down settings until the output channel goes negative and vice versa.

3djc commented 2 weeks ago

That illustrates how complicated it is to setup!

MicheleVilla commented 2 weeks ago

splitting Mixer in two line with option Curve set to Func X>0 and Func X<0 we obtain the same behaviour I believe, however, that there is a need to define the underlying operating principle and that is to distinguish between types of controls that have a single stroke and those that have a central position

philmoz commented 2 weeks ago

splitting Mixer in two line with option Curve set to Func X>0 and Func X<0 we obtain the same behaviour I believe

I tried this and it does not work.

chofchop commented 2 weeks ago

@philmoz That's excellent. I had no idea it was possible to achieve this behavior. Once again, I am impressed by EdgeTX's flexibility and your intellect.

However, it would be cruel to ask the average person to get there on their own, so is there a better way to make it easier for anyone to learn about this method?

MicheleVilla commented 2 weeks ago

splitting Mixer in two line with option Curve set to Func X>0 and Func X<0 we obtain the same behaviour I believe I tried this and it does not work.

https://github.com/EdgeTX/edgetx/assets/6508436/55c09fd1-d306-43bb-b051-efdd41521e7f

MicheleVilla commented 2 weeks ago

IMG_20240626_115350

chofchop commented 2 weeks ago

@MicheleVilla ,Your settings are now 5 sec. for up and 0 sec. for down. That's no problem. Try setting up to 0 sec. and down to 5 sec,, and try moving the stick left and right as if straddling the center. I think you can observe different behavior depending on the settings.

MicheleVilla commented 2 weeks ago

@MicheleVilla ,Your settings are now 5 sec. for up and 0 sec. for down. That's no problem. Try setting up to 0 sec. and down to 5 sec,, and try moving the stick left and right as if straddling the center. I think you can observe different behavior depending on the settings.

You are right! Is strange behaviour Is a problem or is normal? perhaps one more reason to better define this feature

chofchop commented 2 weeks ago

If you set the down to 5 sec., the servo (output) will still remain on the left when you quickly move the stick to the right. Even though the servo (output) is still on the left, the mixer line's "right" settings are applied.

So as @philmoz said, you need to refer to the "output" and switch the mixer line.

MicheleVilla commented 2 weeks ago

In @philmoz's solution the two mixers are disabled when output=0 In the case of slowdown set to return to the center when you instantly switch from the stick to -100 to 100 the movement is slowed down to 0 and immediately switches to +100 I wonder if from a practical point of view it makes sense

chofchop commented 2 weeks ago

In @philmoz's solution the two mixers are disabled when output=0

That won't happen. L01 is defined to be true when 0>x. In other words !L01 is x>=0. If x = 0, the second mixer line will be active. Also, I think there is a meaning to replace mode, but I don't fully understand it either.