Arduino Forum

Using Arduino => Motors, Mechanics, Power and CNC => Topic started by: TheRocketGuy on Mar 05, 2017, 04:02 am

Title: [DUDE] Servo.write interval is necesary?
Post by: TheRocketGuy on Mar 05, 2017, 04:02 am
Hi,

This is a simple question. I'm not using the interval between pulses with the servo, and it works fine.
It's really necesary? Because im using it without intervals and nothing happens, the Servo performance is the same.   :smiley-neutral:


(NOTE: Im talking about the interval of 15 ~ 20 miliseconds, and im using the servo with the pot)

Thanks
Title: Re: [DUDE] Servo.write interval is necesary?
Post by: ardy_guy on Mar 05, 2017, 06:19 am
Wild ass guess here that you're talking about the servo knob example since you didn't say?

Code: [Select]

delay(15);                           // waits for the servo to get there


As it says in the comment it's to give the servo time to get to the new position. Without that perhaps it's possible that before it got there, you would command it to start coming back again. That may or may not be the case for you depending on the servo speed, nor might it matter.

I'd say if it makes no difference to your servo and your requirements, leave it out.

Title: Re: [DUDE] Servo.write interval is necesary?
Post by: 756E6C on Mar 06, 2017, 05:40 am
In the knob example the delay is only for demo purposes I think, but if you look at a servo spec, it says something like "Speed:    4.8V: 0.12 sec/60° " , so it takes 360 milliseconds to swing from 0 to 180. If you want to make sure the servo has time to complete the move before doing another move then you would need an appropriate delay. But I would use a millis timer instead of delay.
Title: Re: [DUDE] Servo.write interval is necesary?
Post by: ardy_guy on Mar 06, 2017, 06:03 am
I'm pondering the meaning of [DUDE] in the subject?