So i have a program that finds the targets and sends a pwm value to our turret the problem is that it over shoots a little bit and just wiggles back and forth i dont know what to do…
p.s our turret has an encoder and our camera is mounted on that turret as well
I am sending a PWM value to my crio then sending that value to our turret the problem is if it goes past it wants to spin back the other way and i tried to slow the motor down but it still seems to cause a wiggle effect just going left right left right and so on, i need a better way to assign the target position and use say a PID loop but im not sure if it will work in this case.
What we did was use a PID controller to control the turret to spin to a specific encoder reading. Then we used the FOV of the camera to calculate how many degrees we were off of the target, then did some math to convert the angle to encoder readings and told the turret to go to that location.
at the end, you told the torrent to go to that angle through PID? if so, than the values of the PID consts are wrong. if not, try to do it through PID.