You are on page 1of 15

Faculty of Engineering

Department of Mechanical Engineering


Mechatronics and Robotics Engineering Program
23MTRN06I Measurement and Analysis
Semester 2 2023/2024

Lab Assignment No. 2

Name Ahmed Rady Hamouda

ID 208749

Criteria Grade Total


Report quality.

Conceptual understanding.

Programming code quality.

hardware setup proficiency.

Integration of hardware and software.


Supervisor: Dr. Abdallah Elgammal Group: A1

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.

What’s an encoder and how does it work?


It is an electromechanical instrument for measuring shifts
in motion and direction. Incremental rotary encoders
generate A/B digital output signals based on a preset
number of pulses per rotation. This is one way to
translate the angular motion of a shaft into an encoded
code that can be utilized to determine the velocity or
relative position of the shaft. Because they offer nearly
instantaneous feedback on position changes, incremental
encoders are widely used in applications requiring extremely precise measurement and
motion control.
Incremental encoders generate a predetermined number of pulses in a single rotation. The
number of pulses per revolution (PPR) of an incremental encoder determines its
resolution, or measurement precision. The pulses are digitally output using two
incremental channels (A and B).
If you only need to know the speed (RPM) and not the direction, you only need to use the
A channel. When you need to know both direction and speed, you combine channels A
and B. The A and B channels have a phasing offset of 90 electrical degrees. Quadrature
refers to the 360 electrical degrees that make up a pulse encoder cycle. When the A and B
signals are in quadrature and travelling at the same speed, the digital output consists of

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

is required to make the system's central axis work.


The voltage that the DC tachometer outputs is proportional to
the revolutions of the central axis, or the revolutions at which
the DC motor is operating. At this maximum motor rotation
speed, the output will be roughly 1.5 V.
As the DC motor speed varies, the tachometer voltage variation
can be seen. As a sensor element of the BS-7 DC motor
revolutions, the use of a DC generator is demonstrated. The generator provides a voltage
that is proportionate to the revolutions of the system axis. Consequently, the voltage
produced by the tachometer can be used to control the generated voltage, just as it can be
used to control the motor speed.
3- Encoder
Objective: to measure the BS-7 system's D.C.
motor speed using an encoder sensor.
We intend to utilize an encode sensor, which is
positioned along the BS-7 system's central axis.
A signal in the form of digital pulses, whose
frequency is proportionate to the rotations of the
central axis, is provided by this sensor. Since the
output signal frequency is multiplied by 500, the
rotation speed value of the axis revolutions/seconds must be obtained by dividing the
frequency signal obtained between 500. After the circuit has been completed, we will
connect the BS-7 DC motor to rotate the axis. This will produce an output square signal,
the frequency of which will be proportionate to the BS-7 central axis's rotation speed.
There is no need for a circuit or other additional component to measure the sensor output
signal directly.
An encoder served as the BS-7 central axle speed detecting element during this
experiment. This kind of sensor costs more than the ones that use the standard
components in this module, but it is simpler to install and produces a direct output signal
that doesn't require additional conditioning. This sensor's unique feature is that it
produces a signal whose frequency is multiplied by 500. This means that for every
rotation the motor produces, the sensor's output will be 500 Hz. This particular feature of

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.

Calculations and Analysis


Motor input Wave time*10-4 Channel Direction Motor speed
voltage (v) (s) (A&B) (From A to B) (V)
Frequency RPM
(s-1)
Start End
time time

1. 3.047 2.2 3.8 6250 Clockwise 750

2. 4.009 1 2 1000 Clockwise 120

3. 5.027 1 1.65 15384.6 Clockwise 1846.1

4. 6.017 1 1.55 18181.8 Clockwise 2181.2

5. 6.534 2 2.47 21276.6 Clockwise 2553.2

6. 7.086 2.8 3.22 23809.5 Clockwise 2857.1

7. 8.011 2 2.38 26315.8 Clockwise 3157.9

8. 9.098 4 4.36 27777.8 Clockwise 3333.3

9. 10.094 3 3.3 33333.3 Clockwise 4000

10. 10.897 4 4.24 41666.7 Clockwise 5000

Rules used to get the remaining columns Frequency, Direction, and


motor speed)
1
1. F=𝑇 , in order to get the time, we subtract the start time form the end time. T=

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

Commenting on the results from calculations and graphs


• During the experiment, we recorded the beginning and ending times of the waves
as well as the input voltage reading. We then used our computations to determine
the frequency; the tables indicate that the frequency increases as the input voltage
increases, and the graph illustrates the nearly linear relationship between the input
voltage and wave frequency.
• Because the direction is clockwise from a to b, a is phase-shifted from b.
• The speed motor was calculated from the table to show that it was increasing as the
input voltage was increased, and when we plotted the graphs, we saw a nearly linear
relationship.
Sources of error
• Incorrect Wiring: Improper wiring connections can result in short circuits,
reverse polarity, or the wrong voltage levels, all of which can harm a motor.
Avoidance: Verify that the wiring connections are secure and correct by checking
them twice. Refer to the wiring diagrams that are included in the user manual or
documentation for the motor.
• Overloading: When a motor is overworked beyond its rated capacity, it may
overheat, stall, or experience mechanical failure.
Avoidance: Verify that the motor is appropriately sized and rated for the intended
use. By keeping an eye on the mechanical load and putting safety measures like
current-limiting circuits or overload protection devices in place, you can prevent
overloading the motor.
• Mechanical Misalignment: Inaccurate revolution measurements may arise from
a tachometer or DC generator that is not oriented correctly with respect to the
central axis.
Avoidance: Verify that the DC generator and tachometer are correctly oriented
with respect to the BS-7 system's central axis.
• Mechanical Friction: By preventing smooth rotation, friction in the system's
mechanical parts or in the center axis can have an impact on the precision of the
revolutions that are measured.
Avoidance: To minimize friction and guarantee the central axis rotates smoothly,
lubricate moving parts sufficiently. In order to identify and resolve any wear or
binding, mechanical components should undergo routine inspections and
maintenance.
• Encoder Resolution: Inaccuracies in the resolution or counting capacity of the
encoder can cause mistakes when motor speed is measured. The encoder might
not correctly record slight variations in speed if it does not offer enough
resolution.
Avoidance: To achieve the required degree of accuracy in speed measurement,
select an encoder with the right resolution.
• literary Noise: Errors in speed measurement can arise from electrical interference,
noise from nearby equipment, or noise from power sources that alter the encoder
signal's accuracy.
Avoidance: To reduce electromagnetic interference, shield the encoder's
connections and wiring. To lessen electrical noise, employ filtering methods like

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

You might also like