Anyone know servo-PWM duty cycle mapped values?

As the title suggests, anyone?

I want to use my ESCs, so I did some research. A guy online used servo values (0-180), but I know that my ESCs have a minimim of 700us and max 2000us to arm.

His own was servo vals; 5 for min and 180 for max.

This makes me think that servo 5 is 700us and 180 is 2000. Am I correct?

Thanks in advance

Rome

You have all the source of the Servo class.
Use writeMicroseconds instead of write.

I understand, AWOL, but I am asking for the equivalent us value of the servo values...

Which file is the info I need in? It's not in Servo.h.

I found this: Convert angles to microseconds? - Robotics - Arduino Forum

Knowing that 1000us is for 0 and 2000us is for 180, i can manually calc the values.

Why calculate an approximation to the duration, when you can specify the duration?

I hope I'm not sounding like a incompetent monkey here, but how can I specify it? You mean like define it?

I can't find the file where the angle equivalent of the write.microseconds() function, so I linked that. It gives me a rough estimate of the PWM us values when I map(x,0,180,1000,2000)

I can't find the file where the angle equivalent of the write.microseconds() function

The function is called Servo::writeMicroseconds ; it does exactly what is says on the tin.

I don't understand why you're fixated on the "angle" fiction.

AWOL:
I don't understand why you're fixated on the "angle" fiction.

If I understand things correctly the OP has been given some angle values and he wants to convert them to the appropriate microsecond values.

By the way, shouldn't this Thread be moved to the Project Guidance section?

...R

Even without using writeMicroseconds() you have control over what pulse width 0 and 180 translate to. That's what the min and max parameters on servo.attach(pin, min, max) control.

The default is 0 = 544 microseconds and 180 = 2400. So in your mapping terms it would be map (angle, 0, 180, 544, 2400).

If you want 700 to 2000 set it in attach. servo.attach(servoPin,700, 2000).

It's all detailed in the Servo library reference.

Steve

slipstick:
If you want 700 to 2000 set it in attach. servo.attach(servoPin,700, 2000).

That won't make 700 be 0 degrees and 2000 be 180 though. It just sets the minimum and maximum values that Servo will put out. The relationship between angle and pulse length is a property of the particular servo you are using.

Robin2:
If I understand things correctly the OP has been given some angle values and he wants to convert them to the appropriate microsecond values.

From what I got he is trying to give an ESC specific length pulses and is trying to figure out which angles to put into servo.write to get those lengths of pulse. If that's really the case then forget the angles, just use write microseconds and give it the pulse length you want.

Delta_G:
That won't make 700 be 0 degrees and 2000 be 180 though. It just sets the minimum and maximum values that Servo will put out. The relationship between angle and pulse length is a property of the particular servo you are using.

It will make write(0) equivalent to writeMicrosconds(700) and write(180) equivalent to writeMicroseconds(2000). That should cover the full range of movement of a servo specified for pulse widths between 700 and 2000 microseconds and that's what the OP seems to be asking for.

You're correct that 0-180 in servo.write() angles don't map to specific physical angles. But given that the full range of movement of a servo could be anywhere from about 110 degrees to about 2500 degrees (for a sail winch servo) it is about the best we can do without individual calibration.

Steve

slipstick:
and that's what the OP seems to be asking for.

The OP doesn't even have a servo. He's got an ESC. ESC doesn't have an angle to it. So it would make a lot more sense to write the pulse width you want instead of going through a bunch of machinations to turn it into degree values which are meaningless in the context of an ESC and would require his code to have math to turn his pulse widths into degrees just to have the Servo library turn them back.

Delta_G:
The OP doesn't even have a servo. He's got an ESC. ESC doesn't have an angle to it. So it would make a lot more sense to write the pulse width you want

I agree and it's what I've been doing since about the second or third time I used servos/ESCs. But since the OP had already been advised of that several times and seems oddly resistant to the idea I thought I'd try to help him understand what the servo.write(angle) function was actually doing (i.e. a small calc then writeMicroseconds()).

Steve