V2.16, building off of 28739ce3f4f9bfcb66318ddf4bb7a3bd7d26aa44 , I'm using a DYS GSPACE_F051 and my friend is using a Mamba HACKRC_KB_F421 as the ESC, this problem is not rooted in hardware though
Problem 1: AM32 simply will not arm when using Dshot, not in normal directional mode and not in bidirectional mode
Problem 2: the direction in bidirectional mode is wrong
NOTE: bidirectional rotation mode, not bidirectional communication
The first problem is that the ESC never arms, ever, I've verified the DShot packets using a logic analyzer.
I conducted an experiment, adding armed = 1; to the bottom of the if (dshot) if statement. The immediately started running even when I was sending 1047. This was unexpected because in bidirectional mode I expected 1047 to be the "center". The motor responded as if the directional mode was single directional, the response was linear with the throttle input.
(the experiment here also confirms that the dshot packets are valid, the bits have valid timings, the bit order is correct, the CRC bits are correct, and the min and max are roughly correct)
This pointed to the problem being the line adjusted_input = ((newinput - 48) * 2 + 47) - reversing_dead_band; doesn't "flip" the adjusted_input value. (in contrast, the code meant for RC pulse input uses the map function to reverse the adjusted_input power level)
I'm trying to help a friend get Dshot working so I rushed out a solution that's very dirty:
It's a bit heavy handed, I'm copying code from the non-dshot parts of the code. The way it arms is more instantaneous. It also uses the deadband when it is probably inappropriate to.
For some reason, zero_input_count doesn't seem to increment, which leads me to believe that adjusted_input is never 0 (or another reason). I also tried adding zero_input_count++; myself but the result was that arming takes like 30 seconds.
NOTE: the device sending out the Dshot is a ELRS receiver built on a ESP32, so it has Dshot implemented by RMT. It is not capable of sending Dshot commands.
NOTE: BLHeli32 is fully working with this ELRS receiver.
Please investigate these issues and please tell me how to fix this properly. Thanks!
V2.16, building off of 28739ce3f4f9bfcb66318ddf4bb7a3bd7d26aa44 , I'm using a DYS GSPACE_F051 and my friend is using a Mamba HACKRC_KB_F421 as the ESC, this problem is not rooted in hardware though
Problem 1: AM32 simply will not arm when using Dshot, not in normal directional mode and not in bidirectional mode
Problem 2: the direction in bidirectional mode is wrong
NOTE: bidirectional rotation mode, not bidirectional communication
The original source code at this commit
The first problem is that the ESC never arms, ever, I've verified the DShot packets using a logic analyzer.
I conducted an experiment, adding
armed = 1;
to the bottom of theif (dshot)
if statement. The immediately started running even when I was sending 1047. This was unexpected because in bidirectional mode I expected 1047 to be the "center". The motor responded as if the directional mode was single directional, the response was linear with the throttle input.(the experiment here also confirms that the dshot packets are valid, the bits have valid timings, the bit order is correct, the CRC bits are correct, and the min and max are roughly correct)
This pointed to the problem being the line
adjusted_input = ((newinput - 48) * 2 + 47) - reversing_dead_band;
doesn't "flip" theadjusted_input
value. (in contrast, the code meant for RC pulse input uses themap
function to reverse theadjusted_input
power level)I'm trying to help a friend get Dshot working so I rushed out a solution that's very dirty:
and later for single-direction mode
It's a bit heavy handed, I'm copying code from the non-dshot parts of the code. The way it arms is more instantaneous. It also uses the deadband when it is probably inappropriate to.
For some reason,
zero_input_count
doesn't seem to increment, which leads me to believe thatadjusted_input
is never 0 (or another reason). I also tried addingzero_input_count++;
myself but the result was that arming takes like 30 seconds.NOTE: the device sending out the Dshot is a ELRS receiver built on a ESP32, so it has Dshot implemented by RMT. It is not capable of sending Dshot commands.
NOTE: BLHeli32 is fully working with this ELRS receiver.
Please investigate these issues and please tell me how to fix this properly. Thanks!