We are trying to watch the Quadrature Encoder using the Debugger through the VexNET connection. We are seeing +2, 0, -2 most of the time on the encoder, occasionally it will start counting up/down properly, but then it will slip back into oscillating by 2.
The question I have is if the Interrupts are slowed down due to the VexNET communication and missing the encoder counts?
We are using RobotC and the same code works when directly connected to a robot.
Thanks!
VEXnet does not use any more resources that the 75MHz radios with respect to the user processor. I will get ROBOTC to look into this. Will you be at the Dallas event?
Unfortunately I will not be there, but the team from Northwest Vista College in San Antonio will be there. We are going to take another look at it this evening.
We did try multiple encoders and they all seemed to be doing the same thing.
Sean
Answer from Tim at ROBOTC
Sorry you’re having trouble with ROBOTC with the Quad encoders. Please
take a look at this troubleshooting document we put together for using
the Quad Encoders with ROBOTC.
The issue seems to be that the wires to the interrupt ports (which
determine direction) are plugged in properly. This is causing the
fluctuation between -2, 0 and 2. ROBOTC counts the encoders by 2s in
order to give an representation in degrees (180 counts/revolution * 2 =
360 degrees). The second wire gets plugged into the Analog/Digital
sensor bank in order to keep count of how many degrees you have
traveled. This seems to be the wire that isn’t plugged in, as the counts
are only fluctuating between positive and negative.
To assist, please take a look at the following document:
http://www.robotc.net/vex_full/reference/hp_quadrature.pdf
If you’re still having trouble after reviewing those steps, feel free to
contact us at [email protected] tonight with your code and we’ll take a
look ASAP.
Thanks!
- Tim Friez
Carnegie Mellon/ROBOTC
That is what prompted us to use a different encoder. We used two different D/A ports (9/10) and two different Interrupt ports (5/6). We have a single encoder on the robot.
I’ll continue to troubleshoot this with Tim and crew over on the RobotC forum. When I find a resolution, I’ll cross post it back here if it applies.
Sean
We replaced it with two more Encoders. Finally, we hit one that worked, but we are still experiencing intermittant functionality with the encoders (watching the devices debugger window). I think it will work; but we are not sure what the actual fix was.
Sean