Pixhawk 4 holybro Arducopter 3.6.9 -> 4.0.1rc3, no control over two motors in an X8 with DSHOT

Good catch. I was thinking PH4 MINI

Dshot with 8 outputs with that Flight Controller it futile. Configure the 8 main outputs for PWM, Oneshot or Onshot125. Select channels 1-8 in the SERVO_BLH_MASK parameter. You have Serial 4 configured for ESC telemetry so connect all the ESC’s telemetry leads to Serial 4 Rx.

The question about calibration of the ESC’s when operating in PWM mode has been answered.

I’m not a DShot users but I don’t think that AP will get feedback (aka ESC telemetry) from DShot ESCs unless AP is setup to send DShot. My understanding is that the DShot protocol includes a message that allows the autopilot to request the ESC send it’s latest info over the telemetry link. Without the autopilot sending that request the ESCs won’t send it. They actually can’t send it because they are all using the same serial pin to send info back to the autopilot and so they would start “talking” over each other.

I don’t think it’s necessary of possible to calibrate DShot ESCs.

By the way, the RC Output banner change has been merged to master so if someone wanted to test that it outputs reasonable results that would be great. Basically you should be able to use MP (or QGC I think) to load “latest” onto the flight controller and then after you download parameters the Message tab should show something like, “RCOut: PWM:1-8 DS:9-12” meaning the flight controller is setup so that regular PWM is coming out of outputs 1 to 8 and DShot is coming out of outputs 9 to 12 (i.e. the auxiliary outputs).

If you choose to help me out with the testing, please remember that this is “alpha” code meaning that it hasn’t gone through beta testing so it’s probably not a great idea to fly it (although it probably will be fine).

Randy, there’s some confusion between ESC Telemetry and DShot Telemetry.

DShot Telemetry makes the signal wire bidirectional. There’s no extra telemetry wires connecting together on a serial RX. Instead, each ESC “responds” to each DShot frame with a telemetry frame on its respective MCU pin. This only works in DShot mode.

ESC Telemetry is where the T outputs from all ESCs are wired together to the same serial RX pin. This works regardless of the protocol used for driving the ESC.

Now, what I don’t quite get is the following:

  • for PWM output, the dataflash logs record the usual 1000-2000 range
  • fror OneShot125, the dataflash logs record the specific 125-250 range
  • for DShot output, there’s a snippet of code running, supposedly with the sole purpose of translating the 2048-step values into the PWM 1000-2000 usual range, and logging that.

Why isn’t dataflash logging the actual DShot value !?

I’ve tested the RC Output banner message. What I get is:

ArduCopter V4.0.2-dev (2898b5e2)
Pixhawk4 0049002A 3038510B 35323635
RCOut: PWM:1-8 DS300:9-12

How to interpret this? I know that I can’t get 8 DShots, but why I have only 4 and only 3 are reported in telemetry?

Does the choice of the protocol depend on what the ESCs answer? Or it will be the same whether they are connected or not?

Do I have more than 8 outputs configured?

1 Like

I’ve started to further analyze which outputs exactly my setup is using. Pixhawk 4 is a bit confusing, as both I/O and FMU outputs are connected to the power board, and there is no schematics to say where actually the pins are wired? (to I/O? FMU? both?) So maybe it was so that I was flying with I/O PWM outputs, and for some reason 3 of them are overloaded to FMU already on the Power Board? Here the wiring is shown:

(so two outputs and protocols connected to the same pins, one group of motors is quick enough to get DShot? And the remaining ones must be happy with PWM?)

There is also a micro board with pins, allowing to connect just to a single ribbon wire, either FMU or I/O, but not both. I’ll try and report.

But the situation with the DShot support is really strange for Pixhawk 4 and Durandal. Do really these great high end controllers enable just 6 and 5 outputs, respectively? So not even a hexacopter with Durandal? There are still CAPs - is there no chance of using them? (I’m not asking about the current code but rather a future state, even at the expense of some other features)

EDIT: correction: I’ve had just one ribbon wire connected, that from FMU. So no IO influence here.

I’ve connected a single ESC to all the inputs with a connector board attached to FMU output. The outcome is (partly consistent with the new banner message):

outputs 9-12 - DShot available, telemetry works, ESC gives a different sound sequence (one more tone)
outputs 13-16 - no Dshot, no telemetry

Why it is so? I should have DShot for 6 outputs. It goes accross the timer groups. (4 outputs working)
I would expect the banner message to be:

RCOut: PWM:1-8 DS300:9-14 PWM: 15-16

from PX4 docs:

FMUv5-based boards (e.g. Pixhawk 4 or CUAV Pixhawk V5+) support DShot only on the first four FMU pins due to hardware conflicts. The other pins cannot be used as motor/servo outputs.

So maybe it’s to be expected that only 4 DShots work? Why should be a difference between ArduPilot (6) and PX4 (4) on the same hardware?

It flies! That’s the conclusion to end this thread. I’ve tested the 4.0.2-rc3 (or master, the first version for which the DShot banner messages work). In more detail:

-4 motors (the “upper” ones on X8) work in the DShot mode, with telemetry
-4 bottom motors work in PWM mode, the calibration is possible with BLHeli_32 (setup for DShot but fall back to PWM)
-the flight is maybe even smoother than previously. In particular the takeoff, not easy with this copter (long legs, CoG high)
-in telemetry, motors 3 and 2 have in average more RPM and more current - I don’t know how reliable this data are?
-the banner message works not correctly, is incomplete. It shows:

RCOut: PWM:1-8 DS300:9-12

and it should be

RCOut: PWM:1-8 DS300:9-12 PWM: 13-16

-4 DShots are functional and I can’t see how the promised 6 could be obtained for Pixhawk 4? I have identical ESCs and the setup which has been tested very carefully. PX4 promises only 4 DShots for this FC, maybe not without a reason?

