View Single Post
  #2   Spotlight this post!  
Unread 13-02-2016, 17:33
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 374
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: How to display motor speed for PID Tuning

You can see the current motor voltage set by your motor controller if you're using CAN. Use the GetOutputVoltage method on your motor controller object and send it to SmartDashboard.

If you want to see actual speed, you'll need an encoder on your drive. Then, you'll need to periodically read the encoder and convert the value into rotations, degrees, or whatever you need. Then divide the amount that it has changed by the time since your last read the value (typically 1/50 sec if nothing is bogging down your program loop). That should give you the velocity.