Connect with us

New to encoders and need assistance...

Discussion in 'Sensors and Actuators' started by Cliff T., Mar 8, 2021.

Scroll to continue with content
  1. Cliff T.

    Cliff T.

    4
    0
    Mar 8, 2021
    Hi group,

    I am in the beginning phases of designing an automated backlash test bench at work which will require the use of an encoder. My issue is this will be the first time Playing with encoders and have very little practical working knowledge of them. Would anyone in this group know of any resources for me to gain insight into wiring and application? I also have a question about a baumer encoder I was given to "learn" on; the pin assignments have one wire called out as "F/R" and another as "DV", could anyone explain what these mean? Thank you all in advance for your time and have a great day!
     
  2. bertus

    bertus Moderator

    1,611
    638
    Nov 8, 2019
    Cliff T. likes this.
  3. Cliff T.

    Cliff T.

    4
    0
    Mar 8, 2021
    I have an older BFG 1G.24C8192-B2-A model that has been phased out (apologies for not providing that information up front). I was able to get the spec sheet from Baumer, it is attached.
     

    Attached Files:

  4. bertus

    bertus Moderator

    1,611
    638
    Nov 8, 2019
    Hello,

    In the datasheet I found this:
    BFG comments.png
    The F/R* seems to be an input singnal.
    The DV is an output signal for Data Valid.

    Bertus
     
    Cliff T. likes this.
  5. Minder

    Minder

    3,058
    651
    Apr 24, 2015
    Generally the most common encoder, is the differential Quadrature encoder variety.
    The have two pulses to indicate rate rotation and direction.
    The two pulses are 90 deg. apart, hence Quadrature encoder.
    Many also a one-per-rev pulse, AKA marker pulse for the purpose of obtaining a zero position on power up.
     
    Cliff T. likes this.
  6. Cliff T.

    Cliff T.

    4
    0
    Mar 8, 2021
    Would this encoder be able to be wired to a RS 485 interface using just the clock and data outputs and if so how would I go about doing it? Again, apologies in advance for the rudimentary questions...
     
  7. Minder

    Minder

    3,058
    651
    Apr 24, 2015
    Possibly, but then you are going to have to decipher the information.
     
    Cliff T. likes this.
  8. Cliff T.

    Cliff T.

    4
    0
    Mar 8, 2021
    To expound a little further, I am currently using a productivity 1000 PLC that does have an "encoder" parameter so my thought process is if I can get the 4 wires (clock +/- and data +/-) wired to the RS 485 port correctly then it should be a short jump to getting understandable data.
     
  9. hevans1944

    hevans1944 Hop - AC8NS

    4,581
    2,142
    Jun 21, 2012
    @Cliff T. The datasheet indicates that you have an absolute encoder with a gray-coded output bit stream pattern. @Minder in his post #5 mentions the more common (and much less expensive) differential encoder with two quadrature outputs, but this is not what you have, nor is such an encoder particularly advantageous for automatic backlash measurements, for reasons that I need not discuss here. You probably already know that your absolute angular position encoder is ideal for the task.

    There is no indication in the datasheet that there is any way to initiate an output bit-stream of a 13-bit gray-encoded "word" in any other manner than by toggling the differential clock input from "high" to "low" to initiate a position sample, followed by a stream of clock transitions from "low" to "high" that will cause the absolute position to be appear as a serial bit-stream, most significant bit first, until all thirteen bits are read out and the clock returns to the high state, awaiting another position measurement. The differential electrical clock input and data output appear to be RS-442 compatible levels for Vcc levels between 10 and 30 VDC.

    There is no indication (that I could find) that the Data Available or DA output is toggled when the entire "word" is ready to be serially output, but that would surely be convenient. So, you may have to experiment a little with a logic probe or even a binary data analyzer to determine how to use this DA output. In any case, IMHO you will need to either use an embedded microprocessor or your Productivity 1000 PLC to generate the burst of clock pulses while reading the gray-encoded data stream output.

    If it makes sense for your "automatic backlash testing" project, you could embed code in microprocessor firmware that will convert the 13-bit gray-encoded data into a serial ASCII data stream, perhaps adding time stamps to each data point, or only transmitting RS-422 data on command. Getting the data into the microprocessor (or your Productivity 1000 PLC) is the "easy" part. Getting the data out and interpreting that data as backlash information is your programming problem, perhaps best done with a serial data link (RS-232 or USB) to a laptop or desktop computer running your backlash testing program.

    This looks like a very interesting "one off" project. Beware of how you interpret the gray codes because the direction control may also be sensitive to backlash. Thirteen bits is a lot of resolution for an optical-disk encoder (2 minutes, 38 seconds of arc) and I do not know why there is a forward/reverse direction control associated with the data output.
     
  10. Harald Kapp

    Harald Kapp Moderator Moderator

    11,155
    2,548
    Nov 17, 2011
    From this PDF:
     
  11. Minder

    Minder

    3,058
    651
    Apr 24, 2015
    There is absolutely no potential difference in accuracy between quadrature, co-tangent, and absolute encoders.
    The benefit of the latter is that at power up, the position is retained, one common usage is Robotics, where it is desirable not to perform a zero routine first.
    Cliff.T, If you are sourcing an encoder for that project, I would suggest the quadrature of sufficient counts/rev.
    This gives you maximum flexibility for controllers.
    I would assume in that application the zeroing at power up would not be a problem, if needed?
    What form is your controller taking?
    PLC? Custom?
     
  12. hevans1944

    hevans1944 Hop - AC8NS

    4,581
    2,142
    Jun 21, 2012
    True.

    But I don't believe that I stated, or implied, that there was any difference in accuracy among the three rotary position sensors you mention. There can be significant differences in cost and required instrumentation for a given resolution and accuracy.

    Fortunately, if the OP sticks with Baumer, the cost of the existing but obsolete transducer is nil, and there is a PC (personal computer) module, part number 139338, that directly interfaces with his SSI (Synchronous Serial Interface). It even comes with some software.

    There are also other PC modules, from other manufacturers, that will drive various types of motors connected to the gear-train whose backlash you want to test. Or you can roll your own motor drivers, always an interesting project in itself. A PC solution means abandoning the Productivity 1000 PLC and writing a program, which @Cliff T. may not feel comfortable doing if already experienced with programming the PLC.

    If someone can manufacture an optical disk with some arbitrary number of alternating transparent and opaque segments evenly distributed around the circumferance, it is almost trivial to add additional concentric tracks with some sort of binary-coded position information (such as a Gray code), along with appropriately positioned optical sensors for each additional track. Of course the alignment, or run-out, of the disk becomes more difficult as more bits of resolution are added, but this is a presumably solved problem. There is also the possibility of using magnetically encoded disks. Magnetic coding has been used for years as a durable position readout on machine tools, but I have no idea what the state-of-the-art is today.

    Things have changed since I had a go at optical encoders, which was sometime in the late 1960s for a stepper motor application driving the sine-bar mechanism that rotated a precision-machined diffraction grating in a Czerny-Turner monochromator.

    The end-user wanted to use his monochromator as an illumination source for measuring transmission losses, as a function of various visible and near-infrared wavelengths passing through sample laser-window materials. We needed to read the grating position to determine amplitude corrections to be applied to a photo-multiplier tube (PMT) output current after analog logarithmic amplification to linearize the illumination intensity as a function of wave length.

    The absolute grating position was to be determined by counting up/down pulses from a quadrature encoder connected to the double-ended stepper motor drive shaft. The grating position, digitized to eight bits, addressed a look-up-table (LUT) that stored the correction values as twelve-bit data that was applied to a Burr-Brown multiplying digital-to-analog converter (DAC). The PMT logarithmic amplifier output was the other multiplicand, and the DAC analog output product.was a measure of the window transmission as a function of wavelength. Or so we hoped.

    We used a commercial off-the-shelf (COTS) up/down counter with quadrature square-wave inputs and binary-coded-decimal (BCD) display outputs and Nixie tube optical display of the digits, so the operator could "dial in" or see whatever wavelength of illumination the monochromator was producing. We also wired in a second up/down 8-bit binary counter that operated in parallel with the COTS BCD up/down counter. The only function of this 8-bit counter was to address the LUT. There was also a mechanical decimal counter, part of the original equipment, attached to the sine-bar mechanism that also allowed the wavelength to be read visually.

    This was a complicated electro-optical and electro-mechanical project that really tested my developing electronics technician skills. The stepper motor was a large Superior Electric motor that was usually driven with 60 Hz AC, using a phase-shift capacitor to produce quadrature excitation currents for the two windings. We needed to drive it with variable-frequency DC square waves in discrete rotational increments. Easy peasy today with switch-mode MOSFETs and PWM control of the motor winding currents.

    A real PITA back then was the huge power-wasting, forced-air cooled, wire-wound, ceramic-insulated, current-limiting resistors in series with each motor winding. We drove the windings from a large DC power supply through several (I forget how many) 2N3055 NPN power transistors operating as saturated switches. The whole electronics package looked like a kluge. The heat given off was huge. Plus, in retrospect, I think the mechanical engineer who specified the Superior Electric stepping motor went a little overboard on the size. I now know enough mechanical engineering today (but not then) to specify a better motor solution.

    Anyhoo, we spent a few months getting it all wired up and tested to make sure the stepper motor would rotate the diffraction grating. I also had to come up with an easy method to download the 256 values for the 12-bit LUT. Back then, we had no flash memory to store data so the LUT had to be re-loaded after every power interruption. Could have used battery backup, but the static random access memory (SRAM) was a relative power hog. The LUT values were also subject to change for a number of reasons, so the load mechanism had to be simple.

    We toyed around with the idea of using ASR-33 teletype terminals to punch and read a "LUT tape" but the end user didn't want to tie their monochromator down to a huge, noisy, teletype terminal. The final solution was a program, written in interpreted BASIC, that accepted user input at the teletype terminal (connected to a time-sharing computer located elsewhere) and produced a punched tape output. Of course the output was 7-bit ASCII characters, which then had to be converted to 8-bit binary values after reading the tape. But this was all transparent to the end user. All they had to do was type in 256 decimal values, each representing a 12-bit binary number, and the software would output, and punch onto paper tape, two ASCII characters for each of those input values. A tape reader on the kluge would then read the tape, strip off the bits in the two characters representing the 12-bit LUT data value, and sequentially load the LUT. Entire read and load process took about ten seconds IIRC. The ASR-33 was only needed when a new "program" tape for the LUT needed to be generated.

    I thought we were done, but sadly several months of troubleshooting lay ahead. Turns out the differential rotary transducer was somehow "losing" some pulses and a cumulative position error would occur as a result. Thankfully, we had left the mechanical wavelength counter intact, so it was easy to manually drive the grating to a known position and then reset the counter. But it took weeks to find out what was causing the problem. I won't go into any detail about how we eventually solved this, but if @Cliff T. experiences similar difficulties, perhaps we can start another thread on how to troubleshoot and permanently "fix" the problem.
     
  13. Minder

    Minder

    3,058
    651
    Apr 24, 2015
    I don't think anyone implied that you did as such?
    It was just a general statement I made

    Especially in light of this statement.
    "I am in the beginning phases of designing an automated backlash test bench at work which will require the use of an encoder. My issue is this will be the first time Playing with encoders and have very little practical working knowledge of them."

    IMO The cheapest, and usually easiest to learn is usually the simple quadrature incremental version.
    This if he is not 'locked' in to using the Baumer
     
  14. hevans1944

    hevans1944 Hop - AC8NS

    4,581
    2,142
    Jun 21, 2012
    I agree with you 100% regarding rotary incremental quadrature encoders. Simplest to use in most situations not requiring absolute position readout. If an index or zero position can be found with repeatable and acceptable accuracy prior to the actual backlash test, then the incremental encoder is hands down the better solution in terms of cost and lack of complexity.

    The two quadrature position coding outputs, taken together, can be interpreted as a two-bit Gray code (only one bit changes state on any given code transition) which means the direction can be determined from just two consecutive codes. No direction bit necessary. A problem we encountered way back when occured when one of the quadrature bits (but not the other) rapidly switched back and forth between the two binary states, perhaps because the encoder happened to be sitting astride a state transition position for one of the bits, and mechanical tolerances and/or vibrations allowed that bit to toggle rapidly. Depending on the direction decoding logic, this caused spurious up or down counts to occur.

    We didn't notice the problem immediately, but eventually the Nixie tube wave-length display became waaay out of sync with the actual wavelength. We figured whatever the problem was, it probably affected the eight-bit counter we were running in parallel with the COTS BCD up/down display counter. This BCD up/down counter and the encoder were, IIRC, purchased as a "matched pair" and were supposed to work together "right out of the box" with no extra circuitry required. But like was done with the stepper motor, I was simply handed this kit and told to make it work.

    I was earning a pretty good reputation for "making things work," so that may be why I was assigned to the project some months after it began. With 20-20 hindsight, if I had been able to change the design direction, I think I would have tried to read the Nixie tube BCD display and derived the eight bits needed to address the LUT from that data instead of from a separate 8-bit up/down counter. Of course that would not have solved the spurious up and down counts the Nixie tube readout was displaying, but that turned out to be a mechanical oscillation problem caused by pulses applied to the stepper motor. Adding an inertial dampener to the motor shaft apparently solved the problem... a few weeks after we discovered how to ignore the "phantom" transitions by using a one-shot multi-vibrator to "read" the quadrature bits a few microseconds after each bit made a logic state transition.

    @Minder, I think @Cliff T. might be in the same bind I was in: he is handed an obsolete absolute rotary encoder and told to "make it work" so they can save money by not having to buy a new one.

    I did some Google research on the Productivity 1000 PLC and discovered it is quite a spiffy (and inexpensive) alternative to waaay more expensive Allen-Bradley PLCs. It appears there are now gobs of inexpensive PLCs available. More importantly, the software needed for program development is free to download and use from the manufacturer's website! If this program development software is based on so-called "ladder logic" it might not be so easy to read and decode the serial data stream from the obsolete Baumer encoder. Instead, it might be better to purchase an inexpensive incremental encoder with quadrature outputs and work from there. This project may be above the OP's current level of experience and capability, but that never stopped me. You learn and grow by reaching further than you can grasp. And asking a lot questions.
     
  15. Minder

    Minder

    3,058
    651
    Apr 24, 2015
    If the OP is interested in playing around or experimenting to get accustomed to a simple quadrature encoder, there is the slotted disk and opto reader on Ebay for under $5.00.
    Ebay 112453707979
    Depending on current level of expertise.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-