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

Flysky gimbal support for Boxer #3139

Merged
merged 14 commits into from
Feb 26, 2023
Merged

Flysky gimbal support for Boxer #3139

merged 14 commits into from
Feb 26, 2023

Conversation

richardclli
Copy link
Collaborator

Fixes #3066

Summary of changes:

@richardclli richardclli marked this pull request as draft February 2, 2023 04:31
@richardclli
Copy link
Collaborator Author

Seems not working yet, discovered that the SD card DMA may affects the UART4 DMA, disabling the SD card DMA still no luck. Try to use the UART3 instead but seems not working as well.
@rotorman Can you spot any errors in my changes?

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.

The RCC_APB1PeriphClockCmd for UART4 needs to be enabled as well.

@raphaelcoeffic
Copy link
Member

@richardclli you should not try to use TX DMA on UART4 ;-)

@raphaelcoeffic
Copy link
Member

It should be much easier to setup once #3050 and #2631 are merged.

@rotorman
Copy link
Member

rotorman commented Feb 3, 2023

Tested with Boxer:

  1. analog gimbals still work as expected.
  2. Flysky digital hall gimbals do not work yet, need to investigate.

@rotorman
Copy link
Member

rotorman commented Feb 3, 2023

PA0 (UART4 TX) and PA1 (UART4 RX) on Boxer are on the right stick header (not on the left stick header as with T16/TX16S/T18 in https://github.com/EdgeTX/edgetx/wiki/Flysky-Hall-Sticks-Mod ).

Also the RX and TX pins are swapped between vertical and horizontal stick, thus in the image in https://github.com/EdgeTX/edgetx/wiki/Flysky-Hall-Sticks-Mod (here for T16/TX16S/T18):

For Boxer, need to swap the RX and TX as below:

grafik

I am getting data in on Boxer with Flysky gimbals. Need to check/fix their scaling though, but we are almost there.

@richardclli
Copy link
Collaborator Author

@rotorman Just spot that when you disabled the DMA_Stream for TX, the driver just skip the command sending, will this cause problem because the gimbal is not properly reset by the reset command?

@rotorman
Copy link
Member

rotorman commented Feb 7, 2023

The reset command is not required, the Flysky digital hall gimbal will still stream out it's data. Thus IMO, TX will only be required for possible future gimbal upgrade, otherwise for normal operation only RX on the radio side is needed.

@richardclli
Copy link
Collaborator Author

I let somebody test the boxer with Flysky gimbal. It is quite strange that the raw values displayed do not have -ve values and the range only has around 2500.

@rotorman
Copy link
Member

rotorman commented Feb 9, 2023

The raw values from Flysky digital hall gimbals are available to Boxer radio target OK, as can be seen in the raw analogs diagnose page (the range is from ca. -2500 to +2500, similarly to color targets). Thus the issue likely stems on how black-and-white targets process the values above 11-bit range. I have not yet had time to look into it, but will try check this in the near future.

@rotorman rotorman marked this pull request as ready for review February 11, 2023 09:02
@rotorman
Copy link
Member

rotorman commented Feb 11, 2023

Installation of Flysky digital hall gimbals into RadioMaster Boxer, using the Hawk-RC Adapter ring set:

Step 1: mounting the bottom rings using stock RadioMaster analog gimbal screws:
grafik

Step 2: mounting top rings using 2x2 M2x6 screws:
grafik

Step 3: mounting Flysky digital hall gimbals HZCZ03-ADJ (here HCZC03 from an EL18) with 2x2 M2x6 and 2x2 M2x14 screws to the adapter rings and attaching the gimbal connection cable:
grafik

Do note that the RX and TX lines of the gimbal connection cable need to be swapped for Boxer, when compared with T16/TX16S/T18 cable, that comes with Hawk-RC adapter rings.

Here a close-up of the correct cable for Boxer - note especially the white (Gimbal RX) and yellow (Gimbal TX) data lines:
grafik

Further, please do note that on Boxer, the UART4 serial connection for digital gimbals is on the right gimbal header (when radio is looked from the back, then left side, as in the above picture), whereas on T16/TX16S/T18 the digital gimbals need to be connected to the left gimbal header.

End-result:
grafik

Video showing calibration and proportional channel diagnose pages output:
https://www.youtube.com/watch?v=ifFAXC0KMwM

@rotorman rotorman added the enhancement ✨ New feature or request label Feb 11, 2023
@pfeerick pfeerick added this to the 2.9 milestone Feb 19, 2023
Copy link
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

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

Just a general though, as it seems counter-intutive to have non-radio specific code conditionally marked as such. Tie it to the feature, not the radio, and enable it at the target level perhaps?

radio/src/gui/128x64/radio_diaganas.cpp Outdated Show resolved Hide resolved
radio/src/hal/adc_driver.cpp Outdated Show resolved Hide resolved
Tested with RadioMaster Boxer and RadioMaster TX16S with Flysky digital gimbals.
@pfeerick
Copy link
Member

Thanks for that @rotorman, looks a lot cleaner now :)

@rotorman rotorman merged commit 9216570 into main Feb 26, 2023
@rotorman rotorman deleted the boxer_flysky_gimbal-3066 branch February 26, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flysky Gimbal Support for RM Boxer
4 participants