Go to Post Let's just say that I am old enough to... - dlavery [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 20-02-2015, 14:09
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,605
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Motion Profiling

Jared, that's really interesting. We have a desire to do a trapezoidal profile on our tote lift in order to prevent sudden deceleration from jerking a tote off of the hooks. We're doing something primitive right now, but I wonder if our programming lead thought about a lookup table for it.
  #2   Spotlight this post!  
Unread 20-02-2015, 14:19
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,064
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Motion Profiling

Quote:
Originally Posted by JesseK View Post
Jared, that's really interesting. We have a desire to do a trapezoidal profile on our tote lift in order to prevent sudden deceleration from jerking a tote off of the hooks. We're doing something primitive right now, but I wonder if our programming lead thought about a lookup table for it.
The only reason we used a lookup table last season is that (a) we wanted to be able to visualize the x/y/theta quintic spline paths we were generating before deploying to the robot to make sure they looked reasonable, and (b) we needed to re-parameterize our splines by arc length, which we did with naive (and costly) numerical integration that took a little too long on the cRIO. If we had more time we would have made some quick optimizations and just done it on the fly.
  #3   Spotlight this post!  
Unread 20-02-2015, 15:09
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Motion Profiling

The lookup table method was the best way for our team, as all of our autonomous action is based on distance triggers. We would generate the desired motion profile on the roboRIO, generate a .csv file from the data, copy it to the laptop, and open it in excel. This let us sit in front of graphs and data and decide when and where each action in autonomous would happen. It takes some amount of time for our elevator and container swatter to move, so knowing how fast the robot was going at each point was very helpful to determine where we should set the distance trigger for starting elevator or swatter movement.

The table method is also super easy to explain. The polynomial method would require separate polynomials for acceleration ramp up, constant positive acceleration, acceleration ramp down, constant velocity, deceleration ramp, constant deceleration, and final deceleration ramp. That seems harder to keep track of.

The table calculation method also gave me an easy way to work in motor equations. You get more torque, and therefore more acceleration, from your motor at lower speeds. If your profiling takes this into account, you can go much faster. Without taking this into account, you must limit your max acceleration to less than the robot can actually achieve so that as it accelerates, it can still achieve the same acceleration.

The solution to the dc motor equations for a pulley driven lift is

Code:
v = (r * w_n * (a_g * r * m - T_s)/T_s) * (1 - e^(-(t * T_s)/(r^2 * w_n * m))))
where v is velocity, r is pulley radius, w_n is no load speed (rad/sec), a_g is acceleration of gravity, m is mass carried, T_s is stall torque, and t is time.

If you have lots of time, you could integrate this again and find the position equation, and use that to determine your motion profile.

However, that's difficult, and you can come up with a simpler equation, v * a = k, where k is some constant specific to your setup. This means you either get a large acceleration or a large velocity, but not both at the same time. This equation is only valid when a is less than the acceleration achieved by stall torque and v is less than the no load speed. This is really easy to add into your calculations for the constant acceleration portion with
Code:
a = k/v_prev
If you have a large velocity, you can't accelerate as fast.

This would let you achieve the most aggressive and fastest profile possible for when speed really matters.

Last edited by Jared : 21-02-2015 at 14:03. Reason: Missed some close parenthesis - Thanks Ether
  #4   Spotlight this post!  
Unread 21-02-2015, 13:43
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: Motion Profiling

Quote:
Originally Posted by Jared View Post
However, that's difficult, and you can come up with a simpler equation, v * a = k, where k is some constant specific to your setup. This means you either get a large acceleration or a large velocity, but not both at the same time. This equation is only valid when a is less than the acceleration achieved by stall torque and v is less than the no load speed. This is really easy to add into your calculations for the constant acceleration portion with
Code:
a = k/v_prev
If you have a large velocity, you can't accelerate as fast.

This would let you achieve the most aggressive and fastest profile possible for when speed really matters.
If you can experimentally (or analytically) determine the maximum speed vmax and the maximum acceleration amax, you could try using a linear relation:

acceleration = amax*(1-speed/vmax)

... and that would be easy to numerically integrate in a spreadsheet.

When speed=vmax the acceleration is zero, and when speed=0 the acceleration is amax.

EDIT: added screenshot and XLS for user-selectable accel & speed limiting

Attached Thumbnails
Click image for larger version

Name:	accel limited profile.png
Views:	57
Size:	12.4 KB
ID:	18450  Click image for larger version

Name:	accel & speed limited profile.png
Views:	46
Size:	10.5 KB
ID:	18453  
Attached Files
File Type: xls accel limited profile.xls (34.0 KB, 14 views)
File Type: xls accel & speed limited profile.xls (34.5 KB, 27 views)

Last edited by Ether : 21-02-2015 at 15:37. Reason: added more attachments
  #5   Spotlight this post!  
Unread 21-02-2015, 14:48
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
Re: Motion Profiling

I've attached an excel spreadsheet with a few of the motion equations I've come up with so far. For inputs, they take motor constants. If you have a gear reduction before the motor constants, you need to come up with a new set of motor constants that match the characteristics of the output of the gearbox.

The first sheet is for some mechanism which is always fighting gravity in the same direction it is trying to move. The speed under load after a few seconds matches the loaded speed values calculated by the JVN design calculator.

The velocity is determined exactly, not by numerical integration. I don't know how to integrate that velocity function (though I'm sure it's possible), so I did what you suggested in your previous post.

The second sheet calculates velocity and position with explicit functions for each, but does not take into account gravity. The velocity function had a less complicated integral. This would work for a drive system, but not for an elevator. I like this better because the robot could simply plug in the time elapsed into the position function to determine its setpoint.

If you're interested in seeing my work, I could take a picture of it.


Our 2015 elevator has these values
stall torque 25 nm
mass 35 kg
free speed 32 rad/sec
sprocket radius .022 meters

It's way overpowered, and does achieve full speed in less than .25 seconds under load.
Attached Files
File Type: xlsx Elevator Motion Profile.xlsx (34.3 KB, 59 views)

Last edited by Jared : 21-02-2015 at 14:52. Reason: Added example data
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:13.

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