|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Encoder Trouble
We use Java and have Grayhill 63R encoders that do not work. We have checked the wiring and it is fine. The a and b signals are taking up 2 different channels, it has power and ground, and the wires are not broken. The constructor is :
driveLeftEncoder = new Encoder(3, 4, false, EncodingType.k4X); We also remembered to start and reset it. When printing the values, the encoder always returns 0 for the get() method, .25 for the getDistance() method, 1 for getRaw(),and true or false at random for getDirection(). Unless we stop then start it, the rate is 0, and when we do it is a random value. Also without stopping and starting it, it always returns true for getStopped(). We are utterly confused as to what is wrong and would appreciate any help. |
|
#2
|
|||
|
|||
|
Re: Encoder Trouble
An issue that can easily get over looked is do you have your encoder reset inside a while function? And would you also mind posting your code?
|
|
#3
|
||||
|
||||
|
Re: Encoder Trouble
Another thing crucial to getting Encoders to work is using the setDistancePerPulse() method.
You experimentally determine this constant by rolling the robot over a pre-determined distance, and recording the number of pulses from the get() method. Then it's as easy as dividing distance by the number of pulses, and using the setDistancePerPulse() before getting the distance. Hope this helps. If this still doesn't work, maybe try posting the code, and we can look it over. |
|
#4
|
|||
|
|||
|
For the past two weeks our team has tried to get our US Digital encoder working. We cannot read any values from the encoder at all. Our wiring is the same as this:
![]() And our code is attached. We have tried to test everything that we could think of. Please help us find what is wrong so we can get them working. Thank you very much for your help, we really appreciate it. |
|
#5
|
||||
|
||||
|
Re: Encoder Trouble
Quote:
|
|
#6
|
||||
|
||||
|
Re: Encoder Trouble
Maybe he meant PWM cable
|
|
#7
|
||||
|
||||
|
Re: Encoder Trouble
I hope so. But that needs to be confirmed.
|
|
#8
|
|||
|
|||
|
Re: Encoder Trouble
Sorry for the confusion, we are connecting them via pwm cable to the "DIGITAL I/O" on the digital sidecar.
|
|
#9
|
||||
|
||||
|
Re: Encoder Trouble
Quote:
|
|
#10
|
|||
|
|||
|
Re: Encoder Trouble
Yes, we do own an oscilloscope.
|
|
#11
|
||||
|
||||
|
Re: Encoder Trouble
Look at the output of the encoder(s). See if there's any signal coming out.
You may have to carefully strip the insulation of a small section of the signal wires. |
|
#12
|
|||||
|
|||||
|
Re: Encoder Trouble
Quote:
The same guy taught me to strip wire using small side cutters, another handy trick. |
|
#13
|
|||
|
|||
|
Re: Encoder Trouble
We are getting signals from channel a and channel b. (it looks like a pwm signal)
|
|
#14
|
||||
|
||||
|
Re: Encoder Trouble
Quote:
|
|
#15
|
||||
|
||||
|
Re: Encoder Trouble
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|