Go to Post Sleep is for the weak in week 6! - JesseK [more]
Home
Go Back   Chief Delphi > ChiefDelphi.com Website > Extra Discussion
CD-Events   CD-Media   CD-Spy   FRC-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 05-15-2012, 09:29 AM
Michael DiRamio Michael DiRamio is offline
Registered User
FRC #1114 (Simbotics)
Team Role: Teacher
 
Join Date: Jan 2006
Rookie Year: 2006
Location: St. Catharines, Ontario, Canada
Posts: 38
Michael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond repute
paper: Team 1114 Controls and Programming Overview 2012

Thread created automatically to discuss a document in CD-Media.

Team 1114 Controls and Programming Overview 2012 by Michael DiRamio
Reply With Quote
  #2   Spotlight this post!  
Unread 05-15-2012, 09:43 AM
Michael Blake's Avatar
Michael Blake Michael Blake is offline
Head Coach
FRC #3481 (Bronc Botz)
Team Role: Coach
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Helotes, TX
Posts: 242
Michael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant futureMichael Blake has a brilliant future
Re: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by Michael DiRamio View Post
Thread created automatically to discuss a document in CD-Media.

Team 1114 Controls and Programming Overview 2012 by Michael DiRamio
WOW. THANKS for sharing this!

We'll review with our team on Friday, see if we can create a punch-list to add functionality to our bot and enhance our capabilities/skills since we're competing through November.

GOOD STUFF here...
__________________
Founder - FRC 3481 - Bronc Botz (2011) // 2012, 2013, 2014, and 2015 Beta Test Team - C++
Founder - San Antonio Competition Robotics Alliance, Inc. (SACRA) [501(c)(3) pending] (2012)
Co-Founder w/Matt Blake - VEX VRC 3481Z - Wonder Botz (2011) [for Physically or Mentally Challenged Teens]
Co-Founder - FTC 4008 - Bronc Botz-Orange (2010) and FTC 4602 - Bronc Botz-Blue (2011) and FTC #6976 - Bronc Botz-Nano (2013 - middle-schoolers)
Reply With Quote
  #3   Spotlight this post!  
Unread 05-15-2012, 10:15 AM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 243
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by Michael DiRamio View Post
Thread created automatically to discuss a document in CD-Media.

Team 1114 Controls and Programming Overview 2012 by Michael DiRamio
This is awesome!! I hope someone would be kind enough to explain how you made the equations for the linearizaton of the victor. I mean sure I could use this, but I'd rather know how to do something like this as I've needed to do it in the past professionally and had to use wxMaxima to hammer out something close. I've googled around, but I just haven't found anything that spells it out step by step (e.g. curve fitting). I was going to hit Ether up on this in his equations, but I'm here now.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-15-2012, 11:26 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,003
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: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by JamesTerm View Post
This is awesome!! I hope someone would be kind enough to explain how you made the equations for the linearizaton of the victor. I mean sure I could use this, but I'd rather know how to do something like this as I've needed to do it in the past professionally and had to use wxMaxima to hammer out something close. I've googled around, but I just haven't found anything that spells it out step by step (e.g. curve fitting). I was going to hit Ether up on this in his equations, but I'm here now.

You can do curve fitting in Excel (or OpenOffice or LibreOffice) using the "trendline" function.

See this Excel spreadsheet.

Chart 1 shows the test data (A1:B20) plotted with the joystick command on the X axis and the actual Vic output on the Y axis.

Chart 2 is the inverse of Chart 1 and shows the actual Vic output on the X axis and the joystick command on the Y axis.

Chart 3 shows a 3rd degree polynomial trendline added to Chart 2. The polynomial can be used to linearize the Vic's output.



Last edited by Ether : 05-15-2012 at 11:44 AM.
Reply With Quote
  #5   Spotlight this post!  
Unread 05-15-2012, 11:36 AM
Michael DiRamio Michael DiRamio is offline
Registered User
FRC #1114 (Simbotics)
Team Role: Teacher
 
Join Date: Jan 2006
Rookie Year: 2006
Location: St. Catharines, Ontario, Canada
Posts: 38
Michael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond reputeMichael DiRamio has a reputation beyond repute
Re: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by JamesTerm View Post
I hope someone would be kind enough to explain how you made the equations for the linearizaton of the victor.
We did this fairly quickly this year after getting frustrated with the shooter speed control. This summer we hope to generate a more accurate function.

