Go to Post THE GAME PIECES ARE BEARS - JohnSchneider [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 15-01-2012, 13:09
Alex Redman's Avatar
Alex Redman Alex Redman is offline
Zombots Lead Programmer
AKA: Alexander Redman
FRC #3013 (Zombots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Vallejo,CA
Posts: 14
Alex Redman is an unknown quantity at this point
Re: Range Finder Help

If I used an Analog Setup to use my range finder like the labview example,could I use the voltage output from the AnalogChannelGetAverageVoltage.vi and connect that into the output channel of a MotorSetOutput.vi?
Reply With Quote
  #2   Spotlight this post!  
Unread 15-01-2012, 17:35
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,113
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: Range Finder Help

The Motor Set vi uses a range of -1 (full reverse) to +1 (full forward). Transform the Analog Voltage Get vi result to turn distance (0.01 volts per inch) into whatever power you want to run the motor at. You'll probably want something a little fancier than a simple multiplication -- a basic lookup table where input is distance and output is power should be about right.
Reply With Quote
  #3   Spotlight this post!  
Unread 15-01-2012, 20:53
Alex Redman's Avatar
Alex Redman Alex Redman is offline
Zombots Lead Programmer
AKA: Alexander Redman
FRC #3013 (Zombots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Vallejo,CA
Posts: 14
Alex Redman is an unknown quantity at this point
Re: Range Finder Help

Quote:
Originally Posted by Alan Anderson View Post
The Motor Set vi uses a range of -1 (full reverse) to +1 (full forward). Transform the Analog Voltage Get vi result to turn distance (0.01 volts per inch) into whatever power you want to run the motor at. You'll probably want something a little fancier than a simple multiplication -- a basic lookup table where input is distance and output is power should be about right.
Sorry, stupid question. How do I do that?
Reply With Quote
  #4   Spotlight this post!  
Unread 15-01-2012, 21:18
mesamb1's Avatar
mesamb1 mesamb1 is offline
Registered User
AKA: Sam Bacon
FRC #1466 (Webb Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Knoxville
Posts: 93
mesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nicemesamb1 is just really nice
Re: Range Finder Help

I would suggest experimenting with your shooter to make sure that your kicker works on along a linear equation(ie. does a .01 voltage increase equal a inch), and then derive an equation to match your found voltages to get the ball in the basket.
Reply With Quote
  #5   Spotlight this post!  
Unread 15-01-2012, 23:35
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,113
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: Range Finder Help

The "Interpolate 1D" vi is an easy way to implement a lookup table. Provide it with two arrays, one of input values and one of the assocated output values. See the "1D Interpolation.vi" LabVIEW example to play with how it works.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-01-2012, 11:46
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Range Finder Help

Or, more simply:

You experiment, and find that at a distance of (0.73 volts = 73 inches), setting your motor control to +0.48 makes the shot 9 out of 10 times. You also find that at 1.45 V (145") a motor control of +0.83 is 'perfect'.

You create a table:
Code:
Measured  Motor
Distance  Voltage
73         +0.48
145        +0.83
This is a "look up table".

With such a table, you might be able to assume that a distance halfway between 73 and 145 (=110) should use a motor control of halfway between 0.48 and 0.83 (=0.65). Doing this kind of math to 'guess' at what might be a good value in between known-good values is called "interpolation".

Or, you can just experiment every 12 " and see what you get, and use the value in the table that's closes to the measured distance.

Be sure to take into consideration what to do if there's a robot between you and the spot you want to measure from.
__________________

I am N2IRZ - What's your callsign?
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


All times are GMT -5. The time now is 20:42.

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