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

Correct DShot Timings #16786

Closed
1 of 6 tasks
andyp1per opened this issue Mar 2, 2021 · 8 comments
Closed
1 of 6 tasks

Correct DShot Timings #16786

andyp1per opened this issue Mar 2, 2021 · 8 comments

Comments

@andyp1per
Copy link
Collaborator

andyp1per commented Mar 2, 2021

This is not really a feature request but a documentation of DShot timings for BLHeli that we should use to model our own DShot output on. BLHeli32 and BLHeli_S are incredibly sensitive to timing but always guaranteed to work on Betaflight. Here then are the betaflight timings that we should model as closely as possible

Platform

  • All
  • AntennaTracker
  • Copter
  • Plane
  • Rover
  • Submarine
@andyp1per
Copy link
Collaborator Author

Betaflight 4.3.0 w/DShot600 against BLHeli_S 16.7.3 (Channel 0), BLHeli32 32.7 (Channel 1) and no ESC (Channels 4 & 5). 8k gyros 1k PID loops:

image

image

Pulse-to-pulse is exactly 1ms

@andyp1per
Copy link
Collaborator Author

image

For Channel 0:
ΔT 26.048 µs
Nfalling 16
Nrising 16
fmin 600.962 kHz
fmax 603.865 kHz
fmean 601.54 kHz
Tstd 3.312 ns

ΔT 32.552 µs
Nfalling 1
Nrising 1

ΔT 23.92 µs
Nfalling 8
Nrising 8
fmin 266.525 kHz
fmax 435.54 kHz
fmean 345.713 kHz
Tstd 708.89 ns

For Channel 1:

First pulse is the same then

ΔT 27.616 µs
Nfalling 1
Nrising 1

ΔT 26.776 µs
Nfalling 8
Nrising 8
fmin 251.004 kHz
fmax 377.644 kHz
fmean 306.802 kHz
Tstd 760.068 ns

@andyp1per
Copy link
Collaborator Author

At 8KHz PID loop the pulse output is identical but pulse-to-pulse is 125us (i.e. 8Khz)

@andyp1per
Copy link
Collaborator Author

DShot 300 / 1Khz PIDs:

image

Pulse-to-pulse 1ms as before

image

Channel 0:
M1:
ΔT 52.112 µs
Nfalling 16
Nrising 16
fmin 300.481 kHz
fmax 301.205 kHz
fmean 300.625 kHz
Tstd 3.312 ns

M2:
ΔT 33.8 µs
Nfalling 1
Nrising 1

M3:
ΔT 50.048 µs
Nfalling 8
Nrising 8
fmin 131.441 kHz
fmax 204.918 kHz
fmean 165.188 kHz
Tstd 1.446 µs

Channel 1:
First pulse the same
M2:
ΔT 30.104 µs
Nfalling 1
Nrising 1

M3:
ΔT 53.368 µs
Nfalling 8
Nrising 8
fmin 125.502 kHz
fmax 188.253 kHz
fmean 154.104 kHz
Tstd 1.468 µs

@andyp1per
Copy link
Collaborator Author

DShot 150 / 1Khz PIDs. Interestingly BLHeli_S does not work at this point - it does not return telemetry. Also higher PID rates are disallowed because the DShot pulse will not fit:

image

Pulse to pulse still 1ms

image

M1:
ΔT 104.424 µs
Nfalling 16
Nrising 16
fmin 149.88 kHz
fmax 150.24 kHz
fmean 150.024 kHz
Tstd 4.485 ns

M2:
ΔT 34.416 µs
Nfalling 1
Nrising 1

M3:
ΔT 106.488 µs
Nfalling 8
Nrising 8
fmin 62.751 kHz
fmax 94.127 kHz
fmean 77.283 kHz
Tstd 2.887 µs

@andyp1per
Copy link
Collaborator Author

Interestingly DShot1200 is disallowed so I couldn't get any data

@andyp1per
Copy link
Collaborator Author

andyp1per commented Mar 2, 2021

500Hz PID loop rate works fine so clearly ESCs do not need 1Khz as our code claims. Maybe 500Hz is the lowest - it is the lowest that Betaflight allows
image

@giacomo892
Copy link
Contributor

Can we close this? @andyp1per

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

2 participants