Making the limelight work

My team got the limelight2 to get into vision tracking. Everything is working great and we took the code for it alright off of the range and direction case study. We have however had trouble tuning the KpAim value. One moment the limelight corrects so violently that the target goes out of its vision. The next it doesn’t give the robot enough juice to make micro adjustments. Any suggestions on a KpAim value or other ways to fix the problem?

yeah, so what our team did, along with what many other teams did tuned a PID that got it kinda there, and then we add some sort of small min command until it reaches its goal(tx < 0.1). Also, I don’t know if you do this but what our team does that makes it run alot better is make sure to take advantage of the 90fps. How we do this is we have a separate control loop that runs at 100hz(many teams do this) this way your min command is based off real-time data.

We have a working PID algorithm for our Limelight, has been working very consistently with P value .14, and D value 1.5 to 2. We also use a rolling average to smooth out the error values coming from the limelight.

1 Like

Our code is far simpler (taken right of the limelight site) the thing is if we hold outlet button to initiate the limelight it way over reacts. However if we quickly tap it, it works…

does your team have a github?

Yeah, we experimented with the bang-bang controller, but it didn’t work well for our robot. We wanted to ability to go forward while centering at the same time. Our vision controller class also has the bang-bang controller method at the bottom if you want to use that.

We do not but if you want to see the exact code, go to http://docs.limelightvision.io/en/latest/cs_aimandrange.html
We pulled the code right off of There but translated it into java.

We want our bot to be able to smoothly go in and aim at the same time but like I said when we hold the button to initiate the limelight, it throws itself to the side

You could check this example:
http://docs.limelightvision.io/en/latest/cs_drive_to_goal_2019.html
It’s a lot easier to get a robot to align as it drives forward to vs getting it to turn in place (depending on your drive train of course)

Does this work only for arcade drive train or would it work for tank as well? Nevermind. It does

we are having similar problems can we see your code

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.