Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   Reading encoder values? (http://www.chiefdelphi.com/forums/showthread.php?t=152248)

Ubspy 10-11-2016 15:25

Reading encoder values?
 
I'm having trouble reading values from the coders. When it goes forward I get increasing values for the .get() function (for the encoder). But when I reverse the motor everything the values stay the same, and when I go forward again they continue rising, and they all stay at 0 (I'm printing the get(), getRaw(), getDistance(), and getRate() values).

I don't know if it's wiring or coding, but my code only calls reset on the initialization of the subsystem (we're using java command based programming), so I don't know why it would be resetting.

For the wiring, I only have power going from one digital input, but I'm using 2 DIO ports for the signals.

Any ideas on how to reduce the get() when going in reverse?

Logan Byers 10-11-2016 16:26

Re: Reading encoder values?
 
Definitely sounds like a wiring issue. Double check the signal wires for the encoder and the connection to the encoder itself.

Troubleshooting tip: switch the channels of the encoder. Does the encoder reading flip? If so, you may have a bad encoder. If it stays the same after switching the channels, you may have a bad DIO on the RoboRIO.

GeeTwo 10-11-2016 17:04

Re: Reading encoder values?
 
We had a (homemade) encoder disk our rookie year which would only rotate one way; something caught it when going the other way.

Ubspy 13-11-2016 19:33

Re: Reading encoder values?
 
If we use DIO ports 0 and 1 it works fine, but DIO ports 2 and 3 don't seem to work as well.


All times are GMT -5. The time now is 17:38.

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