View unanswered posts | View active topics It is currently Tue Feb 28, 2017 12:54 pm

Reply to topic  [ 2 posts ] 
Quad Encoders 
Author Message

Joined: Tue Mar 18, 2008 7:11 pm
Posts: 22
Location: San Antonio, TX
Post Quad Encoders
I'm seeing some unusual activity when trying to get the quad encoders to work.

Platform: VEX
RobotC: 1.16

I'm attempting to get the Quad Encoders to work. I've got them wired like this:

left encoder - in4 - int4 (via the wizard)
right encoder - in5 - int5 (via the wizard)

I'm getting 1, 0, -1 on the encoder counts.

Now for the interesting part. If, in the wizard, I set both int number to int4 so it looks like this:
left encoder - in4 - int4
right encoder - in5 - int4

The right encoder will count, but only if the left encoder is moving. If I move them seperately, just 1, 0, -1.

What I'm not entirely clear about is how the VEX knows to attach int4 and in4 together in code (or int5 and in5).

Now, I can get one encoder to work if they are wired on these ports:
right encoder - in5 - int4 (works)
left encoder - in4 - int3 (doesn't work)

Finally, while this may have no bearing at all, if I query ifiInterruptPorts(l_encoder) I get 2 and ifiInterruptPorts(r_encoder) I get 3.

It looks like ifiInterruptPorts[] is newer than the docs.

1. How does the controller know which interrupt port is attached to which digital/analog input? I know the wizard does it, but is there a way to explicitly set it?

2. If anyone has two encoders working can you outline what ports you have hooked where?

3. Does it matter which lead from the encoder goes to the interrupt port and digital/analog input? If I look at the encoder from the front with the lead coming out the top, I've got the left hand lead going to the interrupt and the right hand lead going to the digital/analog.

I'm actually at a loss as to what the problem might be.

Any assistance would be appreciated.



Sun Mar 30, 2008 1:05 am

Joined: Tue Mar 18, 2008 7:11 pm
Posts: 22
Location: San Antonio, TX
Alrightly for all you encoder challenged people I think I've figured it out.

If you read the docs about the sensors it mentions that the inputs are either digital or analog. Then it recommends that the analog sensors occupy the lower range and the digital sensor occupy the upper range.

I read this like this however.

There cannot be an analog sensor in a higher number input number than any digital sensor. So, if you have the following sensors:

3 x line sensors
1 x ultrasonic sensor
2 x quadrature encoders
1 x button sensor

A reasonable layout would be:
Analog Sensors
in1 - right line sensor
in2 - center line sensor
in3 - left line sensor
in4/int1 - ultrasonic sensor

Digital Sensors
in9/int5 - right quadrature encoder
in10/int4 - left quadrature encoder
in11 - Touch Sensor

The bottom line; analog sensors first, then your digital sensors.


Sun Mar 30, 2008 11:44 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.