Go to Post The sponsor had a $2000 sheet of aircraft aluminum in their scrap bin? Do they also blow stacks of dollar bills off their loading dock with a giant fan? - Richard Wallace [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 05-02-2009, 13:24
intellec7's Avatar
intellec7 intellec7 is offline
108 programmer
AKA: Gustavo
FRC #0108 (SigmaC@ts)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2006
Location: Hollywood, Florida
Posts: 65
intellec7 is on a distinguished road
Send a message via AIM to intellec7 Send a message via MSN to intellec7
Can't read encoders

My hardware setup works with the Encoder Example that came with FRC LabVIEW, so hardware is not the issue in this case.


Here is where I open the encoder (in begin). I created a "drive encoders" struct, but I don't think that should be the problem, as I am unbundling it.


Here is where I read from the encoder (In periodic tasks)


I tried it both with and without the shift registers for the encoder. The LabVIEW encoder example does use shift registers, though I don't know why since I don't think the "get" vi modifies the Device Reference.

Thank you.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2009, 13:27
intellec7's Avatar
intellec7 intellec7 is offline
108 programmer
AKA: Gustavo
FRC #0108 (SigmaC@ts)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2006
Location: Hollywood, Florida
Posts: 65
intellec7 is on a distinguished road
Send a message via AIM to intellec7 Send a message via MSN to intellec7
Re: Can't read encoders

Haha. Three seconds after posting I realized that I'm "overwriting" the Left encoder device reference with the wrong pins (the ones of the left encoder) as is clear from the first picture. Now it works!

If anyone could clear up the shift register question, I'd appreciate it.
--
EDIT
It looks like I'm not reading the proper encoder velocity -- not even in the example. No matter how many samples I average or what I set the minimum rate to, at slower speeds, I read +/- 83333.3 (depending on the direction) If I speet it up, the numbers change. I can't tell whether they are accurate or not, though.

If it is relevant, I'm doing quadrature decoding and am using an NXT motor, which produces 720 quadrature transitions per rotation (180 rising pulses on a single channel per rotation).

I am using the latest cRIO image and LabVIEW edition.
--
EDIT 2
This symptom only occurs when doing 4x decoding, and not 2x or 1x. I did read about something similar before, but I can't recall where.

Last edited by intellec7 : 05-02-2009 at 13:45. Reason: Additional Question
Reply With Quote
  #3   Spotlight this post!  
Unread 05-02-2009, 16:38
rwood359 rwood359 is offline
Registered User
AKA: Randy
FRC #0359 (Hawaiian Kids)
Team Role: Mentor
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Waialua, HI
Posts: 212
rwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to allrwood359 is a name known to all
Re: Can't read encoders

Quote:
Originally Posted by intellec7 View Post
If it is relevant, I'm doing quadrature decoding and am using an NXT motor, which produces 720 quadrature transitions per rotation (180 rising pulses on a single channel per rotation).

I am using the latest cRIO image and LabVIEW edition.
--
EDIT 2
This symptom only occurs when doing 4x decoding, and not 2x or 1x. I did read about something similar before, but I can't recall where.
LabView Update 3.0a and cRIO Version 11 corrected the problem of different rates being returned by the encoders.

You don't have a distance per count going into the open for the bottom encoder, I don't know what the default will be.

The values returned by the Encoder routines are not a function of the decode type (1X, 2X, or 4X). You should get 180 counts per revolution. Have you looked at the distance that is being returned? If you can go slow enough, you should be able to predict the distance based on revolutions.
Reply With Quote
  #4   Spotlight this post!  
Unread 05-02-2009, 23:36
intellec7's Avatar
intellec7 intellec7 is offline
108 programmer
AKA: Gustavo
FRC #0108 (SigmaC@ts)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2006
Location: Hollywood, Florida
Posts: 65
intellec7 is on a distinguished road
Send a message via AIM to intellec7 Send a message via MSN to intellec7
Re: Can't read encoders

The count works fine in all three modes. The default distance / tick is 1.

The problem I'm experiencing has to do with the tick rate when doing 4x decoding.
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2009, 12:06
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Can't read encoders

Could you be seeing this bug: http://forums.usfirst.org/showpost.p...5&postcount=34
Reply With Quote
  #6   Spotlight this post!  
Unread 07-02-2009, 00:01
airnate airnate is offline
Registered User
FRC #0236 (Techno Ticks)
Team Role: Programmer
 
Join Date: Feb 2009
Rookie Year: 2009
Location: southeastern CT
Posts: 93
airnate is a jewel in the roughairnate is a jewel in the roughairnate is a jewel in the rough
Re: Can't read encoders

Regarding the use of the shift registers:

I believe you are correct in that the Get.vi does not modify the device reference, so the shift registers are not strictly necessary in this case, but shift registers are good form for this sort of thing.

If you were writing this code and someone later decided to update the Get.vi such that the device reference was changed (admittedly unlikely), then the shift registers would cover that eventuality; whereas if you had wired straight through tunnels, then you would lose the changes on the next loop iteration.

One other consideration is that LabVIEW may have to make a copy of the data (internally) when you wire through a loop tunnel. So the tunnel may require more memory to execute than the shift register, but I would be rather surprised if this caused a problem in anyone's code in FRC. This would be more of consideration if you were passing extremely large quantities of data through the wire (e.g. large array or cluster of arrays).

Last edited by airnate : 07-02-2009 at 00:07.
Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2009, 09:00
intellec7's Avatar
intellec7 intellec7 is offline
108 programmer
AKA: Gustavo
FRC #0108 (SigmaC@ts)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2006
Location: Hollywood, Florida
Posts: 65
intellec7 is on a distinguished road
Send a message via AIM to intellec7 Send a message via MSN to intellec7
Re: Can't read encoders

Thanks for the explanation, airnate.

The 4x velocity decoding fails to work when averaging is set to 2-10, so I don't think it is the same bug.
Reply With Quote
  #8   Spotlight this post!  
Unread 07-02-2009, 10:39
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Can't read encoders

I didn't read the entire thread, but I did test the latest encoder stuff just a few days ago.

If you have the latest FPGA and WPI, update 3 and v11 are the latest I think, then we think everything works except for the 4x with averaging set to 1. This also affects only the velocity, the distance is still correct even in the 4x and 1 case.

Is the rate wrong because the Min Rate is set too high?

Greg McKaskle
Reply With Quote
  #9   Spotlight this post!  
Unread 07-02-2009, 11:26
tyson2010 tyson2010 is offline
Registered User
FRC #1254
 
Join Date: Jan 2009
Location: VBISD
Posts: 4
tyson2010 is an unknown quantity at this point
Re: Can't read encoders

Quote:
Originally Posted by Greg McKaskle View Post
I didn't read the entire thread, but I did test the latest encoder stuff just a few days ago.

If you have the latest FPGA and WPI, update 3 and v11 are the latest I think, then we think everything works except for the 4x with averaging set to 1. This also affects only the velocity, the distance is still correct even in the 4x and 1 case.

Is the rate wrong because the Min Rate is set too high?

Greg McKaskle
Where do you get update #3.

Carolyn
Reply With Quote
  #10   Spotlight this post!  
Unread 07-02-2009, 19:00
Ceal Craig's Avatar
Ceal Craig Ceal Craig is offline
Registered User
no team
Team Role: Leadership
 
Join Date: Mar 2005
Rookie Year: 2003
Location: San Jose CA
Posts: 41
Ceal Craig is a glorious beacon of lightCeal Craig is a glorious beacon of lightCeal Craig is a glorious beacon of lightCeal Craig is a glorious beacon of lightCeal Craig is a glorious beacon of lightCeal Craig is a glorious beacon of light
Talking Re: Can't read encoders

I imagine the problem you are experiencing has nothing to do with the problem we just found the root cause for... but wanted to share.

After installing the encoder on the transmissions with the AndyMark encoder mounting plate, crafting two modified (PWM style three-wire) cables to attach to the US Digital four wire cable for the encoder (2 signals from the encoder, 5V power and ground), soldering (shrink wrapping too) the connecting wires, then installing these two cables (one with three wires into it, signal, power, ground; other with signal wire) to the Digital Sidecar, then using the LabView standard encoder wizardry (hey, I'm a mechanical, not a SW gal) package, the encoder did not work! yikes! only a value of 1.

We spent hours hooking up scopes, DVMs, measuring many, many things, Thank you mentor, Bill S! Next, we called on a local Subject Matter Expert (high five to Laura Rhodes, of Team 100 for taking the calls and the Woodside/Carlmont team for helping on the phone during their busy day too). We were seeing strange voltage readings on the side car itself (only the 5V LED lighted up [remember this one....], not seeing 5V on digital I/O pins using a DVM, strange and inconsistent ground readings across the various items. We tried a different sidecar, checked so many many things. Laura suggested we mock up a signal to the program that didn't depend on the encoders and sure enough the LabView wizard was able to read it.

FINALLY.... those pieces of data all came together (thanks to mentors Tim, Steve, and JohnG and all the students who stuck through it)....we swapped out the Wago connector from the Power Distribution panel to the Analog breakout board that we KNEW was working (battery readings, accelerometer) and used it. [insert drumroll please....].

ALL the lights now on the SideCar lit up! We didn't know there were supposed to (all this time) AND the encoders send out readings and LIFE IS VERY VERY SPIFFY.

REMEMBER: check all the wires on the Wago connectors
(Jaguars worked just fine on the Digital Sidecar which misled us into thinking all was ok w/ Sidecar and kept thinking it was the encoder wiring); and don't give up!

Sincerely, the scribe for Team 1120, Week 5, almost 6 with only 9 days left to go!!
__________________
Cecilia (Ceal) D. Craig
Retired Mechanical Engineer (BSME: The Ohio State University; MS CalState Fullerton)
PhD in Education Student Walden University
FRC Mentor: 2003 - 2009
Treasurer WRRF BOD: Western Region Robotics Forum
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
[FTC]: FTC read encoders vi Jim.D FIRST Tech Challenge 8 26-12-2008 23:42
can't pay registration? READ THIS PhillyRobotics General Forum 5 13-06-2002 17:39
'read' posts that arent read mike o'leary CD Forum Support 4 10-06-2001 11:29


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

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