You are on page 1of 9

2017

MicroDAQ_Encoder Block

M.Mohamed Ibrahim
Tenet Technetronics
28-APR-17
Tenet Technetronics 1
Application Notes

Contents

Introduction .. 2

DC Motor ..2

Encoder .3

MicroDAQ Encoder Block .4

Steps involved5

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 2
Application Notes

Introduction
Encoders are used to translate rotary or linear motion into a digital signal. Usually this is
for the purpose of monitoring or controlling motion parameters such as speed, rate,
direction, distance or position.

Here, we can use MicroDAQ Encoder Block to count rotation of DC motor directly from
SCILAB_XCOS. We can also build graphical interfaces to verify device performance,
compare real-world data to models created in SCILAB_XCOS.

DC Motor with Encoder


This gear motor is a powerful 12V brushed DC motor with a 29:1 metal gearbox and an
integrated quadrature encoder that provides a resolution of 64 counts per revolution of
the motor shaft, which corresponds to 1920 counts per revolution of the gearbox's
output shaft. These units have a 0.61"-long, 6 mm-diameter D-shaped output shaft.

Figure 1: DC Motor with Encoder

This powerful brushed DC gear motor is available in six different gear ratios and features
an integrated quadrature encoder with 64 counts per revolution (CPR) of the motor
shaft.

Encoders
A two-channel Hall Effect encoder is used to sense the rotation of a magnetic disk on a
rear protrusion of the motor shaft. The quadrature encoder provides a resolution of 64

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 3
Application Notes

counts per revolution of the motor shaft, which corresponds to 1920 counts per
revolution of the gearboxs output shaft.

The motor/encoder has six color-coded, 11" (28 cm) leads terminated by a 16 female
header with a 0.1 pitch, as shown in the Figure 2.

The Hall sensor requires an input voltage, Vcc, between 3.5 and 20 V and draws a
maximum of 10 Ma. The A and B outputs are square waves from 0 V to Vcc
approximately 90 out of phase. The frequency of the transitions tells you the speed of
the motor, and the order of the transitions tells you the direction.

Figure 2: Encoder

The following table describes the wire functions:

Wire color Function

Red motor power (connects to one motor terminal)

Black motor power (connects to the other motor terminal)

Green encoder GND

Blue encoder Vcc (3.5 20 V)

Yellow encoder A output

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 4
Application Notes

White encoder B output

Table 1: Wire functions

MicroDAQ_Encoder Block:
Encoder block reads MicroDAQ quadrature encoder. 'Init position' parameter allows to
set initial value of quadrature encoder position register.

This block can be used in host simulation mode and for code generation.

Figure 3: Encoder Block

Figure 4: Encoder Block Parameter

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 5
Application Notes

Step 1: MicroDAQ blocks are used to access the MicroDAQ hardware. MicroDAQ
bocks are available in XCOS palette browser under MicroDAQ palette.

Figure 5: MicroDAQ Palette

Step 2: Objective is to count rotation of DC motor using MicroDAQ Encoder


block (see Figure 6a). Pick all the blocks specified in the fig 6b, set the
appropriate parameters and connect as shown in the diagram.

Figure 6a

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 6
Application Notes

Figure 6b

MicroDAQ Function key block is used to read function key state.

Figure 6c

Set DIO Config block parameter as shown Figure 6c.

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 7
Application Notes

Step 3: Give hardware connections are shown in Figure 7.

Figure 7: Hardware Connection diagram

Note:

Here, we use gear motor so,we need to give 12v supply externally.

Step 4: Run the model & displayed output is shown in Figure8.

Figure 8: Output

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com
Tenet Technetronics 8
Application Notes

For more information please visit: www.tenettech.com

For technical query please send an e-mail: info@tenettech.com

Tenet Technetronics | Varsity

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726., Website: www.tenettech.com, Email: info@tenettech.com

You might also like