Go to Post Free food attracts us like flies. It's the one sure way to get us to meetings. - Mark McLeod [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
  #31   Spotlight this post!  
Unread 25-12-2012, 10:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
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 z_beeblebrox View Post
I'm limiting change in motor current.
Technically, acceleration is a function of current, not rate of change of current.

I suspect what you mean is you have a rate limiter on your motor commands?



  #32   Spotlight this post!  
Unread 25-12-2012, 11:08
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Motion Profiling

Correct.
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
  #33   Spotlight this post!  
Unread 25-12-2012, 13:28
Paul Copioli's Avatar Unsung FIRST Hero Woodie Flowers Award
Paul Copioli Paul Copioli is offline
President, VEX Robotics, Inc.
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Rockwall, TX
Posts: 1,382
Paul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond repute
Re: Motion Profiling

If you try, I think you will find the motion profile algorithm takes less memory usage, is much more accurate, and makes PID much easier to tune.
__________________
In full disclosure I am the President of VEX Robotics, a division of Innovation First International.
  #34   Spotlight this post!  
Unread 25-12-2012, 22:09
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
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


I'm ruminating why a motion control algorithm plus PID would take less memory than a PID without motion control. What am I missing?


  #35   Spotlight this post!  
Unread 25-12-2012, 23:34
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Re: Motion Profiling

Ether,
Without knowing exactly what Paul is thinking, I am assuming that the PID control algorithm does not work as well as expected and the necessary software additions required to get desirable PID performance are greater than the proposed motion profiling software and the "out of the box" PID software.
Thoughts?
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
  #36   Spotlight this post!  
Unread 26-12-2012, 01:51
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 802
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Motion Profiling

Quote:
Originally Posted by z_beeblebrox View Post
I'm curious why you would want to use motion profiling rather than just PID, as a well designed and tuned PID controller with acceleration limiting approximates the results of a trapezoidal speed curve, as can be seen in the data from running my program on a Vex robot:
Your plot shows me exactly why you wouldn't want to do it that way. Look at the overshoot at the end of the trajectory. You can do a lot better with a trapezoidal profile, for a similar space/time cost.

Without reading your implementation, I would also ask how your robot handles the case when both sides of the drivetrain are artificially or physically saturated and you have a heading error. You somehow have to deal with the heading error. You can either try to close the loop on heading so that you are still aiming for the same point in the x, y, theta configuration space, or you have to eliminate heading errors very quickly to avoid missing your goal.
  #37   Spotlight this post!  
Unread 26-12-2012, 10:27
Paul Copioli's Avatar Unsung FIRST Hero Woodie Flowers Award
Paul Copioli Paul Copioli is offline
President, VEX Robotics, Inc.
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Rockwall, TX
Posts: 1,382
Paul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond repute
Re: Motion Profiling

Ether,

What I meant was that the motion profile algorithm plus PID will take less memory than the method he was using to sense and control acceleration. The motion profile filter is very few lines of code and was designed to run real time back in the early 90s. It is very clean and fast.

Paul
__________________
In full disclosure I am the President of VEX Robotics, a division of Innovation First International.
  #38   Spotlight this post!  
Unread 26-12-2012, 10:48
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Motion Profiling

I'll try the motion profiling method and post my results.


Edit: One question: What's the easiest way to tune velocity PID?
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist

Last edited by z_beeblebrox : 26-12-2012 at 10:53.
  #39   Spotlight this post!  
Unread 27-12-2012, 05:44
Adam.garcia Adam.garcia is offline
Design Mentor
FRC #0004 (Team 4 Element)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 1997
Location: High Tech LA
Posts: 133
Adam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really niceAdam.garcia is just really nice
Re: Motion Profiling

I know that 254 has their drive code implemented into their 2011 robot code, but is there anybody willing to post drive code implementing this feature in the most stripped down form possible?

Being able to see this feature (in C++ or Java) singled out will really allow me to see what is going on here.

I think it will help everybody gain a more pragmatic understanding of this motion profiling implementation.
__________________
“The object of education is to teach us to love what is beautiful.”

“Never discourage anyone who continually makes progress, no matter how slow.”
  #40   Spotlight this post!  
Unread 29-12-2012, 01:21
z_beeblebrox's Avatar
z_beeblebrox z_beeblebrox is offline
Custom User Title
AKA: Cal
FRC #4183 (Bit Buckets)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Cambridge MA
Posts: 811
z_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond reputez_beeblebrox has a reputation beyond repute
Re: Motion Profiling

I looked through 254's code but was very confused. First, I don't really understand C++. Second, I don't think that this is the simplest implementation of motion profiling. I mostly understand how Paul's system works, but am not sure how his algorithms translate into real time motion profiling code.

