RTI ds1104 encoders

4 views (last 30 days)
Nassim Benhabib
Nassim Benhabib on 4 Jun 2018
Edited: SMEAC on 17 Jan 2019
Hello! I use the RTI1104 toolbox to control two engines. I have accutuellment a DAQ interface cp1104 and I would like to exploit the data provided by the encoders (using Inc1 and Inc2). Problem, my encoders do not provide an INDEX signal. Would anyone have an idea to get the rotation angles of my engines using Simulink?

Answers (1)

SMEAC
SMEAC on 17 Jan 2019
Edited: SMEAC on 17 Jan 2019
Hello NB,
You don't actually need the Index Signals to use the encoders. You just have to note that both encoders, on program start, are set to 0. So you will be working in a relative angular offset to where you have started at.
To actually determine the angle, you have to know how many pulses your encode gives per rotation. Then you can divide the encoder block output by this number, multiply by 2pi, and you have the angles in radians.
Because you do not have the index, you can run into an overflow. If you read the dSpace Help for the DS1104 you will see it uses a 24bit counter, but due to the 4-fold subdivision of each encoder line, the counter allows you to measure up to 2^22 encoder lines in the range –2^21 … +2^21 – 1. This is the integer representation of the encoder lines, which can be enlarged by the 4-fold subdivision increments up to +2^21 - 0.25. The count direction depends on the encoder’s rotation direction.
So, just to remember to watch for the overflow in your software, use the set_encoder block to reset the value to some value representing the same angle and you should be right.
Hope that helps
SMEAC

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!