Author Topic: Reading Mechanical Encoder  (Read 5975 times)

Mark P.

  • Newbie
  • Posts: 6
    • View Profile
Reading Mechanical Encoder
« on: February 28, 2019, 11:09:44 AM »
Hello

I have been having a problem reading a mechanical encoder.

That is, a mechanical encoder not a normal encoder like on a motor.

I have tried high speed encoder in, that did not really work.  Skips or jumps.
I am guessing the signal received from a hand turned encoder knob is not the best signal.


I have written some code to look at the inputs and make decisions if the encoder went right or left
based on inputs and previous inputs.   This seems to work best but there are times this is not perfect either.

I have probably spent a week trying several software iterations and different encoders, and different inputs.

Has anyone taken in this type of encoder that worked almost flawlessly ?

I also think scan my also be causing a issue ?  Missing inputs ?

Also these encoders come in several types of code output, I prefer a two wire
method, that is useing just two inputs.  Don't have enough inputs available to 4 wire gray code.

Any suggestion on code or encoder brand or type would be helpfully.

Mark

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3170
    • View Profile
    • Internet Programmable PLCs
Re:Reading Mechanical Encoder
« Reply #1 on: March 01, 2019, 08:26:35 AM »
The FMD, Nano-10 and Fx series of PLC can directly read standard quadrature encoder inputs. Each high speed counter only needs two digital inputs (see Chapter 6 on the mappings to the digital inputs).

However, if you are trying to read a specialty encoder using ladder logic it may not be fast enough to process in real time due to the time lag in the I/O scan (about 2ms for FMD and Fx PLC. Much shorter for Nano-10 since there is no expansion I/O) which means that you may miss some rising / falling edge.

You may also try to use the interrupt inputs to handle the specialty encoder.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS