|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
E4T Encoder Help
We are having issues getting values from our am-3132 (E4T) encoder, connected to our ToughBox Mini with Dual CIM input.
We currently have it wired as follows: Orange Wire --> DIO 5 / 5V Brown Wire --> DIO 5 / GND Yellow Wire (Channel B) --> DIO 5 / S Blue Wire (Channel A) --> DIO 6* / S *Nothing is wired to GND or 5V Code (Java): Encoder enc = new Encoder(5,6); //robotInit() enc.reset() //robotInit() enc.getDistance(); //teleopPeriodic() So far we have tried:
Is there something we're overlooking? |
|
#2
|
||||
|
||||
|
Re: E4T Encoder Help
Is this in a looping section of your code (like teleop periodic)? If so, you're calling reset every time before you get your distance, so it gets reset to zero every time.
Also, what do you mean nothing is wired to GND and 5v? It's clearly being powered as you can tell it's oscillating. |
|
#3
|
|||
|
|||
|
Re: E4T Encoder Help
Reset is called during robotInit only. Calling getDistance() is the only thing that's done during looping teleop
DIO 5 has 5V, GND, and Signal wired. DIO 6 only has signal wired, see response #6 in https://www.chiefdelphi.com/forums/s...d.php?t=133263 A little more info we discovered: the encoder values oscillate between 0 and 0.25 when the motors are moving and stay constant at 0 when they aren't moving. Does that help clear things up? |
|
#4
|
|||||
|
|||||
|
Re: E4T Encoder Help
|
|
#5
|
||||
|
||||
|
Re: E4T Encoder Help
Are you setting the other parameters for the encoder? For getDistance() to make sense you need to set number of pulses per revolution (I think 360 for the E4T), I don't know what it defaults to. The screen steps detail this:
http://wpilib.screenstepslive.com/s/...or-other-shaft Also try checking the outputs of get() or getRaw() from the encoder object (not the DIO object). These should give raw encoder counts rather than a distance. |
|
#6
|
||||
|
||||
|
Re: E4T Encoder Help
Quote:
|
|
#7
|
||||
|
||||
|
Re: E4T Encoder Help
This is standard for this sort of encoder. They made a cable that goes to two three pin pwm connections, so one cable provides power and ground to the encoder and the second connection is needed only for the second signal wire.
|
|
#8
|
||||
|
||||
|
Re: E4T Encoder Help
So from what I can tell, your DIO 6 (channel B) seems to be disconnected. Connect up a multimeter (or a oscilloscope if you're feeling fancy) and see if you can get a signal anywhere on the wire (at the connector to the encoder, solder joint to the board). From there you can figure out which portion you need to replace.
|
|
#9
|
|||
|
|||
|
Re: E4T Encoder Help
Thanks for the suggestions everyone. Unfortunately, nothing we tried solved the problem. The encoder still inconsistently oscillates between 0-n*0.25 where n is the number of ticks/rev set in the code.
Here's what we tried:
Sadly, nothing we tried got us usable values from the encoder. I guess this means our encoder itself is busted. My advice for anyone reading this thread in the future is to be extra careful when assembling the optical encoders and avoid touching the sensor as much as possible. Thanks again for the help! |
|
#10
|
||||
|
||||
|
Re: E4T Encoder Help
Quote:
if you take the cover off (carefully) and post a picture (in focus), we can look to see if it looks an installation error. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|