View Single Post
  #5   Spotlight this post!  
Unread 02-02-2017, 17:54
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: 559
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Setting PID constants in code for TalonSRX Velocity Control

Quote:
Originally Posted by KrazyCarl92 View Post
Depending on your application, you may actually want:

_talon.configPeakOutputVoltage(0.0f, -12.0f);

in the case that you only want it to spin in the 'reverse direction' and never apply 'forward' voltage. If you realize you're driving your car faster than you want on the highway usually you just let off the gas, not throw the engine into reverse.
Capping the output to one direction is perfectly legitimate. However depending on the Fgain, you may not get a direction change caused by being under the target velocity. This happens when the F term provides most of the motor output, and the PID simply tweaks the output to approach the target speed.

This is ideal for applications where you want both directions, such as drive wheels. Here's an example of a team using speed servo all the time on four mecanum wheels...
https://www.chiefdelphi.com/forums/s...+talon+sp eed

Notice our velocity walkthrough in the Talon SRX Software Reference Manual does not require you to enforce only driving in one direction.
Reply With Quote