View Single Post
  #1   Spotlight this post!  
Unread 20-01-2015, 01:22
josesantos's Avatar
josesantos josesantos is offline
Mentor; Former Design Chairman
FRC #0687 (Nerd Herd) (VRC #687z) & FRC #5499 (BHS Robotics)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Carson, CA/Berkeley, CA
Posts: 42
josesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond reputejosesantos has a reputation beyond repute
Re: Drive System Control Compensation

I've implemented ramping speed filters in RobotC using this example from one of our old programming leads. Essentially, the filter adds to the current speed the different between the current speed and the desired speed divided by some "alpha". This "smooths out" any motor speed changes.

So basically:
speed = speed + (joystick - speed)/alpha

Note that in his example, he multiplies then divides by an arbitrarily large value. I'm told he did this because the controller either didn't support floats or did floating point calculations much more slowly.
__________________
CAMS Robotics, FIRST Team 687 The Nerd Herd 2010-Present
College Mentor 2013-Present // Design Chairman 2012-2013
Berkeley High Robotics, FIRST Team 5499 2014-Present
College Mentor 2014-Present

Last edited by josesantos : 20-01-2015 at 01:24. Reason: clarity