-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Implement Input for Spektrum SRXL2 Receivers #17555
Conversation
note: holding as draft, until the QGC calibration issue is resolved |
edit: fixed formatting. |
re: missing include: Resolution ideas:
Progress:
|
Channel Mapping chartNote: still blocked by: QGroundControl issue 1.Mode 1 and mode 2 seem to produce identical channel data Channel Mapping: Mode 1
Channel Mapping: Mode 2
|
@dagar All known bugs fixed. Rebased on master 2021/05/22 |
Update: this PR is now out-of-sync with 'master'. It will be squashed & rebased after resolution of the current conversations:
Also, a new topic, since the current PR is mostly acceptable:
|
@teyrana is |
@podharmic However, IF you know what you're doing and are comfortable manually starting the rc_input process to kickstart the driver, ... It is functional, and would benefit from some ground testing :) |
(ci failed due to unrelated issues in UAVCan. Paused for a few days to let that issue resolve itself.) |
( pushed a rebase / update, to check CI status ) |
CI failed due to changes outside of PR:
|
Update: 2021/Aug/31
|
I've ordered some new SRXL2 equipment and I'll follow up with this soon. |
Source patch: - "srxl/dsm telemetry initial support" Contributors: - Kurt Kiefer <kekiefer@gmail.com> (original commit) - Daniel Williams <equipoise@gmail.com> (rebase) 1. remove SRXL telemetry code from this branch 2. split Spektrum Legacy serial protocol (erroneously labeled `dsm`, currently) - revert dsm parser to mainline 3. SRXL parser is now separate from dsm code - src/lib/rc/srxl.h|cpp: C => C++ style (hpp|cpp)
- handshake - control channels - bind receiver - disables control channel mapping
Update: 2021-Nov-16
|
@teyrana confirmed that
Pixhawk now reflects 6 channels sent from my DX6e. This is confirmed by checking |
Also (partially) confirmed that when connected to servos, radio transmitter commands are actuated by servos. I say partially because there are two concerns:
I can post a couple videos that show both points if it helps. |
Update on the two issues from my physical test: (1) I am now getting elevator and motor responses to my commands. I'm not sure why elevator wasn't working before, but the motor was previously unresponsive because I hadn't armed it (user error). This issue is resolved. Would (2) be an issue with this SRXL2 feature, or does this occurs with other receivers communicating through the SBUS/DSM port? @dagar Has anyone else seen this "lock up" before (even on other receiver types/connections)? I'm certain this is not a servo hardware issue, as I don't get this freezing when directly using my AR620 without a Pixhawk. Sporadic.Radio.Freezing.mp4 |
@teyrana I got some data but haven't been able to sift through it all. Once I'm back from traveling I'll upload it here. |
log_119.zip In order to "locate" the failures when you're reading this data, every time I noticed the aileron servo being unresponsive to my RC commands, I would throw aileron left-right-left-right commands from extreme to extreme (like you see in the video). If there were portions when the servos were not tracking, to flag the event I would flip an RC switch on and off rapidly. Those signals and events can be seen by the following mappings: aileron commands (received and transmitted):
RC "error flag" switch (rapidly on/off to indicate the previous aileron commands weren't tracked):
I've looked through this data to try and find a disparity between the input channels (input_rc_gears, rc_channels) and the output commands (actuator_outputs_1, manual_control_setpoint.y). I haven't found that yet, so I'm thinking it has something to do with the input RC commands not being properly processed. There's a lot more data in the .ulg file, but none that I've found helpful in finding why there are problems (for example, rc_signal_lost is false, rc_signal_found is always true, etc.). You might find something I haven't found though, I'm still looking. Another thing to note, the two instances of this failure occurs both when the system is disarmed (the first instance) and when the system is armed (the second instance). I'll load another set of data if I observe the failure again today. |
@mfry90 (Apparently the pixhawk 4 has two processors, and I want to run this by the core devs, and ask it may be causing this issue.) |
Here's another data log that shows the same behavior. I believe that the SRXL2 protocol is not processing RC commands correctly, because the topic Top-level description of my test run:
Here is the input_rc_gears topic (a mirror of the input_rc topic), recorded on the .ulg file: The failure can be found from 34 seconds to 43 seconds. Although I am commanding sinusoids, |
@mfry90 Update: 2022-Jan-29Using Configuration:
|
@teyrana
|
@teyrana Testing update here. I believe I've been able to rule out the remaining PX4 or Pixhawk hardware as causing the intermittent freezes. I replaced the SPM4651T (which uses the SRXL2 protocol) with another Spektrum serial remote receiver SPM9745 (which does not use SRXL2). I've collected about 15 minutes worth of data from distinct tests and have not yet seen the same intermittent freezing that I'm observing with the SRXL2 receiver. Next steps for me are logging diagnostic messages in the modified code to determine what part of the code is causing the locking. |
@mfry90 (if you're wondering, I never did get my setup to output actuator signals at all :/ ) |
Are there any updates to when this will be this will be resolved? |
@alexzhou707 |
Problem Description
Updated: 2021 Sep 2
A clear and concise description of the problem this proposed change will solve:
Not included:
Describe your solution
Best effort has been made to work with the exist architecture.
src/lib/rc/srxl.*
.src/drivers/rc_input/RCInput.*
to accommodate the addition parser caseHistory
This patch is inherited from Kekiefer (https://github.com/kekiefer), Much thanks for the examples, and ground-work.
Describe possible alternatives
Trade-Off 1: Custom vs Prexisting SRXL parser
Available as implemented in this patch. It is simple to comprehend and debug, but also lacks features.
Spektrum RC, the original equipment manufacturer of both the transmitter and receiver produces a reference library to parse this telemetry:
https://github.com/SpektrumRC/SRXL2
It is more complicated, but fully featured. And maintained by Spektrum themselves.
Recomend bring it in as a submodule for future development.
Trade-Off #2: Parellel SRXL parser vs Expanding DSM parser
The rational here is very simple. From the Spektrum Documentation:
In addition, parallel parsers prevent introduction of inadvertent bugs to the legacy "dsm" parser, and also allows completely code paths for the two cases.
Documention
the list of supported receivers at:
https://docs.px4.io/master/en/getting_started/rc_transmitter_receiver.html
is just out-of-date. It needs to be updated.
Compatible: - PPM, satellite receivers, SRXL2/Serial Port
Note: DSM refers to over-the-air radio-wave modulation. DSM modulated receivers may implement analog PWM, Summed PWM, or SRXL
Development Hardware:
Test Setup:
Procedure:
plug in dronecode adapter
connect:
$ screen /dev/ttyACM1 57600
(yes, baudrate is necessary, USB connection notwithstanding)
plug in mainboard (fmu) (if already plugged in, unplug, then replug -- the goal is to verify the boot sequence on the debug console.
Verify that we see the boot sequence through the dronecode adapter (the boot text should scroll by, and dump you at a
nsh>
prompt.Build firmware:
rc_input start
rc_input status
Spektrum RC Specifications Sources
Receiver Feature Matrix
Old Spektrum Serial Protocol (RevG)
Old Spektrum Serial Protocol (RevA)
New Serial Protocol: SRXL2
Github Links