Go to Post I just want to say that the rack 'n roll was my first year with FIRST! It was the best thing I ever did. I cant wait to learn more when we get to start up again! - ctorloey [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 29-01-2014, 16:16
ElectricNoodle's Avatar
ElectricNoodle ElectricNoodle is offline
Registered User
AKA: Ted Pabst
FRC #2789 (TEXsplosion)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2011
Location: Manor, TX
Posts: 9
ElectricNoodle is an unknown quantity at this point
Question Acceleration Ramp Up Code

Our team is trying to cut out some of the bumps in acceleration by writing a "ramp up" code. For example, if we want the motor power to go from 0 to 100, we want there to be other steps in there to prevent jumping ss in the acceleration. Any ideas of how to do this?
__________________
#code on code on code
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2014, 16:59
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Acceleration Ramp Up Code

Can you elaborate on what you want to do to cut down on acceleration? The way I am familiar with manipulating the drive is from the joystick outputs. I don't think you can manipulate the motor output itself since the motor outputs are used the vi given by wpi. I wouldn't want to mess around with their vis until it becomes necessary.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-01-2014, 17:01
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Acceleration Ramp Up Code

Quote:
Originally Posted by ElectricNoodle View Post
Our team is trying to cut out some of the bumps in acceleration by writing a "ramp up" code. For example, if we want the motor power to go from 0 to 100, we want there to be other steps in there to prevent jumping ss in the acceleration. Any ideas of how to do this?
http://thinktank.wpi.edu/article/140


Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2014, 12:08
ElectricNoodle's Avatar
ElectricNoodle ElectricNoodle is offline
Registered User
AKA: Ted Pabst
FRC #2789 (TEXsplosion)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2011
Location: Manor, TX
Posts: 9
ElectricNoodle is an unknown quantity at this point
Re: Acceleration Ramp Up Code

Quote:
Originally Posted by Kevin Phan View Post
Can you elaborate on what you want to do to cut down on acceleration? The way I am familiar with manipulating the drive is from the joystick outputs. I don't think you can manipulate the motor output itself since the motor outputs are used the vi given by wpi. I wouldn't want to mess around with their vis until it becomes necessary.
To be more specific, I'm essentially looking for the best way to do what you described and manipulate the JOYSTICK outputs to ramp up acceleration of the motor INPUTS. Sorry I didn't really explain it well the first time, but if you have any ideas they would be greatly apprieciated.
__________________
#code on code on code
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2014, 12:22
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Acceleration Ramp Up Code

Quote:
Originally Posted by ElectricNoodle View Post
I'm essentially looking for the best way to do what you described and manipulate the JOYSTICK outputs to ramp up acceleration of the motor INPUTS. Sorry I didn't really explain it well the first time, but if you have any ideas they would be greatly apprieciated.
Did you read the link in Post #3 ? It explains how to do exactly what you indicated above.


Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2014, 12:29
gnunes gnunes is offline
Registered User
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Westtown School
Posts: 57
gnunes has a spectacular aura aboutgnunes has a spectacular aura aboutgnunes has a spectacular aura about
Re: Acceleration Ramp Up Code

Quote:
Originally Posted by Ether View Post
Did you read the link in Post #3 ? It explains how to do exactly what you indicated above.


I did! Thank you for posting that. The linked paper is full of good ideas.
Reply With Quote
  #7   Spotlight this post!  
Unread 30-01-2014, 12:29
ElectricNoodle's Avatar
ElectricNoodle ElectricNoodle is offline
Registered User
AKA: Ted Pabst
FRC #2789 (TEXsplosion)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2011
Location: Manor, TX
Posts: 9
ElectricNoodle is an unknown quantity at this point
Re: Acceleration Ramp Up Code

Actually yes I read through yesterday, and was interested in the "Slew Rate" and "Low Pass Filtering" sections, as we were thinking of doing it in a similar fashion but didn't know how to implement it. So that helped a lot in that regard, but I'm still wondering. Are there better ways to do this? Which of these options do you think is best?
__________________
#code on code on code
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2014, 13:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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: Acceleration Ramp Up Code

Quote:
Originally Posted by ElectricNoodle View Post
Actually yes I read through yesterday, and was interested in the "Slew Rate" and "Low Pass Filtering" sections ...Which of these options do you think is best?
From what you described in your original post, it sounds like you want the slew rate limiter.

In a text-based language, it would look something like this:

Code:
change = joystick - limitedJoystick;
if (change>limit) change = limit;
else (if change<-limit) change = -limit;
limitedJoystick += change;
limit is the amount of change you will allow every iteration (e.g. every 20 milliseconds for TeleOp)

limitedJoystick is the rate-limited joystick value you use to control your motors.





Reply With Quote
  #9   Spotlight this post!  
Unread 30-01-2014, 14:36
ElectricNoodle's Avatar
ElectricNoodle ElectricNoodle is offline
Registered User
AKA: Ted Pabst
FRC #2789 (TEXsplosion)
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2011
Location: Manor, TX
Posts: 9
ElectricNoodle is an unknown quantity at this point
Re: Acceleration Ramp Up Code

Thanks for the help!
__________________
#code on code on code
Reply With Quote
  #10   Spotlight this post!  
Unread 30-01-2014, 15:03
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Acceleration Ramp Up Code

I've attached an example that helps visualize what happens when you use the low pass filter option. It has two different low pass filter implementations. One of them is simply averaging your joystick outputs over a number of samples. This method makes the most sense intuitively if you have not studied low pass filters before.

As far as implementing this, I see a couple of options. The easiest might be what was said before, which is to put a block between your joystick and your motor drive functions.

The other option is to put whatever function you want to use into a VI and assign that VI to each motor as its 'transfer function'. This way you use all of your motor drive functions as you normally would, both in teleop and auton, and your ramp function will always be working.

For both of these options, if you create your ramp function as a SubVI and you create multiple instances of it, it will be important to set your execution to Reentrant for that SubVI. This is File -> VI Properties -> Execution -> Reentrant execution with option Preallocate clone for each instance

Edit: Added the PID Output Rate Limiter as well which is what Ether describes.
Attached Files
File Type: vi Ramp Example.vi (24.0 KB, 70 views)

Last edited by wt200999 : 30-01-2014 at 17:17. Reason: Better Example
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 20:53.

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