I am using the DFRobot Romeo all in one controller.
Allatched I have a servo with IR (Sharp) and Ultrasonic (URM37) sensors.
When I turn the servo 180° step by step and only read the IR Sensor at every step, the servo does a smooth round.
When I do a Ultrasonic Scan at every step, the servo starts to share as to be seen here: VID_20120620_073015.3gp - YouTube
The shaking seems to be especially strong when the scan distance is high (eventually higher than the 3m max range).
The board as well as the servo is powered via the Motor Power (11.1V LiPo).
I am using the milesburton library for the URM37. Sketch is attached.
You're busting your 20msec servo constraint.
Closer objects yield a response in a shorter time, but farther objects take more time to get a bounce back.
If you timeout earlier from those far objects (i.e. if it's not close, if no response before x, then it doesn't matter) then you can return to your servo routine before it goes jittery.
OK. I found that the problem is most likely caused by the SoftSerial library (taking interrupts and interfering with the servo library). Because of this I would like to interface the URM37 via PWM.
There seemed to be some example code on yerobot.com . But the site is down.
Does someone have example code for the PWM mode? All I found is for serial communication.