View Single Post
  #3   Spotlight this post!  
Unread 06-02-2014, 18:58
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Potentiometer, need help with programming

You're definitely better using a potentiometer.

An encoder (most FRC 'encoders' are quadrature incremental encoders) tells you how far you have gone since your zero point.

A potentiometer tells you exactly where you are, but when you exceed the limits it will break.

There are also 'absolute encoders' which work just like a potentiometer, but roll over to the other end of their range when they hit their limits.

In any case, in LabVIEW, use an 'AnalogChannel' to measure the voltage of the potentiometer. Connect the pot's ends to the black and red wires (+5v and Gnd), and the wiper to the white wire (Signal). The voltage in on the analog module will be between 0 and 5v.

Once you have the position, you can scale it from volts to degrees, or whatever units you want, or leave it in volts. From there, you can run a control loop (search here for 'PID control') for your position control.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote