Asked — Edited

Servo Controlled Camera Question

Just a quick question:

I'm having an issue with the face tracking in that if a face moves off screen too quickly, it is, of course, lost. It would seem iRobot's head need to move more quickly to keep up (with a reasonably moving face) but if I set the servo speed over 2 it gets jerky and kind of scary. My frame rate is pretty slow. I don't remember the exact rate but it's under the lowest setting. I have the camera resolution set to 160x120, the lowest res. Would a faster computer help? I'm running it on an old quad-core, win 7 unit. I have an i7 Asus laptop but the vid card went belly-up (I think). I may risk the $70 for a used vid card replacement. I'm assuming the camera is a processor intensive process and that more RAM or better graphics won't help. Thanks:)


Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.


I believe your reference or "servo speed" was incorrect. Did you mean the "tracking steps"? I.e. How many steps to increase/decrease while tracking when an object is outside of the grid lines?

Because with servo speed, the higher the number the slower the servo moves. Which is actually what would solve the jerky movement if the steps were increased.

Increasing the steps will increase jerky movements - but you will need to if the face moves too quick. Increasing the servo speed will dampen the jerky movements. I would start with a servo speed of 1, then move to 2, etc. find the most appropriate speed.


Oh, i forgot to add how to set the servo speed.

  1. Press CONFIG button on the connection control

  2. Edit the script for the EZ-B #0 Connection

  3. Add something like...

# Init horizontal servo to center
servo(d0, 90)

# init vertical servo to center
servo(d1, 90)

# set servo speeds
servoSpeed(d0, 2)
servoSpeed(d1, 1)

Each time the software connects, that script will run. The script must run for the servo speeds to initialize. The servo positions must be set before the servo speed command takes effect.


Yes, DJ, you're correct, I had it backward in my head. I have the speed set to 2 (using script). 3, it's too slow, 1 and it's too jerky.

I haven't played much with the "steps". I'll give that a try. Thanks DJ.


Also, what's the best way to increase the frame rate (through hardware)? Would that not help with better tracking?


There is a slide dial to adjust a delay. Ensure it's set all the way to the left.

User-inserted image

The video card doesn't process the recognition algorithm - the video card displays video. There was an update to ARC a few releases ago with performance enhancements for face tracking. I would recommend upgrading to the latest ARC.

Based on your usage, the update to face tracking includes new parameters...

User-inserted image


Just a thought and question here; once all servo positions and then the speeds are initialized it seems like the servos are now energized and holding position. If you don't need them in that state would it be advisable to release them? I would think this would save power and servo life.

Once released do they have to be initialized again?

I sometimes see my servos jerk when I send a series of release commands to several servos (with sleep commands between the releases). Sometimes they jerk violently sometimes just a twitch, sometimes not at all. Any thoughts on this?


When you release a servo, it is no longer holding position. When the servo is re-initialized to hold a position, it will move to the position. The jerk you are experiencing is the servo moving into position. When released, the servo is not holding position so it may have moved. A servo that moves, is no longer in the original position.

Also I highly doubt after a release, that you're putting the servo back in the original position that it was when released. Which means not only is it moving into a position because it had moved due to the weight of... ah i'm not finishing this sentence - it's common sense:)

Find out how a servo works here:


@Dave Although I haven't yet tested the new camera up/down micro-servo, the head left/right servo did buzz and use juice when it was done tracking. I was lucky though; when the head centered, it seemed to rest in that position. That's why I wrote the script to center the head when finished tracking. No release necessary in my case. You, on the other hand, with those "Danger, Will Robinson!" arms, I can certainly see why you want to release them. BTW, I have one of those digital servos, the Hitec HS 7950TH you used for the arms and modified the controller, I have one barely used if you'd like it. $75 a fair price? It didn't fit the servo housing in the top of the spine.

@DJ Thank for the info. I need to play with the new release a little anyway. I was having trouble with the face tracking after installing it. Dave suggested deleting the camera control and opening a new one. servo speed and slider worked fine.


