2

I'll preface this by saying that I know nothing about electronics and have never held a soldering iron in my entire life.

I am a pathologist by profession. I am trying to design a controller that mimics the X- and Y- adjustment knob of my microscope to serve as an USB input device that can control the x and y axis of my digital slide.

In the physical microscope, the knob has two rotating knobs mounted on a single metal shaft, each of which can rotate independently of each other. One knob controls the movement of the microscope slide in the X axis, the other control the movement of the slide in the Y axis, by moving the slide holder on the stage, enabling me to navigate around the glass slide placed on the microscope

In my institution, we use digital pathology, which is a scan of a glass slide viewed on a computer. Navigation is usually done by dragging on the image with a mouse, or by pressing arrow keys. I want to be able to make a controller which translates movements of either knob into left/right and up/down arrow key presses.

Something already exists in the market, but I want to try to build one myself. The available one looks like this:

Text

From what I have googled, my best chance is using a incremental rotary encoder with an Arduino microcontroller, something like in this video.

This sort of incremental rotary encoder only allows for translation of one direction of movement. How can I rig up two incremental rotary controllers to accept inputs in both X and Y axis from two shafts that are coaxial?

JRE
  • 67,678
  • 8
  • 104
  • 179
user329958
  • 21
  • 1
  • For me and many others here, the mechanical design would be the hardest part. If you can buy one of these, what is your goal. To learn? To make a better one? – Mattman944 Jan 07 '23 at 09:00
  • The missing keyword for the necessary electronics is a **concentric** rotary encoder. Off the shelf concentric dual rotary encoders exist, that is, encoders that feature two independent sensors but mechanically in the same axis of rotation. For example : [this](https://www.mouser.com/ProductDetail/Bourns/PEC11D-4120F-H0015?qs=gZXFycFWdAOSJnQVihOhZg%3D%3D) – crasic Jan 07 '23 at 09:42
  • Most software uses a click and drag to move in xy but a HID (human interface device) USB interface device is interesting. – D Duck Jan 07 '23 at 18:01

2 Answers2

6

What you are looking for is a "dual concentric encoder." It may also be found by searching for a "coaxial encoder."

These will have two shafts, each with an encoder. The encoders will be stacked, one behind the other. The front encoder will have a hollow shaft to pass the shaft from the encoder in back.

You'll need to find knobs that fit on the differntly sized shafts - the encoder manufacturer will probably also have a line of accessories including knobs. They will be sold separately.

Most of them will have a pushbutton. You can use the two encoders to move the cursor then push down on the top knob and click the button to make a selection.

Here is an example:

enter image description here

I also found kits for hobbyists that include a small PCB and the knobs:

enter image description here

  • You will need an Arduino that can be used as a "human interface device" (HID.) Not all Arduinos can do this. Ones that can: Leonardo, Micro, Zero and Due.
  • You will need a library to read the encoders.
  • You will have to write a program for the Arduino to read the encoders and emit keyboard commands over the USB HID functions of the Arduino.
  • You will have to build a small housing to hold the Arduino and the encoders. It will need to be ergonomic (easy and comfortable to use) and not (too) ugly.

You've picked a large project for your first attempt. You will probably have lots of questions. Ask new questions here (EE stackexchange, not in this question,) but try to solve the problems yourself first. Explain what you need to accomplish, what you have tried, and where you got stuck.


The parts and libraries are only examples. They may not be appropriate for your project. I put them in as examples of what you need to look for, not as recommendations.

JRE
  • 67,678
  • 8
  • 104
  • 179
2

Seems you want to reinvent the inner workings of a roller ball computer mouse. If you happen to have one of these old school things you could open it up and get some good ideas for your project. These used a ball that rolled up against two wheels (90 degrees apart) and each contact wheel turned another rotary encoder wheel. There are holes in the encoder wheels that pass light from an LED onto an optical reader. the light pulses tell the encoder how may pulses the wheel turns and in which direction it is rotating. The mouse circuitry then sends encoded data to the PC that is converted into XY motion of the screen cursor.

If you buy two sets of rotary encoders you should be able to feed the pulses to an Arduino like module that could then send code back to a USB port. Some of these modules are available in very small footprints now a days, even some with the USB connectors included. Look up some of the different Arduino copy-cat modules with the options you may need. Most of the code snippets you would need are likely already written and freely available, (even from the shops that sell the modules).

If the only remaining issue is the mechanical connection of the encoder shafts then find a location on (or inside) your original motion control system where the XY rotations are separated. You would just need a contact wheel or a gear set going between the rotating component and the encoder shaft. Be sure that the rotation ratio is the same once the motion gets to each encoder shaft.

Nedd
  • 7,939
  • 15
  • 19