<< return to Pixycam.com

Pixy2 Pan/Tilt How to Limit Servo's range of movement



I have a robotic project which uses the Pixy2, mounted to a robot’s head, to look at an object. The robot’s head design only allows it to tilt a small amount before it collides with the chassis of the robot’s torso. So, I am attempting to limit how far the Pix2 will move the tilt servos when tracking an object.

I ran rcs_getPos in PixyMon console and the maximum range of movement the head’s design will allow is 640 - 370. 640 is looking up and 370 is looking down.

So I attempted to use the rcs_setLimits command to adjust this range but it didn’t seem to have any effect. I also adjusted the S1 lower and upper limit in the Servo tab under configure and this too had no effect.

I am not connected to Arduino, I am just using the Pixy2 board.

What setting do I need to change to limit the tilt servo’s range of movement?

Thank you for your help :?


The servo limits are adjustments. It might be that you need a courser adjustment. I’d just limit the positions you send to rcs_setPos.