Go to Post Gee, I wonder if AndyMark has a wedding gift registry? - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2016, 12:32
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Aiming with Vision

I am having trouble aiming with my vision system in labview. I acquire the target, calculate the bounding box, then calculate the offset. Then I feed the offset to a PID loop. However, as soon as I activate the target, the turning causes the vision to lose the target and the robot spins in circles. I have a few ideas I want to try, but does anyone know a better way to do this?
Attached Thumbnails
Click image for larger version

Name:	vision_processing_offset.png
Views:	215
Size:	81.4 KB
ID:	19764  Click image for larger version

Name:	teleop.png
Views:	178
Size:	50.5 KB
ID:	19765  
__________________
2015 MAR District Champions




Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2016, 12:49
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Aiming with Vision

Your input value ranges from -160 to 160, which means that your other tuning parameters will need to be pretty small to output a number between .5 and -.5.

Also, cameras are slow sensors in the best of cases, and my suspicion is that your is probably updating the set point at 100ms or 150ms intervals. That is a lot of tele Op loops running at 50% throttle between images. A moving camera blurs and distorts the image as well.

My guess is that your target is not centered, so your robot is jumping to half throttle spin and the next image doesn't have a target at all. If your code doesn't see a target, it should zero the offset and the PID will settle to 0 output, but not knowing the coefficients, it could have history and not immediately output a zero.

If you are ever tuning a PID that controls the robot orientation, here are some suggestions.
1. Put the robot on blocks so it can't hurt anyone.
2. Wire the error term, set point, and output value to a chart (put all three into a cluster and wire that to the chart terminal) so that you can see what happens over time.
3. Put the target in the center of the camera and test that the code works as you expect.
4. Put the target just a bit off center and see what the motor values are. 50% may be too high.
5. Have someone walk back and forth and see that the robot motors make sense.

By the way, for this, I'd set I and D to zero initially and get P in the ballpark.

Finally, after doing this, I think you'll find that you cannot really close the loop using a camera. I'd suggest that you use the offset from the camera to compute an amount to turn the robot. Then use a gyro to close the loop. The measure with the camera and repeat if necessary.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2016, 14:51
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
Re: Aiming with Vision

The best way we've found is to add a gyro to the robot and base the PID off the gyro. The camera gives us the delta to our new angle but we only use it to give us the new heading.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2016, 20:13
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Aiming with Vision

Quote:
Originally Posted by Greg McKaskle View Post
Your input value ranges from -160 to 160, which means that your other tuning parameters will need to be pretty small to output a number between .5 and -.5.
...
Finally, after doing this, I think you'll find that you cannot really close the loop using a camera. I'd suggest that you use the offset from the camera to compute an amount to turn the robot. Then use a gyro to close the loop. The measure with the camera and repeat if necessary.

Greg McKaskle
Thank you, this is great advice. I hadn't thought of graphing the output. We were discussing closing the loop with a gyro, now I think we will definitely do that. I'm not sure if it was included in the snippets, but I was trying to set the offset to zero when we lost the target but the robot kept spinning, must have been a bug.

Also when I set the I to 0, the loop doesn't output anything. Why is that?
__________________
2015 MAR District Champions




Reply With Quote
  #5   Spotlight this post!  
Unread 18-01-2016, 07:19
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Aiming with Vision

When I is set to zero, the code has a special case for P and PD. When you say it doesn't output anything, do you mean it doesn't complete, always returns zero, or something else?

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 18-01-2016, 13:00
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Aiming with Vision

Quote:
Originally Posted by Greg McKaskle View Post
When I is set to zero, the code has a special case for P and PD. When you say it doesn't output anything, do you mean it doesn't complete, always returns zero, or something else?

Greg McKaskle
I'll do some more testing when I get back to the shop, but AFAIR, it outputs 0
__________________
2015 MAR District Champions




Reply With Quote
  #7   Spotlight this post!  
Unread 18-01-2016, 14:48
btcshields6 btcshields6 is offline
Registered User
FRC #4206
 
Join Date: Aug 2014
Location: Texas
Posts: 107
btcshields6 is an unknown quantity at this point
Re: Aiming with Vision

So dubiousSwain, you used both RoboRealm and the Vision Assistant? What 'algorithm' did you perfect in RoboRealm?
Reply With Quote
  #8   Spotlight this post!  
Unread 18-01-2016, 17:44
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Aiming with Vision

Quote:
Originally Posted by btcshields6 View Post
So dubiousSwain, you used both RoboRealm and the Vision Assistant? What 'algorithm' did you perfect in RoboRealm?
We have two programmers on our team, so we decided to split up and research different approaches. I worked on blob filtering in RoboRealm, while my teammate Billy worked on pattern matching in the Vision assistant, a la 900. I made much quicker progress on the blob filter, and it gave good results, so we ported the pipeline into the vision assistant and had it build the VI. We decided that socketing into roborealm would not be as reliable as running a VI robot-side or using NT dashboard-side

tl;dr, we are not using both Roborealm and Vision Assistant, we tested both and then decided to use the VA.

