Go to Post FIRST is not about building robots, it is about building people; the robots are just a good way to get the people there. - JamesBrown [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 13-02-2011, 11:59
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Labview Timed Loop

How does one go about making a timed loop in labview? Pictures would be great, but words will make due. Our team would like to use a timed loop to fulfill the following function. For our arm, it is currently set to move up when joystick is forward and vice-versa. Our mentors would like it so when the joystick is forward, the arm will move up for let's say 2 seconds, and stop. Then when the joystick is moved back, the arm will move down for 2 seconds back to initial position. Is this possible at all? If so, please help

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 13-02-2011, 12:10
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Labview Timed Loop

First, I think you need to sit down with you mentors and understand truly what they want. I suspect that they actually do NOT want the arm to move for 2 seconds. I suspect that they want the arm to move a certain distance.

People unfamiliar with programming often make that mistake. Instead of trying to program thier robot to do something definite - like drive 3 feet using the encoders, they try to make it do something non-definite like drive for 3 seconds (at what speed? at what battery voltage? On what field? With how much wheel slip). One will get you the exact same result every single time. The other will get you a nearly random result that is unrepeatable.

People who program their autonomous based on timing almost always have problems with it being very inconsistent and unpredictable.

So go back and find out what your mentors actually want. Do they want the arm motion smoother? Do they want it to go to specific locations?

It's trivial to make an arm simply move for 2 seconds. But I'd wager a pretty penny that it isn't really what they mean.
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2011, 12:32
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Labview Timed Loop

Quote:
Originally Posted by Tom Line View Post
First, I think you need to sit down with you mentors and understand truly what they want. I suspect that they actually do NOT want the arm to move for 2 seconds. I suspect that they want the arm to move a certain distance.

People unfamiliar with programming often make that mistake. Instead of trying to program thier robot to do something definite - like drive 3 feet using the encoders, they try to make it do something non-definite like drive for 3 seconds (at what speed? at what battery voltage? On what field? With how much wheel slip). One will get you the exact same result every single time. The other will get you a nearly random result that is unrepeatable.

People who program their autonomous based on timing almost always have problems with it being very inconsistent and unpredictable.

So go back and find out what your mentors actually want. Do they want the arm motion smoother? Do they want it to go to specific locations?

It's trivial to make an arm simply move for 2 seconds. But I'd wager a pretty penny that it isn't really what they mean.

Yes, you are somewhat right. Yesterday we measured the time it took the arm to go from its lowest location (where it can grab tube from human player), and its highest location(second row). It was an average of about 2.4 seconds. They thought of just making it run up for 2.4 seconds, stop, then run down for 2.4 seconds when the joystick is moved back. After what you said, it does sound like it can vary in results.
We were also thinking of using a limit switch to regulate when the arm is at lowest and highest points.
According to what you said, how could i program the arm to move distance rather than time? Like when pushed forward, arm travels 2 feet, when pushed back, arm travels down 2 feet.

Thanks for the quick response
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2011, 12:59
Tom Line's Avatar
Tom Line Tom Line is offline
Raptors can't turn doorknobs.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 2,533
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Labview Timed Loop

There are several ways to move something a set distance. All require some type of feedback to the robot.

The first would be a limit switch. A limit switch would be hooked up to the digital i/o on the digital sidecar, and you could read it in your code.

I'll leave the mechanical thinking to you, but consider - what if you programmed your arm so that when the operator pressed forward the arm would move, but would stop when it hit the limit switch until the operator released the joystick then pressed it forward again?

That is one example.

More common, though, is a potentiometer. That is a variable resistor. They are hooked up to your analog breakout and as they are rotated their resistance varies. This means the voltage sent back to the robot varies. So you can determine the voltage at any given height and use that as I suggested you use the limit switch above. The difference would be that the potentiometer will work for any position you like, whereas you will need multiple limit switches.

You could also start looking at PID loops. Essentially if you drive the arm to a point and tell it to stop, it will over-shoot the location due to momentum. A pid scales down the motor speed as the manipulator nears the stop point. Do a search for PID on the Chief Delphi media section under papers and you will find any number of excellent resources, however if you haven't ever done it before it might be a bit of a challenge.
Reply With Quote
  #5   Spotlight this post!  
Unread 13-02-2011, 13:12
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Labview Timed Loop

Quote:
Originally Posted by Tom Line View Post
There are several ways to move something a set distance. All require some type of feedback to the robot.

The first would be a limit switch. A limit switch would be hooked up to the digital i/o on the digital sidecar, and you could read it in your code.

I'll leave the mechanical thinking to you, but consider - what if you programmed your arm so that when the operator pressed forward the arm would move, but would stop when it hit the limit switch until the operator released the joystick then pressed it forward again?

That is one example.

More common, though, is a potentiometer. That is a variable resistor. They are hooked up to your analog breakout and as they are rotated their resistance varies. This means the voltage sent back to the robot varies. So you can determine the voltage at any given height and use that as I suggested you use the limit switch above. The difference would be that the potentiometer will work for any position you like, whereas you will need multiple limit switches.

You could also start looking at PID loops. Essentially if you drive the arm to a point and tell it to stop, it will over-shoot the location due to momentum. A pid scales down the motor speed as the manipulator nears the stop point. Do a search for PID on the Chief Delphi media section under papers and you will find any number of excellent resources, however if you haven't ever done it before it might be a bit of a challenge.

We were also thinking of the use of a limit switch, which i think is the easiest. Now i am wondering about placement of the limit switch. We were thinking of putting it where the arm is at its lowest point, thus it would trigger when going down. Any ideas?
Reply With Quote
  #6   Spotlight this post!  
Unread 13-02-2011, 13:41
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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 Timed Loop

Quote:
Originally Posted by jhellr13 View Post
We were also thinking of the use of a limit switch, which i think is the easiest. Now i am wondering about placement of the limit switch. We were thinking of putting it where the arm is at its lowest point, thus it would trigger when going down. Any ideas?
Yes. Make sure you put a flexible extension on the limit switch so that the arm's momentum does not destroy it.


Reply With Quote
  #7   Spotlight this post!  
Unread 13-02-2011, 13:47
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Re: Labview Timed Loop

Quote:
Originally Posted by Ether View Post
Yes. Make sure you put a flexible extension on the limit switch so that the arm's momentum does not destroy it.

Yes. I was gonna do that to avoid damage.
For programming this, i know how to set up a limit switch, but is their any special programming i need to do to make it work in this case?
Reply With Quote
  #8   Spotlight this post!  
Unread 13-02-2011, 13:57
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
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 Timed Loop

Quote:
Originally Posted by jhellr13 View Post
Yes. I was gonna do that to avoid damage.
For programming this, i know how to set up a limit switch, but is their any special programming i need to do to make it work in this case?
Whenever the switch is activated, de-power the motor in the direction that activated the switch, but allow power in the opposite direction (if commanded).


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:29.

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