Log in

View Full Version : Turret + tracking help


ProgrammerMatt
06-03-2012, 15:53
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

Ether
06-03-2012, 16:32
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...

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

ProgrammerMatt
06-03-2012, 16:56
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.

MorocoMan
09-03-2012, 03:59
have you considered using a control loop, such as PID, in order to arrive just at the spot you wanted to?

notmattlythgoe
09-03-2012, 07:09
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.

MorocoMan
09-03-2012, 07:46
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.