Go to Post While grandmothers are pretty cool, I would be hesitant in letting them determine what is and is not a robot. - Kellen Hill [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-03-2016, 16:53
Alon Alon is offline
Registered User
FRC #3075
 
Join Date: Mar 2016
Location: israel
Posts: 9
Alon is an unknown quantity at this point
Shooter speed calculation from vision tracking

Hi,
I was wondering how other teams who used a shooter this year calculated its
speed with vision tracking.
In our team, we built a table for speed-distance, plug it into excel and used polynomial regression to give us a function that transfers a given distance from the high goal to the desired shooter speed needed to score. with this method we managed to hit the goal from almost any given point on the field.

The disadvantages of this method,i think, are that
1) it can maybe be not precise if you have not done your measurement right, 2) it is a little time consuming and need to be redone after every slight change in the shooter mechanism.

My question is, how did your team calculate your flywheel/angle/shooter speed from a given distance?

i know some teams did it with physical calculation but i have always thought that air drag / ball spin (magnus effect) are really hard to predict and calculate. maybe someone did it that way and can explain how? or maybe someone did it with a different approach and can share their experience?

if you have any external resources / reading material on the subject please share them

thanks for you answers!
  #2   Spotlight this post!  
Unread 13-03-2016, 17:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Alon View Post
we built a table for speed-distance, plug it into excel and used polynomial regression...it is a little time consuming...
maybe someone did it with a different approach
You don't need to turn the table into a polynomial. You can use a lookup table, or a carefully-chosen piecewise-linear function.


Quote:
i know some teams did it with physical calculation but i have always thought that air drag / ball spin (magnus effect) are really hard to predict and calculate.
Gathering empirical data for your specific shooter and using that data as you did is likely the most accurate approach.

Quote:
maybe someone ...explain how?
Here's a paper for students interested in the physics, math, and computer simulation aspects of this problem: Free-body force diagram, derivation of differential equations of motion, and C pseudo-code for trapezoidal numerical integration.


  #3   Spotlight this post!  
Unread 14-03-2016, 10:19
Alon Alon is offline
Registered User
FRC #3075
 
Join Date: Mar 2016
Location: israel
Posts: 9
Alon is an unknown quantity at this point
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Ether View Post
You don't need to turn the table into a polynomial. You can use a lookup table, or a carefully-chosen piecewise-linear function.




Gathering empirical data for your specific shooter and using that data as you did is likely the most accurate approach.



Here's a paper for students interested in the physics, math, and computer simulation aspects of this problem: Free-body force diagram, derivation of differential equations of motion, and C pseudo-code for trapezoidal numerical integration.


thank you for your quick response

so a piecewise linear function will be more accurate than a polynomial regression?

and physical calculations will be generally more precise than a table?

thanks for the reading material ill read it!
  #4   Spotlight this post!  
Unread 14-03-2016, 10:38
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Alon View Post
so a piecewise linear function will be more accurate than a polynomial regression?
Not as a general proposition, no. It depends on your empirical data.

For data that is shaped such that it is not well-modeled by a polynomial of reasonable degree, a piecewise-linear function might be more accurate.

Also, depending on the processor being used, a piecewise-linear function may execute faster than a high-order polynomial.

Quote:
and physical calculations will be generally more precise than a table?
I don't know what you mean by "physical calculations" so I'll wait till you have clarified before answering that.


The thing you should be focusing on is consistency. If you shoot several times from the same location using boulders of different weight, age, and state of disrepair, do you always score the goal, regardless of the battery's state of charge? If you don't have a consistent shooter, it's fruitless to worry to much about polynomial vs piecewise-linear vs lookup table.



  #5   Spotlight this post!  
Unread 14-03-2016, 10:52
Alon Alon is offline
Registered User
FRC #3075
 
Join Date: Mar 2016
Location: israel
Posts: 9
Alon is an unknown quantity at this point
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Ether View Post
Not as a general proposition, no. It depends on your empirical data.

For data that is shaped such that it is not well-modeled by a polynomial of reasonable degree, a piecewise-linear function might be more accurate.

Also, depending on the processor being used, a piecewise-linear function may execute faster than a high-order polynomial.



I don't know what you mean by "physical calculations" so I'll wait till you have clarified before answering that.


The thing you should be focusing on is consistency. If you shoot several times from the same location using boulders of different weight, age, and state of disrepair, do you always score the goal, regardless of the battery's state of charge? If you don't have a consistent shooter, it's fruitless to worry to much about polynomial vs piecewise-linear vs lookup table.



by physical calculation i mean calculating the position and height of the ball at a given point with physical equation that include air drag and magnus effect
  #6   Spotlight this post!  
Unread 14-03-2016, 11:28
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Alon View Post
by physical calculation i mean calculating the position and height of the ball at a given point with physical equation that include air drag and magnus effect
That will be very precise but not as accurate as empirical data.

Besides, there is no closed-form solution to the differential equations of motion when you introduce air drag and magnus. You would have to do a numerical simulation as discussed in the paper I linked. You probably don't want to be doing that in the roboRIO.


  #7   Spotlight this post!  
Unread 14-03-2016, 11:55
Alon Alon is offline
Registered User
FRC #3075
 
Join Date: Mar 2016
Location: israel
Posts: 9
Alon is an unknown quantity at this point
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Ether View Post
That will be very precise but not as accurate as empirical data.

Besides, there is no closed-form solution to the differential equations of motion when you introduce air drag and magnus. You would have to do a numerical simulation as discussed in the paper I linked. You probably don't want to be doing that in the roboRIO.


by empirical data you mean like a table of values?
  #8   Spotlight this post!  
Unread 14-03-2016, 12:32
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by Alon View Post
by empirical data you mean like a table of values?
By "empirical data" I mean the test data you collected by actually firing your shooter from different distances.

You can put that empirical data into a table and do a table lookup in your code.

Or you can fit a polynomial to that data and compute the polynomial in your code.

Or you can construct a piecewise-linear function from that empirical data, and compute that function in your code.

Or you can construct a piecewise-cubic-spline function from that empirical data, and compute that function in your code.




Last edited by Ether : 14-03-2016 at 12:36.
  #9   Spotlight this post!  
Unread 14-03-2016, 13:55
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 296
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Shooter speed calculation from vision tracking

We use a catapult-like pneumatic arm instead of a shooter wheel, but we have found that as other people have stated on this thread, the values we set to make shots look really arbitrary. They're most likely a combination of multiple physical effects and very hard to predict.
We used linear interpolation between values in a lookup table we got from test data. It's been very successful so far, and I suggest you do something similar instead of trying to simulate the physics of the shot. Retaking values for the table took us about 15 minutes on the practice field before our competition last weekend, so it shouldn't be too hard after you've done it a few times.
  #10   Spotlight this post!  
Unread 14-03-2016, 14:11
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 7,986
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Shooter speed calculation from vision tracking

Quote:
Originally Posted by euhlmann View Post
We used linear interpolation between values in a lookup table
A piecewise linear function is essentially the same thing as an interpolated lookup table with unevenly-spaced x values.


Closed Thread


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 09:16.

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