-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Dshot 3D mode, allowing for both forward and reverse rotation #3139
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
base: master
Are you sure you want to change the base?
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: |
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.cpp
has been edited to remap the throttle values properly for the selected mode.