Go to Post It's about picking a good alliance, not good robots. - evanperryg [more]
Home
Go Back   Chief Delphi > Technical > Programming
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 06-02-2017, 09:20
EmileH's Avatar
EmileH EmileH is online now
#dontbelarge
AKA: Emile Hamwey
FRC #1058 (The PVC Pirates) & SLFF (NE Way You Want It)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2011
Location: New England
Posts: 551
EmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant future
Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

Hello all,

Recently there has been some debate about whether or not a vision closed loop programming technique (where the position of an object in a frame directly drives a motor output) has benefits over a vision software that takes a single frame and calculates an error based on that frame and then drives some-other-sensor-based PID controller with a setpoint based on the frame's error.

Benefits of Vision Closed Loop:
  • Little to no need for high level arithmetic
  • Can be used to lineup while moving as the robot constantly updates to the target

Downsides of Vision Closed Loop:
  • Needs to be run at low latency to be worth it as it is directly updating the motor controller

Benefits of Vision-fed Encoder/Gyro PID Closed Loop
  • Can be run on a slow <5fps processor
  • Less jitter as the loop can be run once to hit the target

Downsides of Vision-fed Encoder/Gyro PID Closed Loop
  • Requires higher level arithmetic to calculate the error to the image
  • If the target moves as a result of robot movement outside of the loop, the loop would target inaccurately.

This is a pure philosophical question rather than an implementation question, so, for a team with a coprocessor vs one that has to run all their vision on the RoboRIO, which is best? Discuss.
__________________
2016-present: High School Student, FRC 1058 PVC Pirates

Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2017, 12:59
solomondg solomondg is offline
Registered User
FRC #2898 (Flying Hedgehogs)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Portland, Oregon
Posts: 14
solomondg is an unknown quantity at this point
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

Vision fed encoder or gyro, hands-down. Using vision for feedback requires insanely low latency as well as dampened PID loops. It's much better to just feed the vision into setpoints for encoders or gyros (with some latency compensation), then let the PID loop bring you to that.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2017, 13:17
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,082
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

Let's play in the fantasy world where image processing takes 0 time.

With off the shelf webcams the fastest you're likely to get is 30 fps. Compare at the update rate of the NavX which is configurable between 4 and 200Hz. The Gyro can be a faster source of updates.

I've always subscribed to the theory that running control loops on sensors that respond quicker was more successful.

Add onto this the fact that processing time will lower my effective update rate I feel it's just much more likely to be successful with the Gyro.

EDIT: Encoders on a turret are generally even more accurate so I'd just rely on them. I've tried based on vision position (2006) and it was functional but not optimal.
__________________




.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2017, 13:38
T8PineappleSam T8PineappleSam is offline
Jonathan
AKA: Jonathan Zwiebel
FRC #0008 (Paly Robotics)
Team Role: Driver
 
Join Date: Jan 2016
Rookie Year: 2013
Location: California
Posts: 29
T8PineappleSam will become famous soon enoughT8PineappleSam will become famous soon enough
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

Last year we captured through an Axis camera and did our processing on the driver station. This had way too high a latency to be usable as a feedback device even with significant dampening. Even with on-board processing I think that latency will always be too high to use vision exclusively as a feedback. The one exception I could see is a computing device with a built-in camera such as a Nexus. I know 254 used one for Stronghold and I would be curious to see what kind of update rate they got for vision data back to the Rio.
__________________
Jonathan Zwiebel
Driver, Project Manager, Programmer [Team 8, Paly Robotics]




2016 Central Valley Regional Finalist and Wildcard, Silicon Valley Regional Quarterfinalist, Curie Division, CalGames Quarterfinalist and Entrepreneurship Award, Capital City Classic Quarterfinalist
2015 Central Valley Regional Entrepreneurship Award, Silicon Valley Regional Entrepreneurship Award, Capital City Classic Semifinalist and Judges' Award
2014 Central Valley Regional, Silicon Valley Regional, Chezy Champs
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2017, 13:44
wesleyac's Avatar
wesleyac wesleyac is offline
Registered Luser
AKA: Wesley Aptekar-Cassels
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Davis, CA
Posts: 61
wesleyac is a splendid one to beholdwesleyac is a splendid one to beholdwesleyac is a splendid one to beholdwesleyac is a splendid one to beholdwesleyac is a splendid one to beholdwesleyac is a splendid one to beholdwesleyac is a splendid one to beholdwesleyac is a splendid one to behold
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

100% gyro/encoder closed loop.

Trying to do PID on pixels is a recipe for tears and frustration. You will likely not have enough resolution to do proportional control without overshooting, let alone have a good derivative value.

