Go to Post Building sustained excellence happens when you start with the right pieces at the top...and pick up the rest of the pieces on your way. - Jared Russell [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-10-2016, 15:52
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 516
ozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant futureozrien has a brilliant future
Re: How is velocity control supposed to work on the Talon SRX?

The general goal is calculate or tune a FeedForward gain so that the sensor velocity is near the target velocity. P (and potentially D/I) are then tuned to respond when the velocity error is nonzero. This allows for an aggressive closed-loop response with less overshoot caused by large changes in target velocity (let F do the heavy lifting).

To make this clearer we provide an velocity closed-loop walkthough in our documentation and examples on our site/GitHub.

Section 12.4 (Talon SRX Software reference manual)
http://www.ctr-electronics.com/talon...ical_resources
Reply With Quote
  #2   Spotlight this post!  
Unread 29-10-2016, 16:37
Wasabi Fan Wasabi Fan is offline
Registered User
FRC #0488
 
Join Date: Dec 2015
Location: Washington
Posts: 14
Wasabi Fan is an unknown quantity at this point
Re: How is velocity control supposed to work on the Talon SRX?

Quote:
The general goal is calculate or tune a FeedForward gain so that the sensor velocity is near the target velocity. P (and potentially D/I) are then tuned to respond when the velocity error is nonzero. This allows for an aggressive closed-loop response with less overshoot caused by large changes in target velocity (let F do the heavy lifting).
Using the F parameter to get close is a good policy, but it doesn't fix the problem. Using F as a crutch is no better than just setting a power target directly; the value produced by F doesn't change as the state of the system does. The issue here is that, as velocity PID is implemented in the Talons currently, P is useless. One must rely on the I term, because it is the only term which will actually help you get to your velocity goal based on changes in the system.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-10-2016, 16:49
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,510
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by Wasabi Fan View Post
One must rely on the I term, because it is the only term which will actually help you get to your velocity goal based on changes in the system.
This.

While I can usually be skipped when driving to a position, it is essential to tuning a velocity control PID for a realistic (can't control every variable) situation.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #4   Spotlight this post!  
Unread 29-10-2016, 16:59
R.C.'s Avatar
R.C. R.C. is offline
2017... Oooh Kill em, Swerve!
AKA: Owner, WestCoast Products
FRC #1323 (MadTown Robotics)
Team Role: Engineer
 
Join Date: Feb 2008
Rookie Year: 2006
Location: Madera, CA
Posts: 2,172
R.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond reputeR.C. has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by Wasabi Fan View Post
Using the F parameter to get close is a good policy, but it doesn't fix the problem. Using F as a crutch is no better than just setting a power target directly; the value produced by F doesn't change as the state of the system does. The issue here is that, as velocity PID is implemented in the Talons currently, P is useless. One must rely on the I term, because it is the only term which will actually help you get to your velocity goal based on changes in the system.
We followed Omar's advice this season and used pdf control. We got our shooter speed to +-.50 rpm of our goal. This has been the cleanest we've ever gotten.
__________________
R.C.
Owner, WestCoast Products || Twitter
MadTown Robotics Team 1323
Reply With Quote
  #5   Spotlight this post!  
Unread 29-10-2016, 18:04
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,068
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: How is velocity control supposed to work on the Talon SRX?

Quote:
Originally Posted by Wasabi Fan View Post
The issue here is that, as velocity PID is implemented in the Talons currently, P is useless..
This is totally false in practice. Proof by counter-example:

254 used Talon-based velocity control on both our drive motors and our flywheel last season. In both cases, we used a PD+F controller and were able to track our setpoints to within +/- single digit RPM despite no integral action, even with varying battery voltage, system load, and (for the drive) while traversing defenses.

The reason why this works well is (a) feedforward, and (b) a really fast 1KHz control loop. Both of these factors let you crank up your feedback gains without sacrificing stability.

Feedforward helps because it deals with the nominal dynamics of the system so that feedback only needs to worry about dealing with modeling errors and disturbances. Usually this means that feedforward is doing most of the heavy lifting, so the feedback gains can be really aggressive because the disturbance is pretty small in magnitude. Likewise, a faster loop means that your P term can correct for the current error very quickly, so even if you overshoot by a little bit, a millisecond later you are compensating.

Our tuning methodology was to start with a nominal battery and load (e.g. flat floor and no other systems running) and tune F first, as recommended in the Talon SRX Software Reference Manual. Once this was working, we tuned our P gain until we oscillated (very quickly! 1KHz loop ) around the setpoint. Then we crank up D until the oscillation is no longer noticeable to your eye or in a plot of system response. For both of our systems last year, this meant a D gain on the order of 4-5x Kp.

I understand the sentiment around saying that integral gain is the only way to ensure that in the steady state (error=0), your system continues to operate at your desired setpoint. This is theoretically correct. But, with a sufficiently high Kp and Kd, you can react quickly to very, very small errors that are about the same magnitude as your velocity measurement error. In other words, more than good enough for FRC.
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:46.

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