<< return to Pixycam.com

i want stop servo

Aruduino pan/tilt running,

I use Google Translator
So it would be hard to read, sorry.

Servo is moving like crazy

Seems to have accumulated a stack of servo commands

Servo to move in
pixy.setServos (panLoop.m_pos, tiltLoop.m_pos);

Then servo to (current angle is) what is to stop the code?

pixy.h can not find the related functions of the servo
Where are there specific functions?

Servo not want to know the code that initializes the stack

Thank you kindly

Written summary of translator
During the rotation of a pan-tilt detection object is moved,
The new direction of rotation was stopped without rotating,
After you are finished with the existing rotation was rotating in a new location.
This will eventually went to the location that had the object,
The object is already having a and
Pan Tilt falls in an infinite loop is moving like crazy

Hi SeongHyeon,

So the servos keep moving even after you have stopped sending them commands? I have a feeling this could be because of a noisy cable. Long, cheap USB cables are poorly shielded and have a large voltage drop across them, which causes erratic behavior in the servo motors. Try using a shorter, higher quality USB cable and see if that fixes the problem.

Scott

Unpacking the new line to buy two just looked at test

Arduino and let you run through the pan-tilt because
Has nothing to do with the USB cable

I’ve experienced servos moving wildly when the primary object I want to track is out of the camera’s field of view. By using PixyMon in the “default program” mode, you will see a black screen with white rectangles indicating objects that Pixy interprets as a color match. In my case, objects in the background were similar in color to the original trained color, so Pixy detected multiple objects and tried to track them, moving wildly. (Note: if you run PixyMon in any mode other than “default program” there will be no data sent over the serial bus to your microcontroller)

One method to halt the servos is to force their position using pixy.setServos(x,y) where x and y are values between 0 and 1000, which correlates to the 0-180 degree rotational range of a servo. I’m using this on my own project with a switch to toggle the Arduino between “track” and “center” modes for a two-axis gimbal.

A second method could be to look at the size of the objects being detected and bypass the error and position updating code when the detected objects are below a size threshold that you choose. To extract the size parameters, look at “struct Block” in TPixy.h for the data available. You can access the values using:

pixy.blocks[0].x
pixy.blocks[0].y
pixy.blocks[0].width
pixy.blocks[0].height
pixy.blocks[0].signature