<< return to Pixycam.com

[Ask for help] - UNO + PID + Pixy2

I made a project by Arduino + Pixy2 + PID + 2Servos, my target is to make it keeping a colored ball in the center of a plate, now, it works, but the moving was not stable and smoothy. Any suggestion is welcome.

The code:


snapCode-2

Could you attach a link to a video of the motion? This would help with suggestions.

Thanks,
Jesse

https://www.bilibili.com/video/BV1uL41177gd/

Hello,
This looks like a PID tuning issue. PID loops can be challenging to tune… I noticed that you are doing quite a bit of printing AND you are running PixyMon with video, both of which can really slow things down. I doubt you’re update rate is more than 15 updates/second with video and prints.

Printing on the Arduino can really slow things down because each print statement typically takes several milliseconds.

And sending video over USB also slows things down greatly. You want to set the View to Blocks only.
https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:pixymon_index#color-connected-components-view-menu

Use video and prints to make sure the logic of your code is correct, then remove the prints and switch to viewing blocks only, or not running PixyMon.

Edward

1 Like