View Single Post
  #1   Spotlight this post!  
Unread 10-29-2016, 02:47 PM
Wasabi Fan Wasabi Fan is offline
Registered User
FRC #0488
 
Join Date: Dec 2015
Location: Washington
Posts: 15
Wasabi Fan is an unknown quantity at this point
How is velocity control supposed to work on the Talon SRX?

I'm trying to use the closed-loop control on the Talon SRXs to run the motor at a specified velocity. I have successfully configured the encoders and they read in the units I want them to. However, I'm having trouble with the concept of velocity control as it currently stands.

In many cases, a PID(F) controller is used for position control, where the property of the system that the control variable is acting on is roughly the derivative of the error property (velocity -- which is roughly proportional to motor power -- is the derivative of position). In this case, however, the output of the controller will be roughly proportional to the input. That means that, when the error is zero (the motor is spinning at the desired velocity), output will fall to zero and by extension the motor will no longer be spinning at its target speed.

Intuitively, I expect this would result in the motor falling into a state of equilibrium where the error value corresponds to an output speed that sustains that error value. This behavior doesn't actually run the motor at the desired velocity, it runs it at an unpredictable velocity. The F parameter could be used to get closer to the target, but the P and D parameters still wouldn't be doing anything.

What is the proper way to handle this with the Talon's built-in velocity control? I would normally implement velocity PID by adding the output of the PID to a velocity accumulator, but in this case I can't do that because the closed-loop control logic is being run on the motor controller itself.
Reply With Quote