View Single Post
  #10   Spotlight this post!  
Unread 09-15-2017, 12:07 AM
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 870
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Tuning a PIDF follower on a robot with high gearing

Quote:
Originally Posted by nuclearnerd View Post
I'm very interested in the answers to this, because it also applies to a differential swerve with too-high a turning gear ratio. Can someone post an example of gain scheduling or some other non-linear feedback control of turning for my non-coder brain to absorb?
Here's a simple one.

Code:
  const double kP = ::std::abs(velocity) < 1.0 ? 5.0 : 4.0;
  voltage = kP * error;
If you want to hurt your head some, look at our 2016 drivetrain code. We gain schedule all 4 shifter combinations. ({left low, left high} x {right low, right high}).

Practically speaking, gain scheduling means picking a different set of gains at different points in the state space. It's harder to guarantee stability mathematically, so I like to avoid it if possible, or constrain its use such that it's driven by something like gear ratio that doesn't have as much interaction with the loop.
Reply With Quote