Looking for someone to develop a quadrature encoder counter module
As it is very difficult to read quadrature encoders with a Basic Stamp, I'm looking for a dedicated module, like those existing for driving DC or stepper motors. But it does not seem to exist. There are some specialized IC, like the LS7366, but they seem to be very hard to found and buy (at least from France), and they take a lot of place on a board, especially when you need 2!
So, I was wondering if someone could develop such module, able to read 2 encoders providing signals up to 5kHz, store their position in a 24bits counter, and communicating through a simple serial interface? I think that it could be made from a PIC 12C508 or so...
If someone is volonteer, please let me know.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
So, I was wondering if someone could develop such module, able to read 2 encoders providing signals up to 5kHz, store their position in a 24bits counter, and communicating through a simple serial interface? I think that it could be made from a PIC 12C508 or so...
If someone is volonteer, please let me know.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
Comments
IN the SX/B examples their is a Quadrature encoder reader project that displays the value to a 7 segment display this example could be modified to do what you want.
Is it like this? http://zone.ni.com/devzone/cda/tut/p/id/4763
Tiny11 will work as well for one if it is like the one in the link above. If you have a sync signal as well we can add that.
Of course output is necessary as well. Do you want shiftin and shiftout commands, that would be best.
Also I would add a zero feature to zero the counter. You would use one chip per encoder. This should work up to 100Khz I think.
Code so far will keep a 16 bit value updated forwards and backwards. It will roll over at 0000 to FFFF or FFFF to 0000.
.include "tn11def.inc" ; 3.17mA active ; 1MHZ internal oscillator ; 8 pin DIP ; Pin 6 input A PINB1 INT0 INterrupts on any change ; Pin 5 input B PINB0 .def temp = r16 .def encL = r17 .def encH = r18 .def tempsreg = r19 rjmp RESET ; Reset handler rjmp EXT_INT0 ; IRQ0 handler rjmp PIN_CHANGE ; Pin change handler rjmp TIM0_OVF ; Timer0 overflow handler rjmp ANA_COMP ; Analog Comparator handler RESET: ldi temp,(1<<INT0) out GIMSK,temp ldi temp,(0<<ISC01)|(1<<ISC00) ;Any change on INT0 out MCUCR,temp ldi temp,(1<<ACD) ;Disable Analog Comparator (to save power) out ACSR,temp SEI MAIN: rjmp main EXT_INT0: ; IRQ0 handler in tempsreg,sreg sbis portb,0 ;skip next instruction IF B channel is high rjmp Forward rjmp Backward forward: inc encL brne exitint inc encH rjmp exitint Backward: cpi encL,0 brne skipH dec encH skipH: dec encL exitint: out sreg,tempsreg RETI PIN_CHANGE: ;Pin change handler RETI TIM0_OVF: ; Timer0 overflow handler reti ANA_COMP: ; Analog Comparator handler RETI
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
Post Edited (metron9) : 6/7/2007 5:49:11 AM GMT
@metron9: yes, the signals are like the ones described in your link. If you can help me on this project, please contact me in private; I will give you more informations, and explain what it is for.
Thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Frédéric
The nice thing about this encoder is if your stamp is delayed in processing for a bit, you don't have to worry about missing a "tick" from the quadrature encoder. You just re-read the voltage and you know where it is.
Good luck.
Jeff
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
I hope this helps
Randy A.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fr
To date, this code will support one encoder. You would need two AVRs to deal with two encoders. Future versions could well support two encoders in one chip.
-Phil
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Frédéric