Go to Post It's possible to do nearly anything with enough resources and ingenuity. - Madison [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-11-2016, 14:05
Oblarg Oblarg is offline
Registered User
AKA: Eli Barnett
FRC #0449 (The Blair Robot Project)
Team Role: Mentor
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Philadelphia, PA
Posts: 1,047
Oblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond reputeOblarg has a reputation beyond repute
Velocity PID(F) Best Practices - To Integrate, or Not To Integrate?

There seems to be a general lack of agreement about the best way to handle velocity PID loops.

In particular, in comparison to position PID loops, velocity PID loops present us with a problem:

In a position PID loop, there is a natural integrator between the loop output (motor voltage, which corresponds roughly to velocity) and the setpoint, since the position is the integral of velocity.

On the other hand, in a velocity loop, there is no such integrator.

Thus, the two loops behave, at a fundamental level, extremely differently. This much is known to basically anyone who has ever used a velocity PID loop.

One solution to this, currently employed by WPILib, is to integrate the output of a velocity loop (save for the feedforward term, for obvious reasons). This serves to make the relationship between the loop output and the setpoint more closely resemble that of a position loop. Effectively, this is the same as turning the 'p' term into what was, pre-integration, the 'i' term, and turning the 'd' term into the 'p' term (since, per the fundamental theorem of calculus, the integral of the derivative of the error is simply the error itself).

However, I've also heard many teams state that, with use of a feedforward term, there is no need to do this and simply using a non-integrated loop predominantly tuned with the P term suffices.

I, myself, am not quite sure what to make of this, for several reasons:

For the first method, the 'd' term in an integrated velocity loop (i.e. the 'p' term in a non-integrated loop) really doesn't behave entirely like the 'd' term in a position loop; the aforementioned fundamental-theorem-of-calculus argument only indicates that their effect on the endpoint behaves similarly up to some constant offset - and this constant may be nonzero, depending on how 'd' responds to changes in setpoint (e.g. if my setpoint is 1, and my measured endpoint is 0 and has not yet started to change, the resulting 'd' term of an integrated velocity loop will be some positive constant, but the 'd' term of a position loop would be 0 - only the effects of the changes to the two terms from this point are analogous). Moreover, motor voltage does not precisely correspond to velocity (if it did, we'd have no need of a control loop!), and so this causes differences in behavior, as well.

However, for the second method, the 'p' term of a non-integrated velocity loop certainly does not behave like the 'p' term of a position loop, so tuning around 'p' in a non-integrated loop (even in the presence of a feedforward term) has never made much sense to me. I can totally believe that it works, but it does seem like it would be closer (but, as per the previous paragraph, not analogous) to tuning around the the 'd' term of a position loop rather than the 'p' term, and that is confusing.

I know many teams (including mine) tune around the 'p' term of an integrated loop (i.e. the 'i' term of a non-integrated loop), even when using feedforward. This seems to work very well for us, but I've seen many teams say that they do not use this term at all for their velocity loops.

So, is there any consensus about this, at all?
__________________
"Mmmmm, chain grease and aluminum shavings..."
"The breakfast of champions!"

Member, FRC Team 449: 2007-2010
Drive Mechanics Lead, FRC Team 449: 2009-2010
Alumnus/Technical Mentor, FRC Team 449: 2010-Present
Lead Technical Mentor, FRC Team 4464: 2012-2015
Technical Mentor, FRC Team 5830: 2015-2016

Last edited by Oblarg : 17-11-2016 at 17:15.
Reply With Quote
 


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 09:01.

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