But we all just have to do what we can and are willing to, to keep our teams going. - Adrienne E. [more]
 Chief Delphi > Java How would I find robot constants for motion profiling?
 portal register members calendar search Today's Posts Mark Forums Read FAQ rules

#1
11-08-2018, 01:42 AM
 Mahim Registered User FRC #4571 (Rambots) Team Role: Programmer Join Date: Jan 2017 Rookie Year: 2016 Location: New York Posts: 3
How would I find robot constants for motion profiling?

I am just wondering how would I measure a robot's maximum velocity, acceleration, and jerk? Is there a specific method? How would I use it to generate a path using pathfinder?
#2
11-08-2018, 10:26 AM
 gerthworm Making the 1's and 0's FRC #1736 (Robot Casserole) Team Role: Mentor Join Date: Jan 2015 Rookie Year: 2015 Location: Peoria, IL Posts: 706
Re: How would I find robot constants for motion profiling?

In general it's something you'd define to limit how aggressive you want your pathplanner to be.

In theory you could set them equal to the mechanical limits of the robot, but in practice those limits can change during a competition (adding a bit of extra grease, changing tires, different carpet, changing battery charge, changing weight, motor temperature... the list goes on).

If you have encoders hooked up, you can drive your robot as fast as possible by jamming the control stick forward, and measuring the wheel RPM (which you can convert to linear velocity). The highest speed you see on carpet is probably your max velocity. The fastest you see your speed change due to control inputs alone (ie, not running into walls) is your max acceleration. The fastest you see your acceleration change is your max jerk. You could in theory measure all these things, account for a margin of error (say, multiply by 0.8), and go with those numbers.

As far as I know though, we usually start by tuning those numbers very very conservatively, and ensuring the auto routine fundamentally accomplishes what we needed (abet slowly). Then we start ratcheting up the numbers as high as we can without losing accuracy of the routine.

I should also note, I'm not super familiar with how the max parameters impact Jaci's pathplanner behavior. I'm assuming these parameters are what dictate the allowed performance envelope, and pathplanner honors them while generating its output.

Last edited by gerthworm : 11-08-2018 at 10:28 AM.
#3
11-08-2018, 10:40 AM
 Prateek M Kotlin Master Race FRC #5190 (Green Hope Falcons) Team Role: Programmer Join Date: May 2018 Rookie Year: 2018 Location: Cary, North Carolina Posts: 41
Re: How would I find robot constants for motion profiling?

The version of Pathfinder that most people are familiar with (v1) honors the max velocity, acceleration, and jerk constraints when generating the velocity profile for the center of the robot. Often times, this profile has to be split into separate profiles for the left and right sides of the robot. This "splitting" does not take the constraints into consideration.

For example, if you are negotiating a sharp right-turn curve and your velocity constraint is 9 feet per second, the central profile will max out at 9 feet per second; however, when it's split up into the profiles for the left and right sides of the drivetrain, the left side profile will have velocities higher than 9 feet per second in order to negotiate the curve.

The newer version of Pathfinder which was released about a month ago takes into consideration the dynamics of the drivetrain when splitting up the central profile. This would cause the robot to slow down near the curves so that no side of the drivetrain will be commanded a velocity that is more than the constraint specified.

Last edited by Prateek M : 11-08-2018 at 10:42 AM.
#4
11-08-2018, 01:16 PM
 Oblarg Registered User AKA: Eli Barnett FRC #0449 (The Blair Robot Project) Team Role: Mentor Join Date: Mar 2009 Rookie Year: 2008 Location: Philadelphia, PA Posts: 1,906
Re: How would I find robot constants for motion profiling?

Quote:
 Originally Posted by gerthworm The fastest you see your speed change due to control inputs alone (ie, not running into walls) is your max acceleration. The fastest you see your acceleration change is your max jerk.
This is not correct; see the whitepaper in my signature for more details.

In order to guarantee an achievable profile, max acceleration and max velocity must be jointly chosen so that the required voltage is not greater than what the battery can provide (after taking into account voltage drop due to internal resistance of the battery and robot wiring). As mentioned above, in pathfinder v1, turning will violate these constraints and extra "headroom" is required.

Max jerk is theoretically determined by motor inductance, though in our experimental data we've found it's generally no more than a third of a second or so from 0 to max acceleration, and it can safely be neglected.
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"

Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016

FRC Drivetrain Characterization
#5
11-08-2018, 01:29 PM
 gerthworm Making the 1's and 0's FRC #1736 (Robot Casserole) Team Role: Mentor Join Date: Jan 2015 Rookie Year: 2015 Location: Peoria, IL Posts: 706
Re: How would I find robot constants for motion profiling?

Quote:
 Originally Posted by Oblarg This is not correct; see the whitepaper in my signature for more details. In order to guarantee an achievable profile, max acceleration and max velocity must be jointly chosen so that the required voltage is not greater than what the battery can provide (after taking into account voltage drop due to internal resistance of the battery and robot wiring). As mentioned above, in pathfinder v1, turning will violate these constraints and extra "headroom" is required. Max jerk is theoretically determined by motor inductance, though in our experimental data we've found it's generally no more than a third of a second or so from 0 to max acceleration, and it can safely be neglected.
Hmmmm ok, looking through whitepaper. I think I understand the comment about where the battery-provided voltage dictating acceleration/velocity constraints.

I think I might have made my explanation overly complex: All I meant to imply was that you should run some trials on the robot, record some data, and use this information as the basis for determining what the drivetrain's max achievable velocity/acceleration/jerk could be.

EDIT: If I could make a guess - my error is in the detail of how you "use this information". You cannot pick the global max acceleration over a sample set independently of the global max velocity - max acceleration is a function of velocity. At best you might be able to pick a single point in time that reflects the best acceleration & velocity?

I'm assuming that if a set of input commands in teleop can produce a certain velocity profile, that same profile should be achievable in autonomous. I think this is a valid simplification, but am not as certain now.

Understood that even with those constraints entered into the V1 pathfinder, the resulting paths may actually violate it for the overall robot. With this I presume there is further "margin of error" required to correct for it? Or alter the path generation algorithm?

Last edited by gerthworm : 11-08-2018 at 01:33 PM.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 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 User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     User Announcements FIRST     General Forum     Rumor Mill     Career     Robot Showcase Technical     Technical Discussion     Robotics Education and Curriculum     Motors     Electrical         CAN     Programming         NI LabVIEW         C/C++         Java         Python     Sensors     Control System     Pneumatics     Kit & Additional Hardware     CAD         Inventor         SolidWorks         Creo     IT / Communications         3D Animation and Competition         Website Design/Showcase         Videography and Photography         Computer Graphics Competition     Awards         Chairman's Award     Rules/Strategy         Scouting     Team Organization         Fundraising         Starting New Teams         Finding A Team         College Teams     Championship Event     Regional Competitions     District Events     Off-Season Events     Thanks and/or Congrats     FRC Game Design     OCCRA         OCCRA Q&A Other     Chit-Chat         Games/Trivia         Fantasy FIRST     Car Nack's Corner     College & University Education     Dean Kamen's Inventions     FIRST-related Organizations         The Blue Alliance     FIRST In the News...     FIRST Lego League     FIRST Tech Challenge     VEX     Televised Robotics     Math and Science     NASA Discussion ChiefDelphi.com Website     CD Forum Support     Extra Discussion

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

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

 -- English (12 hour) -- English (24 hour) Contact Us - Chief Delphi - Rules - Archive - Top