EDIT: By algorithm I mean Pipeline.
__________________
2015 MAR District Champions





Last edited by dubiousSwain : 18-01-2016 at 17:45. Reason: clarification
Reply With Quote
  #9   Spotlight this post!  
Unread 18-01-2016, 17:48
btcshields6 btcshields6 is offline
Registered User
FRC #4206
 
Join Date: Aug 2014
Location: Texas
Posts: 107
btcshields6 is an unknown quantity at this point
Re: Aiming with Vision

Oh. Okay. We only have one programmer, me, so the quicker I can settle on something the better. I guess I'll stick with Vision Assistant. Thanks!

Benjamin
Reply With Quote
  #10   Spotlight this post!  
Unread 18-01-2016, 17:52
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Aiming with Vision

Quote:
Originally Posted by btcshields6 View Post
Oh. Okay. We only have one programmer, me, so the quicker I can settle on something the better. I guess I'll stick with Vision Assistant. Thanks!

Benjamin
The key for vision assistant is to take as many test images as you can, in all kinds of lighting. You can do this by pausing the live stream at 10.42.06.20 and right clicking "save as". Make sure its paused, or your computer will not open the dialogue box and continuously acquire images.

Please PM me if you have any trouble, it can be tricky to figure out
__________________
2015 MAR District Champions




Reply With Quote
  #11   Spotlight this post!  
Unread 18-01-2016, 18:07
btcshields6 btcshields6 is offline
Registered User
FRC #4206
 
Join Date: Aug 2014
Location: Texas
Posts: 107
btcshields6 is an unknown quantity at this point
Re: Aiming with Vision

Okay. Thanks! Do I use all the images to test it, or somehow factor them all in as images to look for in Vision Assistant? Sorry for my inexperience, I've never used it before, and I haven't yet had the chance to play around with it.
Reply With Quote
  #12   Spotlight this post!  
Unread 18-01-2016, 20:54
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Aiming with Vision

Quote:
Originally Posted by btcshields6 View Post
Okay. Thanks! Do I use all the images to test it, or somehow factor them all in as images to look for in Vision Assistant? Sorry for my inexperience, I've never used it before, and I haven't yet had the chance to play around with it.
There is an option in the file menu to import images. Just shift select all the images you saved and it will import them all. then use the green arrows above the pipeline or the grey arrows to the left to move through them.
__________________
2015 MAR District Champions




Reply With Quote
  #13   Spotlight this post!  
Unread 18-01-2016, 12:52
annie1939's Avatar
annie1939 annie1939 is offline
Registered User
AKA: Ann Fairburn
FRC #4388 (Ridgebotics)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2006
Location: Fort Collins,CO
Posts: 58
annie1939 has a spectacular aura aboutannie1939 has a spectacular aura aboutannie1939 has a spectacular aura about
Re: Aiming with Vision

Hello! I'm a programmer for FRC Team 4388 Ridgebotics. We are looking to use vision processing this year to be able to shoot goals into the tower. Initially, we decided to use the NI Vision Assistant VI in vision processing to detect the target, but we are having issues with it.

I came across this thread and saw that you used a Vision VI in your vision processing code. I want to see if this may be a better tool for us in successively using vision, but we can't seem to find the VI anywhere in the library. Could you please direct us to where it is located? Thanks in advance!
Reply With Quote
  #14   Spotlight this post!  
Unread 18-01-2016, 12:58
dubiousSwain's Avatar
dubiousSwain dubiousSwain is offline
The ride never ends
AKA: Christian Steward
FRC #5420 (Velocity)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2011
Location: USA
Posts: 304
dubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond reputedubiousSwain has a reputation beyond repute
Re: Aiming with Vision

Quote:
Originally Posted by annie1939 View Post
Hello! I'm a programmer for FRC Team 4388 Ridgebotics. We are looking to use vision processing this year to be able to shoot goals into the tower. Initially, we decided to use the NI Vision Assistant VI in vision processing to detect the target, but we are having issues with it.

I came across this thread and saw that you used a Vision VI in your vision processing code. I want to see if this may be a better tool for us in successively using vision, but we can't seem to find the VI anywhere in the library. Could you please direct us to where it is located? Thanks in advance!
Hi,
The vision VI is a custom VI that I modified from the output from the Vision assistant. I would highly recommend using the vision assistant. My team perfected our algorithm in Roborealm, the took a bunch of sample images and ported the roborealm algorithm into the vision assistant. Then, I built the VI in the vision system and made some changes to the output terminals, and made a custom picture for it.
__________________
2015 MAR District Champions




Reply With Quote
  #15   Spotlight this post!  
Unread 19-01-2016, 18:43
jmb888 jmb888 is offline
Registered User
AKA: Justin Beekman
FRC #0280 (TnT)
Team Role: Programmer
 
Join Date: Nov 2014
Rookie Year: 2015
Location: Taylor
Posts: 10
jmb888 is an unknown quantity at this point
Re: Aiming with Vision

I'm having trouble developing the vision detecting code connecting with the vision assistant vi. Do you mind posting a picture of yours?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi