The lost Optical Encoder Demo Box

Optical ENcoder Demo Box Main Menu

We recently teamed up with one of our distributors to create a Demo box that showcased our QD145 optical encoder with a Delta Tau PLC and touchscreen panel.  It was sent off to a trade show where potential customers would get to spin the encoder and watch on the screen as counts were incremented and decremented and needles on dials spun.

I thought the Optical Encoder Demo box would make for a fantastic topic to write a post on, so that was my plan as soon as the demo box returned from the show.

Well… it never did come back.  I would love to tell you that I did such a great job on it that our distributor insisted on keeping it but the truth of the matter is that it was lost in shipping.

What I do have is the code and screenshot of the Optical Encoder Demo box, which should be more than enough to explain the functionality. What I don’t have are pictures, or video of the Optical Encoder Demo box in action, so you will have to use a little imagination on your part.
I  mounted the PLC, HMI and encoder to an enclosure that can set on a table.  The default screen (shown above) tells a little about the encoder. From this screen you can select a few different screens that allow you to interact with the encoder.

Count Screen:
This screen shows Pulse Count, Angle, RPM and direction.

Optical Encoder Data Screen

Degree Screen:

This screen shows mechanical degrees. The needle rotates in conjunction with encoder rotation:

Optical Encoder Mechanical Degree Screen

Pulse Count:
This screen shows the direct read count of the encoder, the needle rotates in conjunction with  encoder rotation:

Optical Encoder Pulse Count Screen

Tank Screen:
This is sort of a fun screen where rotation the encoder fills tanks in sequence, tank one fills, when tank one is full it “empties” into tank 2, when tank 2 is full it “empties” into tank 3.  Tank 3 continues to accumulate until 2 billion counts or so. The Drain button clears the levels on all of the tanks.

Optical Encoder Tank Filling Screen

ABZ screen:
This screen indicates status of inputs coming from the encoder.  Since I used a 5000 LC encoder, the screen was not be able to keep up real time when the encoder was rotated really fast, and it was nearly impossible to land on Z(Index) and have it light.

Optical Encoder Incremental Signals Screen

Programming

The Delta Tau was pretty easy to program, with only a couple hiccups.  The manual was a little vague in its explanation of the way two registers were used for some of the counter functions, but a little troubleshooting showed me which bits were activated when the counter set point was hit.

The Ladder Logic

This first rung of code is needed to do some basic housekeeping to ensure that D1022 is properly configured with a “1” on the first program scan. It is set by  M1002 and forever latched by M110.  The value of 1 tells the high speed input that we want a double frequency selection A/B phase counter.

The second rung sets up our high speed counter and checks the count to see if we have gone negative in value. If so, bit M120 is set high.

Rung three turns on a physical output Y11 if the counter set point has been hit.

Rung four moves the set point of 5000 back into the counter if we have gone negative in value. This allows the needles on our display screens to rotate continuously and not peg out to a high or low value.

Rung five updates Register D300 with our counter value every 10mS via the handy M1011 10 mS clock pulse.

Rung six divides the counter value by 16 and moves the answer into Register D302. This is where we start our math for the degree conversion. The rest is scaled by the configuring the screen register in the screen editor software.

Run seven uses the trailing edge of our 10 mS clock pulse to move the counter value into register D310.  This value is held for comparison in time to get RPM.

Rung eight uses the leading edge  of our 10mS clock pulse to find the difference in our stored value and put it out to register D312.  D312 is then doubled and sent out to register D350.

For any of you interested in repeating the project, I have included the BOM below.

Of course, I also used some miscellaneous wire and hardware to construct the Optical Encoder Demo box, but the list below includes all the big ticket items.

From Cymatix:

QD145-5/26-5000-0-02-T1-01-02 Optical Encoder

DOP-AS35THTD 3.5” Color touch screen

DVP12C11T Micro programmable Logic controller 8 inputs 4 High Speed outputs

DRP024V060W1AZ CliQ 24 Vdc, 60 Watt power supply

DVPACAB2A30 3 Meter connection cable

 

From Automation Direct:

DN-R35S1 Din Rail 35mm X7.5mm

WC12C12  N12 Desktop enclosure 12”X12”X9”

DN-T12A Terminal Blocks

DN-EB35MN End Brackets

DN-LAB terminal block labels

Advertisements

Why do my optical encoder signals look this way?

I received an email from a customer who was seeing “not symmetrical” data channels on some optical encoders we shipped to them

Hi Jim,

The data channels are not symmetrical and there appears to be something superimposed on the index. Attached are pictures. Can I return these for your evaluation?

Regards,

Al

Below are the screen shots that he sent:

Read more of this post

Brushless Motors vs Brush Motors, what’s the difference?

What’s the difference between a Brushless Motor and a Brush Motor?

Well, the brushes of course.

Yeah, but what does that mean?

The principle behind the internal working of both a brushless DC motor and a brushed DC motor are essentially the same.  When the motor windings become energized, a temporary magnetic field is created that repels(and/or attracts) against permanent magnets.  This force is converted into shaft rotation, which allows the motor to do work.  As the shaft rotates, electric current is routed to different sets of windings, maintaining electromotive repulsion/attraction,  forcing the rotor to continually turn.

Construction differences

Brushes inside  electric motors are used to deliver current to the motor windings through commutator contacts.  Brushless motors have none of these current carrying commutators.  The field inside a brushless  motor is switched via an amplifier triggered by a commutating device, such as an optical encoder.

Windings are on the rotor (Rotating part of motor) for brush motors and on the stator (stationary part of motor) for brushless motors.

Brush Motor: windings on rotor, magnets on stator

Read more of this post