Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(flysky gimbals): mask first 4 channels when FS gimbals are detected #3778

Merged
merged 6 commits into from
Jul 17, 2023

Conversation

raphaelcoeffic
Copy link
Member

@raphaelcoeffic raphaelcoeffic commented Jul 8, 2023

As Flysky Gimbals use only 1 pin instead of 4 for analog gimbals, and 2 of these are re-used, it is not enough to mask used pins. This PR adds support in the ADC driver to manually mask inputs which will then be ignored / left untouched by the ADC driver.

Update by rotorman: Due to offset bias change in this PR, Flysky digital hall gimbals NEED to be re-calibrated, if they were calibrated previously with previous versions of EdgeTX.

@pfeerick pfeerick requested a review from rotorman July 8, 2023 08:38
@rotorman
Copy link
Member

rotorman commented Jul 8, 2023

Tested on TX16S. After this PR, the Flysky digital hall gimbals work on TX16S again, also EXT1 to EXT4 work as expected.

New is their new uncalibrated range of 16384 +/- ca. 2500 digits, requiring 5 digits to be displayed on analogs diagnose pages 2, 3 and 4. This causes a line break with current 480x272 pixel layouts, displaying the 5th digit on another line.
On first page (calibrated values), the input is scaled down, so only 4 digits are used, where values range typically from 7000 to 9100 and are centered around 8192.

Update: tested also on EL18, same behaviour there, but on vertical screen layout 5 digits are displayed correctly w/o linebreaks.

@pfeerick pfeerick added hardware support bug/regression ↩️ A new version of EdgeTX broke something labels Jul 8, 2023
@pfeerick pfeerick added this to the 2.10 milestone Jul 8, 2023
@raphaelcoeffic
Copy link
Member Author

I'm not sure when the value display has changed, but it seems we had this value range for a long time (maybe just not visible at the time because of the target specific display implementation).

@pfeerick
Copy link
Member

Anything more needed @rotorman or is this right to go? Asking you since you've got the hardware ;)

@rotorman
Copy link
Member

rotorman commented Jul 15, 2023

Started testing the latest state. Flashed RM Boxer with Flysky gimbals with the firmware from GH actions - unfortunately on black and white screen Boxer, there is no input from Flysky digital hall gimbals anymore.

In raw analogs diagnose page, A1 to A4 show almost static value with slight noise on last two digits. A1 around ca. 1700, A2 around 2500, A3 around 4000 and A4 near 0.

@rotorman
Copy link
Member

rotorman commented Jul 15, 2023

Next, tested Flysky EL18 - Flysky digital hall gimbals work, no issue there.

But, probably not related to this PR, the VRB is not shown during calibration though on UI when \RADIO is not present on SD card, whereas VRA is. By looking under HARDWARE -> Pots, S1 and S2 are in default configuration (no RADIO folder on SD card) set wrongly to None. After setting both to Pot, VRB slider is also displayed on the calibration screen.
Thus IMHO two errors with EL18:
a) default YAML config needs to set S1 and S2 to pot and
b) if S1 is set to None, during calibration VRA slider is still being displayed.

Further default YAML settings issue I stumbled with EL18 - the default Backlight OFF brightness is set to lowest slider setting - the display turns dark after 10 sec. IMHO better would be to have a default low value, higher than fully dark.

@rotorman
Copy link
Member

rotorman commented Jul 15, 2023

Next tested with two RadioMaster TX16S radios.

First TX16S was equipped with Flysky Paladin EV gimbals. First tested with EXT1 to EXT4 set to none and then with EXT1 to EXT4 set to Pot. No problems here with Flysky digital hall gimbals, incl. handling and sampling of EXT1 to EXT4.

Second, tested with "normal" TX16S with analog gimbals (AG01) just to make sure that analog gimbals work as well. Also here, no issues with reading the gimbal analogs.

Noticed two unrelated issues though to this PR:
a) the output of 6-Pos during calibration needs rework - even after going over all 6 buttons multiple times, the UI screen at calibration does not display the output correctly from 1 to 6.
b) When no \RADIO and \MODELS is present, there will be messages "STORAGE WARNING / Missing or bad radio data" with a button "Press any key to skip" and "STORAGE WARNING / Storage preparation" with also "Press any key to skip". At least during Storage preparation the word "skip" is not appropriate - it should be better "Press any key to initialize" or in this vain.

@rotorman
Copy link
Member

Tested with RM Boxer with Flysky digital hall gimbals. The gimbals work now OK also on Boxer.

Copy link
Member

@rotorman rotorman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with:
a) TX16S with Paladin EV gimbals - working, also EXT1 to EXT4.
b) TX16S with analog (AG01) gimbals - working
c) EL18 - working
d) Boxer with Flysky digital hall gimbals - working

@rotorman rotorman merged commit 179c677 into main Jul 17, 2023
@rotorman rotorman deleted the fix-tx16s-fs-gimbals branch July 17, 2023 15:53
@beach97
Copy link

beach97 commented Mar 18, 2024

JUMPER T16 also has the same problem when using Flysky digital hall gimbals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/regression ↩️ A new version of EdgeTX broke something hardware support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants