Generating PWM from PID to control DC motor

Robin2:
The normal frequency for Arduino PWM is 490 Hz (I think). You can change that, as mentioned in Reply #5.

When you have changed to frequency you can then use analogWrite() as normal. (By the way "analogWrite()" is not a very good description of what the function does - pwmGenerate() might have been a better name.)

...R

Sir i didnt find pwmGenerate() in arduino website if u hav anylink please share and am trying to implement manually like this
void loop()
{
digitalWrite(13, HIGH);
delayMicroseconds(10); // Approximately 10% duty cycle @ 1KHz
digitalWrite(13, LOW);
delayMicroseconds(40);
}
only problem i m struck with PID OUTPUT that how that output can be converted into in range of my time period 50us if i get that above code willbe implement i hope so