Question regarding ESC's/servo library

Hi there,

So I've read on some forums that you should not use analogWrite() on ESC's but use the servo library instead. But the servo library is a bit too "slow" since we need something that has a higher refresh rate than 50 Hz since the ESC (Turnigy Multistar 20A) runs at around 400-500Hz according to hobbyking, so I was wondering is there an alternative to the servo library? Or should we just use analogWrite().

Sorry if I haven't made myself clear and thank you for your time

since the ESC (Turnigy Multistar 20A) runs at around 400-500Hz according to hobbyking,

Isn't it the output that runs at 400-500Hz?

You need to find out exactly what sort of input signal the ESC needs.

The normal servo signal is a pulse between 1000 microsecs and 2000 microsecs width repreated every 20,000 microsecs

If it was to be repeated 500 times per second that would mean once every 2000 microsecs so the individual pulses would merge into each other.

Are you sure that the 500 Hz is not an update rate internal to the ESC?

If it really can take input pulses at 500 Hz the length of the pulses must be different and you need to post a link to the exact specifications.

...R

Refreshrates of 400 Hz are normal for multirotor ESC's

http://pixhawk.org/platforms/multicopters/esc_refresh_rate

These rates are also used for tails servos on helicopters.
I think that the 50 Hz refreshrate is a standard from the old analog systems days.

The refreshrates on my FrSky X receivers are 9 ms.

Ok wait, I'm a bit confused. So apparently I misunderstood what they said on hobbyking, but should I use the servo library or use something else?

As I understand it the 400Hz is the maximum frequence the ESC can handle.
I don't think there would be a problem with using a lower frequence, but I don't know for sure

You could change the servo library:

http://forum.arduino.cc/index.php/topic,45094.0.html

Erni:
Refreshrates of 400 Hz are normal for multirotor ESC's

Now that I have found someone who understands this can you explain what is sent at 400Hz?

Perhaps you have a link to the specifications for that high frequency system?

...R

what is sent at 400Hz?

It is the servo signal that is sent. It also means that the highest refreshrate would be 500 hz to make room for a 2ms signal.

Perhaps you have a link to the specifications for that high frequency system?

I suspect you could take a look at most multirotor flightcontrollers, for example the pixhawk I linked to.

Most modern tx/rx rc - systems have options for low/high refreshrate which is usually 10/20 ms.
This can give some problems for certain analog servos, but most digital servos are fine.

Ofcource you could argue that hih refresh rates isn't really nessecary when it is a human that controls the input, but that is not the case for multirors and other things that are controlled by gyros and other sensors

This is a picture from my Frsky receiver, the servosignal is 1,5 ms, repeated every 9 ms

Edit:
Just found this:

This discussion comes up fairly frequently. Below are some similar past discussions.

https://www.google.com/search?as_q=esc+refresh+rate&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=http%3A%2F%2Fforum.arduino.cc%2Findex&as_occt=any&safe=images&tbs=&as_filetype=&as_rights=&gws_rd=ssl

Yea, I'm also trying to build a quad and I've been using Basel's code as an example, but he used analogWrite for output, but I've been told I should use the servo library since ESC's expect servo signals so i'll try to speed up the servo signal using the link from Erni.

but I've been told I should use the servo library since ESC's expect servo signals s

A servo signal is just PWM, which is exactly what analogWrite does, but a normal 50Hz R/C signal has a particularly low duty-cycle, typically 5-10%
At this frequency, simple eight bit resolution PWM wouldn't provide fine enough control - the whole range would be covered by just 12 counts.

Erni:
It is the servo signal that is sent. It also means that the highest refreshrate would be 500 hz to make room for a 2ms signal.

Because 2ms represent 100% duty cycle at 500Hz I had assumed that a different range of pulse widths would be used (e.g from 100usecs to 200usecs) but it appears not.

...R