0
\$\begingroup\$

I am curious how ESC's read a pwm signal. I previously thought they interpret the average voltage of the signal, and determine their AC output rate based on that.

However an ESC's output is based on pulswidth in between 1-2 ms, regardless of the period (assuming it is in 50-500 hz for my ESC's). So clearly it can't be only looking at avg. voltage, since 1.5 ms duty cycle corresponds to different average voltage for different periods.

So if not avg. voltage then what? Are they able to exactly pinpoint rising/falling edges?

\$\endgroup\$
  • 1
    \$\begingroup\$ Assuming you mean the model radio control ESCs, they measure the pulse width. \$\endgroup\$ – Brian Drummond Sep 15 '16 at 18:38
  • \$\begingroup\$ Ok that makes sense, so what is the mechanism behind that measurement? Some people I am working under have a hard time believing an ESC is able to do that, and I want to be able to explain to them how the ESC works. \$\endgroup\$ – Thomas Kirven Sep 15 '16 at 18:43
  • \$\begingroup\$ They use something called an interrupt routine. Whenever the PWM signal changes from Hi to Lo, or the inverse, it activates a bit of code that stores the time between changes. using this, you can measure the pulse width. \$\endgroup\$ – user86234 Sep 15 '16 at 19:39
2
\$\begingroup\$

They use a microcontroller, that also generates the 3-phase output switching waveforms.

The simplest way for a microcontroller to read a pulse width is with the internal timer peripherals. It varies a bit with the type of MCU, but generally a counter (perhaps 16 bits wide) is started at the positive edge, counts some fixed frequency pulses based on the MCU clock, and then triggers an interrupt or flag when the negative edge occurs. The value in the counter gives you the width of the pulse. You can have another timer running that times out if a new pulse is not received within a set period of time.

Even an internal RC clock is good enough in stability and accuracy to read that kind of PWM.

If the counter clock frequency is, say, 4MHz then a 16-bit counter can measure up to a 16ms pulse with +/-125nsec resolution. A crystal clock would be good to a few tens of ppm accuracy, an RC clock probably to +/-0.5%.

If you want to know more about a specific ESC, look up the full datasheet for the particular MCU they designed in, and read the datasheet section on timer-counter peripherals.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks Spehro! That is exactly the amount of detail I was looking for. I would up vote but I don't have 15 reputation.. \$\endgroup\$ – Thomas Kirven Sep 15 '16 at 18:51
  • \$\begingroup\$ Well, you can accept the answer, but you should wait some period of time before accepting - such as 12-24 hours to see if a better answer appears. \$\endgroup\$ – Spehro Pefhany Sep 15 '16 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.