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.
Could you attach a link to a video of the motion? This would help with suggestions.
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.
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.