Go to Post ROBUST, ROBUST and ROBUST if you want to win - dan 322 [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 03-01-2013, 11:20
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Digital Side Car Issue with Encoder

We are having an issue with a USDigital S4 encoder... when the A channel is plugged into the DSC DIO port 1 and the B channel plugged into port 2 it properly provides an output using getRaw() when the DS is disabled. As soon as the DS is enabled, the output count oscillates between the last disabled value and last disabled value + 1. If we plug the same encoder into ports 9/10, 11/12, or 13/14 it works fine both disabled and enabled.

I checked the wiring twice for both continuity between ends and the proper pin order. The voltage at the +/gnd pins is 5v for all ports when the DS is both disabled and enabled.

Any ideas what might be going on?
  #2   Spotlight this post!  
Unread 03-01-2013, 11:49
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Digital Side Car Issue with Encoder

Is this happening all the time, or is this a one off occurrence?

If it's one-off, I kind of suspect the encoder was sitting on a rising/falling edge.

IF you have an oscilloscope, I would suggest probing the A and B channels to make sure you're getting a clean signal. Probe it from the DSC connectors, that way you simultaneously check your pinout and wiring (you can never be too sure). My thought right now (but it doesn't exactly fit with the problem description) is that one of the channels is continuously low or high instead of oscillating like it should, so the count only oscillates.
  #3   Spotlight this post!  
Unread 03-01-2013, 12:37
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Digital Side Car Issue with Encoder

I've tried it 3 times plugged into ports 1/2 and each it's same behavior... fine in disabled, crippled when enabled. I've tried it once in port 9/10, 11/12. and 13/14 and these all worked fine. I have two identical encoders and both exhibit the same behavior when plugged into the same wiring.

We don't have an oscilloscope. I checked the voltage using a multimeter on the A and B channels and both where 2.5v when the encoder was spinning.
  #4   Spotlight this post!  
Unread 03-01-2013, 12:47
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Digital Side Car Issue with Encoder

When the encoder is plugged into 1/2, can you read increasing/decreasing counts (more than +/- 1 in any direction)?
  #5   Spotlight this post!  
Unread 03-01-2013, 12:54
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,600
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: Digital Side Car Issue with Encoder

What else do you have plugged into the digital sidecar? What additional things are you doing in the code when you're enabled?
  #6   Spotlight this post!  
Unread 03-01-2013, 13:33
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Digital Side Car Issue with Encoder

Actually, you're not shorting the SIG and GND pins on 1 or 2, are you?
  #7   Spotlight this post!  
Unread 03-01-2013, 13:58
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Digital Side Car Issue with Encoder

My guess is a chassis isolation fault is affecting one of the encoder channels. Something down stream of an actuator controller (Jaguar, Victor, Talon, Spike, Solenoid Breakout, etc) is asserting a voltage on the chassis (hopefully the battery return voltage).

The value "chatter" tells us two things: The software is fine, since things are moving, and one pin is stuck in one position (high or low).
  #8   Spotlight this post!  
Unread 03-01-2013, 14:06
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Digital Side Car Issue with Encoder

Quote:
Originally Posted by Joe Ross View Post
What else do you have plugged into the digital sidecar? What additional things are you doing in the code when you're enabled?
The compressor switch is plugged into port 5, that's it. Nothing different in code happens between disabled and enabled.

initialize in chassis constructor:
m_encoder = new Encoder(aChannel, bChannel, true, CounterBase.EncodingType.k4X);
m_encoder.start();

each period output to SmartDashboard:
m_encoder.getRaw();
  #9   Spotlight this post!  
Unread 03-01-2013, 15:22
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Digital Side Car Issue with Encoder

Quote:
Originally Posted by EricVanWyk View Post
My guess is a chassis isolation fault is affecting one of the encoder channels. Something down stream of an actuator controller (Jaguar, Victor, Talon, Spike, Solenoid Breakout, etc) is asserting a voltage on the chassis (hopefully the battery return voltage).

The value "chatter" tells us two things: The software is fine, since things are moving, and one pin is stuck in one position (high or low).
I unplugged everything (4 talon + compressor relay PWMs) from the DSC except the encoder and removed the circuit breakers for everything except the cRio and DSC. Same problem.

I then tried different combinations of pins for channels A/B and found that pins 2, 3, 4 work when the DS is disabled but not when enabled. If I have one good pin and one bad, I get the "chatter" as you described, two bad pins = nothing, two good pins it works fine disabled and enabled.

Last edited by Brian Selle : 03-01-2013 at 15:26. Reason: more info
  #10   Spotlight this post!  
Unread 03-01-2013, 16:26
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Digital Side Car Issue with Encoder

Neat! Sounds like an interesting break inside the DSC then: Haven't seen this one before. You are listed as being in texas - If you are headed to an Austin kickoff I'd love to take a look at it.
  #11   Spotlight this post!  
Unread 03-01-2013, 16:32
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Digital Side Car Issue with Encoder

