Repository navigation
Dshot 3D mode, allowing for both forward and reverse rotation - #3139
Conversation
|
WARNING: Both PR #3139 and PR #3126 are sending dshot 0000 disarm command prior to ELRS link! This PR (#3139) does allow user to send the disarmed/zero throttle command which is required for use of AM32 ESCs. And I am now able to use 3d mode with an AM32 esc by setting the RX to use normal DSHOT output and using an EdgeTX curve to trick sending 0000 at center with inverted reverse throttle and normal forward throttle ranges.
draft EdgeTX dshot to dshot3d test curve: *Updated to remove invalid data due to a dirty pot and loose connection in my test setup. -fixed now :-) |
|
New test of PR#3139 normal dshot along with the RX set to mirror the same channel out on another PWM pin captured with pulseview. This data set clearly shows that the RX is outputting the dshot 0000 disarm command immediately on power up without awaiting link and user input to send dshot 0000 while the PWM pin does not output any signal until after link has been established as to allow the user to safely arm a PWM ESC. I do notice the output I collected for this test is much cleaner. I am starting to suspect my MT12 P2 knob tainted my prior tests and P2 knob just needed a bit more exercise to clean up the potentiometer wipe path. When I have more time I will: |
|
I just ran a quick Dshot-3D test and find this does behave as expected. Currently I think this Just need to leave the dshot pins floating at boot and wait for ELRS link to send dshot packets. |
|
Commenting this single line will restore arming safety to user control. |
|
that was there before I started modification, I thought that was the desired behavior the original code would've armed BLHeli32 ESCs, but not AM32 I'm fine with removing the line that you are pointing out as long as everybody is in agreement |
|
Summary understanding: |
|
@frank26080115 is it ok with you if I rebase this to master, with a few updates for the config, and push your branch? |
Sure go ahead. Is there anything for me to do? |
|
I look forward to test this again :-) Using an EdgeTX curve can allow 3D DSHOT but it's a bit too exciting to switch between PWM / DSHOT modes without remembering to enable/disable the curve :-) |
71e3036 to
395cd67
Compare
Nothing for you to do. Thanks. They are all updated and ready for testing and hopefully merging soon. |
# Conflicts: # src/lib/ServoOutput/devServoOutput.cpp # Conflicts: # src/lib/ServoOutput/devServoOutput.cpp
395cd67 to
ddd12d5
Compare
|
Built MT12, ER3C-i, RP4TD, and a gerneric EPW5. All servos and ESCs are working with PWM, DSHOT, and DSHOT 3D as expected. Thank you, -p |
CapnBry
left a comment
There was a problem hiding this comment.
I merged master and moved the dshot stuff from servoWrite() to its own function. The RX config updater isn't working right but who would expect that anyone could ever do that correctly? I'll fix it in #3391
Behavior change: This PR applied DSHOT-3D with an input range of 988-2012, but existing DSHOT used 1000-2000. We should not have confusingly slightly different ranges so they both now use 1000-2000.
|
@frank26080115 have you had time to test Dshot3D since CapnBry's updates and merge to master? After updating my test gear with new builds from master today I appear to observe an issue with Dshot3D center position and/or scaling. Reverting my RX to builds for this PR on 2025-10-19 restored Dshot3D to expected behavior. I should be able to run more Dshot & Dshot3D tests as well as capture an output sample in the next few days. |
|
The recent changes have left both Dshot and Dshot3D broken. PR3302_gaps-in-dshot-data.sr.zip Notes:
|
|
Oh lovely, thanks for the report @pitts-mo Can you try aa42bc2 which is master right after this PR was merged and see if that has the correct DShot 3D output you had verified earlier? We need to narrow down which PR broke it. Hopefully, this one checks out and it is just #3140 messing with the dshot output. The behavior is extremely different after 3140 by design but it should work. I only reviewed the code itself in both of these PRs, and did not grab any captures to verify their operation. |
|
I now suspect this data set was in erroneous.
|
|
I'm just looking at PWM using the latest master (2775774). I can't see any major gaps or errors. The scatter plot shows 333Hz packet rate / 333Hz PWM frequency sampled for one minute on CH4., CH5 is on DShot, CH6 is on DShot 3D (to make sure they don't interfere with PWM). I can't see gaps (all pulses are with 3ms period) and there's hardly any jitter, at worst some quantization noise from ETX (all duty cycle are either 50.03% or 49.96%). What exactly is your setup and what are you looking at?
|
|
I will re-verify PWM before/after October 19 builds tonight... Realizing I
might have forgot to remove uart 1/2 pin assignments on the RP4TD I am
using.
…On Sat, Nov 22, 2025, 11:05 Michael ***@***.***> wrote:
*mha1* left a comment (ExpressLRS/ExpressLRS#3139)
<#3139 (comment)>
But I can confirm the irregular timing on DShot (3) and DShot 3D (1)
image.png (view on web)
<https://github.com/user-attachments/assets/890d6d96-9915-4e56-822b-8511e7ede340>
—
Reply to this email directly, view it on GitHub
<#3139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNT6YDATUR4ASW72J5FXZD36CCTJAVCNFSM6AAAAACJNJXQKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNRWHAZTKOBQG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I did forget to clear the uart pin assignments on my RP4TD after I reset it to verify problematic signal ... but clearing them did not make a difference ... testing with aa42bc I still see periodic gaps in PWM signaling, no valid Dshot packets on Dshot output and no output at all for Dshot3D. |
|
Test with PR3302 ddd12d ~2025-10-19. All devices appear to work but I do notice some noise on channel 1. PWM pins = 1,3,18,5 ddd12d_working-but-noise-on-ch1.sr.zip
|
|
now repeat the same with master |
|
See the PR3302 sample above. I can re-test again but I did not see any
changes since and was merged to master.
…On Sat, Nov 22, 2025, 20:19 Michael ***@***.***> wrote:
*mha1* left a comment (ExpressLRS/ExpressLRS#3139)
<#3139 (comment)>
now repeat the same with master
—
Reply to this email directly, view it on GitHub
<#3139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNT6YCFP5ZDIMSFINU3JA336EDQNAVCNFSM6AAAAACJNJXQKCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNRXGMYDOMBUGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
master 277577 still notice issues of: master-2025-11-22_ch1-noise_dshot-gaps.sr.zip
|
|
ok, I have tested back and forth a couple times now to verify this. 14872ae introduces DSHOT 0048 @min throttle and gaps in DSHOT and DSHOT3D signal aa42bc2 still functions with PWM, DSHOT 0000 @min throttle, no notable gap in DSHOT or DSHOT 3D data signal. -Not sending DSHOT 0000 @min throttle makes sense as I notice a hack in DshotRMT.cpp to translate 0048 to 0000 was removed. I will submit a PR to propose a better fix. -I do not yet understand the issue with gaps in DSHOT data signal. extra thought: |
|
Well the DShot gaps I can say are a function of how #3140 changes how the dshot packets are scheduled now. The old system used a separate piece of hardware for each channel, but the replacement cycles through each one and should be sending a DShot command, switch to next output, send a dshot command, etc. I'm not sure it appears to be doing that properly though. From the post right above this one though, it appears as you are saying now that aa42bc2 works fine, is this correct? |






DShot does not work linearly, when controlling a ESC configured for "3D", the values are not linear
The stop value is 0, but the lowest throttle value for forward rotation is 1048, the highest throttle forward is 2047. The lowest throttle while reversing is 49, and the highest throttle while reversing is 1047.
But this is also completely different for a ESC configured for single-direction rotation, where 0 means stop, 48 means low throttle, and 2047 means max throttle.
This PR adds a 3D mode for DShot, the user can choose this from the drop-down menu within the Wi-Fi web page user interface. The code in
lib\ServoOutput\devServoOutput.cpphas been edited to remap the throttle values properly for the selected mode.