-I hope that something will be done with enabling DShot for 8 motors. Right now, I don’t see any point in buing high end FCs - what you gain with better sensors you lose with less precise motor control. And not even a DShot hexacopter with Durandal? It’s a joke! How about using the CAPx inputs/outputs?

I attach the logs, screenshots of current and RPM for motors 1-4, and a bonus, a 360x180 pano made during this flight. Of course in non-optimal conditions, in sunny weather during winter (non-existent this year in Eastern Europe) the sun is too low on the horizon. But I’m very happy that my copter is again airworthy :slight_smile:

http://46.41.148.74/pan/psv-test/example/zakole.html

46.41.148.74/20-02-07_11-27-20.bin

1 Like

That’s great you found a solution that works Maciej! Quite novel I would say but creative :grinning: Thaks for sharing the pan shot, it’s cool!

Are you sure that is correct for the CUAV v5+? Reason I ask is that I have this flight controller in a HEX using Dshot on aux1-6 in Dshot150 mode. And it flies perfectly and I get telemetry from all 6 ESCs

EDIT

I reread and saw where you your PX4 only supports 4 vs AC 6… Nevermind

@ThePara,

OK, txs. I’m definitely not aware of the difference between DShot Telemetry and ESC telemetry. I only see BL Heli ESC telemetry mentioned on our DShot wiki page so I’ll have to chat with some of the other devs about this.

Re the difference in the onboard log’s RCOU ranges when using OneShot vs DShot. I’ve created an issue for it here so we will discuss it at the next dev call. I think the difference stems from the implementations. Regular PWM outputs and OneShot are basically the same thing except that OneShot uses a smaller range. DShot is a completely different protocol though as are ToshibaCAN, PiccoloCAN, KDECan, etc. These protocols are implemented almost as translations of the RegularPWM. I.e. the RegularPWM output continues but then AP takes the outputs and converts them to whatever protocol the ESC uses.

My personal view is that it would make support more difficult if we logged the “native” range output to the ESCs depending upon the protocol. An extreme example is ToshibaCAN which outputs in the range of 6300 to 32000. Trying to make sense of this in a log would be hard. To be consistent I think we should consider artificially logging OneShot in the 1000 ~ 2000 range as well but I suspect other devs will disagree… we shall see.

@maciek252,

Great that you’ve got it working and thanks for testing out “RCOut:”. As far as I know, besides me, you’re the first one to try it. I suspect the RCOut message is correct and we’ve got an issue in our hwdef file for the Pixhawk4. Our wiki page for the Pixhawk4 is inconsistent about whether the board supports 14 or 16pwm outputs (should be corrected soon) which may be related.

Thanks again for the report.

ArduPilot does not yet implement bi-directional DShot

not quite. You still need a mechanism to tell each ESC when it is safe to send telemetry. The method ArduPilot supports is to set the telemetry bit in DShot command packets. Some ESCs support an alternative method where a particular throttle level is sent which allows for non-DShot protocols to trigger telemetry send. ArduPilot does not yet support those non-DShot mechanisms

because the logging happens at a level above the translation to the 11 bit DShot values. We could change this, although there isn’t much advantage

The Holybro ESCs that I am using allow me to send telemetry at a 10hz rate regardless of being asked for it. This is a setting in the blheli32 firmware. I needed to enable this to get telemetry on my octo which is using oneshot

nice!
how do you prevent multiple ESCs sending at the same time and causing corruption on the UART?

Ummm. 🤷. I figured they would just fight it out. Lol

I don’t know honestly, but I do get different results for each esc so they might arbitrate?

I do think every now and then I get a collision, as a rpm line spikes super high. But I get maybe one of those every 20 mins of flight. If interested I can share a log

This is what I am referring to:

OK so here is an interesting question… And I do not want to drag up the “are we sending dshot or not” conversation… But…

If telemetry is being asked for when using dshot, and we don’t get any back, is dshot really being used?

Thanks for this clarification. Kept me from trying it myself.

@maciek252,

@tridge and I investigated this over the weekend and found two issues:

  • there is a hardware limitation that means the Pixhawk4 can only support 4 DShot outputs. In case it matters, the limitation is on the DMA (Direct memory access) channels which is required for high speed output. It seems that the DMA channel we would need to use to support 6 (or perhaps 8) dshot outputs is already being used to communicate with the IOMCU (the 2ndary processor on Pixhawk boards that sends outputs to the MAIN OUT channels).
  • there is a bug in the “RCOut” code (or more accurately a bug in some code that the “RCOut” relies on). We’ve got a fix here that will probably go out in Copter-4.0.3.

Anyway, the short answer is that it won’t be possible to get DShot working on more than 4 channels on a Pixhawk4. We’ve updated the wiki page for the Pixhawk4 to say this so hopefully this will be easier for the next person.

Thanks again for the testing and reporting back.

Great! Thanks, a negative result is better than uncertainty. I’ll test the RCOut code when it will be available.

But how about CAPx outputs? Maybe can IOMCU remain disabled and instead some PWM outputs be available via CAPx? For example, I need just 3 PWM in my copter, for the landing gear and triggering the photos. Would this require hardware modifications?

And what is the situation with Holybro Durandal? Also only 5 DShot outputs? Isn’t this already time to say goodbye to IOMCU? Anyway, many thanks for investigating, when looking at the other threads one can easily notice that ArduPilot users are interested in DShot!

Another interesting takeaway from this thread is that you can easily check if DShot is being enabled by connecting an ESC to the working outputs. The sound sequence for DShot is longer than for PWM.

So, Pixhawk 4 Mini should be able to run more DShot outputs, since it lacks the IOMCU.
Question is: how many ? :slight_smile: