Go to Post Relax. Have fun. Enjoy the improvements. Build what you want to. - Rich Kressly [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: 51 votes, 5.00 average. Display Modes
  #31   Spotlight this post!  
Unread 04-08-2015, 23:03
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 89
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by MrRoboSteve View Post
The JVM has changed a lot since the 1.3 version that was used on the cRIO.

Do we know what the startup command line looks like for the Java VM? I am curious to see if there are special settings regarding garbage collection.

You want to do GC tuning using the command line parameters, not by calling System.GC(). System.GC() can be undesirable as it can trigger a full GC when you shouldn't need one. http://stackoverflow.com/questions/6...gc-do-anything has some discussion.

This article discusses the tradeoffs in GC tuning. If I was having issues like this, I'd want to be looking at the output of -verbose:gc to see if I had big pauses. Then I'd experiment with the parallel collector, using in particular -XX:MaxGCPauseMillis to set a cap to the amount of time spent in GC. You want lots of very short GC runs in the younger generations.

I'd also set -Xmx and -Xms to the same value, large enough that -verbose:gc never shows a full GC occurring during a run. If you're getting full GC runs occurring, you probably need to look at changes in your program to reduce allocation as there's too much memory pressure.
I realize that this conversation is a bit dormant, but I do have a question about command line parameters. Can we modify the command that runs our robot code by adding parameters like the ones you mention here? I see where to do that (I don't have a roboRIO handy, but I believe that the command is stored in the file /home/lvusr/robotCommand) but want to know if it is "competition legal". I don't see any specific reason that it wouldn't be legal and I really hope that it is.
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)

Last edited by mmaunu : 04-08-2015 at 23:04. Reason: Edit to path
  #32   Spotlight this post!  
Unread 04-08-2015, 23:36
BenGuy's Avatar
BenGuy BenGuy is offline
Co-Driver - 3641 - Flying Toasters
AKA: Ben
FRC #3641 (The Flying Toasters)
Team Role: Operator
 
Join Date: May 2014
Rookie Year: 2014
Location: South Lyon, Michigan
Posts: 219
BenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of light
Re: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by Aero View Post
Our elevator is way too fast.

We're currently using a standard PID loop, but it accelerates ridiculously quickly and throws totes.

I've looked into motion profiling, but can't see an easy way to (quickly) dynamically generate profiles between two arbitrary points on our elevator.

Is motion profiling the best solution here, or is there a simpler way to stop our elevator from accelerating too fast?
I have another stratagy... Our team had the same problem when we used straight PID, that it was way too fast. We solved it with about 30 seconds of coding though. (I'm not the team programmer but do know a good amount about it so this is my best pseudo code impression): If error (in PID) > .35 then set speed to .35 This worked out great and we have used it since. Before trying to go with motion profiling, I would try this. It caps the max speed to .35, when the error finally gets below that, it decelerates like normal.
__________________



Ben Wolak
The Flying Toasters Website

Team YouTube
Team Twitter

The real problem with computers is that they do what you tell them to do, not what you want them to do.
  #33   Spotlight this post!  
Unread 04-08-2015, 23:53
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,507
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: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by BenGuy View Post
I have another stratagy... Our team had the same problem when we used straight PID, that it was way too fast. We solved it with about 30 seconds of coding though. (I'm not the team programmer but do know a good amount about it so this is my best pseudo code impression): If error (in PID) > .35 then set speed to .35 This worked out great and we have used it since. Before trying to go with motion profiling, I would try this. It caps the max speed to .35, when the error finally gets below that, it decelerates like normal.
If you have to cap the speed to keep it stable within your tuning skill set, you will see better performance if you gear down more. You'll end up with a more stable system that has far more margin for loading changes.
  #34   Spotlight this post!  
Unread 06-08-2015, 00:13
RonnieS's Avatar
RonnieS RonnieS is offline
Just a tad washed up
AKA: Ronnie Sherrer
FRC #0314
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2006
Location: Flint/Warren
Posts: 389
RonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond reputeRonnieS has a reputation beyond repute
Re: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by AdamHeard View Post
Gear slower. It will do wonders here.
+1

-Ronnie
__________________
"Do not argue with an idiot. He will drag you down to his level and beat you with experience"
  #35   Spotlight this post!  
Unread 10-08-2015, 12:04
Hugh Meyer's Avatar
Hugh Meyer Hugh Meyer is offline
Registered User
FRC #1741 (Red Alert Robotics)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Greenwood Indiana
Posts: 158
Hugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud ofHugh Meyer has much to be proud of
Re: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by Ether View Post

If you need to change the setpoint only when the speed is zero, it's pretty straightforward to generate a sinusoidal profile for smooth acceleration and deceleration.

Given the max desired acceleration M and the distance D to the new position, compute the constants T, K1, K2, and K3 as shown in the equations. Then you can use the functions a(t), v(t), and x(t) to generate a nice smooth trajectory to the new target. "t" is elapsed time from start of profile.

Note that T will be the time-to-destination and K2 will be the maximum speed.

See the example profile for M=3.5 ft/s2 and D=5 ft.


Ether,

I created a spreadsheet to see if I could duplicate your example. Everything matches except for your statement "K2 will be max speed". My spreadsheet shows the max speed as 3.33 (cell I17) with a K2 value of 1.66 (cell D8). What am I doing wrong? Attached is my example sheet.

-Hugh
Attached Files
File Type: xls ExampleFromCDByHugh.xls (56.5 KB, 13 views)
  #36   Spotlight this post!  
Unread 10-08-2015, 12:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,088
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: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by Hugh Meyer View Post
Ether,

I created a spreadsheet to see if I could duplicate your example. Everything matches except for your statement "K2 will be max speed". My spreadsheet shows the max speed as 3.33 (cell I17) with a K2 value of 1.66 (cell D8). What am I doing wrong? Attached is my example sheet.

-Hugh
The error is mine, not yours. The maximum speed will be 2*K2.

Thanks for pointing that out.

.
  #37   Spotlight this post!  
Unread 15-08-2015, 10:05
BenGuy's Avatar
BenGuy BenGuy is offline
Co-Driver - 3641 - Flying Toasters
AKA: Ben
FRC #3641 (The Flying Toasters)
Team Role: Operator
 
Join Date: May 2014
Rookie Year: 2014
Location: South Lyon, Michigan
Posts: 219
BenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of lightBenGuy is a glorious beacon of light
Re: Elevator Motion Profiling / PID Ramping

Quote:
Originally Posted by AdamHeard View Post
If you have to cap the speed to keep it stable within your tuning skill set, you will see better performance if you gear down more. You'll end up with a more stable system that has far more margin for loading changes.
I agree, but if you couldn't change this (if it was a pre-built system and couldn't be changed for some reason) this is my best offer of a way to fix the problem just in programming - it worked great for us this year.
__________________



Ben Wolak
The Flying Toasters Website

Team YouTube
Team Twitter

The real problem with computers is that they do what you tell them to do, not what you want them to do.
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 10:56.

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