|
Re: Potentiometer, need help with programming
Quote:
Originally Posted by apalrd
You're definitely better using a potentiometer.
|
Agreed. A pot is the sensor to use in this application.
Quote:
Originally Posted by apalrd
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.
|
One note: Before you connect up your pot, use an ohmmeter and check the resistance range from the wiper (center) to one of the two outer pins across the entire range of motion. We have had problems in the past with people installing pots with 270 degrees of motion but only 60 degrees of resistance change. As soon as we replaced these joystick pots with normal ones (270 degrees of motion and 270 degrees of resistance change), a lot of things worked so much better.
__________________
----------------------------------------------
With 1370 --
2012 Rutgers District Event Champions with 1676/56
2012 Lenape District Event Finalists with 2191/1691
2013 TCNJ District Event QuarterFinalists with 1143/4750, Gracious Professionalism Award
2013 Bridgewater-Raritan District Event Semi-Finalists with 4285/223
2013 MAR Championship Finalists (Backup) with 222/11/1403; Gracious Professionalism Award
|