Hi,
I posted this topic before and thought I had an answer but as I study the eQEP module more, I now have more questions. I'm not sure what I want to do is even possible but I'm leaning on the experts here to see if I can use the eQEP in a creative way.
I'm trying to use my Hall input as my period T and count system clocks between the period T as position. It looks like the eQEP module wants to count QCLKs (which come from my Hall input) and use the system clock to determine the period T. The nice thing about the eQEP module is it gives me speed and position that I need for FOC. I'm of the understanding that I need 500+ counts (per electrical rotation) to get enough resolution to run the FOC. The most I could ever hope for from 3 Halls is 6 edges and that's just not enough resolution for FOC (or am I wrong?).
My idea is to count the time between Hall A pulses and use that to determine speed and position. How?
HallA to HallA = period T
Count system clock (deltaT) from HallA to HallA => n * deltaT = period T. Period T needs to be stored in (QPOSCMP?) every time the counter gets reset by the next Hall A.
Speed is k1/T, where k1 is in units of RPM * t. The shorter T, the higher the RPM. A similar constant (k2) can be used to calculate angular velocity for the FOC.
Position (or theta in angular rotation) is 2pi*(n*deltaT)/(period T). If there are 2000 clock counts between HallA ticks (QPOSCMP?) and there are 500 clocks in the register (QPOSCNT?), I'm at 90 degrees.
It appears the eQEP module has everything necessary to do the above but I just have to stand it on its head because it wants to count QCLKs instead of system clocks and it wants to use UTOUT (derived from SYSCLOCK) as the period T.
I may not be exactly correct yet in my math above but right now I'm going for concept. I just tried to put enough math in to give the idea of what I'm trying to accomplish.
It looks like I need to use the eQEP Edge Capture function but again, I need to swap the use of my HallA and UTOUT.
Thanks,
Rick