View Full Version : ServoPod, Quadrature Encoder Help.
Can somebody please help, i need an up to date example of a Quadrature Encoder program made for the SERVOPOD, i have, phase A, Phase B and an Index interface, gnd and pwr.
I would like to test my encoders.
The example "Quadrature Generator" is i think made for isopod, i just do not have the time to figure out that program, and then add all the I/O's point required for the servopod.
Any help will be appreciated.
Thank you for your time
The Dr
nmitech
11-21-05, 12:23 PM
To use the "Quadrature Generator" example code for the ServoPod, simply add 400 (hex) to offset all the I/O addresses.
i.e.
( QUAD CH GEN MADE OUT OF TMRB0/1
0000 D26 400 + ! ( CTRL TMRB0 STOP TIMER WHILE INIT
FFFF D20 400 + ! ( CMP1 FOR OVERFLOW
0000 D21 400 + ! ( CMP2 FOR UNDERFLOW
0001 D23 400 + ! ( CMP2 FOR UNDERFLOW
0001 D25 400 + ! ( COUNTER
2C33 D26 400 + ! ( CTRL TMRB0
0001 D27 400 + ! ( STATUS
....
....
E5D 400 + @ 0080 AND REDLED SET ( QUAD DECODER INPUT PH A
E5D 400 + @ 0040 AND YELLED SET ( QUAD DECODER INPUT PH B
E5D 400 + @ 0020 AND GRNLED SET ( QUAD DECODER INPUT PH IN
....
....
Great Thanks,
How about the I/O's, are the points indicated in the program setup for Servopod's J10 interface (PhaseA1 TB0, TB1 etc) it is a little unclear.
I am new with the servopod, so if you can help i would appreciate it.
Thank you in advance
Marcel....
RMDumse
11-21-05, 06:44 PM
Quick way to understand is to go to the schematic:
http://www.newmicros.com/store/product_schematics_pdf/ServoPod.pdf
The signals are pretty clearly labed, on J10.
Starting at the top (same end as serial cable, starting just behind the serial connector) and three columns in (which are the three columns of J9) and moving down the fourth column (first in J10) from the top pin, you have:
+5
GND
Phase0(TA0)
Phase1(TA1)
Index (TA2)
Home (TA3)
+5
GND
Phase0(TB0)
Phase1(TB1)
Index (TB2)
Home (TB3)
So these are pretty nicely set up to receive encoder signals. The +5 and GND are there, since most encoders require power, and then the encoder phases, then the index (if you use it) and home (which is even less often used). The pin outs of encoders tend to vary, so you may need to make an adapter and swap these signals into the order they appear on your particular encoder pinout.
The other two columns of J10 are mostly power and gnd for servo connections if you use these as RC Servo output connectors, rather than as encoder input connectors.
what i was asking, in the Quad Programme, the I/O's are listed as
"TMRB0" etc,
I do understand the pin layout on the servopod J10.
Let me try to clarify my question
Is TMRB0 the same as phaseA1(TB0) on the servopod J10 or, is it something other than that, will the programme respond to TMRB0 as the correct pin on J10, or do i have to change the programme to reflect the configuration TB0, as indicated on J10 and not TMRB0 as indicated in the programme????
Thanks
Marcel...
RMDumse
11-21-05, 11:31 PM
Oh, yes, TMRB0 is short for Timer B0. TB0 is an even-shorter alias for Timer B0. The Phase names are for the quadrature inputs. The quadrature inputs share pins with the timers, which can be either inputs or outputs, depending on how they are programmed.
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.