Would it be possible for someone to post pseudocode for his motion profiling technique?
__________________
2012 Utah Regional Rookie All-Star
2013 Phoenix Regional Judge's Award for "design process and prototyping"
2014 Hub City Regional Quality Award, Arizona Regional Excellence in Engineering Award
2015 Arizona East Regional Creativity Award, Winner
2016 Arizona North Regional Finalist, Arizona West Excellence in Engineering Award, Finalist
  #41   Spotlight this post!  
Unread 29-12-2012, 01:44
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,498
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Motion Profiling

Quote:
Originally Posted by z_beeblebrox View Post
I looked through 254's code but was very confused. First, I don't really understand C++. Second, I don't think that this is the simplest implementation of motion profiling. I mostly understand how Paul's system works, but am not sure how his algorithms translate into real time motion profiling code.

Would it be possible for someone to post pseudocode for his motion profiling technique?
Paul's code is pretty much psuedocode, I was able to code something up that ran off what he posted pretty quickly.
  #42   Spotlight this post!  
Unread 01-01-2013, 21:11
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Motion Profiling

I've played around with the excellent Excel spreadsheet-simulators on the previous page, but I still have a couple more questions. Namely, in the way Paul proposed of designing a motion profile (the "double filter" scheme), how do the filters work, exactly? I see that the parameters T1 and T2 modify the filters, and I see that the filters' role appears to be to shape the motion profile (defining the acceleration and deceleration especially).
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #43   Spotlight this post!  
Unread 02-01-2013, 09:26
Paul Copioli's Avatar Unsung FIRST Hero Woodie Flowers Award
Paul Copioli Paul Copioli is offline
President, VEX Robotics, Inc.
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Rockwall, TX
Posts: 1,382
Paul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond reputePaul Copioli has a reputation beyond repute
Re: Motion Profiling

Colin,

You can think of a linear filter as a damper. It takes instantaneous change and spreads that change out over the length of the filter. In the case of this particular filter, it takes a step instantaneous velocity (target velocity) and spreads it out over the filter length.

The double filter just smooths out the velocity transitions a l little more. It just takes the output from the first filter and filters that.

The implementation is pretty simple. You have two loops (while loops, or whatever suits your style). The outer loop runs until the filter is empty (contains all zeros). The inner loop runs based on Npts that is calculated based on the path distance and programmed velocity. This is basically how many times you input a "1" into the filter.

So, you run the planning algorithm until the filter is completely empty, inside that filter you add a 1 as the filter input for Npts. Each outer loop you shift each filter position to the next filter position.

The Excel file demonstrates this exactly.
__________________
In full disclosure I am the President of VEX Robotics, a division of Innovation First International.
  #44   Spotlight this post!  
Unread 02-01-2013, 09:37
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,077
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 kenavt View Post
I've played around with the excellent Excel spreadsheet-simulators on the previous page, but I still have a couple more questions. Namely, in the way Paul proposed of designing a motion profile (the "double filter" scheme), how do the filters work, exactly? I see that the parameters T1 and T2 modify the filters, and I see that the filters' role appears to be to shape the motion profile (defining the acceleration and deceleration especially).
F1 is a low-pass FIR filter that imposes a rate limit on the input (where the input in this case is a "go full speed ahead" speed command). As a result, an acceleration limit is put on the output. The T1 parameter of F1 is the amount of time it takes to accelerate from 0 to full speed.

F2 is another low-pass FIR filter that imposes a rate limit on its input (which is the output of F1). As a result, a jerk (derivative of acceleration) limit is put on the output. The T2 parameter of F2 is the amount of time it takes to increase acceleration from 0 to the maximum defined by T1.

You could in theory add an F3 or even more successive FIR filters and achieve smoothness down to an arbitrary order.

Here are some examples...

If T1 is equal to 400ms and T2 is equal to 0 (use 1ms in the spreadsheet to avoid divide by zero), you get an acceleration-limited velocity, but there are no limits on the jerk (you immediately go to maximum acceleration).

If T1 is equal to 400ms and T2 is equal to 400ms, it takes the same amount of time to reach the maximum acceleration as velocity, so you get a triangular profile (as soon as you hit maximum acceleration it is immediately time to reduce acceleration)

If T1 is equal to 400ms and T2 is equal to 200ms (or any number 0 < T2 < 400ms), you spend a non-zero amount of time at your maximum acceleration before reducing acceleration.

Last edited by Jared Russell : 02-01-2013 at 09:43. Reason: Changed the language of "slow down" since it carries speed connotations
  #45   Spotlight this post!  
Unread 02-01-2013, 11:42
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Motion Profiling

How would this algorithm deal with changes in Vprog dynamically?

If another algorithm would like to impose velocity limits dynamically, would simply setting Vprog to the imposed velocity limit allow me to impose the limit, and would the trapezoid deal with it? Or do I need something else?
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
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 06:44.

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