Skip to content

electrical comm esc

Grant Geyer edited this page Jan 31, 2022 · 6 revisions

ESC Controls

PWM, OneShot, MultiShot, DShot

Part of Communication Protocols.

There are several types of ways that most ESCs found in quadcopters are controlled. I will divide them into "Analog" and Digital.

  • "Analog"
    • "PWM"
    • OneShot
      • Oneshot125
      • Oneshot42
    • MultiShot
  • Digital
    • D Shot 150, 300, 600, 1200

"PWM"

The "Analog" methods are not analog in the traditional sense of a value ranging between 0 and VCC; they are PWM and the length of the high pulse is measured to determine the value. This is all based on old servo motor control that many controllers could easily output in the early days of ESCs. The first and simplest to cover is "PWM". Unlike normal PWM fed to an LED or your choice of component in which the duty cycle and frequency matter most, the "PWM" for ESC control is based on the pulse length of the on time of the signal. The period between different signals, which in turn affects the duty cycle and frequency, does not affect the speed of the motor/ESC. Pulses range between 1000 us and 2000 us, though some ESCs will use 1100 to 1900 us or other ranges. The maximum duty cycle ranges from 40 Hz to 500 Hz based on the ESC, so look at the manual/documentation for your ESC and firmware (if it exists at all because some of this stuff is really undocumented). Frequencies (especially on the lower end toward 40 Hz) were fine for controlling drones and the like when the inputs were coming from a human pilot.

OneShot, MultiShot

As PID loops in flight controllers (FCs) became more common, other control methods started popping up. OneShot and MultiShot are variants that basically divide everything by a factor, like 8, 24, etc. For example: in Oneshot125 pulses range from 125 us to 250 us. OneShot also dictates that values (pulses) are only sent when there is a new value to use from the PID loop. This is done so that a pulse doesn't start getting sent, only to have the PID loop calculate a new value just after the start of transmission. Oneshot42 has 42-84 us pulses. Multishot has 5-25 us pulse lengths.

DShot

The D in D Shot stands for digital. In comparision to analog methods that are sensitive to timing mismatches and electrical noise that could affect the pulse, digital methods are most robust. A D Shot packet has 16 bits. The first 11 bits are the throttle value (note 211=2048 possible values), then there is 1 bit that is high if the ESC should send a telemetry packet. Then there is a 4 bit CRC. If the ESC reads the D Shot packet annd the CRC does not match the rest of the message, then the packet is discarded. In this way, noise and errors cannot cause the ESC to run at a value not written by the controller.

D Shot packet 1s and 0s are similar to the 1-wire protocol. Each bit has a high and low component. 1s are represented by a longer pulse and 0s are represented by a shorter pulse. For more information on the timings and pulse lengths, I recommend reading the third and fourth links below (the dmrlawson and blck.mn ones). Good documentation on the CRC calculation is also available on the former page.

NOTE: For DShot, some guides will recommend removing the filtering cap. I have no idea how necessary that is on our ESCs, but it'd be good to check on a scope. They are newer with good firmware support for DShot, so I wouldn't be suprised if the designers thought to not put a cap there.

NOTE: A lot of references talk about needing an STM32F1 or STM32F3 or greater. This is talking about the micro on the ESC itself. The micro sending dshot to the ESC can be something less powerful, namely an STM32F0 like we use.

Application to ROV

From the ROV Maelstrom (X8) through ROV X12, Afro ESCs were used with SimonK firmware. When the ESCs were discontinued, the Scott found near Lumenier 4 in 1 ESCs (45A model if you're looking them up) with BLHeli firmware for ROV Triton (X13). By default, the BLHeli PWM range is 1 to 2 ms. The firmware starts in unidirectional mode (as most quadcopters only want to the go up), but this must be reflashed to bidirectional mode. To get an idea of pulse length to speed (and other parameters), see Blue Robotics' T200 Technical Details page. NOTE: their ESCs us 1.1 to 1.9 ms, unlike BLHeli's default settings. Blue Robotics' Basic ESC page also includes an arduino sketch to get an ESC and thruster up and running. As shown on Blue Robotics' graphs, 1.5 ms corresponds to neutral/stopped, 1 ms corresponds to full reverse, and 2 ms corresponds to full forward.

References

Clone this wiki locally