Problems with PWM

Hello!

I'm new in the arduino and i've some problemes to program my first servo motor.

I want to send differents Ton values for one squared signal. It's possible do it with PWM or with another system?

Thanks!

i've some problemes to program my first servo motor.

Like no code?

differents Ton values for one squared signal.

Different what?

What kind of servo are you trying to control? Why are you not using the servo library?

PaulS:

i’ve some problemes to program my first servo motor.

Like no code?

differents Ton values for one squared signal.

Different what?

What kind of servo are you trying to control? Why are you not using the servo library?

I’m trying to control this servo:

I can’t use the library servo, because this servo is “special”… it’s very strange and i haven’t the datasheet.

I found that the PWM signal is always working with a frequency of 490Hz.
I want to change the Duty Cycle because one lap of my servo go to 35% to 46% of DC, and i want to increase this factor 0,01% every time… Because now i only have 27 points per lap, and i need more.

Thanks.

I’m using arduino MEGA, and the code for one lap is:

int MOTOR = 9;
int n=90;
void setup()
{
pinMode(MOTOR,OUTPUT);
}

void loop()
{
delay(500);
if (n<118){
analogWrite(MOTOR,n);
n++;
}
else{
n=90;
}
}

I can't use the library servo, because this servo is "special"... it's very strange

It's a five turn sail winch. What makes you think it won't work with the Servo library?

That's a servo NOT a motor so you can't use PWM. Try it with the servo lib and it may it's own power supply.

Mark

so you can't use PWM

sp. "you shouldn't use the 490Hz PWM produced by an analogWrite, but you can use the low duty-cycle PWM produced by the Servo library"