Turret + tracking help

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

Providing more information will get you a useful answer more quickly.

Alright so,

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.

have you considered using a control loop, such as PID, in order to arrive just at the spot you wanted to?

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.