Author Topic: Retrofit encoder interfaces  (Read 1052 times)

0 Members and 1 Guest are viewing this topic.

Offline GUGLHUPFTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Retrofit encoder interfaces
« on: April 04, 2022, 12:21:19 am »
I am a newbie to electronics with only a week or two into it. My project is to replace a non working turning knob on an appliance interface. I desoldered the rotary encoder and looked at its behavior in an oscilloscope.
It is of the type where when you click from one indent to the next it will go low on A followed by B ( and vice versa ) and then go back to zero (no current)  (quadrature encoder). I searched long and far but there is no exact replacement available (PIN distance, mount orientation, shaft length etc. ). I fixed the appliance by buying the whole interface board, but want to learn about electronics.
So I got a different encoder from one of the maker suppliers, the ANO.
This encoder behaves differently. When you go from one indent to the next it will go low for A and B and stay there until the next click where it will go high again. I would like to retrofit the new encoder into the old encoders behavior. I am a software person and this could be done easily with a microcontroller, but I would like to learn electronics and I am certain this can also be achieved with a couple simple components.

I saw a Youtube video "How To Use A Rotary Encoder Without Software" where the person shows some tricks with electronic components. It's not the easiest to understand for a beginner and either way his output is not what I need.

My expectation for drop-in of the new encoder into the old interface board AS IS WITHOUT ANY LOGIC CONTROL is that a) at best only every other click will work b) since the new encoder stays high(low) until the next click the load on the interface board will be high and depending on how it is sourced may destroy the board ( I think microcontrollers can only source for a small current or short time ).


Can somebody guide me along for an electronics interface circuit that can do what I want? I can research this in more detail but don't know where to start. I saw Flip Flops, Multivibrator or logic gates. I am sure one or a combo can achieve the behavior.
Thank you
 

Offline JuanGg

  • Regular Contributor
  • *
  • Posts: 193
  • Country: es
    • My personal blog
Re: Retrofit encoder interfaces
« Reply #1 on: April 07, 2022, 09:38:45 am »
Hi, I would advise you to mention the part numbers of the old and new encoder, and skecth out the waveforms that each produces. Their datasheet should help. You can then work from there. Some reverse engineering of the interface board may be in order (just the section that interfaces with the encoder). Are you certain that the encoder was at fault in the first place?
    Juan

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6228
  • Country: es
Re: Retrofit encoder interfaces
« Reply #2 on: April 07, 2022, 09:53:28 am »
As fas as I know all encoder work in quadrature mode?





Better you explain further that strange signal you're describing.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1767
  • Country: se
Re: Retrofit encoder interfaces
« Reply #3 on: April 07, 2022, 02:25:05 pm »
As fas as I know all encoder work in quadrature mode?
Yes they do, but there are variation in the quadrature signals' edges with respect to the the detents and also to each other (as in how close they are during the rotation).
The OP seems to have a "half step" encoder, i f I understood correctly their description (please provide the part number).
Only one transition, either H->L or L->H, will happen on each phase when stepping from one detent to the next.

I don't think there is an easy way to transform it in a "full step" encoder with a handful of components (I could think needing at least a couple of suitably timed monostable triggered by either rise or fall of each phase - a simple 74xx123 won't probably do).

As for the worries about overloading or damaging the logic board, a correctly designed input circuitry should not really care.
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: GUGLHUPF

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2647
  • Country: us
Re: Retrofit encoder interfaces
« Reply #4 on: April 07, 2022, 05:10:32 pm »
Both pins (A and B) return high when you stop turning the Bourns PEC11 Encoders I have been using.  This sounds like the behavior the OP is describing.

For a hardware circuit, I found this one with logic chips a long time.  But, never tried it.

 

Offline mazurov

  • Frequent Contributor
  • **
  • Posts: 524
  • Country: us
Re: Retrofit encoder interfaces
« Reply #5 on: April 07, 2022, 05:46:26 pm »
Some encoders output a sine wave (example pictured). The drive circuit looks similar to one posted by @MarkF. If your appliance is 40-ish years old you may want to drive the encoder with a power drill when probing :-).
With sufficient thrust, pigs fly just fine - RFC1925
 

Offline GUGLHUPFTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Re: Retrofit encoder interfaces
« Reply #6 on: April 08, 2022, 02:51:28 am »
Sorry, not only am I new to electronics, but also to this forum. So I didn't see the responses until now. Thank you.

What Newbrain says seems to jive with what I am seeing. I see on one click the signal going high on both channels and staying there and on the next click it goes down and stays there. Also when I checked my solder connections I got connection between all of common+A+B in one position so I think this jives with that too. Here is the new encoder https://learn.adafruit.com/ano-rotary-encoder

I watched so many Youtube videos about multivibrators, RS latches, flip flops and more. My head smokes. Aside from learning all these new things I partitioned the problem in my head how I would program it. For when both channels go high and stay there I thought I will devise something to bring it down to zero after a while ( like the original encoder). So I just experimented with a RC circuit and a PNP. My theory is that the PNP will shut off when there is enough voltage on the base ( equal to the source voltage ) and so I can get my output low. Like the old encoder I should see a signal which then goes to zero. This should work for the pulse up. For the pulse down from the encoder I don't know yet. Maybe something like discharging the capacitor that brings the base of the PNP to 0 and it will start conducting again, but then what will charge it.  But I am just making stuff up in my head. I am sure there is stuff with comparators or things that can be tried.

This is one click https://photos.app.goo.gl/9oqQMYmUprqyXRXz7
This is the next click https://photos.app.goo.gl/9oqQMYmUprqyXRXz7

Maybe I try MarkFs circuit, but it's complicated for a beginnner (nor do I have the parts yet _. Maybe better to work up from simple stuff, fail or stall and try something new. I will need to get the parts.


I am not sure it was the encoder JuanGg. But this is almost besides the point. Now, I just want to learn how things work and hack into them. That's best done with a real world problem.

----
At the high probability I don't know what I am doing I went back just now with a multimeter and all I can say is that it seems on one click there is a connection between A-C-B and on the next click  there is non. Not sure if I don't know how to read a MM. I meant to go into the Arduino library to look through it. This will tell me how the encoder behaves.
« Last Edit: April 08, 2022, 03:00:58 am by GUGLHUPF »
 

Offline GUGLHUPFTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Re: Retrofit encoder interfaces
« Reply #7 on: April 08, 2022, 04:21:11 am »
I found this in the data sheet.

Number of detents: 24
Pulse/Rotation: 12/360

Does this not say exactly what I say. It needs two clicks for a full pulse. One upward, the next click down.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1354
  • Country: si
  • I like to measure things.
Re: Retrofit encoder interfaces
« Reply #8 on: April 08, 2022, 11:56:32 pm »
Your problem sounds a lot like the one I've faced some years ago. The solution was simple, but irritating.

A) Learn
C) my mistakes.
B) from
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf