View Single Post
  #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: 323
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, 69 views)

Last edited by wt200999 : 30-01-2014 at 17:17. Reason: Better Example
Reply With Quote