We started by plotting programming output vs victor voltage output (as well as programming output vs shooter speed) and used this to come up with a curve of best fit for the victor output.

We then used Mathematica to generate the inverse of this function. It was pretty ugly so we hacked it a bit by plotting the values from 0 - 1 and then finding a curve of best fit for this (which became the linearization function).

There's definitely a lot of room for improvement/higher accuracy in the function, but we found this linearization made a HUGE difference in the performance of our PID loops.
Reply With Quote
  #6   Spotlight this post!  
Unread 05-15-2012, 11:44 AM
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 114
Hjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud ofHjelstrom has much to be proud of
Re: paper: Team 1114 Controls and Programming Overview 2012

Did you end up using the software "base lock" when on the bridge? We have a feature like this but only used it on the field because if the wheels slip, the PID controller would then "correct" and end up driving the robot the opposite way off the bridge. Maybe your rubber wheels don't slip on the bridge though!

Nice job!

Last edited by Hjelstrom : 05-15-2012 at 11:54 AM.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-15-2012, 11:51 AM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,003
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: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by Michael DiRamio View Post
We started by plotting programming output vs victor voltage output (as well as programming output vs shooter speed) and used this to come up with a curve of best fit for the victor output.

We then used Mathematica to generate the inverse of this function. It was pretty ugly so we hacked it a bit by plotting the values from 0 - 1 and then finding a curve of best fit for this (which became the linearization function).

There's definitely a lot of room for improvement/higher accuracy in the function, but we found this linearization made a HUGE difference in the performance of our PID loops.
If you plot your data so that the joystick command is on the Y axis, and the actual Vic output is on the X axis, then you don't need to invert anything analytically. It's already inverted. All you have to do is fit the trendline and you've got your linearization function. See the Excel file link in my previous post in this thread.


Reply With Quote
  #8   Spotlight this post!  
Unread 05-15-2012, 12:03 PM
Q-Tip Q-Tip is offline
Mike Quill
FRC #1114
 
Join Date: May 2012
Rookie Year: 2008
Location: St. Catharines
Posts: 1
Q-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant futureQ-Tip has a brilliant future
Re: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by Hjelstrom View Post
Did you end up using the software "base lock" when on the bridge? We have a feature like this but only used it on the field because if the wheels slip, the PID controller would get "correct" and end up driving the robot the opposite way off the bridge. Maybe your rubber wheels don't slip on the bridge though!

Nice job!
Yes, we did use base lock on the bridge. The two main situations that base lock was used were when we were waiting for a balancing partner to climb on and when we were close to balanced and used fine adjustment on the base lock.
Reply With Quote
  #9   Spotlight this post!  
Unread 05-15-2012, 12:37 PM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 243
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by Ether View Post
If you plot your data so that the joystick command is on the Y axis, and the actual Vic output is on the X axis, then you don't need to invert anything analytically. It's already inverted. All you have to do is fit the trendline and you've got your linearization function. See the Excel file link in my previous post in this thread.

Thanks for this response and so I want to flash back to this one:
http://www.chiefdelphi.com/forums/at...d=13215692 33

The curve is similar to this one you posted, but just a bit more curvy at the end. Should this process of working out the curve be custom for any given rotary system? It seems like I could use any of these equations and they would be in the ball park, but I'd probably want to go through these steps on each robot, and each closed loop rotary system because of other properties like model of victor and the work load that it is controlling. Well that is really the question, does the work load impact the kind of curve you will have? Are there other factors which may contribute to the curve being different from one robot/rotary system to the next, and if so, is it significant enough to be worth the effort?
Reply With Quote
  #10   Spotlight this post!  
Unread 05-15-2012, 12:43 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,003
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: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by Ether View Post
You can do curve fitting in Excel (or OpenOffice or LibreOffice) using the "trendline" function.

See this Excel spreadsheet.
If the model you want to fit is not supported by "trendline" -- for example you think y=p1+p2/(x-p3) might fit the data better than, say, a polynomial -- you can create and fit your own model using Tools|Solver as shown in this spreadsheet.


[edit1]
Hat tip to Joe Ross: In Excel, cell E1 can be coded directly as sumxmy2(B1:B20,C1:C20) instead of creating cells D1:D20 (if a least-squares fit objective function is desired).
[/edit1]]

