Go to Post (You know you're overdosed on FIRST) when watching regional web-casts takes precedent over Saturday morning cartoons. - Hawiian Cadder [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
  #1   Spotlight this post!  
Unread 17-04-2016, 13:08
Ryan-Greenblatt Ryan-Greenblatt is offline
A foolish programmer
FRC #0900 (Zebracorns)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: NC
Posts: 8
Ryan-Greenblatt has a spectacular aura aboutRyan-Greenblatt has a spectacular aura about
Issues with Motion Profile Generator

One of our programming teams post-season goals (yes post-season ) is to start using motion profiling. I wrote a motion profile generator in labview which utilizes the "Copioli" method (Motion Profile Generater-Demo.vi). I directly copied the math from the excel spread sheet released by CTR electronics (Motion Profile Generator.xlsx) and it appeared to work fine. However, in some specific situations the profile generator either fails to get to the location as fast as it could (acceleration maxes out at a value below the specified max acceleration) or it doesn't get to the location at all. I thought this was a problem with how I copied the math but I put the same inputs in the spread sheet and got the same incorrect results. I also checked my math using a different spread sheet which uses the same method (Motion Profile - Copioli Method-2.xlsx) and I got the same results. Images of the profile failing to get to the target are attached. Please note I changed the inputs so instead of inputting T1, T2 you can input max acceleration and max jerk into the vi.
Click image for larger version

Name:	Motion Profile VI not getting to target.PNG
Views:	76
Size:	33.9 KB
ID:	20626
Click image for larger version

Name:	Motion profile excel doc not getting to target.PNG
Views:	56
Size:	23.7 KB
ID:	20628
Reply With Quote
  #2   Spotlight this post!  
Unread 17-04-2016, 15:46
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 522
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Issues with Motion Profile Generator

Hi Ryan,
The spreadsheet in our example also uses the Copioli Method [I basically took Paul's example and added the source generator tabs ], so it follows that you get the same generated results.

It's not clear what you're observation is. Are you saying the generated profile doesn't match your expectations? If so, exactly what is wrong with the generate profile screenshots that you attached? Those plots seem reasonable at first glance.

...Or are you saying the physical motion of the mechanism isn't matching your expectations? If so the specified cruise-velocity/acceleration may need to be tweaked, or gains need to be adjusted to better honor the generated target profile.
Reply With Quote
  #3   Spotlight this post!  
Unread 17-04-2016, 16:06
Ryan-Greenblatt Ryan-Greenblatt is offline
A foolish programmer
FRC #0900 (Zebracorns)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: NC
Posts: 8
Ryan-Greenblatt has a spectacular aura aboutRyan-Greenblatt has a spectacular aura about
Re: Issues with Motion Profile Generator

The issue is that the motion profile results in a final position of 1.7956 instead of the target final position of 4. Look at the attached images, the position line in the spreadsheet and the vi both don't end up at 4. I'm assuming that if this motion profile was used on a motor the motor would end up turning just 1.7956 units instead of 4, because the position line is effectively just calculated by integrating the velocity line and the position and velocity arrays are the only pieces of data used to control the motor, but I haven't tested it.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-04-2016, 17:04
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,059
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: Issues with Motion Profile Generator

Quote:
Originally Posted by Ryan-Greenblatt View Post
The issue is that the motion profile results in a final position of 1.7956 instead of the target final position of 4.
Just for grins, download and try this.

Also try this.



Last edited by Ether : 17-04-2016 at 17:08.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-04-2016, 17:10
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 522
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Issues with Motion Profile Generator

Looks like the problem is T1 is bigger than T4, and the generator isn't meant to know how to handle reducing the peak of the velocity curve.

To confirm this, first set T2 to '1' to remove the s-curving. This gives us a trapezoid. You can bump this up later to put s-curving back.

Next look at T4. T4 is dist/vprog => 4 rot / 3rps => 1333ms. If you set T1 to this the trapezoid reduces to a triangle, meaning we don't spend time any time at a velocity of vprog.

Now keep increasing T1, the generator doesn't know to add more time to the profile to make up for the loss in area due to the reduction in max-velocity (peak of the triangle). That's the limitation.

To work around that limitation, reduce Vprog to be at or below what's actually possible based on where the Velocity curve is now (peaks at about 2.5rps).

It boils down to make sure the specified vprog is obtainable. Changing T1 means changing the time between zero-speed and vprog-speed.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-04-2016, 19:33
Ryan-Greenblatt Ryan-Greenblatt is offline
A foolish programmer
FRC #0900 (Zebracorns)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: NC
Posts: 8
Ryan-Greenblatt has a spectacular aura aboutRyan-Greenblatt has a spectacular aura about
Re: Issues with Motion Profile Generator

Quote:
Just for grins, download and try this.
The issue with that method is that I want to generate profiles in real time which have a set max acceleration, velocity, and jerk. That method offers too little control.

Quote:
Also try this.
Thanks! That seems to work. I'm assuming all you just added "max vel adj" and made that the max velocity input. However, there is another issue. The same type of adjustment must be made to acceleration. Otherwise if you increase acceleration beyond what is possible to reach some issues occur. Specifically the acceleration maxes out way below what the maximum actually is. I am uncertain how to determine what the maximum possible acceleration should be.

Quote:
It boils down to make sure the specified vprog is obtainable.
Yes, ether's solution seems to make sure that that happens.
Reply With Quote
  #7   Spotlight this post!  
Unread 17-04-2016, 19:37
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,059
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: Issues with Motion Profile Generator

Quote:
Originally Posted by Ryan-Greenblatt View Post
ether's solution seems to make sure that that happens.
To give credit where credit is due: The online spreadsheet at the link I provided is the work of Jared Russell; an adaptation I believe of Paul Copioli's original spreadsheet.


Reply With Quote
  #8   Spotlight this post!  
Unread 17-04-2016, 21:22
Ryan-Greenblatt Ryan-Greenblatt is offline
A foolish programmer
FRC #0900 (Zebracorns)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: NC
Posts: 8
Ryan-Greenblatt has a spectacular aura aboutRyan-Greenblatt has a spectacular aura about
Re: Issues with Motion Profile Generator

After doing some bizarrely painful math I discovered that the obtainable max acceleration = MIN(max acceleration, (dist*.5*max jerk^2)^(1/3)).
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 11:05.

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