I am curious about what determines the frequency of the bidirectional DShot feedback (ESC status). When I attempt direct motor control via ROS2 at a frequency of 500 Hz, I observe the following in the working queue, indicating that the DShot is running at 500 Hz:
Work Queue: 10 threads RATE INTERVAL
|__ 1) wq:rate_ctrl
| |__ 1) control_allocator 20.0 Hz 49996 us
| |__ 2) dshot 500.0 Hz 2000 us
| |__ 3) mc_rate_control 2003.1 Hz 499 us
| \__ 4) vehicle_angular_velocity 2003.1 Hz 499 us
|__ 2) wq:SPI1
...
I have increased the DDS frequency under the suggestion mentioned in this question
However, the frequency of esc_status is only ~45 Hz by ros2 topic hz /fmu/out/esc_status.
Based on my understanding, the bidirectional DShot protocol allows for obtaining ERPM feedback at a frequency matching the DShot motor control frequency (i.e., over 2000 Hz), without requiring telemetry over the serial port. However, as I’m reviewing the firmware, I’m uncertain if this functionality is supported in PX4. Part of my knowledge comes from the Betaflight documentation, as outlined below:
I am looking to implement a closed-loop motor speed control system based on ERPM feedback, and I hope the feedback frequency can match the control frequency. Could I kindly ask if, based on your knowledge, this is feasible? @Benja
I found that I was unable to enable bidirectional DShot, but I did receive ERPM data via telemetry. My hardware is this, and I’m wondering, in addition to enabling DSHOT_BIDIR_EN, what other configurations are necessary to fully enable bidirectional DShot?
I’ve been looking at DShot for the past week+. I found this thread when searching for the dshot loop rate. I am running a custom fork of PX4, based on 1.15 but I pulled in two recent PRs for bi-directional DShot support
These were merged into PX4 main, so if you are using that you should be all set. They added a new parameter, DSHOT_BIDIR_EN, set that to 1 and try it out.
Typing “work_queue status” I see that my dshot loop is 800 hz, and that matches up with my o-scope readings of ~1.2 ms between dshot command packets.
Now I am getting the dshot response packets with eRPM data. Our drones use AM32 ESC boards, so I kinda have to keep an eye on what is in PX4 and what the AM32 source code expects. For instance, esc_info in PX4 only sends command 6 once, but AM32 expects 6 repetitions of that command before it replies.
Oh also, you mention that you are using the telemetry for eRPM data, but I read that using serial telemetry responses is far too slow to be used in active RPM-filtering, it’s more just useful for logging/review. Found that info here DSHOT - the missing Handbook | Brushless Whoop