Also, resolution isn't the only issue - you'll have some lag in your vision, which will hurt a ton if you want to go at a reasonable speed.

If you have the resources to do vision, you have the resources to do the angle conversion from the vision program to the gyro. It's not hard - last year we just did an empirically found scaling factor. It took about 20 minutes to get the scaling factor. You need some sort of controller either way, so finding the scaling factor is basically the only "higher level arithmetic" that you need.

You can get away with doing vision based feedback if you align slowly, but in general, that isn't an option for us (especially last year - our two ball's main speed issue was with vision alignment). It's not significantly harder to do gyro based alignment, so why not do it?
__________________
Quote:
Originally Posted by The programming team
Define "works."
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2017, 14:08
AustinH's Avatar
AustinH AustinH is offline
Registered User
FRC #4918 (The Roboctopi)
Team Role: Coach
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Port Townsend
Posts: 91
AustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to behold
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

The Pixy we're using is tracking at 50 frames per second and spitting out signal via analog output piped straight into the RoboRIO. We're basically reading it like a potentiometer with another DIO channel used for target verification. Does anyone have any insight as to whether or not we should expect to have to use the gyroscope as described for tracking, or does that sound fast enough to use the analog signal as the input?
__________________
3826: 2013 Seattle Regional Industrial Design Award & Semi-Finalists
4918: 2014 PNW Glacier Peak District Event Rookie Inspiration Award & Quarter-Finalists, 2014 PNW Mount Vernon District Event Highest Rookie Seed Award, Rookie All Star & Semi-Finalists, 2015 PNW West Valley District Event Engineering Excellence Award & Semi-Finalists, 2015 PNW Mount Vernon District Event Semi-Finalists





Visit us on the web at www.team4918.org
Reply With Quote
  #7   Spotlight this post!  
Unread 08-02-2017, 14:34
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,189
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

Quote:
Originally Posted by AustinH View Post
The Pixy we're using is tracking at 50 frames per second and spitting out signal via analog output piped straight into the RoboRIO. We're basically reading it like a potentiometer with another DIO channel used for target verification. Does anyone have any insight as to whether or not we should expect to have to use the gyroscope as described for tracking, or does that sound fast enough to use the analog signal as the input?
Don't do this. The pixy makes no guarantee of frame processing time and you may see spurious detections. I would input that analog signal into a filter that makes sure it isn't jumping around too fast (compared to how you know your robot is moving), the dump that signal into a controller which is based on the gyro or encoders. You are already going to want to tune that loop for any kind of autonomous driving, so it's not that much more work.
Reply With Quote
  #8   Spotlight this post!  
Unread 08-02-2017, 14:53
AustinH's Avatar
AustinH AustinH is offline
Registered User
FRC #4918 (The Roboctopi)
Team Role: Coach
 
Join Date: Apr 2013
Rookie Year: 2013
Location: Port Townsend
Posts: 91
AustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to beholdAustinH is a splendid one to behold
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

Good to know, thank you. We've got a solution that so far has done a nice job of tracking only what we want but artifacts do still rarely pop up.

Does it make more sense to do filters on a hardware level or a software level for this application? I don't know if we've ever implemented those before in our code but we do a decent amount of custom circuit soldering.
__________________
3826: 2013 Seattle Regional Industrial Design Award & Semi-Finalists
4918: 2014 PNW Glacier Peak District Event Rookie Inspiration Award & Quarter-Finalists, 2014 PNW Mount Vernon District Event Highest Rookie Seed Award, Rookie All Star & Semi-Finalists, 2015 PNW West Valley District Event Engineering Excellence Award & Semi-Finalists, 2015 PNW Mount Vernon District Event Semi-Finalists





Visit us on the web at www.team4918.org
Reply With Quote
  #9   Spotlight this post!  
Unread 08-02-2017, 15:25
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,770
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Concept Discussion: Vision Closed Loop or Encoder/Gyro PID based Closed Loop?

We had fair performance with a vision closed loop in 2013 and 2014, where the goals were several times wider than they were tall, but they were easily stymied by any sort of nudge by another robot or collision with an obstacle (pyramid or wall), and it wasn't really fast (most of a second even when you were close), and didn't work well for Stronghold. It might work this year for the peg, where you drive right up to the target, but not likely for the high goal.

The past two years we're using the vision to drive wheel encoder loops. We may sanity check with an inertial system (accelerometer/gyro), though more likely that will be a driver function. Off season or next year we may go to the inertial system being an intermediate step; the slow vision controls the inertial loop at an intermediate speed, and the inertial loop controls the drive wheel encoders at high speed.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
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 20:10.

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