Author Topic: Reverse Engineering a DC Motor's Rotary Encoder  (Read 1083 times)

0 Members and 1 Guest are viewing this topic.

Offline DumpsterholicTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: us
Reverse Engineering a DC Motor's Rotary Encoder
« on: August 16, 2022, 06:42:44 pm »
Hi all:

The motor depicted below is 12 years old and no longer listed in the manufacturer's catalog, nor is its built-in encoder. Based on my research so far, two of the five pins are likely +5VDC and GND, while one of the others is directly connected to the slotted disk inside. My question is, how do I go about mapping out the pins for testing? Will I get any meaningful results by Ohming out various pairs of pins, and if so, what sort of results should be looking for? If I were to provide, say +5VDC to the red wire and GND to the green wire, and then manually spin the shaft, would I get any meaningful results if I coupled the remaining pins to an oscilloscope?

My guess is that, properly configured, the encoder's outputs should be two out-of-phase square waves, whose duty cycle will correspond to the motor's speed and direction of rotation. I have not yet done any testing, for fear I may damage the encoder. Is that a reasonable risk, or are those encoders capable of being hooked up "wrong"?
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2767
  • Country: us
Re: Reverse Engineering a DC Motor's Rotary Encoder
« Reply #1 on: August 16, 2022, 10:11:47 pm »
Hi all:

The motor depicted below is 12 years old and no longer listed in the manufacturer's catalog, nor is its built-in encoder. Based on my research so far, two of the five pins are likely +5VDC and GND, while one of the others is directly connected to the slotted disk inside. My question is, how do I go about mapping out the pins for testing? Will I get any meaningful results by Ohming out various pairs of pins, and if so, what sort of results should be looking for? If I were to provide, say +5VDC to the red wire and GND to the green wire, and then manually spin the shaft, would I get any meaningful results if I coupled the remaining pins to an oscilloscope?

My guess is that, properly configured, the encoder's outputs should be two out-of-phase square waves, whose duty cycle will correspond to the motor's speed and direction of rotation. I have not yet done any testing, for fear I may damage the encoder. Is that a reasonable risk, or are those encoders capable of being hooked up "wrong"?
I have a Pittman brushless motor that appears to have the same encoder.  Red is +5V, black is Gnd, and the two wires farthest from black are the A and B quadrature.  The one next to black is the index pulse.  The duty cycle does not change, it should be very close to 50%.  The phase relationship between the A and B changes when the rotation is revesed.  The Frequency is proportional to speed.  I think these pinouts are the same as the HEDS encoders.
Yes, I suspect connecting the power backwards will damage the encoder.  These encoders also need about a 4.7K Ohm pullup to +5V.
Jon
 
The following users thanked this post: Dumpsterholic

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: us
Re: Reverse Engineering a DC Motor's Rotary Encoder
« Reply #2 on: August 16, 2022, 10:36:01 pm »
Looks pretty similar to this one. Are the wire colors the same?
90% of quoted statistics are fictional
 
The following users thanked this post: Dumpsterholic

Offline DumpsterholicTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: us
Re: Reverse Engineering a DC Motor's Rotary Encoder
« Reply #3 on: August 16, 2022, 11:29:24 pm »
  I think these pinouts are the same as the HEDS encoders.
Jon

Jon: Many thanks. Your whole response is gold! Specifically, re: HEDS encoders, I was completely ignorant of that spec, and after a little searching discovered that it has gone through a few permutations. Given the motor's age, I'm guessing that what I have is only a two-channel encoder. When you used the word "quadrature", you nearly provoked a fainting spell in me, as I'm math-deficient, but I took some deep breaths and hope to soon recover from the shock.

Looks pretty similar to this one. Are the wire colors the same?
.

