|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||||
|
||||||
|
Re: Encoders Programming
You haven't yet posted how you wired it or taken any pictures, per Ether's request.
|
|
#17
|
||||
|
||||
|
Re: Encoders Programming
So I have the two bare red wires to one of the grounds and the other to csn and soldered to the black which is connected to the other ground. I also have the blues connected to channel a and the yellow to channel b and red to 5v. the red and blue are in dio 1 and yellow and black are connected to dio 2.
|
|
#18
|
||||
|
||||
|
Re: Encoders Programming
I found another thread related to the magnetic encoders. You might want to look through it if you haven't already: http://www.chiefdelphi.com/forums/sh...d.php?t=111202
Also, here's the non FIRST-specific data sheet for the sensor: http://www.ams.com/eng/content/downl...heet_v1-15.pdf Unfortunately I can't see the wiring very well from the pictures provided, so I won't be of much help there. It seems the sensor has two modes of output: absolute position, and quadrature output. For you usage, you need to make sure you wire it for quadrature output. Here's the wiring: Quote:
|
|
#19
|
||||
|
||||
|
Re: Encoders Programming
yep thats exactly how it is wired
|
|
#20
|
||||
|
||||
|
Re: Encoders Programming
Quote:
What part number magnet are you using? |
|
#21
|
||||
|
||||
|
Re: Encoders Programming
Here are some other things to consider:
Are both encoders giving you identical output? It might be easier to look at the output using System.out.println() rather than SmartDashboard. The output goes to the console in NetBeans, and from my experience is more useful for debugging. Are you calling Encoder#start() more than once for the encoders? You should only need to call it once at the beginning of the program, unless you stop counting with Encoder#stop(). I don't know if this would cause the encoder count to reset though. Have you checked for hardware defects? Ensure that there is nothing wrong with your digital sidecar and cables. As Joe Ross mentioned earlier, the problem you described is often because only one channel of the encoder is being read. Does your team have any other encoders, such as the US Digital E4P? You could try swapping one out temporarily to see if it behaves any differently. This would help identify it as a hardware or a software issue. |
|
#22
|
||||
|
||||
|
Re: Encoders Programming
You may want to consider setting up a couple of DigitalInputs in code and read/println the two encoder inputs while slowly spinning the shaft by hand: you should be able to see the inputs toggle. That would tell you if it's wiring (or wrong/bad input) or problems setting up the Counter class....
|
|
#23
|
||||
|
||||
|
Re: Encoders Programming
Quote:
Last edited by Ether : 14-11-2013 at 18:30. |
|
#24
|
||||
|
||||
|
Re: Encoders Programming
I still haven't figured out the encoder resetting problem sadly. I had about 2 months of just thinking about it while I worked on the Safety Animation but the program I came up with inevitably failed. I might just end up going through and yanking everything because the only thing I can think of is it's a wiring problem.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|