How to put together an HKT30 optical rotary encoder?

I'm working on a project involving stepper motors. It is important for this project to track the position of these motors, so I decided to buy an optical rotary encoder, specifically an HKT30(HKT3005-C03G-1000B-5E) pictured [here](https://www.omc-stepperonline.com/image/cache/catalog/encoder/HKT3008-C03G-1000B-5E 1-1000x1000.jpg). I've found it difficult to find resources on how to put this together. I've found datasheets, like this one, but it does not seem to be made up of the same components I have. I think I've basically gotten the gist of how one puts this together from google images, but I would like to be pointed in the way of an explicit resource in case I damage my parts.
Additionally, I was hoping for an explanation on the 5 wires (red, green, black, white, and gray), their purpose and how to set one up on a board.
If any clarification or images are needed, I would be happy to provide.
Thank you!

Choose stepper motors being up to the task. Using a home switch for calibration/resetting can be needed. Tracking steppers is waisted resources.
If You really want to trace the motor actions, choose DC motors.
In order to "put things together", as I call it, wire the circuits, use wiring diagrams, not pictures.

If the stepper motors are chosen appropriately, you should not need to track the shaft position.

Perhaps you should explain the project in more detail.

I decided to buy an optical rotary encoder

Why buy one without a data sheet?

Hi,

I'm working on a project involving stepper motors.
It is important for this project to track the position of these motors, so I decided to buy an optical rotary encoder, specifically an HKT30(HKT3005-C03G-1000B-5E) pictured [here](https://www.omc-stepperonline.com/image/cache/catalog/encoder/HKT3008-C03G-1000B-5E 1-1000x1000.jpg).
I've found it difficult to find resources on how to put this together.
I've found datasheets, like this one, but it does not seem to be made up of the same components I have.
I think I've basically gotten the gist of how one puts this together from google images, but I would like to be pointed in the way of an explicit resource in case I damage my parts.
Additionally, I was hoping for an explanation on the 5 wires (red, green, black, white, and gray), their purpose and how to set one up on a board.
If any clarification or images are needed, I would be happy to provide.
Thank you!

Can you please tell us your electronics, programming, arduino, hardware experience?
What is your project?

Thanks.. Tom.. :slight_smile:

An encoder doesn't help you all that much because if you need it, it implies that your stepper is missing steps and all that really means is it's not up to the job.

But, if you do need an encoder for some reason, your linked data sheet tells you what the wires are. Black is ground, red is Vcc. Green is the A pulse, white is B and since it's the only one left, I assume gray is Z.

I don't see how much current it draws, but based on how much it outputs, you may be able to power it from your Arduino.

So wire up power and ground and connect the three outputs to Arduino digital pins. Poll them using digitalRead as you turn the shaft by hand. Confirm that Z is less frequent than A & B to prove that the assumption about gray is true.

Eventually, you may want to use interrupts to read the A & B pulses.

TomGeorge:
Can you please tell us your electronics, programming, arduino, hardware experience?
What is your project?

I'm a complete novice. My only experience is working on this project on and off in the last 6 months. The project involves using stepper motors to turn the dial and spheres (the large half-gear shapes on the sides) of a phoropter.

jremington:
If the stepper motors are chosen appropriately, you should not need to track the shaft position.

Perhaps you should explain the project in more detail.
Why buy one without a data sheet?

As for why I'd buy one without a data sheet, I don't know how to read them and I don't understand the importance of them.

wildbill:
An encoder doesn't help you all that much because if you need it, it implies that your stepper is missing steps and all that really means is it's not up to the job.

But, if you do need an encoder for some reason, your linked data sheet tells you what the wires are. Black is ground, red is Vcc. Green is the A pulse, white is B and since it's the only one left, I assume gray is Z.

I don't see how much current it draws, but based on how much it outputs, you may be able to power it from your Arduino.

So wire up power and ground and connect the three outputs to Arduino digital pins. Poll them using digitalRead as you turn the shaft by hand. Confirm that Z is less frequent than A & B to prove that the assumption about gray is true.

Eventually, you may want to use interrupts to read the A & B pulses.

I haven't rigged up the motors yet, so I'm not sure if they'd skip steps. Regardless, it's still important in this project to be accurate, so I'd like some feedback from the hardware that no steps have been skipped as well as a contingency in case power shuts off.
Thank you, I'll test the pins soon.

Railroader:
Choose stepper motors being up to the task. Using a home switch for calibration/resetting can be needed. Tracking steppers is waisted resources.
If You really want to trace the motor actions, choose DC motors.
In order to "put things together", as I call it, wire the circuits, use wiring diagrams, not pictures.

I couldn't find any.

I haven't rigged up the motors yet, so I'm not sure if they'd skip steps.

Before ordering the motors, determine the maximum torque and power your project requires. Buy a motor/driver combination that comfortably supplies twice that, and you never have to worry about skipped steps.

Encoders will not help. Incremental encoders lose position upon power down, just like motors, and it is almost impossible to find absolute encoders that match the motor steps.

Everyone uses some sort of zeroing mechanism (slotted disk or an end stop switch) to home the motor upon power up.

If you expect your project to work as a professionally designed project, you have no choice but to take the same design steps as a professional, or hire a professional.

If a stepper looses steps it might as well stop half way because of not having torque enough. No encoder in the world would help.

Hi,

A phoropter is an instrument used to test individual lenses on each eye during an exam. If, during an eye examination, your doctor has discovered a vision problem like nearsightedness, farsightedness or astigmatism, it's likely that one of the next steps you'll take will involve a phoropter

vt-10.png
Tom.. :slight_smile:

vt-10.png

jremington:
Before ordering the motors, determine the maximum torque and power your project requires. Buy a motor/driver combination that comfortably supplies twice that, and you never have to worry about skipped steps.

How can I determine that maximum torque/power?

jremington:
Encoders will not help. Incremental encoders lose position upon power down, just like motors, and it is almost impossible to find absolute encoders that match the motor steps.

Everyone uses some sort of zeroing mechanism (slotted disk or an end stop switch) to home the motor upon power up.

If you expect your project to work as a professionally designed project, you have no choice but to take the same design steps as a professional, or hire a professional.

So I should look into slotted disks or end stop switches? Will they get in the way of the motors at all?
Thank you!

Can limit switches be used for this purpose as well? If so, how?

The end/limit sensor can be as simple as a piece of white paper on the shaft.
When the shaft rotates, the paper dot will pass in front of a photo detector (opto / transistor)

You interpret that position as zero (or something else), and index your ongoing count position from there.
Even if the motor is rotating continuously, you know where it is, and can count complete revolutions as well.

Since Tom has now reminded us exactly what a phoropter is, a couple of things become clearer (as they would as you adjust the lenses :grinning: ).

Firstly the necessary torque is not substantial, so you should not require very heavy steppers or need to be concerned about stepper slippage if you have adequately engineered it.

Secondly, there is no harm in "zeroing" it on start-up and indeed, each usage, by running it to the end stop. Or you could (in addition) provide a photo-gate/ vane at the optical zero position.

A stepper which is neither excessively powerful nor inadequate will with the necessary precision engineering, perform the job with complete reliability and durability without an encoder. But it is critically dependent on your engineering. A well-made end stop works just fine for a stepper though printers do use limit switches (photo-gate/ vanes) in order to find the zero position without having to attempt to turn the mechanism all the way from the opposite end of travel.

Good introduction to force and torque.

Please describe how you plan to connect the motors to the phoropter, and how they will be supported. That is a more difficult engineering/machining problem than attaching an encoder to a shaft.

If the connection is to be through the knobs that an operator would turn by hand, it would be straightforward to determine the torque required to make the adjustment.

ON the other hand, those devices seem to have detents in order to hold their set position. Motor torque has to overcome the detent force in order to move. Perhaps you can remove the detent mechanism and rely on the stepper motor to hold position. That mean continuous power to the stepper motor and always having the controller board enabled.

Paul

PS. One time at my optometrist, they used an automated machine controlled by a PC. I know it used stepper motors or servos to position the lenses. Other times it was a mechanical device like pictured.

balmybear:
I'm working on a project involving stepper motors. It is important for this project to track the position of these motors, so I decided to buy an optical rotary encoder, specifically an HKT30(HKT3005-C03G-1000B-5E) pictured [here](https://www.omc-stepperonline.com/image/cache/catalog/encoder/HKT3008-C03G-1000B-5E 1-1000x1000.jpg). I've found it difficult to find resources on how to put this together.

I think I recognise that type.

The encoder wheel has a grub screw for attaching it to the shaft, the housing is then assembled free-floating around the wheel, so has to be rigidly mounted in such a way the shaft and wheel don't touch the housing
or optical sensors as they rotate. The encoder doesn't have bearings.

MarkT:
I think I recognise that type.

The encoder wheel has a grub screw for attaching it to the shaft, the housing is then assembled free-floating around the wheel, so has to be rigidly mounted in such a way the shaft and wheel don't touch the housing
or optical sensors as they rotate. The encoder doesn't have bearings.

I tried setting up the encoder but the housing can't close properly around the shaft. The top container has no hole so it bumps against it. Do you know if this means the shaft is incompatible or I'm putting it together wrong? Here's an image.
Thanks!

balmybear:
I tried setting up the encoder but the housing can't close properly around the shaft. The top container has no hole so it bumps against it. Do you know if this means the shaft is incompatible or I'm putting it together wrong? Here's an image.
Thanks!

Your photo should be included in the next post you make, but, the picture does not show any attempt to firmly attach the encoder housing to the stepper motor frame. The normal assembly would be to make the stepper and the encoder both be firmly attached to a single assembly that can be then attached to your project.
Paul

Paul_KD7HB:
Your photo should be included in the next post you make, but, the picture does not show any attempt to firmly attach the encoder housing to the stepper motor frame. The normal assembly would be to make the stepper and the encoder both be firmly attached to a single assembly that can be then attached to your project.
Paul

Could you share an example? I'm having a hard time understanding what you mean.

Hi,
Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Ops image;


And the disassembled assembly. :o