Eugene: Unfortunately, the wire colors do not match up, but the dimensions (roughly 6 inches long and 2-1/4 inches in diameter), are about the same. I noted also that the mass of the motor on the datasheet your supplied is 57 ounces (~3.5lbs or ~1.6Kg), which seems about right--it is one hefty motor. Voltage rating is a little higher, 30.3 vs. 24, but otherwise it looks about the same. My O'scope is in my storage space somewhere; looks like it might be a good time to start digging around in there until I find it.

If I understood Jon's response aright, once I have properly powered up the encoder, I would need to ground both scope probes at the black wire, then connect the probe tips to separate channels, in order to see something like this, which is a screen grab from an informative article posted by Drone Bot Workshop on its Website, which supports an extremely well organized YouTube channel that I highly recommend to other newbies who wish to know more about how to use rotary encoders:
« Last Edit: August 16, 2022, 11:33:21 pm by Dumpsterholic »
 

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: us
Re: Reverse Engineering a DC Motor's Rotary Encoder
« Reply #4 on: August 17, 2022, 12:30:35 am »
It's probably pretty safe to guess that the red wire is VCC and the black one is GND. You should be able to figure out what VCC needs to be; probably 5V. Probe the other three wires with a scope while spinning the motor. Pullups might be required. You can identify the index wire as it will pulse only once per revolution. It's not trivial to distinguish between the A and B signals, but I wouldn't be too surprised if the wire colors are common on that brand of encoder. If you get them backwards it will look to the controller as if the motor is spinning backwards.
90% of quoted statistics are fictional
 
The following users thanked this post: Dumpsterholic

Offline DumpsterholicTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: us
Re: Reverse Engineering a DC Motor's Rotary Encoder
« Reply #5 on: August 17, 2022, 12:34:32 pm »
Thanks, Eugene. I'm still struggling with some very basic concepts with which most readers here are probably quite familiar. For the benefit of those who, like me, slept through math lectures and never enrolled in any electronics courses, I found this Wikipedia article quite useful:

https://en.wikipedia.org/wiki/Incremental_encoder#Quadrature_outputs

Below the article itself are some references; I thought this one in particular did a good job of sketching out the key concepts:

http://engineering.nyu.edu/mechatronics/Control_Lab/Criag/Craig_RPI/SenActinMecha/S&A_Optical_Encoders.pdf

Within that article appears a useful diagram, laying out the basics of the HP HEDS 5505-A14 spec, which I believe may correspond to the encoder I'm attempting to decode:


What I have gathered so far is that the encoder's output consisted of two square waves which were fed into some fancy circuitry for decoding and machine control. I pulled the Pittman motor (and many other useful bits) from a machine that was designed to create mailing labels. It contained a print head, several circuit boards, a couple of beefy EMK AC motors, and a conveyor belt which apparently unrolled blank self-adhesive labels, printed them, and applied them to pieces of mail moving along the belt. In theory, I still have the control circuitry, but in the messy process of disassembling the thing I unplugged quite a few sensors and circuit boards willy-nilly and hence do not expect to ever get them properly re-assembled. But since I have no need for printing masses of mailing labels and am interested only in learning how the encoder works, I simply need to set about designing a test jig consisting of a +5V power supply, some pull-up resistors, and a dual-channel oscilloscope. Based on the feedback so gracefully provided by Jon and Eugene, I think I'm well on my way.
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2767
  • Country: us
Re: Reverse Engineering a DC Motor's Rotary Encoder
« Reply #6 on: August 17, 2022, 02:46:04 pm »

If I understood Jon's response aright, once I have properly powered up the encoder, I would need to ground both scope probes at the black wire, then connect the probe tips to separate channels, in order to see something like this, which is a screen grab from an informative article posted by Drone Bot Workshop on its Website, which supports an extremely well organized YouTube channel that I highly recommend to other newbies who wish to know more about how to use rotary encoders:
You will likely need pull-up resistors to +5V to the A and B signals to get any output.  Anything from 1 K to 4.7 K Ohms should be fine.
The photo you provided shows quadrature, ie. 90 degree phase shift between A an B signals.
Jon
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf