Go to Post From past experience members of our team insist on never trusting gravity. - Vash [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 26-01-2012, 21:27
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Counter & DIO not working every time

Hey guys,

We're using the Counter class of the WPI Library in LabVIEW to count the rising edges of a proximity sensor (simple DIO through the Sidecar) in its semi-period mode.

Our procedure at the beginning is to turn on the cRIO and run Robot Main/deploy the whole robot project. This first time, our Counter does not register anything without any errors). However, if the robot project is re-deployed in the same way without any changes to the code, the counter works perfectly.

The raw DIO data works perfectly fine (we get raw feedback from our sensor regardless of the number of times it has been deployed) but the Counter appears to be unreliable.

Can anyone give any advice on this? Is this a problem others have replicated?
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #2   Spotlight this post!  
Unread 02-02-2012, 21:28
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Counter & DIO not working every time

Consider this a formal bump. This issue is starting to cripple us, and getting a bit worse in that it takes more deployments to get the system to work. Any help would be appreciated.

We're hoping to test the exact same code with a different cRIO on Saturday.
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #3   Spotlight this post!  
Unread 02-02-2012, 22:35
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Counter & DIO not working every time

I don't know anything about this specific issue, but this seems similar to the issue we had last year with Encoders (which internally use Counters for 1x or 2x). We could not get Rate from half of the counters(1x/2x) or encoders(4x) on the first boot, but could get Distance.

The workaround (for the entire 2011 season) was to only use half of the Encoders, since half of the FPGA counter and encoder(4x) modules had issues. We created dummy encoders in a specific order to force LV to allocate the counters in a specific order, and it worked, then jhersh released a workaround which marked the bad encoders/counters as already allocated in the WPIlib, so it would not use them.

Try creating two in order (by wiring a wire between the errors on the Opens so it forces them to execute in order) and seeing if both or only one has this issue.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #4   Spotlight this post!  
Unread 06-02-2012, 21:42
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Counter & DIO not working every time

Our current status is that we've added in error wires to control the data flow in the Begin.vi when initializing the counters. We have four Counters being initialized in the order of Real - Dummy - Real - Dummy. The Counters now appear to be working properly when perma-deployed and when temporarily deployed. We are now having trouble using Counter data in the Teleop.vi, but that appears to be an issue with our PID loops, not the Counter class itself.

Palardy, could you elaborate on the issue you had last year and the workaround? Is that what we implemented?
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #5   Spotlight this post!  
Unread 06-02-2012, 22:57
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Counter & DIO not working every time

Quote:
Originally Posted by kenavt View Post
Our current status is that we've added in error wires to control the data flow in the Begin.vi when initializing the counters. We have four Counters being initialized in the order of Real - Dummy - Real - Dummy. The Counters now appear to be working properly when perma-deployed and when temporarily deployed. We are now having trouble using Counter data in the Teleop.vi, but that appears to be an issue with our PID loops, not the Counter class itself.

Palardy, could you elaborate on the issue you had last year and the workaround? Is that what we implemented?
That's what we did last year. I couldn't remember if the first one was dummy or real, but they alternated (at least the first few did, one of the last ones seemed random).

What issue are you having with the data?
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #6   Spotlight this post!  
Unread 07-02-2012, 21:31
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Counter & DIO not working every time

Hmmm, alright.

Our current issue now is discrepancies between how the LabVIEW code works when it's temporarily deployed and permanently deployed. We have integers that are outputs from a NI default PID node. The inputs are valid doubles or clusters of doubles. We have feedback going to the User Message area in the Driver Station that reports the integers as strings correctly (in Teleop.vi) when temporarily deployed, but not when the program is permanently deployed. Then, "NaN" is displayed instead. Have you had this issue either?
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
  #7   Spotlight this post!  
Unread 08-02-2012, 08:02
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Counter & DIO not working every time

Have you probed the wire to see if it actually is NaN? Try probing up to the source of the NaN.

I usually use NaN in my code to indicate fatal error conditions. It's possible something has an NaN error.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #8   Spotlight this post!  
Unread 08-02-2012, 16:10
Doug Norman's Avatar
Doug Norman Doug Norman is offline
Registered User
no team (National Instruments)
Team Role: Engineer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Austin, TX
Posts: 137
Doug Norman will become famous soon enoughDoug Norman will become famous soon enough
Re: Counter & DIO not working every time

Can you post a simplified version of your code that exhibits the problem, along with instructions on how to reproduce the problem? If so, I can try it on my test system.
__________________
Doug Norman
National Instruments
  #9   Spotlight this post!  
Unread 19-02-2012, 23:45
kenavt's Avatar
kenavt kenavt is offline
Registered User
AKA: Colin S
no team
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Ann Arbor
Posts: 253
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Counter & DIO not working every time

Our head programmer intended to post himself on this thread with code, but he never got around to it, and the issue appeared to resolve itself (No, we don't know how).

I don't have code on hand (will attach in future post when I can get at it). I want to post screenshots of the apparent solution if anyone else in the future has this issue.
__________________
University of Michigan Computer Engineering '17

FRC 2337 student alumni (2010-2013)
Closed Thread


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 19:00.

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