This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Ti Community!
I'm working with the TMS320f28335 and using the eQEP Module. I got a motor witch give me a special quadrature pulse signal.
It looks like the folowing scheme:
Count | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 |
Channel A | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
Channel B | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
Index | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Its easy to see that the index signal is a complete Channel A period long, and the eQEP documentation permit a Index Signal like this (at the beginning of the Document --> Gated Index Signal). But I get a lot of problems when I implement it in the DSP.
The Counter Register of the QEP modul reset twice - first at the normal 0 Position and then at the Position 2.
TI Specialist, did you have a solution or Idea for that ?
Thanks a lot,
Heiko
Heiko,
Have you verified the signals going into the eQEP module match your description? I would recommend scoping the signals first to check for noise and false edges.
Regards,
Daniel
Heiko,
The position counter can be reset from a number of different registers. I'd recommend checking to make sure it is only configured to be reset by an Index Event and not by position compares or timers as well. If you would like, you could post your QEP initializations here for us to take a look at.
Nishant
Hi Nishant,
here is my Init Code...
EQep1Regs.QUPRD=1500000; // Unit Timer for 100Hz at 150 MHz SYSCLKOUT
EQep1Regs.QDECCTL.bit.QSRC=00; // 0 = QEP quadrature count mode Quadratur Mode
EQep1Regs.QEPCTL.bit.FREE_SOFT=2; // Debug Mode
EQep1Regs.QEPCTL.bit.PCRM=00; // PCRM=00 mode - QPOSCNT reset on index event
// PCRM=01 mode - QPOSCNT reset on maximum position
EQep1Regs.QEPCTL.bit.IEI = 00; //0x02 Initializes the position counter on the rising edge of the QEPI signal (QPOSCNT =
//0x00 Do nothing
EQep1Regs.QEPCTL.bit.QPEN = 1; //eQEP position counter is enabled
EQep1Regs.QEPCTL.bit.QCLM=0; // Latch on CPU read
EQep1Regs.QPOSCTL.bit.PCE = 1; // Enable position compare unit // Achtung kann zum Ausgang werden
EQep1Regs.QEPCTL.bit.QPEN=1; // QEP enable
EQep1Regs.QCAPCTL.bit.CCPS=7; // 1/128 for CAP clock
EQep1Regs.QCAPCTL.bit.CEN=1; // QEP Capture Enable
EQep1Regs.QPOSINIT = 0; // Starting at 0
EQep1Regs.QPOSMAX = 0xb; // Max 12 States QPOSCMP
EQep1Regs.QEINT.bit.PCM = 1;
EQep1Regs.QEINT.bit.QDC = 1;
Heiko,
You may want to try setting EQep1Regs.QEPCTL.bit.PCRM to 01. Since you have configured QPOSMAX to be the amount of Quadrature Events in one revolution, this should create the same result. Setting PCRM will reset the Counter Register on the first Index Event only, and also on each subsequent QPOSMAX match, achieving a result similar to what I believe you are trying to get to now. Although I do not see any reason from your configuration for two resets to occur, the signals from your QEP do not seem to all be in the right phases, so this may be producing incorrect triggers.
On another note, I see you are enabling the Position Compare and setting it for an interrupt. Did you initialize QPOSCMP for a value to "compare" to? Just to be safe, make sure there are no other lines in ISRs or other parts of code that are resetting the Counter Register at an undesired time.
Let me know if this works.
Nishant
Hi Nishant,
no, the Interrupt and the other Configuration works with a Index Signal with is one Signal Change (Step) long...
Reset at the Maximum Position let me help to ignore the Index Signal - I know the Step at the beginning of the initialization and set the CNT Register with that start val.
Here you will see a Diagramm of a better QEP Encoder Signal, and the DSP Togle Signal (on Reset Toggle Input 1, Step Change Toggle Input 0) Input 3-5 are the Encoder Signal.
There ist a other option in the Manual - but no description: what does the IGATE Bit in the QDECCTL Register do ? A gate with the strobe ? Can you please explane it ?
Heiko,
The strobe is a trigger/sensor that can be used to measure whether the system has reached a certain point in space. It is not a direct part of the encoder itself. As an example, suppose the encoder is on a rotational gear, and the gear is moving a part of a system in a certain direction, say to the right. As the gear and encoder rotate, after the part of the system moves far enough to the right, it can set off a "strobe" to let the encoder know it has travelled a certain distance to the right. I have not had any practical experience with it, but this is my understanding of it.
Is the system still resetting twice after configuring it for reset on max position?
Nishant
Hi Nishant,
sorry for the late response...
The Problem is unfortunately not sloved! It's not clear for me what Ti mean with the gatet Index Event at Page 9 oft the http://www.ti.com/litv/pdf/sprug05a - here are some Questions:
a) Can a Index Signal be
longer than 1 State - like the Blue and green Table ?
b) What is a Index Event, a rising Index Edge (like the green Table) or a falling Index Edge (like Red and Blue) - i just find the option to negate the Index-Input, but not a description if the Index Event occours at the rising/falling Index Edge.
at the moment sometimes I get a Result State like the Green an Sometimes like the Blue Table
c) How can I configure the QEP Module to get every time the Same Result with a Encoder Source like Table Blue ?
Thanks a lot!
Regards,
Heiko
State | A | B | Index |
0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
2 | 1 | 1 | 0 |
3 | 1 | 0 | 0 |
4 | 0 | 0 | 1 |
5 | 0 | 1 | 1 |
6 | 1 | 1 | 1 |
7 | 1 | 0 | 1 |
State | A | B | Index |
0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
2 | 1 | 1 | 0 |
3 | 1 | 0 | 0 |
4 | 0 | 0 | 0 |
5 | 0 | 1 | 0 |
6 | 1 | 1 | 0 |
7 | 1 | 0 | 1 |
State | A | B | Index |
4 | 0 | 0 | 0 |
5 | 0 | 1 | 0 |
6 | 1 | 1 | 0 |
7 | 1 | 0 | 0 |
0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
2 | 1 | 1 | 1 |
3 | 1 | 0 |
1 |
Hi Nishant,
sorry for the late response...
The Problem is unfortunately not sloved! It's not clear for me what Ti mean with the gatet Index Event at Page 9 oft the http://www.ti.com/litv/pdf/sprug05a - here are some Questions:
a) Can a Index Signal be
longer than 1 State - like the Blue and green Table ?
b) What is a Index Event, a rising Index Edge (like the green Table) or a falling Index Edge (like Red and Blue) - i just find the option to negate the Index-Input, but not a description if the Index Event occours at the rising/falling Index Edge.
at the moment sometimes I get a Result State like the Green an Sometimes like the Blue Table
c) How can I configure the QEP Module to get every time the Same Result with a Encoder Source like Table Blue ?
Thanks a lot!
Regards,
Heiko
State | A | B | Index |
0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
2 | 1 | 1 | 0 |
3 | 1 | 0 | 0 |
4 | 0 | 0 | 1 |
5 | 0 | 1 | 1 |
6 | 1 | 1 | 1 |
7 | 1 | 0 | 1 |
State | A | B | Index |
0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 |
2 | 1 | 1 | 0 |
3 | 1 | 0 | 0 |
4 | 0 | 0 | 0 |
5 | 0 | 1 | 0 |
6 | 1 | 1 | 0 |
7 | 1 | 0 | 1 |
State | A | B | Index |
4 | 0 | 0 | 0 |
5 | 0 | 1 | 0 |
6 | 1 | 1 | 0 |
7 | 1 | 0 | 0 |
0 | 0 | 0 | 1 |
1 | 0 | 1 | 1 |
2 | 1 | 1 | 1 |
3 | 1 | 0 |
1 |
the next questions:
whats the diference between the PCRM and the IEI Signal - does the Index Event (whatever it is) or the rising/faling Edge reset the Counter ??? to use both at the same time do not make sense....
Hi Heiko and TI expert,
I have met the similar problem on f28335, in which the index signal has caused the mutiple reset within each revolution.
Would any of your expert, could please provide some hints on this?
Rgs
Nathan
I have sent the folowing files to the TI Support, I haven't got a response - they working verry strong on it ;-)
Did you ever get an answer on this? I think I am running into the same issue.