VEX Quadrature encoder
Hi All,
I am using VEX Quadrature encoder to get the direction and the distance traveled by the Boe-bot.I do not know the circuit and as well as the ways to retrieve these values through the PBASIC.Can anyone help me in accomplishing this?
Thank you in advance,
Lokesh
I am using VEX Quadrature encoder to get the direction and the distance traveled by the Boe-bot.I do not know the circuit and as well as the ways to retrieve these values through the PBASIC.Can anyone help me in accomplishing this?
Thank you in advance,
Lokesh
Comments
· I've attached a bit of coding that I've used several times with good results.
·· The pulses coming into the Stamp have to be relatively slow ( say no more than 10 per second) in order that the Stamp has time to do other things.
· Hope this helps.·
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
I thank you for your reply.I will work on this with your program.If I face any problem,I will post here.
Regards,
Lokesh
Can you please share the circuit diagram for the program that you have attached?
Thank you in advance,
Lokesh
Basically, each encoder pulse is fed into an input ( pin 6 and 7 in the program).
An LED (and resistor) connected to pin 0 turns on if the encoder is going in one direction and off if going in the other.
Pins 8 through 15 show the binary count of the encoder. You can optionally put LEDs (and resitors) on each pin to see the count.
I only needed to count a limited range so I started "counter" at 127. You can put any number you want there.
Cheers,
· <<<<<<<<<<<<< Edit:· Sketch added Dec 2, 2008 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
Post Edited (stamptrol) : 12/3/2008 12:47:24 AM GMT
I thank you once again for providing me further input.I have set the circuit in the way that you have specified.However I am not receiving the desired output when I rotate the motors.
The following is my set up.
1.I took both the black wires of the encoder to the ground.
2.I took both the red wires of the encoder to the +5 V power supply.
3.I connected one of the white wires to the one end of the 100 ohm resistor whose other end goes to PIN 6 of the STAMP.
4.I connected another white wire to one end of another 100 ohm resistor which in turn is connected to PIN 7 of the STAMP.
5.I connected anode of the LED to the resistor that in turn is connected to PIN 0 of the STAMP.I connected cathode of the LED to the ground.
When I run the program,I do not see the LED glowing irrespective of the direction in which the motor is rotating.I would like to know as to where am I going wrong.
Thank you in advance,
Regards,
Lokesh
I haven't used the VEX encoder,But I have a API-HAROWE,inc Quad encoder.It needs at least 7.5volts input to deliver a 4volt output.
I would double check the DOC.s on Your VEX.Any voltage checks/test/changes should be done w/ the VEX removed from the $stamp.as this could exceed the 5volt TTL limit.This is a no no on any I/O pin on the $stamp.
_______Its just a Thought________$WMc%_____
Your connections sound fine......you do have the encoder ground connected to the Stamp ground, right?
Also, don't forget you will be feeding the Stamp 90 pulses per revolution of the encoder. If the encoder spins at any great speed, the stamp won't be able to keep up. If the shaft turns once per second, that's 90 pulses per second which, in my experience, is too fast for the Stamp.
Finally, check the signal level on the white leads with a voltmeter to make sure the high level is somewhere between 4 - 5 volts and that it drops close to 0 volts. Turn the shaft VERY slowly to see the switching action.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
I tried running the program with the circuit but I couldn't get it to work.Is there any ways that you suggest me of troubleshooting this and getting it to work.For testing purpose,I was rotating the shaft by hand.
Thank you in advance,
Lokesh
Are the signal voltages switching between 0 and 5 volts as you rotate the shaft?
Tom
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
The signal voltages are switching between 0 to 5 V when I rotate the shaft.However the range that I get is from 0V to 2.6V.
Regards,
Lokesh
If its only going to 2.6 volts, it won't switch reliably. An earlier post had some information about having to drive the VEX with 7 volts in order that the outputs get closer to 5 volts.
Alternatively, does the VEX recommend pull-up resistors to +5 volts?
T
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·