farhang
December 10, 2024, 3:48pm
1
PX4 Sync / Q&A: Dec 11, 2024
Dronecode Calendar
Agenda
Announcements
Release Discussion
Q&A
Announcements
There will be no calls on Dec 25th 2024 and Jan 1st 2025
Release Discussion
Bug report / Q&A
1- BMM150 keeps resetting on Pixhawk Jetson Baseboard Bundle
2- @daryna : Using stock Pixhawk 6C mini, is it possible to fly with no GPS only relying on optical flow sensor only?
@bresch Always another sensor is needed in addition to the internal IMUs in case position mode is needed.
So far optical flow could be simulated with Gazebo Classic ( Iris Optical flow) Gazebo Classic Simulation | PX4 Guide (main)
3 - Possible to use Go_to_setpoint for offboard mode?
You could get the idea of adding an external mode here: PX4 ROS 2 Control Interface | PX4 Guide (main)
PRs needing review
PX4:main
← dakejahl:dev/bidirectional_dshot_single_timer
opened 10:37PM - 29 Oct 24 UTC
First of all a big thank you to @julianoes for the initial implementation. This … implementation differs in that it uses up to 4 DMA channels for Capture Compare input on all 4 channels of the first timer. The limitation to a single timer is due to the limited available DMA channels on most boards (4 without PX4IO on ARKV6X) This will work down to 1 DMA channel by only capturing the input from a single timer channel.
**Implementation**
If Bidirectional DShot is not enabled the implementation is the same as it was before. Timers will be configured for DShot mode if the timer supports Burst Mode and if there is enough DMA channels available (1 DMA per timer). If Bidirectional Dshot is enabled, only the first timer will be configured for DShot due to DMA channel limitations. Burst mode uses 1 DMA, and CaptureCompare mode uses 4 (re-using the DMA used during Burst). An hrt callback is used to process the eRPM frames since DShot frames have predictable timing but unpredictable pulse count. This [webpage](https://brushlesswhoop.com/dshot-and-bidirectional-dshot/#erpm-transmission) was a useful resource.
**TODO**
- Param for `timer_index` which selects the timer for bidirectional mode. Right now it is hardcoded to the first timer.
- Test STM32F7 and fix build for F4/F1
**Further discussion**
Initially I wanted to support bidirectional dshot on all timers with DMA simultaneously. This requires triggering each timer (burst/captcomp) sequentially so that we can reuse the available DMA channels between the timers.
Timer1 Burst (1DMA) --> Timer1 CaptComp (x4 DMA) --> Timer2 Burst (1 DMA) --> Timer2 CaptComp (x4 DMA)
I made it pretty far with this implementation but decide to scrap it because I kept running into race conditions and this development has already taken quite some time. I think it is still possible to do, but is out of scope of this PR. The code is structured in a way that should allow fairly easy extensibility to support this in the future.
**Issues**
An issue I found but am not fixing here is that DShot.cpp configures all of the channels on timers that have DShot enabled. This results in a pulse train on every channel output on that timer, regardless of if the output function is enabled. The fix is not super easy as it requires extra logic in order to properly initialize the timer channels for burst mode, since the enabled outputs need to be sequential. This is the current implementations behavior so I am leaving it as I found it.
**Targets Tested**
ARKV6X with 4 DMA channels
ARKV6X with 2 DMA channels
CubeOrange with 4 DMA channels
**Screenshots**
![image](https://github.com/user-attachments/assets/4cba3e58-196c-4dff-b459-81d091ec0f45)
![image](https://github.com/user-attachments/assets/c6a5e2cb-1f54-4838-8f45-d99f08dafbc6)
1 Like
We are currently setting up a new drone and are having some issues with the magnetometer (BMM150 keeps resetting on Pixhawk Jetson Baseboard Bundle ).
If time permits it would be great to get some additional input on this topic.