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

DSHOT sending 0048 on forward after reverse #10648

Open
pitts-mo opened this issue Jan 26, 2025 · 2 comments
Open

DSHOT sending 0048 on forward after reverse #10648

pitts-mo opened this issue Jan 26, 2025 · 2 comments

Comments

@pitts-mo
Copy link

Current Behavior

INAV rover is sending a dshot signal 0048 burst when RC input transitions from neutral to forward after being in reverse.

Note: This does not happen on initial transition to forward from neutral or on attempts to transition to forward from neutral when the prior non neutral command was forward.

Steps to Reproduce

count, DShot Data, action
6561, 0000, 1 -Armed neutral
76, 1048, 2 -transition forward
3, 1050, increase forward
3, 1054, increase forward
~
3, 1056, decrease forward
22, 1048, decrease forward
54, 0000, 3 -transition neutral
3, 0107, 4 -transition reverse
3, 0114, increase reverse
~
3, 0134, decrease reverse
3, 0116, decrease reverse
11362, 0000, 5 -transition neutral
41, 0048, 6 -transition forward -this value should not be sent
3, 1052, increase forward
3, 1061, increase forward

Expected behavior

The first non zero command when transitioning from neutral to forward should be >=1048.

Suggested solution(s)

mixer bug?

Additional context

INAV_8.0.0_cli_MAXX_20250126_084307.txt


INAV/MATEKF722MINI 8.0.0 Jan 21 2025 / 16:18:25 (ec2106a)

@pitts-mo
Copy link
Author

I have experimented in mixer.c.
The most interesting things I found were strategically setting reversibleMotorsThrottleState = MOTOR_DIRECTION_FORWARD, outputScaleMin = DSHOT_3D_DEADBAND_HIGH, and attempting to revert the dshot reverse fix. However, I have not established the understanding to make this work properly in both forward and reverse.

dshot range values:

// Digital protocol has fixed values

dshot mix request:

#ifdef USE_DSHOT

dshot direction/speed handling:

#ifdef USE_DSHOT

specific fix for dshot reverse:

#ifdef USE_DSHOT

@pitts-mo
Copy link
Author

pitts-mo commented Feb 9, 2025

Update:
Closing PR #10663 as it only moved the problem.

It feels like the detection of commanding forward vs reverse is somehow isolated from the dshot command output scaling in such a way as to allow new commands immediately after a change of direction to return results scaled for the old/prior direction. I have not identified the root cause but do question if this is a simple issue of refresh timing or a result of filtering?

Below is a sample of dshot command counts using PR #10663 around zero crossing as I slowly transition throttle between full forward and full reverse. This data set was started well after arming but for some reason I also see a burst of dshot command 0024 was sent after the first transition to forward had already begun.

inav_pr10663 -crossing zero dhsot command counts.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant