Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Encoder trouble (http://www.chiefdelphi.com/forums/showthread.php?t=82668)

Integral 16-02-2010 18:43

Re: Encoder trouble
 
Quote:

Originally Posted by Alan Anderson (Post 921335)
It might not much matter how, but it certainly makes a difference when and where you read them. The while loop worries me, but I can't comment on whether the code is correct without knowing the context. My earlier question remains: where is it?

Please note that the right encoder is functioning as we expect, the left is not. Again it really does not matter where the code is. If one is working the other should also be.

Once again, does one encoder NEED to be set for inverse operation?

I have operated the right encoder from the both sets of assigned DI/O,s and have installed a new left encoder. The encoder change made no difference.

apalrd 16-02-2010 21:35

Re: Encoder trouble
 
You don't NEED to set one inverse. If it runs inverse, then set it inverse. The software sees it as yet another encoder, one of many. If you swap the A and B channels it will have the same effect, so it is possible you might have to invert one, none, or both, not necessarily the right one. Yes it does matter where the code is; if that code were in Teleop then the while loop would cause problems. When the right encoder is set run on either set of IO, does it work? When you plug it into the ports for the left encoder, does the left show change? If so it is certainly a hardware problem. If not, then it is either a problem with software or the 37-pin cable.

Alan Anderson 17-02-2010 00:05

Re: Encoder trouble
 
Quote:

Originally Posted by Integral (Post 921517)
Please note that the right encoder is functioning as we expect, the left is not. Again it really does not matter where the code is. If one is working the other should also be.

It really does matter where the code is. Context means a lot when trying to determine what might be going on in a real time system.

For example, if it's in a parallel task outside the Robot Main event loop, and if it is not in a sequence enforced by the "error out" connection from Begin.vi, the Refnum Get for your left encoder might be getting executed before the Refnum Set for the encoder has been done.


All times are GMT -5. The time now is 07:37.

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