I am using the Texas Instruments encoder built into the motor Teknic_M2310PLN04K but there are some things I don't understand:
Is the encoder incremental or absolute? In the motor code, the final letter "K" indicates a "Line-driven, single ended TTL" encoder .. but I don't quite understand what does it mean
Is it a quadrature encoder? It has 4000 counts per revolutions and, in the embedded code, the reference manual says to set num_enc_slots = 4000/4=1000 (you use "4" if you think encoder is quadrature encoder .. which I assume).
Plotting to the oscilloscope the signals of the encoder (A, B and Index) I see two 90-degree phase shifted pulses of frequency 30kHz ... while the reference motor frequency (speed) set in code is 30Hz. Is there something wrong with this?
- Once I have the answer to the first two questions, I will search online how it actually estimates the angle. But, if you want to describe it to me, I'll leave this third question open for answers
1 Answer 1
Yes, the encoder is incremental. "line driven" means the output is driven high or low, and does not need a pullup or down to function. "Single ended" means there is only one signal, as opposed to a differential signal. "TTL" means transistor-transistor logic.
It says all over the datasheet that it's quadrature encoding, but you're assumption that quad = 4 in this case is what's confusing you. Quadrature encoding is where two signals from the encoder are 90° out of phase with each other. In this way, you can determine motor direction by which signal is leading the other.
You've bought the part that has 4,000 counts per revolution post quadrature. When you have two signals, you have a total of four combinations (this is the 4 that gives quadrature it's prefix), ie
LOW LOW
HIGH LOW
HIGH HIGH
LOW HIGH
in effect you have now 4 "counts" per revolution. Two signals running at 1Hz, with this 90° phase shift will generate these counts at 4Hz, hence if the specification is 4000 counts/rev, the signals should be running at 1000/rev, so what you're seeing makes perfect sense.
Finally, who do we estimate the angle using this? With difficulty. This kind of encoder is designed to measure speed and direction, rather than angle, but it's not impossible. Simply put, if you know the speed of rotation, and you know how long the motor has been moving for, you can calculate the current angle. This is very much dependent on knowing the starting position of the motor, and is prone to drifting from the true value over time as errors accumulate.
-
\$\begingroup\$ thank you for the detailed answer! Forgive my ignorance, but where is it specified in the datasheet that it is incremental? Texas Instruments provides sensorless and sensored control (using the encoder) ... so I guess the angle is estimated with this encoder (if I'm not mistaken). Otherwise, who estimates it in a sensored control? \$\endgroup\$KaleM– KaleM2025年03月06日 16:50:41 +00:00Commented Mar 6 at 16:50
-
\$\begingroup\$ ti.com/lit/an/sprabz0a/sprabz0a.pdf?ts=1741210109433 \$\endgroup\$KaleM– KaleM2025年03月06日 16:59:50 +00:00Commented Mar 6 at 16:59
-
1\$\begingroup\$ @KaleM it doesn't explicitly use the word incremental, but it's giving details about the quadrature encoding which can only be an incremental. It's better to consider the angle moved per count, which is (360 / total counts per revolution). So for you that's 360 / 4000 or 0.09°/count. \$\endgroup\$LordTeddy– LordTeddy2025年03月06日 18:03:01 +00:00Commented Mar 6 at 18:03
-
1\$\begingroup\$ @KaleM the hardest part is usually finding the starting point with a measure of accuracy. Often this might be done with some kind of sensor that zeros the count when the shaft passes a point, but getting this done as precisely as 0.09° is no small task. \$\endgroup\$LordTeddy– LordTeddy2025年03月06日 18:06:21 +00:00Commented Mar 6 at 18:06
-
1\$\begingroup\$ Yes exactly. Getting a sensor to reliably index the shaft, particularly from both directions, is hard, at least if you need significant accuracy. \$\endgroup\$LordTeddy– LordTeddy2025年03月06日 22:31:22 +00:00Commented Mar 6 at 22:31