Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Encoder fixed in WPILib 2011? (http://www.chiefdelphi.com/forums/showthread.php?t=89153)

apalrd 15-02-2011 23:22

Re: Encoder fixed in WPILib 2011?
 
Quote:

Originally Posted by Jeanne Boyarsky (Post 1024027)
How did you create the first (dummy) encoder? Instantiating using the same arguments gives channel in use errors, no?

I wrote a (fairly quick) VI that takes A phase, B phase, and count scaler and outputs a working encoder. It creates the dummy using the same channels on slot 6, then creates the real one on slot 4. It assumes 1x decoding since that's what we use.

I haven't tested it heavily (still working on mechanism tuning, we haven't tuned the drivetrain yet), so I am hesitant to post it here.

Quick answer:
Create one on slot 6 and one on slot 4. Since we don't use slot 6, that solves all of our problems.

jhersh 16-02-2011 15:03

Re: Encoder fixed in WPILib 2011?
 
Quote:

Originally Posted by Jeanne Boyarsky (Post 1024027)
How did you create the first (dummy) encoder? Instantiating using the same arguments gives channel in use errors, no?

If you instantiate the DigitalInputs first, then pass those into the encoder constructors, you will not get the errors. The errors happen when the encoder tries to construct DigitalInputs for the same channels more than once.

By the way, I found that it is not always the second (odd) decoder that works.

See this thread.

In 4x mode, the 2 odd ones work. In 2x or 1x mode, the first 3 even ones work and the last one (odd) works.

-Joe

Jeanne Boyarsky 16-02-2011 17:40

Re: Encoder fixed in WPILib 2011?
 
Joe,
We got it. It was encoders #1, 3, 5 and 8 that worked. Should have checked this thread before trial and error! This is so illogical, but good it is consistent.

We did have to use different distinct channels for all four dummy encoders. But that's ok.

MagiChau 16-02-2011 18:16

Re: Encoder fixed in WPILib 2011?
 
Is it possible to set the dummy to a slot besides 6 or 4 that are meant for the Digital Side Car? This year my team is using 2 digital side cars so it would be nice to set it to an unused slot.

jhersh 16-02-2011 18:38

Re: Encoder fixed in WPILib 2011?
 
Quote:

Originally Posted by MagiChau (Post 1024596)
Is it possible to set the dummy to a slot besides 6 or 4 that are meant for the Digital Side Car? This year my team is using 2 digital side cars so it would be nice to set it to an unused slot.

You don't need to use a different slot at all... read this post. Construct the DigitalInputs first.

-Joe

MagiChau 16-02-2011 18:40

Re: Encoder fixed in WPILib 2011?
 
Quote:

Originally Posted by jhersh (Post 1024620)
You don't need to use a different slot at all... read this post. Construct the DigitalInputs first.

-Joe

Sorry about that, unlike me to not notice that post.


All times are GMT -5. The time now is 12:47.

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