Encoder (Lab 2)
Encoder (Lab 2)
ID 208749
Conceptual understanding.
Introduction………………………………………………………………...3
Objective…………………………………………………………………....4
What’s an encoder and how does it work?.................................................4
Experimental procedures………………………………………………….5
Calculations and Analysis………………………………………………….7
Working out………………………………………………………………...8
Graphs………………………………………………………………………9
Flowchart………………………………………………………………….10
Commenting on the results from calculations and graphs………………11
Sources of errors…………………………………………………………...11
Conclusion………………………………………………………………….12
References………………………………………………………………….13
Appendix…………………………………………………………………...14
2
Supervisor: Dr. Abdallah Elgammal Group: A1
Introduction
One of the groups of EDIBON modules created to teach
the use and applications of sensors as well as the
essential electronic fitting-out is the BS-7 testing bench.
The purpose of the tachometer testing bench is to
instruct students in both linear and angular speed
measurement methods. In the section that follows, each
component of the testing bench will be covered in
detail. A collection of 2mm terminals will serve as the
outlet for each connection made to the motor and various transducers. These are
positioned in front of the testing bench, labelled with a diagram that shows how they
work. A small motor is mounted on the upper portion of the BS-7 bench and is used to
move the axle. The voltage applied to the actuator motor can be adjusted to alter the
motor's speed. The various measurement transducers mounted on the axle can be used to
determine the rotation speed. The available sensors on the testing bench are: slot optical
sensor, inductive sensor, refractive infrared sensor, hall effect sensor, encoder sensor.
We mainly focusing on the encoder sensor for this
experiment, an integrated circuit with detectors and
output circuitry, a lensed LED source, and a rotating
code wheel that alternates between the emitter and the
detector IC make up this optical encoder. Two
quadrate square waves and a third channel index
output make up the outputs. A high true index pulse
with a voltage of 90 degrees is the index output, and it
is produced once for every full code wheel rotation.
One sensor that calculates angular speed is the
encoder sensor. This kind of sensor uses an LED as its
light source. Through the use of a polycarbonate lens that is situated directly on the LED,
light is transmitted to a parallel emitter. The emitter is in front of the integrated detector
circuit. The digital waveforms are produced by multiple sets of photodetectors that make
up this integrated circuit.
3
Supervisor: Dr. Abdallah Elgammal Group: A1
The code wheel rotates between the emitter and the detector, causing the spaces and lines
to break through the emitter light. The photodiodes that identify these disruptions are
fixed in a sample that matches the code wheel’s radius and design. Additionally, these
sensors are spaced apart such that a period of light in one detector corresponds to a period
of darkness in the detectors next to it.
Objective
The primary objective of the experiment is to use an encoder to measure the motor's
speed, direction, and position. The velocity or speed of a rotating object can also be
determined using encoders. Encoders are used in applications like speed control,
synchronization, and rotational dynamics monitoring to provide information about the
rate of rotation by tracking changes in position over time.
4
Supervisor: Dr. Abdallah Elgammal Group: A1
two square waveforms with a 90-degree phase difference. When the shaft spins in the
opposite direction, the relationship between the A and B channels is inverted. In this way,
rotationally directional data can be produced by incremental encoders.
Furthermore, an index pulse—a digital signal that outputs data once per revolution on a
dedicated channel (Z channel)—is generated by incremental encoders. The index pulse is
commonly used to verify the pulse counts of the A and B signals or to track the number
of shaft rotations with a counter. For homing, or establishing an absolute position, the
index pulse can also be used if the shaft is oriented in reference at the time the Z output
signal is initiated. The width of the index pulse can be gated, or confined, to improve
accuracy.
Experimental procedure
1- Dc motor
Objective: Give the BS-7 system's sensor group, which is
fixed to the equipment's central axis, movement force.
The operation of the motor fixed to the BS-7 central axis is
explained in this practice. Its purpose is to provide
movement to the axis that connects the various BS-7
sensors.
The BS-7 frontal panel has the DC motor's power supply connectors.
To prevent future damages, the voltage margins must be observed when supplying the
motor. In this practice, the functioning of the motor fixed to the BS-7 central axis is
explained. Its function is to supply motion to the axis that joins the different BS-7
sensors.
Power supply connectors for the DC motor are located on the BS-7 frontal panel.
When supplying the motor, the voltage margins must be followed to avoid further
damage.
2- DC tachometer
Objective: to measure the revolutions of the central axis of the BS-7 system using a DC
motor as a tachometer.
In order for the BS-7 central axis system to function, a DC generator is used in this
experiment as a sensor element for the revolutions that the system collects. A DC motor
5
Supervisor: Dr. Abdallah Elgammal Group: A1
6
Supervisor: Dr. Abdallah Elgammal Group: A1
the sensor may indicate a drawback or weakness, but this is rarely the case because high
frequency output makes it easier to measure and capture the signal; high frequency is
used to be unstable the measured because of inferences and noise.
End-start
2. To get Motor speed we multiply the frequency by 60 then
7
Supervisor: Dr. Abdallah Elgammal Group: A1
F∗60
divided by 500. Motor speed=
500
Working out
8
Supervisor: Dr. Abdallah Elgammal Group: A1
Graphs
9
Supervisor: Dr. Abdallah Elgammal Group: A1
Flowchart
10
Supervisor: Dr. Abdallah Elgammal Group: A1
11
Supervisor: Dr. Abdallah Elgammal Group: A1
shielded cables or low-pass filters. To reduce ground loops and interference, make
sure all equipment is properly grounded.
Conclusion
The experiment illustrated the usefulness of encoder-based feedback systems in motor
control applications by measuring the speed, direction, and position of a DC motor using
an encoder. Accurate motor parameter measurement was made possible by the encoder's
integration with the motor, which also provided insightful feedback on motor
performance. This demonstrates the importance of encoder feedback in robotics,
industrial automation, and renewable energy systems, among other fields. The project
gave students and researchers in engineering fields practical experience with sensor
integration, signal processing, and control algorithms. It is possible that more study and
testing in this field will improve motor control methods and advance technological
innovation.
12
Supervisor: Dr. Abdallah Elgammal Group: A1
References
Edibon. (2011, March). Practice exercises manual-
BS-7.
Dynapar. (2019, August 21). Incremental Encoder Overview.
Fanni, M., & Elkeran, A. (2000). THEORETICAL
AND EXPERIMENTAL INVESTIGATION OF
INTEGRATED STRUCTURE/CONTROL
DESIGN OF HIGH-SPEED FLEXIBLE ROBOT
ARM.
Quantum Devices. (2022, October 6). Incremental
Encoder Basics | Quantum Devices.
Agarwal, T. (2022, February 15). Incremental
Encoder: Types, circuit, working & its
applications.
13
Supervisor: Dr. Abdallah Elgammal Group: A1
Appendix
MATLAB Code
Clear all
clc
S=[2.2,1,1,1,2,2.8,2,4,3,4] %%% Start time
E=[3.8,2,1.65,1.55,2.47,3.22,2.38,4.36,3.3,4.24] %%%% End time
T=E-S %%% T is the wave time difference between the end
and start times
F=1./(T*0.0001) %%% F is the frequency of the wave
V=(F*60)/500 %%% Motor speed
%%
v=[3.047,4.009,5.027,6.017,6.534,7.086,8.011,9.098,10.094,10.8797] %%% input
voltage
plot(v,V,'g')
plot(v,F,'g')
pseudocode
Real Starttime, Endtime, Ts, F, V, Angle, Count
BEGIN
Input Starttime
Input Endtime
IF Endtime == Starttime THEN
Output "Stopspinning!"
ELSE
IF Endtime > Starttime THEN
Output "Counterclockwise!"
ELSE
Output "Clockwise!"
ENDIF
ENDIF
Ts = Endtime - Starttime
Output Ts
14
Supervisor: Dr. Abdallah Elgammal Group: A1
F = 1 / Ts
Output F
V = F * 60 / 500
Output V
Input Count
Angle = (Count / 8000) * 360
Output Angle
END
15