A glimpse into an ESC

although it’s actually more like an ultrasonic scan.

Slightly off-topic, but there was a comment conversation about whether ESC PWM input pulse width ratio was linear wrt output motors RPM.

I used the Audio Spectrum Analyzer app, combined with running tests at various PWM speeds.  Oh, and some Blue-Tak to keep Phoebe on the floor as she went over take-off speed.

Here’s what you get – make of it what you will, but it’s definitely not linear – although there are linear sections – the samples are at 5% PWM intervals and it is linear between 20 and 25%, 25 and 45% and finally between 45% and at least 60%.  I daren’t take the test further just in case the blue-tak let go and she whizzed up to the ceiling.  So the ESC microcontroller is doing some sort of logarithmic approximation – also not shown on the graph is that the motors RPM climbs steadily up to the PWM spin rate; the ESC is playing a role there to soften changes in desire spin rate.  I’m guessing the non-linearity of the ESC is to adjust / compensate for non-linearity of the power delivered by each blade for a given rotation speed.:

PWM vs RPM via ESC

PWM vs RPM via ESC

I guess if I have time to kill another day, I could attach my iPad iMSO digital ‘scope and see what the ESC output PWM looks like – but, as I say, that’s for another quiet day.  Now back to PID tuning, where depending on the weather, the next steps are to rerun the Z-N PID tuning with a better (nearer centre of gravity) hang of Phoebe, or a test flight with a lot lower Ki gain.

8 thoughts on “A glimpse into an ESC

  1. I just read a dissertation by Matthew Watson explaining in details its design and implementation of a quad with a Raspberry Pi (see http://www.raspihub.com) and there was an interesting comment about ESCs:

    “Since the ESC’s are designed to be controlled by a RC receiver, they are usually only able to accept PWM pulses at a rate of 50Hz. This is too slow for optimal stability in quadrotor, so a custom firmware was installed by manually connecting to the programming pins on the ATMEGA8 microntroller the ESC’s use. This improved firmware allows PWM data to be sent at a rate of 400Hz, and removes the low pass filter some models implement on the PWM input. This greatly improves the step response of the motor, translating into more stable flight”

    Something to look into ?

    • My ESCs are rated up to 400Hz carrier frequency, and some testing I’ve just finished (blog entry imminent) shows absolutely rock solid stability under the simplest conditions indicating my drift problems are software not hardware related – I also have a couple of thoughts on how to test my speculative causes further.

  2. If you measured at 5% intervals, then I don’t see how you can say “it is linear between 20 and 25%”. You’ve measured at 20% and 25% and then drawn a straight line between them….

    You can measure power (well, thrust), by placing Phoebe on a pair of scales. The difference between her weight at a given % and her weight at 0% is precisely the thrust. (If you add some extra weight, you can go all the way to 100% without take-off). Knowing the force at a given % might be more useful than the RPM.

    • Fair point about the 20 – 25% measure! I might try the weighing scales if I’ve got time to kill – all these experiments relating to PWM vs RPM vs Kv vs force are really just an interesting diversion to stop me from getting too bored when the weather is not good for flying. In the real world, the PIDs handle all this through estimation + feedback.

  3. Hmmm… I didn’t expect that!

    The partition of the curve into linear segments does suggest a conscious design (rather than a natural analog response of some component), but…

    “I’m guessing the non-linearity of the ESC is to adjust / compensate for non-linearity of the […]”

    I find that odd – If i is about compensating the non-linearities, I would have then expected a linear curve (i.e. once compensated, it should b linear, right?). Unless, the non-linearity is otherwise even stronger ; the ESCs are compensating, a bit, but not quite enough to make it perfectly linear ?….

    • Again, pure speculation, but I wonder if it’s an attempt by the ESC to cope with different motor types? My quad 980Kv motors live in the 50% – 70% PWM range – it only takes minor changes to PWM to effect any action required. Perhaps the ESC has been programmed to have a lower ‘gain’ for this style of nippy motors on light, nimble quads, whereas for heavy load carriers with much lower Kv and RPM, the slope is much steep as more power is required to effect the required change? I’m not entirely convinced but it’s the only idea I have.

      • That would make sense though! I didn’t realise the operating range of the PWM input was so small. But it makes sense to me that motor with different Kv value would need a different linear scaling from PWM input to actual RPMs. If that’s true, then the interaction is linear… is just that the ESCs is programmed that way to cover a wide-ish range of different motors as you said.

        • I’d love to be able to take these tests up to 80% PWM to see whether there is another ‘linearity step’, but that would be very scary – 60% is more than enough to get Phoebe off the ground at a reasonable rate – she’d need to be pinned down with significant force (my hand) to go beyond, but both of my hands were required to hold and pause my iPad analyser – I couldn’t put it on the floor due to the noise it then picked up, swamping the RPM peaks. I’d also want another spare hand to hit control-C if things were too scary!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.