Are you doing any encoder resets? (In LabVIEW, there is a Reset Encoder vi that resets the encoder counts to 0 and stops the encoder, you then need to do an Encoder Start. I'm assuming there are equivalent methods of doing this in C++ and Java.)

I found a bug with the Encoder Reset / Encoder Start / Encoder Stop functionality in the 2012 firmware. The bug caused it to act exactly as you're describing. We lost days trying to track that down.
__________________
-
An ounce of perception is worth a pound of obscure.
  #12   Spotlight this post!  
Unread 03-01-2013, 23:37
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Digital Side Car Issue with Encoder

Quote:
Originally Posted by EricVanWyk View Post
Neat! Sounds like an interesting break inside the DSC then: Haven't seen this one before. You are listed as being in texas - If you are headed to an Austin kickoff I'd love to take a look at it.
We are going to the Dallas kickoff. Once we get a replacement I could mail it to you if you PM me your address.

Quote:
Originally Posted by Chris Hibner View Post
Are you doing any encoder resets? (In LabVIEW, there is a Reset Encoder vi that resets the encoder counts to 0 and stops the encoder, you then need to do an Encoder Start. I'm assuming there are equivalent methods of doing this in C++ and Java.)

I found a bug with the Encoder Reset / Encoder Start / Encoder Stop functionality in the 2012 firmware. The bug caused it to act exactly as you're describing. We lost days trying to track that down.
I took the code from last year's shooter encoder and it called the start() method once and reset() each cycle. It seemed to work fine in Java but I will give it a try with start() after each reset(). For this current issue I had removed all the reset() calls to make it as simple as possible.
  #13   Spotlight this post!  
Unread 04-01-2013, 14:42
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Digital Side Car Issue with Encoder

Quote:
Originally Posted by btslaser View Post
I took the code from last year's shooter encoder and it called the start() method once and reset() each cycle. It seemed to work fine in Java but I will give it a try with start() after each reset(). For this current issue I had removed all the reset() calls to make it as simple as possible.
If you have some time to experiment, let us know what you find.

Here is a summary of our experience with the problem:

If you look in my autonomous scripting presentation (you can find it under my whitepapers here on cheifdelphi) you can find our 2011 robot code. In the Disabled vi, any time we switched to a new autonomous script we called the EncoderReset vi and then the EncoderStart vi (it's in selectAutonMode.vi inside of Disabled.vi). This was done in order to reset the encoders back to 0 after the drive team was finished moving the robot around to set up the robot at the beginning of the match. EncoderReset->EncoderStart worked great in 2009 through 2011.

With the 2012 cRIO firmware, that exact strategy would usually lock the encoder decoding causing exactly what you are seeing. I say usually because it didn't always happen. The only remedy would be to power cycle the cRIO (i.e. the decoding wouldn't work if you simply reset the code).

The fact that it didn't always happen caused us a lot of issues. We assumed we had a problem in the digital sidecar or an encoder wire was shorted somewhere. We spent the last 3 days before ship date trying to track down the issue. I accidentally stumbled onto the fact that the EncoderReset->EncoderStart sequence was causing the issue (very thankful for the accident). We figured this out literally 15 minutes before it had to be in the bag the night before our first district event. This whole fiasco caused us to have no autonomous testing before our first event, and it severely limited the testing on our shooter since our speed control and turret control all relied on encoders.

We put in a simple workaround to reset encoder values back to zero (that didn't use EncoderReset or EncoderStart) and I never had time to experiment to figure out the exact cause and a good solution. I'm suspecting that the issue is somewhere in the 2012 FPGA firmware.

I brought the issue up to the NI representative at our first event. I don't think it ever got resolved.
__________________
-
An ounce of perception is worth a pound of obscure.
  #14   Spotlight this post!  
Unread 04-01-2013, 16:15
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Digital Side Car Issue with Encoder

It looks like other posters have a more likely explanation. If switching the DSC for a different one cures the problem, I'd like to see it. If it doesn't, I'll gladly point the finger at software and walk away whistling.
  #15   Spotlight this post!  
Unread 04-01-2013, 19:29
Brian Selle's Avatar
Brian Selle Brian Selle is offline
Mentor
FRC #3310 (Black Hawk Robotics)
Team Role: Engineer
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Texas
Posts: 170
Brian Selle has a spectacular aura aboutBrian Selle has a spectacular aura aboutBrian Selle has a spectacular aura about
Re: Digital Side Car Issue with Encoder

Quote:
Originally Posted by Chris Hibner View Post
If you have some time to experiment, let us know what you find.
With the encoder plugged into "good" DIO ports I tried calling reset() during each periodic cycle and it worked fine. I then added a call to start() after the reset() and that worked fine as well. I tried each case 5-6 times. We used the reset() call last year on our shooter encoder and never had a problem. It may be a LabView thing or just that I haven't run into the unlucky set of circumstances.

Quote:
Originally Posted by EricVanWyk View Post
It looks like other posters have a more likely explanation. If switching the DSC for a different one cures the problem, I'd like to see it. If it doesn't, I'll gladly point the finger at software and walk away whistling.
It's definitely the DSC. I tried the compressor switch in DIO ports 2, 3, and 4 and it curiously it did not work. Works fine in all the other ports.
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 20:11.

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