Go to Post ...too much to do... ...too little time... - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-12-2010, 17:50
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,295
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Labview Potentiometer Control

We're a couple of never-ever programmers trying to teach ourselves LabView (in the next month...) Can someone help us out with some sample code for a trim potentiometer?

We added an analogue Open into Begin.vi (and gave it a unique DevRefNum based on some sample code for a limit switch), then tried to read values from the Get Voltage vi in the teleop.vi (inside the main loop)...

We added a probe to the output of the Get Voltage vi, and it just fluctuates around zero (looks like noise) no matter what the potentiometer does. (The pot is in analogue 1, and we identified it as such in the code.)

Thus, if someone has some sample code they would be willing to share, that would be fantastic.

Thanks,

Patrick
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
Reply With Quote
  #2   Spotlight this post!  
Unread 14-12-2010, 17:55
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Labview Potentiometer Control

Quote:
Originally Posted by pfreivald View Post
We're a couple of never-ever programmers trying to teach ourselves LabView (in the next month...) Can someone help us out with some sample code for a trim potentiometer?

We added an analogue Open into Begin.vi (and gave it a unique DevRefNum based on some sample code for a limit switch), then tried to read values from the Get Voltage vi in the teleop.vi (inside the main loop)...

We added a probe to the output of the Get Voltage vi, and it just fluctuates around zero (looks like noise) no matter what the potentiometer does. (The pot is in analogue 1, and we identified it as such in the code.)

Thus, if someone has some sample code they would be willing to share, that would be fantastic.

Thanks,

Patrick

How is the potentiometer connected to the cRIO (ie where is each wire going)? Have you measured the pot's signal with a simple voltmeter to ascertain for certain that it is actually providing a signal?



Reply With Quote
  #3   Spotlight this post!  
Unread 14-12-2010, 18:15
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Labview Potentiometer Control

Quote:
Originally Posted by pfreivald View Post
We're a couple of never-ever programmers trying to teach ourselves LabView (in the next month...) Can someone help us out with some sample code for a trim potentiometer?

We added an analogue Open into Begin.vi (and gave it a unique DevRefNum based on some sample code for a limit switch), then tried to read values from the Get Voltage vi in the teleop.vi (inside the main loop)...

We added a probe to the output of the Get Voltage vi, and it just fluctuates around zero (looks like noise) no matter what the potentiometer does. (The pot is in analogue 1, and we identified it as such in the code.)

Thus, if someone has some sample code they would be willing to share, that would be fantastic.

Thanks,

Patrick
If it looks like you are getting noise, you probably are - I'm betting that your code is just fine.

Wire one end of the pot to +5V, the other end to ground, and the middle to the signal input. These should be labeled on the shell for the analog breakout.
Reply With Quote
  #4   Spotlight this post!  
Unread 14-12-2010, 23:15
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: Labview Potentiometer Control

Quote:
Originally Posted by EricVanWyk View Post
If it looks like you are getting noise, you probably are - I'm betting that your code is just fine.

Wire one end of the pot to +5V, the other end to ground, and the middle to the signal input. These should be labeled on the shell for the analog breakout.
The 5v voltage regulator does have a certain degree of noise.
On the 2009 Analog Breakout, I measured about +-15mv of variation.

Granted, the regulator was changed to a linear regulator for 2010, so the noise should be less. However, there's a lot of switcher power supplies on the robot (I count 5, excluding any motor controllers). There's probably a lot of noise on the main supply because of this.
__________________
-- Marshal Horn
Reply With Quote
  #5   Spotlight this post!  
Unread 15-12-2010, 12:02
BornaE's Avatar
BornaE BornaE is offline
Registered User
FRC #0842 (Formerly 39)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Gilbert, Arizona
Posts: 359
BornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant futureBornaE has a brilliant future
Re: Labview Potentiometer Control

Quote:
Originally Posted by pfreivald View Post
We're a couple of never-ever programmers trying to teach ourselves LabView (in the next month...) Can someone help us out with some sample code for a trim potentiometer?

We added an analogue Open into Begin.vi (and gave it a unique DevRefNum based on some sample code for a limit switch), then tried to read values from the Get Voltage vi in the teleop.vi (inside the main loop)...

We added a probe to the output of the Get Voltage vi, and it just fluctuates around zero (looks like noise) no matter what the potentiometer does. (The pot is in analogue 1, and we identified it as such in the code.)

Thus, if someone has some sample code they would be willing to share, that would be fantastic.

Thanks,

Patrick
Patrick,

I would be really helpful if you could post a screenshot of the relevant part of your code and a picture showing how you connected the potentiometer to the cRio

it seems like your connection is wrong and you are measuring an input that is not connected to anything.

regards,
Borna
__________________
-Borna Emami
Team 0x27
Reply With Quote
  #6   Spotlight this post!  
Unread 15-12-2010, 12:22
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,355
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Labview Potentiometer Control

Quote:
Originally Posted by Ether View Post
How is the potentiometer connected to the cRIO (ie where is each wire going)? Have you measured the pot's signal with a simple voltmeter to ascertain for certain that it is actually providing a signal?


Above should be the your first step in troubleshooting this problem! So often we overlook the basics and jump to the advanced steps.

1) Verify the pot actually works.
2) Verify it is connected correctly.
3) See if the code reads as expected.

Quote:
Originally Posted by EricVanWyk View Post
If it looks like you are getting noise, you probably are - I'm betting that your code is just fine.

Wire one end of the pot to +5V, the other end to ground, and the middle to the signal input. These should be labeled on the shell for the analog breakout.
To address step #2 above, make sure the pot is connected to the analog bumper as follows:

One end of the pot is connected to the black wire of a PWM cable. The other end of that black wire needs to be connected to the Gnd. pin on the analog input you selected.

The other end of the pot needs to be connected th the red wire of the same PWM cable. The other end needs to be connected to the +5v pin of the analog input.

Now the wiper of the pot needs to be connected to the white wire of the PWM cable. The other end of the white wire needs to be connected to the Signal pin of the selected analog input.


With these steps verified, you can now use a "probe" to see if the code is working properly.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #7   Spotlight this post!  
Unread 15-12-2010, 13:42
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Labview Potentiometer Control

One more thing -- make sure the Analog Breakout has 12 volt power. Its green light should be lit. Without that, it won't be able to supply 5 volts to the potentiometer.
Reply With Quote
  #8   Spotlight this post!  
Unread 16-12-2010, 11:48
pfreivald's Avatar
pfreivald pfreivald is offline
Registered User
AKA: Patrick Freivald
FRC #1551 (The Grapes of Wrath)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2001
Location: Naples, NY
Posts: 2,295
pfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond reputepfreivald has a reputation beyond repute
Re: Labview Potentiometer Control

Just able to get back to this -- very busy week!

Looks like the problem might be wiring. I'll get the electrical kids on that pronto and see where we're at. Thanks for the help, everyone!
__________________
Patrick Freivald -- Mentor
Team 1551
"The Grapes of Wrath"
Bausch & Lomb, PTC Corporation, and Naples High School

I write books, too!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Position Control using potentiometer? biojae CAN 13 03-02-2010 20:12
Labview Servo Control Issue EricWilliams Programming 5 22-01-2010 14:24
Labview motor control seanl Programming 5 11-02-2009 17:02
Labview Revision Control Joe Ross National Instruments LabVIEW and Data Acquisition 2 11-05-2008 17:28
Potentiometer arm control Hazmatt Programming 15 01-04-2008 21:27


All times are GMT -5. The time now is 10:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi