Extended PWM Limits 700-2300us #2522
Replies: 6 comments 1 reply
-
Did I understand correctly that this modification changes the values of all channels except channel 3 (gas)? |
Beta Was this translation helpful? Give feedback.
-
Hello. Maybe not engage in hard code, but implement full-fledged mixing? I played a little as a programmer and implemented mixing with the following functionality:
Below is an example of a rather complex mixing, playground available onhttps://onlinegdb.com/E4mgk_iw2 : /**
* Sample of configuration
* Airplane aka AtomRC Swordfish:
* - Flapperons (Aelerons with flaps function)
* - V-tail
* - Two engine with different thrust
* - Camera panoramic servo
* Channels:
* - 0 - Aelerons
* - 1 - Elevator
* - 2 - Throttle
* - 3 - Rudder
* - 4 - Arm
* - 5 - Flaps
* - 6 - Camera panoramic
* PWM-outputs:
* - 0 - engine left
* - 1 - engine right
* - 2 - flapperon left
* - 3 - flapperon right
* - 4 - v-tail left
* - 5 - v-tail right
* - 6 - panoramic servo (270 deg)
*/
// Left engine value mix throttle, arm, rudder
pwmSettings[0].mixers[2].scale = 100; // 100% of thrust (-500...500) +
pwmSettings[0].mixers[3].scale = 20; // 20% of rudder (-100...100) +
pwmSettings[0].mixers[4].scale = 110; // 110% of arm (-550...+550) +
pwmSettings[0].mixers[4].offset = -550; // -550 arm offset (-1100...0)
// Right engine value mix throttle, arm, rudder
pwmSettings[1].mixers[2].scale = 100; // 100% of thrust (-500...500) +
pwmSettings[1].mixers[3].scale = -20; // 20% of rudder (+100...-100) +
pwmSettings[1].mixers[4].scale = 110; // 110% of arm (-550...+550) +
pwmSettings[1].mixers[4].offset = -550; // -550 arm offset (-1100...0)
// Left flapperon value mix aeleron, flaps
pwmSettings[2].mixers[0].scale = 100; // 100% of aeleron (-500...+500) +
pwmSettings[2].mixers[5].scale = 20; // 20% of flaps (-100...+100) +
pwmSettings[2].mixers[5].offset = 100; // +100 offset of flaps(0...+200)
// Right flapperon value mix aeleron, flaps
pwmSettings[3].mixers[0].scale = 100; // 100% of aeleron (-500...+500) +
pwmSettings[3].mixers[5].scale = -20; // -20% of flaps (+100...-100) +
pwmSettings[3].mixers[5].offset = -100; // -100 offset of flaps(0...-200)
// Left V-tail value mix elevator, rudder
pwmSettings[4].mixers[1].scale = 50; // 50% of elevator (-250...+250) +
pwmSettings[4].mixers[3].scale = 50; // 50% of rudder (-250...+250)
// Right V-tail value mix elevator, rudder
pwmSettings[5].mixers[1].scale = -50; // -50% of elevator (+250...-250) +
pwmSettings[5].mixers[3].scale = 50; // 50% of rudder (-250...+250)
// Panoramic camera
pwmSettings[6].mixers[6].scale = 200; // 200% of panoramic (-1000...+1000)
pwmSettings[6].limit.min = 500;
pwmSettings[6].limit.max = 2500; |
Beta Was this translation helpful? Give feedback.
-
This function would be very useful when the handset could not do mixing configuration. |
Beta Was this translation helpful? Give feedback.
-
As an airplane pilot, I would like this function to be used in the firmware |
Beta Was this translation helpful? Give feedback.
-
This extending function and mixer has been implemented in this branch: example could be found here: |
Beta Was this translation helpful? Give feedback.
-
There is a working modification by @AirNovel , that give us a wider pwm output for more servo angle (180 degree on SG90).
He achieved it by adding one line, that makes all channels expect 3rd (that usually used for throttle) to output 700-2300us PWM
if (ch != 2) us = fmap(us, 988, 2012, 700, 2300);
https://github.com/AirNovel/ExpressLRS_wide_PWM/blob/d84898feb56fd6646cd7336bfe110663aa29cedb/src/lib/ServoOutput/devServoOutput.cpp#L78
Would be cool if someone woud make smth like an option in web/lua to set this to a specific channel.
PWM recievers are getting very popular now, and people coming to ELRS from frsky/spectrum/etc is confused why there is no E.Limits support
https://edgetx.gitbook.io/edgetx-user-manual/edgetx-user-manual/user-manual-for-color-screen-radios/model-settings/inputs-mixes-and-outputs/outputs
Beta Was this translation helpful? Give feedback.
All reactions