OCCRA
Go to Post FIRST robotics: Not just for nerds. - Koko Ed [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
  #46   Spotlight this post!  
Unread 06-09-2018, 01:31 AM
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 108
calcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud of
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by carbotaniuman View Post
And what are the tools to do this in FRC? Looking for a guide on motion profiling before I do anything more serious.
I compiled this intro for my students so I wouldn't have to repeat myself. https://csweb.frc3512.com/ci/ct02/#Motion_profiles

At the bottom, there's a link to 254's motion profiling talk from 2015.
Reply With Quote
  #47   Spotlight this post!  
Unread 06-09-2018, 02:23 AM
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 108
calcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud of
Re: Team 1678 2018 Code Release

I like a lot of the changes this made over 971's state-space stuff (one class per file pair, documentation for new students to orient themselves, files were reorganized so the state-space and motion profile files were easier to find, being able to build it on a non-Debian machine). It's interesting to see that you replaced the Coeffs classes with just passing in the matrices directly. I guess it makes sense given that you control what the Python code generates, doing that simplifies the interface, and you're familiar with what the matrices are for. However, having the matrices in a Coeffs class lets you cleanly abstract away the matrices so you can have prepackaged models like DriveTrain, Elevator, Flywheel, etc. that you pass in to your subsystem. Something to think about anyway.

I noticed you aren't using EIGEN_MAKE_ALIGNED_OPERATOR_NEW in your classes that declare Eigen matrices. If you aren't allocating those classes with new, that's fine, but it's something to keep in mind: https://eigen.tuxfamily.org/dox/grou...enMembers.html.

Some more documentation on how the queues and protobuf stuff fit together would be nice because that part still feels a bit magic to me at this point. By the way, I encountered some non-compiling code and broken tests while trying to get your repo building. I just submitted a PR with the fixes I needed to make it compile.
Reply With Quote
  #48   Spotlight this post!  
Unread 06-17-2018, 10:29 PM
carbotaniuman carbotaniuman is offline
Registered User
FRC #4639
 
Join Date: Jan 2018
Location: Katy
Posts: 16
carbotaniuman is an unknown quantity at this point
Re: Team 1678 2018 Code Release

Neat. How do I tune such a system or determine good values? I can mostly tune PIDs but I'm not too sure how to approach this.

Quote:
Originally Posted by calcmogul View Post
I compiled this intro for my students so I wouldn't have to repeat myself. https://csweb.frc3512.com/ci/ct02/#Motion_profiles

At the bottom, there's a link to 254's motion profiling talk from 2015.
Reply With Quote
  #49   Spotlight this post!  
Unread 06-18-2018, 12:08 AM
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 108
calcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud of
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by carbotaniuman View Post
Neat. How do I tune such a system or determine good values? I can mostly tune PIDs but I'm not too sure how to approach this.
As you know, motion profiles for drivetrains provide tuples of position and velocity for each wheel over time that the robot is physically capable of following. However, PID control alone doesn't track changes in velocity over time accurately enough for this application.

A common way to improve state tracking (hitting your position/velocity targets as they change) is by using feedforwards. Feedforwards let you inject information about the system dynamics into your controller. If the feedforwards to well enough, the feedback terms P, I, and D just pick up the slack and account for unmodeled disturbances. For drivetrains, I generally see steady-state feedforwards used where you apply some voltage to make the system follow velocity or acceleration targets at steady-state. The one for tracking velocity is Kv, which is 1 over the max speed when full voltage is applied; and the one for tracking acceleration is Ka, which is 1 over the max acceleration when full voltage is applied. Each is multiplied by the desired velocity and acceleration respectively to obtain a voltage for achieving each assuming no other dynamics are at play. https://www.chiefdelphi.com/media/papers/3402 has a method of computing these empirically.

Last edited by calcmogul : 06-18-2018 at 12:11 AM.
Reply With Quote
  #50   Spotlight this post!  
Unread 08-15-2018, 02:54 PM
dardeshna's Avatar
dardeshna dardeshna is online now
Alumnus
AKA: Devin Ardeshna
FRC #0008 (Paly Robotics | Team 8)
Team Role: Mechanical
 
Join Date: Dec 2015
Rookie Year: 2015
Location: Palo Alto
Posts: 169
dardeshna is a splendid one to beholddardeshna is a splendid one to beholddardeshna is a splendid one to beholddardeshna is a splendid one to beholddardeshna is a splendid one to beholddardeshna is a splendid one to beholddardeshna is a splendid one to behold
Re: Team 1678 2018 Code Release

Hi Jishnu—could you kindly provide either a brief summary of what the state space plant for the drivetrain looks like, or a pointer to its implementation?
__________________
Devin Ardeshna
Alumnus (Paly Robotics FRC #8)


2018 (FRC #8 - Team Captain) Arizona North Regional Quarterfinalist and Entrepreneurship Award, Silicon Valley Regional Semifinalist
2017 (FRC #8 - Build Captain) Ventura Regional Quarterfinalist, Entrepreneurship Award, and Creativity Award, Silicon Valley Regional Finalist, Entrepreneurship Award, and Wildcard, Roebling Division Semifinalist, Chezy Champs Quarterfinalist, Capital City Classic Semifinalist
2016 (FRC #8 - Safety Captain) Central Valley Regional Finalist and Wildcard, Silicon Valley Regional Quarterfinalist, Curie Division, CalGames Quarterfinalist and Entrepreneurship Award, Capital City Classic Quarterfinalist
2015 (FRC #8 - Student) Central Valley Regional Entrepreneurship Award, Silicon Valley Regional Entrepreneurship Award, Capital City Classic Semifinalist and Judges' Award
Reply With Quote
  #51   Spotlight this post!  
Unread 08-15-2018, 03:00 PM
calcmogul's Avatar
calcmogul calcmogul is offline
WPILib Developer
AKA: Tyler Veness
FRC #3512 (Spartatroniks)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Santa Maria, CA
Posts: 108
calcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud ofcalcmogul has much to be proud of
Re: Team 1678 2018 Code Release

Quote:
Originally Posted by dardeshna View Post
Hi Jishnu—could you kindly provide either a brief summary of what the state space plant for the drivetrain looks like, or a pointer to its implementation?
The Python code describing their model is here: https://github.com/frc1678/robot-cod.../drivetrain.py
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 03:45 PM.

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


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