@DJ I do appreciate your explanation of how a servo works and the link to an more detailed explanation. However this "jerk" seems to have nothing to the normal behavior of a servo or static induction. It's seems more like a voltage serge. It happens when a series of servos fed from the same power supply are released by ARC. I really don't think it has anything to do with ARC. It's probably the way I have my circuit designed or my scripting. Here's the script that's runs when the most noticeable jerk happens:

release(2.D1) #Release Rt Wrist Up & Down Servo
Release(2.D0) #Release Rt Side to side servo
release(2.D4) #Release Left Wrist Up & Down Servo
release(2.D5) #Release Left Side to side servo
release(2.D6) #Release Left Claw
release(2.D3) #Release Right Claw   

I know this is Mac's thread so no real need to follow up on this here. I just thought this may be useful to him.

Mac, I would be interested in your very fare offer. Please contact me at and we can seal the deal. ;)


Again - it is how a servo works. A servo moves into position by the PWM. When the PWM stops, the servo stops holding position. When the PWM returns, the servo moves into position. If there's a jerk or not a jerk, it's irrelevant because the servo is working as designed.

The servo holds position when the PWM starts. When it starts holding position, the motor starts moving. The motor may jerk, it may not jerk. It's irrelevant to the function of Release(). The release does what it does, releases a servo.

If your servo jerks, then it jerks. If it doesn't, then it doesn't. It doesn't matter to the command, because the command and the ez-b are performing exactly what the commands do.


That's it. There's no magic that can be good or bad. You can't STOP PWM badly. You can't STOP PWM incorrectly. Stopping something is the lack of doing something.

And the opposite is STARTING PWM, which is exactly that. You can't START PWM incorrectly either.


OK, I can understand that. So that rules out the scripting. That leaves my circuit and possible voltage surge or induction. Weather the command cares if there is a jerk or not, I sure do. I'll continue to try to find out why it's happening but I wont clutter up this thread or forum with it. I'll be bowing out of this thread now. Thanks for the help. Sorry Mac about hijacking your thread.;)


No - not surging. There is no surging because power to a servo is always applied. You cannot turn off power to a servo. A servo motor may draw more amperage when it is initializing or holding position, but that will only limit the amount of current available to other servos - resulting in the opposite of what you're describing.

What is happening is the servo is initializing into a position and holding weight. The "jerk" that a servo may or may not experience is due to the servo beginning to "do something". It wasn't doing anything before because it was released.

Perhaps a better example is to provide a experiment example...

  1. Extend your arm out and hold something somewhat heavy

  2. Now ask someone to put pressure under your hand to relieve the weight of holding so your arm no longer feels the weight of the heavy object

  3. Now ask the person to quickly remove their hand from assisting to hold the weight

Your arm is going to jerk. It's going to move. This is because suddenly the force that was supporting your arm is gone. Your muscles have to engage, they have to identify a position. They have to suddenly start doing something, because they weren't doing anything before.

Does that make sense?


Yes sir it does. Your very patient and a good teacher. Too bad we cant ramp down a servo.


You will not need to release the servos with the new ez-robot HDD's in february


@DJ, what is the default speed of a servo if there is no script to initiate?


the default speed is 0


Remind me is "0" fastest or slowest ? I understand 1 would be faster than 9, but I think I remember reading 0 was slowest?! Not sure why that's stuck in my head?!

Also would it be reasonable to have a drop down in each window for setting up the servo speed?


@fxrtst 0 is default (fastest speed) and 10 being the slowest... So the higher the ServoSpeed number the slower the servo speed... 1 is slower than 0 and two is slower than 1 and so on...

ServoSpeed(D0,0) #default fastest speed
ServoSpeed(D0,10) #slowest servo speed


Accordong to an old v3 ezb video I just watched from a few years back it looks like 0 is the fastest speed. I don't remember if that changed when the v4 came out.


I just assumed that the "jerk" was the program initializing the servo at 0 speed, before the servo reads the programmed speed. 0 is pretty darn fast, at least in my case.

Of course DJ is the uber expert. I'm just pretending to know anything about all this, lol. FYI, let's not worry about hijacking and what-not. This is good info.