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.61k stars 340 forks source link

3 position throttle idle trim #4514

Open Kevltan opened 10 months ago

Kevltan commented 10 months ago

Is there an existing issue for this feature request?

Is your feature request related to a problem?

I would like to see added a 3 position throttle idle trim. This would be able to used in all flight modes including fm0.

Describe the solution you'd like

As above

Describe alternatives you've considered

I have considered other options but this must be shown on the TX display as normal trim movement. It may have other uses but in my case it would be used for the throttle idle trim - trim min, trim centre and trim max. So from trim min, 1 click up trim centre, next click up trim max and the opposite would apply. There could also be an option for a 2 position throttle idle trim being added - trim min and trim max etc. Trim steps is another way of doing this in the firmware - see below.

Additional context

N/A

pfeerick commented 10 months ago

Just to keep the information for this together in one place, it seems like it should be an extra trim step mode... i.e. coarse is 32 steps vs 128 steps for fine, whereas this would just be three.

The manual snippet that was shared from the Spektrum DX18 manual explaining the purpose of this type of feature is that it can be used to set the throttle trim low, middle or high, useful for turbine models: image

philmoz commented 10 months ago

That would apply to all trims as we only have one trim step setting (at the moment).

pfeerick commented 10 months ago

Indeed. It is something that has been requested before though (https://github.com/EdgeTX/edgetx/issues/3108), so it seems there is a need for that. If we were to go that way it would make sense to implement this as part of that.

Although, the catch is that changing the trim steps changes this for all of the trim controls... so maybe something some special handling along the same lines of the 3P functionality would be needed. Although Phil is right... using some SF Lua logic the manipulate the trim would nicely circumvent the need to do anything more to the trim code.

Kevltan commented 10 months ago

Just to keep the information for this together in one place, it seems like it should be an extra trim step mode... i.e. coarse is 32 steps vs 128 steps for fine, whereas this would just be three.

The manual snippet that was shared from the Spektrum DX18 manual explaining the purpose of this type of feature is that it can be used to set the throttle trim low, middle or high, useful for turbine models: image

Would it not be just 2 steps?

pfeerick commented 10 months ago

high, middle and low is three steps, no? It's sort of in the name ;)

Kevltan commented 10 months ago

Let's just call it a "3 position throttle idle trim". Steps are confusing!

pfeerick commented 10 months ago

I was referring to the maximim number of trim "positions", as anything else is relative to the current position, so is just confusing.

On Mon, 8 Jan 2024, 8:51 pm Kevin, @.***> wrote:

It's all according what you mean by "steps" there are 3 positions but only 1 or 2 steps either way are needed to achieve one of the 3 positions because you are already in position 1, 2 or 3. Yes/no?

โ€” Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/issues/4514#issuecomment-1880771579, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ66KJ2P7CIUHX3HA65653YNPFUPAVCNFSM6AAAAABBQLV4IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQG43TCNJXHE . You are receiving this because you modified the open/close state.Message ID: @.***>

Kevltan commented 10 months ago
Screenshot 2024-01-18 155457

https://github.com/EdgeTX/edgetx/blob/main/radio/src/opentx.cpp#L929C4-L929C71

3 position throttle idle trim edit.

I have changed heading title and text to better reflect the enhancement asked for.

Kevltan commented 10 months ago

Screenshot 2024-02-03 200258

Thanks for help with the code change Michael @mha1๐Ÿ‘

4 - 256 (typical) throttle "Trim idle only" multiple position trim switch work around, using a global variable (GV9). 1 - 256 available for full options.

Example of settings with available centre trim and divisable whole numbers into 256:-

Value = position 256 = 2 position 128 = 3 position 64 = 5 position 32 = 9 position 16 = 17 position 8 = 33 position 4 = 65 position 2 = 129 position 1 = 257 position

Global variable: GV9 Name = IDL Unit = - Value = 0.- Min = 4 Max = 256 Value = 4 - 256

Any additional ideas, options or concerns please comment below.......๐Ÿค” Obviously GV9 NEEDS setting for every model that uses the throttle "Trim idle only" function๐Ÿ‘Œ๐Ÿ‘

philmoz commented 9 months ago

Haven't forgotten about this; just trying to work out a suitable (general purpose) solution. I don't think using a GV is a good idea.

3djc commented 9 months ago

Isn't that much easier to do user side now that we have 3P support on trims ?

pfeerick commented 9 months ago

By definition, 3P disables trims, no? The functionality he wants is a three position trim... https://github.com/EdgeTX/edgetx/issues/4514#issuecomment-1880442429 ... if we had separate trim coarseness settings that could just be another trim step setting... but since we don't... maybe another "Throttle" specific option that can manipulate the trim steps for the throttle?

Kevltan commented 9 months ago

@pfeerick @philmoz please look at the above edit to opentx.cpp. This works. The above edit does not effect the other trims, ONLY the throttle idle trim. I have found it works fine with the added advantage that it is fully customisable as shown above 2P, 3P, 5P, 9P...... etc. and others will like this capability. Just needs a more simpler way of inputing this into the screen that doesn't use a GV.

mha1 commented 9 months ago

using a GV was never intended to go into main. This was just a code snippet for @Kevltan's proof of concept. I'd say this needs a separate yaml variable and some UI in the throttle settings

Kevltan commented 9 months ago

@mha1 Absolutely - is a work around and proof of concept๐Ÿ‘

3djc commented 9 months ago

Given it is for a tiny handful of users, I think cluttering the ui to copy a spektrum radio behaviour may not be the best option. Why focus on using trims for this other than 'I used to do it this way and I don't want to change' ?

Kevltan commented 9 months ago

Hi @3djc, its more than Spektrum because if its done right it is FULLY customisable (so not a "Spektrum copy") as I have proved above and I am sure with the devs input it would be polished to perfection. For your information I have never used a 3 position throttle idle trim for any of my setups. I didn't come up with the idea from Spektrum I just happened to be looking for options for this for my setup and found it online (didnt realise my disused DX18QQ could do this). I thought it would be a good idea - an enhancement to EdgeTX, but unfortunately I appear to be one of your estimated "tiny handful of users"!

But isn't this what EdgeTX is all about being better than the "others" and being able to do just about everything imaginable?

I feel you've been very speculative about my reasons from the begining (Discord), but if you feel this is not the way to go then that's fine and the rest of the "tiny handful of users" will never know! The edit I made works for me and it means I just a have to change a few lines every time I update the firmware in EdgeTX.

I am beginning to wish now that I hadn't used Spektrum as a comparison - Spektrum is Sh%$*. I have a Spektrum DX18QQ that I regret ever buying and in my opinion the worst radio I have ever owned - it was cheap feeling and had a very poor non resilient finish....my bad!! But remember Spektrum radios have firmware, software, control models and have similar "radio behaviour" too, but some radios just have the "Edge" over others!

philmoz commented 9 months ago

@Kevltan I think you mentioned at one point this was for handling the startup sequence for a turbine engine.

You need three easily reproducible throttle settings (STOP, IDLE and MAX) to program the ECU and the initiate the startup sequence.

Having done a bit of research I believe the idea of using trim to do this dates back to the days of mechanical trims and limited programability of radios.

IMO you would be better to use a throttle cut switch and configuration of the throttle input/mix to do this. E.G. set weight to 90 and offset to 10 in the throttle input - this gives you IDLE (stick down) as 10% throttle and MAX (stick up) as 100%. Set a throttle cut switch to override throttle to 0% and you have your STOP setting.

Kevltan commented 9 months ago

@philmoz. You are correct except anything below mid trim is turbine cut anything on or above mid trim setting is turbine run so a 2 position trim would do it really. But for reasons of safety 3 position or more is best and gives access to being able to cut the turbine quickly if necessary.

You may also be aware that I use a widget screen with this that has an idle trim only on screen if I used the throttle I would lose this functionality and it would become redundant. I use a flight controller for the helicopter so no other trims are necessary and are disabled and used for for arming only etc.

As shown above I have found a way of doing this and thought this might be useful for other users. I did not think this would be such a hard thing to implement into EdgeTx as an option but I seem to be finding a lot of opposition to it here Phil!!!

philmoz commented 9 months ago

It's not a question of being hard to implement or being opposed to solving this. We have a lot of legacy 'stuff' that has crept in over the years because someone thought it would be a good idea. A lot of it is poorly documented and hard to understand which makes life difficult when trying to make changes. The more the problem is understood the better the final solution can be for everyone.

What is the widget you are using? Can it be changed to be more flexible?

Kevltan commented 9 months ago

@philmoz This is the edit in operation on the X12S running a highly modified TD-RDT full screen widget and using your background modification on latest 2.10.0. Helicopter flys flawlessly, although I was using the 5 position throttle idle option. But that's the beauty of it, its customisable and I don't think its "legacy stuff" and would it really clutter the UI - just some numbers to selectively edit say 1 - 256 ?๐Ÿ‘

2 position set at 256 https://github.com/EdgeTX/edgetx/assets/56512603/532bb224-e1b5-43f3-9c4a-240773d8ce12

3 position set at 128 https://github.com/EdgeTX/edgetx/assets/56512603/18b00d50-053f-4505-ae91-7fe8b7688ecb

5 position set at 64 https://github.com/EdgeTX/edgetx/assets/56512603/3101c0dc-ae6f-46d3-80f9-9b3ece4714ed

17 position set at 16 https://github.com/EdgeTX/edgetx/assets/56512603/74f18e2e-81f6-4965-af72-513e7e74eb00

philmoz commented 9 months ago

From all the threads I have looked at on rcgroups using a throttle cut switch seems to the preferred and safest option.

What you are doing can be achieved with current EdgeTX logical switches, special functions and a bit of Lua scripting.

Logical Switch: screenshot_tx16s_24-01-30_15-02-37

Special Functions: screenshot_tx16s_24-01-30_15-02-45

Lua script (save as SCRIPTS/FUNCTIONS/ttgv.lua)

local function init()
end

local TH_TR = 3
local FM = 0
local GV = 8

local function run()
  local t = model.getFlightMode(FM)
  local v = model.getGlobalVariable(GV, FM)
  if (v > 128) then v = 128 elseif (v < -128) then v = -128 end
  model.setGlobalVariable(GV, FM ,v)
  t.trimsValues[TH_TR] = v
  model.setFlightMode(FM, t)
end

return { run=run, background=nil, init=init }
Kevltan commented 9 months ago

Hi @philmoz, thanks for that, looks good but I meant to tell you I have no special functions left. In fact I think I have 3 LS's and 0 SF's! Which is another reason I was looking for other options with a possible screen input option tab in throttle idle only.

To be honest Phil the firmware edit I made is much simpler to do and keeps my already complicated model profile "Stream lined". This only works if throttle idle setting is selected. GV9 must be edited to suit and not used elsewhere in the active model file.

3djc commented 9 months ago

Can we see the list of your SF, we might be able to help simplify it

Kevltan commented 9 months ago

OK I think I know what's going on here. I seem to be going round and round in circles trying to get this implemented, wasting my time and others for which I apologise. I needed help and for that I am grateful for all the people/developers who did, and for all of the input and ideas they have given. But it looks like I am not going to get what I actually asked for, only work arounds, which I have done already.

My edit in the firmware is taking up very little precious "Real estate" and only using GV9 which leaves me 8 GV's free! Also as a new addition to the firmware it is quite easy to comment // as to why the edit is there. I dont agree it would "clutter" the UI I just wanted this option consolidated into the idle throttle only page!

So personally, I think it is time to call it quits on this one and move on to something else and come up with new ideas that may improve EdgeTX in the future!๐Ÿค” Hopefully next time unfounded, speculative comments like "I used to do it this way and I don't want to change" will not be used to describe my ideas!๐Ÿ˜ก Thanks again for all help given๐Ÿ‘ On Tue, 30 Jan 2024, 09:52 3djc, @.***> wrote:

Can we see the list of your SF, we might be able to help simplify it

โ€” Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/issues/4514#issuecomment-1916462751, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPFAW3CFNSPSNZM3CWI4HTYRC7HFAVCNFSM6AAAAABBQLV4IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGQ3DENZVGE . You are receiving this because you were mentioned.Message ID: @.***>

Kevltan commented 9 months ago

By definition, 3P disables trims, no? The functionality he wants is a three position trim... #4514 (comment) ... if we had separate trim coarseness settings that could just be another trim step setting... but since we don't... maybe another "Throttle" specific option that can manipulate the trim steps for the throttle?

@pfeerick Please look at my firmware edit - it sets "throttle idle" ONLY steps - NO other trim steps are affected.

Kevltan commented 9 months ago

Can we see the list of your SF, we might be able to help simplify it

Have removed SF as not really needed.

Kevltan commented 9 months ago

Haven't forgotten about this; just trying to work out a suitable (general purpose) solution. I don't think using a GV is a good idea.

@pfeerick @philmoz Using a GV is the only option available to me and how simple is this solution? - 2 extra lines in firmware and one edited, no SF's no LS's and no Function/Lua scripts just 1 asigned GV.

To eliminate GV asignment an extra input tab is needed in Model setup/Throttle page/Trim idle only. Could default to steps 'v = 4'.

"Flexibility with no clutter"!

Kevltan commented 8 months ago

From all the threads I have looked at on rcgroups using a throttle cut switch seems to the preferred and safest option.

Easy to knock a switch accidently in a panic situation (instant turbine cut not recomended in a heavy turbine heli - trust me I know), not so easy to knock the throttle digital trim๐Ÿ‘

pfeerick commented 8 months ago

This I have to agree with 100%... on TX16S I use SF as my arm switch via logic that inhibits both arming and disarming unless certain parameters are met, and instead use T6 up as my emergency instant disarm.

Kevltan commented 8 months ago

My LS's & SF's are used for logic too - using 2 digital trims together to arm (1 sec delay) which cannot be disarmed once turbine is ready to start or running (trim high) unless Si & Sj are pressed together these are added momentary buttons on top of TX (2 sec delay with warning). These are used to emergency stop or just to stop turbine. My idea behind this was, fingers can be kept on the sticks at all times should an E stop need to be executed in flight. Also "pulling" throttle trim down past centre stops turbine. ๐Ÿ‘

On Thu, 7 Mar 2024, 00:40 Peter Feerick, @.***> wrote:

This I have to agree with 100%... on TX16S I use SF as my arm switch via logic that inhibits both arming and disarming unless certain parameters are met, and instead use T6 up as my emergency instant disarm.

โ€” Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/issues/4514#issuecomment-1982127986, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPFAWYGQVBZYQKVVFBRJODYW6ZOXAVCNFSM6AAAAABBQLV4IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBSGEZDOOJYGY . You are receiving this because you were mentioned.Message ID: @.***>