[edit2]
Note that not only the model but also the objective function is user-configurable using the tools|solver modeling technique. For example, suppose that instead of minimizing the sum of the squares of the model errors (least squares fit) you want to find the parameters which produce the minimum maximum absolute error. This is easily accomplished by making cells D1:D20 equal to the absolute model error (for each data point), and making cell E1 equal to the maximum of cells D:D20. Then use tools|solver to minimize cell E1. Note: this does not work well (or at all) in Excel because of the algorithms used; and in OpenOffice takes several minutes (instead of seconds) but does find a solution. For the spreadsheet linked in this post, OO3.3 found the following solution for minimum maximum error: y = -0.2651 -0.419013/(x-1.3281551). Here's a graph of the solution. The solid black line is the raw data. The dashed black line is the inverted data. The solid red line is the linearization function, which uses only 2 adds and 1 divide.
[/edit2]



Last edited by Ether : 05-15-2012 at 03:49 PM.
Reply With Quote
  #11   Spotlight this post!  
Unread 05-15-2012, 04:17 PM
slijin's Avatar
slijin slijin is offline
Pockets
AKA: Samuel Lijin
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York City
Posts: 537
slijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to behold
Re: paper: Team 1114 Controls and Programming Overview 2012

Wow, thanks for this!

Could you also post the data you used to develop your linearization code? I'd like to compare it to other data I've found around.
__________________

2010-12 CT Chairman's
2011 Galileo 5th seed
2010 NY Regional Winners
Reply With Quote
  #12   Spotlight this post!  
Unread 05-15-2012, 04:36 PM
MichaelBick MichaelBick is offline
Mechanical Director, Drive Captain
FRC #1836 (Milken Knights)
Team Role: Mechanical
 
Join Date: Oct 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 609
MichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant future
Re: paper: Team 1114 Controls and Programming Overview 2012

Why would you want to reduce the d constant of PID in certain circumstances for speed PID?
__________________
Team 1836 - The Milken Knights
2013 LA Regional Champions with 1717 and 973
2012 LA Regional Finalists with 294 and 973
To follow Team 1836 on Facebook, go to http://www.facebook.com/MilkenKnights
To go to our website, go to http://milkenknights.com/index.html
Reply With Quote
  #13   Spotlight this post!  
Unread 05-15-2012, 04:50 PM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 243
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by MICHAELABICK View Post
Why would you want to reduce the d constant of PID in certain circumstances for speed PID?
I presume this was the
"Different from standard PID control. Instead of the PID calculation setting
the output, the PID calculation is an adjustment to the output
o output = output + calcPID(currentSpeed)
"
?

But if I had to guess, I know that (at least for our power wheel)... the more momentum and kinetic energy built up on higher speeds the less P is needed... but I cannot see yet how that equates to D except that if D is too high it will reverse oscillate. We too had to use a large D though. This attachment is P=4 and D=7. Where magenta is the predicted velocity, Cyan is the encoder velocity, green is the voltage, and yellow is the PID in action.

I'm still trying to master PID... I'd love to get it down to a 2 radian per second tolerance like 1114 has done! We are around 20 radians tolerance.
Reply With Quote
  #14   Spotlight this post!  
Unread 05-15-2012, 05:38 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,003
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: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by slijin View Post
Wow, thanks for this!

Could you also post the data you used to develop your linearization code? I'd like to compare it to other data I've found around.
Your post was linked to my post, so I assume you were asking me?

If that is the case, the Victor calibration data I used came from the 1114's paper (the subject of this thread), on page 3 (the red dots). Is that what you were asking? If so, the data is in the spreadsheets in cells A1:B20.


Reply With Quote
  #15   Spotlight this post!  
Unread 05-15-2012, 08:00 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,003
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: paper: Team 1114 Controls and Programming Overview 2012

Quote:
Originally Posted by JamesTerm View Post
does the work load impact the kind of curve you will have?
For the Vic, I believe the answer is "yes" (and perhaps significantly) but I have no data to confirm that.

If I am right (that the variation of the Vic's "effective % of full scale output vs input command" curve varies significantly with working load), then it wouldn't make much sense to worry too much about getting the "linearization function" exactly right when the load varies greatly.

Does anyone have such data1 they'd be willing to share?


1 e.g. with a motor connected to the Vic: no-load motor speed vs input command to the Vic, and stalled motor torque vs input command to the Vic. Of course the data for the "stalled motor" curve would have to be limited to small inputs.

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 09:45 AM.

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


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