Go to Post This thread has officially jumped the shark! the old guy shark :) - IndySam [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 16-01-2012, 11:31
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 encoders in autonomous

Hey all,
I'm planning on using encoders to drive our robot during the autonomous period this year.

This is my second year using labview, and last year autonomous was beyond me, so this year I'm determined.

Can anyone help me with some diagrams/pictures of how to set up encoders for autonomous and get them working?

Thanks a lot!
Reply With Quote
  #2   Spotlight this post!  
Unread 16-01-2012, 11:42
tilky's Avatar
tilky tilky is offline
Registered User
AKA: Ryan Thielke
FRC #3137
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Connetquot
Posts: 188
tilky is an unknown quantity at this point
Re: Labview encoders in autonomous

i don't know much about encoders, but i know that autonomous is almost exactly like teleop, except for instead of using joysticks to drive, you have the code input numbers
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2012, 08:15
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: Labview encoders in autonomous

The Encoder Example project in LabVIEW should tell you everything you need to know in order to connect, initialize, and read from the type of encoder provided in the Kit of Parts.

In the main LabVIEW FRC 2011 "getting started" window, click the Support tab then click the Find FRC Examples... option. You will find Encoder Example.lvproj under the Sensors subfolder of the FRC Robotics folder.
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2012, 15:24
frankthelyon frankthelyon is offline
Registered User
FRC #2557
 
Join Date: Jan 2012
Location: Tacoma
Posts: 23
frankthelyon is an unknown quantity at this point
Re: Labview encoders in autonomous

I am also trying to get encoders working in Labview. How can I set a motor output value using encoders? For example, arcade drive> output value > encoder?
Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2012, 22:11
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: Labview encoders in autonomous

If you can be a little more specific about what you want to do, we might be able to give you some advice on how to do it.
Reply With Quote
  #6   Spotlight this post!  
Unread 25-01-2012, 22:17
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 encoders in autonomous

I would still like a more helpful answer to my initial question. Look, I basically want to be able to drive the robot in autonomous to whatever distance I set the encoder to go. I looked at the example, but that is not really any help. Do I need to do a PID Loop for this, or is there a block of code that I can use that I can link to my drive code to drive it a certain distance in autonomous?

Help?
Reply With Quote
  #7   Spotlight this post!  
Unread 26-01-2012, 00:30
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: Labview encoders in autonomous

Quote:
Originally Posted by jhellr13 View Post
Look, I basically want to be able to drive the robot in autonomous to whatever distance I set the encoder to go. I looked at the example, but that is not really any help.
Have you managed to read the encoder value?

Do you know how to calculate the number of encoder counts that represents the distance you want to travel?

Do you know how to do a comparison function in LabVIEW?

Do you know how to use a Case structure in LabVIEW to do different things based on a value?

The simplest thing to do is to continuously read the encoder and run the robot forward only when the value is less than the distance you want to travel. You'll probably coast past the destination unless you have your speed controllers set to "brake" mode.
Reply With Quote
  #8   Spotlight this post!  
Unread 26-01-2012, 13:40
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 encoders in autonomous

Quote:
Originally Posted by Alan Anderson View Post
Have you managed to read the encoder value?

Do you know how to calculate the number of encoder counts that represents the distance you want to travel?

Do you know how to do a comparison function in LabVIEW?

Do you know how to use a Case structure in LabVIEW to do different things based on a value?

The simplest thing to do is to continuously read the encoder and run the robot forward only when the value is less than the distance you want to travel. You'll probably coast past the destination unless you have your speed controllers set to "brake" mode.
Alan,

I have not yet managed to read the encoder value because we don't have encoders on our robot from last year, which I'm using to play with programming right now.

I do not currently know how to calculate the number of encoder counts for my distance. I'm pretty i just need to find the converting factor that is usually provided with the encoder or I could find it online.

I'm not exactly sure how to do a comparison function in Labview, though I'm sure I could find it.

I'm pretty good at using case structures to do certain things, though I usually only used them last year for buttons on the joysticks. Not really related to using them for encoders, but I'm pretty sure I could make it happen with case structures.

The way you described that would be the simplest method was exactly how I was thinking it. Find the distance I need and how many counts it would be. Run the encoder and the motors until the encoder hits this value. At that point, I would set the motors to 0/stop. Also, I would set my speed to something like .5 or .7 to lessen the chance of it overshooting my projected distance.
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 22:26.

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