View Single Post
  #2   Spotlight this post!  
Unread 15-02-2015, 15:02
RoboBucs RoboBucs is offline
Registered User
FRC #5005
 
Join Date: Jan 2015
Location: Chattanooga, TN
Posts: 72
RoboBucs is an unknown quantity at this point
Re: Use a button to make a motor move a certain number of rotations

Quote:
Originally Posted by Levansic View Post
It depends on how you set your motors in Begin.vi, and what type of motor controllers you are using. Most likely, this will cause your motors to run at full speed forward or backward, while the button is pressed.

If you are using encoders and configured Talon SRX's to use CAN and position control with proper PID values, you may get a twitch. You will need proper software setup, encoders, and good PID values to do what you want to do accurately.

The drive reference contains data that will configure the various drive and motor vi's to interpret their inputs properly. By default, the maximum input/output is 1, which corresponds to a 100% forward or backward. Your ±3.76... input will be seen as a saturated maximum of 1. The default mode if you just open a can Talon SRX will be Percent Vbus, which works the same as PWM, and doesn't use feedback from an encoder.

All of this being said, you can approximate the closed-loop control to do what you want with a sensibly low speed and a timer, but this will take a LOT of experimentation, and the results will be highly variable.
Alright, the number I put there was supposed to be the number of rotations that the motors would make each time they're pressed, the motors have built in encoders, where would I put that number so that the motors will run 3.76 rotations each time the button is pressed? Thanks
Reply With Quote