Go to Post I don't want a carbon copy of your wheels.. I want to improve upon your design. - Tom Bottiglieri [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 09-01-2013, 13:03
vitordegf141 vitordegf141 is offline
Registered User
FRC #1772
 
Join Date: Jan 2013
Location: Brazil
Posts: 1
vitordegf141 is an unknown quantity at this point
Progamming Encoder

Hi.
I'm going to program an encoder for traction for both sides run at the same speed, we never did that. We have an idea how it could be done, but we don't know how to program it on labview.

1 motor =10 pwm out
2 motor = 9 pwm

1 encoder = 14 and 13 pwm in
2 encoder = 12 and 11 pwm

we heard that PID could be used to that.

if you guys could give us a example we would appreciated!
Reply With Quote
  #2   Spotlight this post!  
Unread 09-01-2013, 13:11
Kevin Fort Kevin Fort is offline
Registered User
no team (Team NI)
 
Join Date: Dec 2012
Rookie Year: 2002
Location: Cleveland OH
Posts: 21
Kevin Fort is an unknown quantity at this point
Re: Progamming Encoder

There are several good resources for this on ni.com/frc.
There is example code performing PID using an encoder available here:https://decibel.ni.com/content/docs/DOC-26316 and a PID tutorial available here:https://decibel.ni.com/content/docs/DOC-26317
Reply With Quote
  #3   Spotlight this post!  
Unread 09-01-2013, 14:04
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: Progamming Encoder

Start by connecting the encoder to DIO pins, not to PWM outputs.

There are a couple of LabVIEW examples for reading encoders. They should give you enough information to work with.
Reply With Quote
  #4   Spotlight this post!  
Unread 10-01-2013, 09:05
Timekeeper00 Timekeeper00 is offline
Registered User
FRC #1391
 
Join Date: Nov 2011
Location: PA
Posts: 14
Timekeeper00 is an unknown quantity at this point
Re: Progamming Encoder

Here is an example of the code for initializing and reading from a quadrature encoder(a quadrature encoder provides support for lowering the encoder count if the motor spins "backwards" from the encoder positive). If you were to initialize in begin.vi (as you should) you would use an Encoder RefNum Set in begin.vi and then feed a RefNum Get through the Dig Src to the Encoder Open and then to the Encoder Get. Keep in mind that without the DistancePerCount parameter (the double constant wired to the Encoder Open) the encoder will read in counts, not distance. The constant attached to the DecodingType input is dependent on the encoder you are using, as is the DistancePerCount.


-Ti00
Attached Thumbnails
Click image for larger version

Name:	QuadratureEncoder.png
Views:	86
Size:	9.6 KB
ID:	13447  
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 04:12.

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