Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Encoder Trouble (http://www.chiefdelphi.com/forums/showthread.php?t=101892)

CRLS97 03-02-2012 19:53

Encoder Trouble
 
Hey CD,

I've worked with an encoder last year without any troubles, but I can't seem to figure out what's wrong this year.

I have the 8-slot cRio reconfigured and modules swapped (from last years positions) to what they should be as noted by FIRST. I tested with the new ribbon cable and the old thick cable (from cRio to digital sidecar).

Our robot is near-fully functional. All the PWM signals work great. Analog works, etc. The trouble is the digital inputs and it's not just the specific one on the bot because I tried with a couple. I wired up an encoder (two of them actually and I'm 101% sure the wiring was correct (I checked multiple times and then with the help of a mentor used an oscilloscope to make sure the encoders were functional as well). Even tried hooking up our old robots encoders to the sidecar and still no luck-

Our code gave no feedback from the encoders. They were initialized properly and started properly so I'm sure nothing is wrong with code. Then I tried the FRC LabVIEW Motor with encoder example and ran it. Motor outputs are fine but the encoder gave feedback this time. However, what happened is that it went from 0 to 0.003 something and back to 0, continually oscillating between the two whenever there was an output to the motor (and the shaft was actually spinning). At the bottom of the example the encoder alarm is always: "stopped" rather than moving.

Does anyone have any clue to what may be wrong or what I'm doing wrong? The digital sidecar is plugged into module 2 of the cRio, recognized as Digital Module 1 in LabVIEW. Any help is greatly appreciated :)

Joe Ross 03-02-2012 20:46

Re: Encoder Trouble
 
Quote:

Originally Posted by CRLS97 (Post 1119439)
However, what happened is that it went from 0 to 0.003 something and back to 0, continually oscillating between the two whenever there was an output to the motor (and the shaft was actually spinning). At the bottom of the example the encoder alarm is always: "stopped" rather than moving.

This sounds like it isn't reading one of the channels, but is reading the other channel.

CRLS97 03-02-2012 20:52

Re: Encoder Trouble
 
Quote:

Originally Posted by Joe Ross (Post 1119474)
This sounds like it isn't reading one of the channels, but is reading the other channel.

I really have a feeling it might be the cRio / digital sidecar or some other wiring problem between the cRio and sidecar. I tried it on different channels and made the code adjustments and no luck with that either and again I'm sure its not the wiring of the encoder to the channels.

Before leaving, I tried a limit switch and did not see any response to pushing it, in the FRC PC Dashboard for GPIO state with the robot enabled.

Alan Anderson 03-02-2012 21:10

Re: Encoder Trouble
 
Quote:

Originally Posted by CRLS97 (Post 1119439)
I wired up an encoder (two of them actually and I'm 101% sure the wiring was correct (I checked multiple times and then with the help of a mentor used an oscilloscope to make sure the encoders were functional as well).

Congratulations on going that far with your troubleshooting.

Quote:

Then I tried the FRC LabVIEW Motor with encoder example and ran it. Motor outputs are fine but the encoder gave feedback this time. However, what happened is that it went from 0 to 0.003 something and back to 0, continually oscillating between the two whenever there was an output to the motor (and the shaft was actually spinning). At the bottom of the example the encoder alarm is always: "stopped" rather than moving.
Can you tell us exactly how your encoder is wired? It sounds like at least one of the phases isn't getting through to the Digital Sidecar.

CRLS97 03-02-2012 22:43

Re: Encoder Trouble
 
Cable 1:
Encoder | DIO Channel 5
+5v ------- +5v
Gnd ------- Gnd
Ch. A ------ Sig

Cable 2:
Encoder | DIO Channel 6
Ch. B ------- Sig

A snippet of begin.vi-

http://i44.tinypic.com/35i53s5.jpg

seg9585 09-02-2012 03:05

Re: Encoder Trouble
 
Just curious -- have you tried running with one single encoder (A and B inputs) plugged in at a time, and no other digital inputs? How are you attempting to read the output data -- in an Indicator within Periodic Task VI, or maybe on the Dashboard?


All times are GMT -5. The time now is 11:36.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi