Real-Time Measurement and Control

Showing results for 
Search instead for 
Did you mean: 

FRC LabView & Poteniometers

We are in need of using a poteniometer on our FIRST Robotics 2009 robot..  We know the high and low limit values and we do not want to allow the pot to read beyond these values.  We want to use the pot value as input to our code.  How does one set-up using a pot to the analog module? 

0 Kudos
Message 1 of 7

Hook it up as one of the resistors in a voltage divider circuit.  For the details, wikipedia has a good article.



0 Kudos
Message 2 of 7
ok.  so the v+ and gnd and center pin I think give me the three terminals to wire into the cRIO's analog module's gnd/V/signal terminals.  my next question is on how to program this analog sensor in LabView.  Do I need to a calibration to determine the range of resistance and/or voltage levels the pot will provide.  I know I don't want to go full range of the pot because that would allow the hardware to move (or try to move) farther than designed.  I was planning on using FRC WPI lib vi for an analog sensor but I do see any info on selecting bit resolution, but pehraps that's really not needed, but should I just set-up an indicator to read the values output from the pot?  and use these values as high and low?  also, the graphical prgmming is new to me.......I assume I can feed the analog vi get voltage terminal into an if/then elseif else type decision path.
0 Kudos
Message 3 of 7

Hello ptveng,


What analog module are you planning on using here.  Sorry, I don't know what was provided in your FIRST kits.


Typically what you'd do is just measure the voltage at the center with respect to ground.  The fixed resistor has a known value (I'd recommend actually measuring it for better accuracy) and so does the voltage supply you are using.  If you are worried about the supply you could use an additional channel to measure that.  This gives you all the information you need to determine the position of the potentiometer.


If you care about what the voltages you read mean in terms of real units (radians or the like) you will have to do some experiments to map the values.  Potentiometers can change in value either linearly or logarithmically depending on the one you have.


I'm not quite sure what you mean by not going full range?  If you want to limit the measured potentiometer value for use in software you can use something like the in-range and coerce block.



0 Kudos
Message 4 of 7
speleato,   thanks for the help.  here are some more details.  we are given a NI9201 analog module and also an "analog breakout board" that plugs into this module.  we are told this analog breakout board provides 5V for each of the eight analog channels.  this breakout board has three terminals for each channel:  5V, gnd, signal.  with regard to LabView we are given a library of vi's and within this library are sensor vi's that include gyro, accerelometer, and more.  but we don't have a specifically given vi for use with potentiometer.  but we are given such as analog-open, analog-getvoltage, analog-close. there a re joystick vi's as well and joysticks are basiscally potentiometers as well.  at this point we are experimenting with coding using the analogchannel vi's that we have been provided.  our code needs take this reading from the pot and the joystick x-dir value and make decisions about running a motor that drives which directions our robot's front whieels need to turn.    
0 Kudos
Message 5 of 7

Hi ptveng,


If you have questions regarding FIRST Robotics, you should go to There is a discussion forum there that is specific to FIRST groups, and the people there will be more experienced with the FIRST hardware and projects.



Stephen S.
National Instruments
Applications Engineering
0 Kudos
Message 6 of 7
ok. I/we did not see any useful info on how to set-up and use a potentiometer on the ni/first community web site.  what we want to do is something we know how to do from previous year's FRC competitions and we are in need of going down the learning curve with the cRIO and graphical programming.   we will continue to study the problem.  thanks,  ptveng
0 Kudos
Message 7 of 7