Trim as 3-pos momentary switches

More
25 May 2017 05:20 #62538 by Boone
Trim as 3-pos momentary switches was created by Boone
I wanted to use the trim switches to tune my Betaflight PID's, but quickly realized they didn't work in the manner I hoped.

Thanks to the great source code and docker build environment, I was able to download the Debiation source, find and modify the relavent code, and have it flashed and working in almost no time at all. Kudos to you all for making it so easy.

What I did was change the behaviour of the "Momentary" step option for trims, so that the default value is now centered, and pushing the trim switch momentary moves the output to opposite extremes depending on he direction the trim was pushed.

This allowed me to setup inflight adjustments in Betaflight. For example, I can individually adjust my roll and pitch P values up and down just by pushing the obvious trim switches.

Perhaps there was already a way to do this without modifying the source code, please let me know if I've missed the obvious! If not and this feature sounds valuable to others, I'd be happy to create a PR for it. Currently I've modified the behaviour of the existing Momentary option, but I believe it could also be implemented as a new option altogether.

Patch is attached.
Attachments:

Please Log in or Create an account to join the conversation.

More
25 May 2017 06:21 #62541 by FDR
Replied by FDR on topic Trim as 3-pos momentary switches
Yes, you could do that in the standard way, i.e. without modding the code.
You need two virtual channels for that binded to the two trim switches as momentary switches, and an output channel with a 3 page complex mixer. The first page would be fixed 0, the other two would use the virtual channels as switches, and use fixed max and min values with a replace mux type.

If you want your solution included, it would definitely need a new trim switch type...

Please Log in or Create an account to join the conversation.

Time to create page: 0.041 seconds
Powered by Kunena Forum