2015
International Conference on Communication, Control and Intelligent Systems (CCIS)
Implementation of Closed Loop based Scan Mechanism Leo Louis
Ashok Kumar
Saffrony Institute of Technology,
Scientist Engineer, SFED, SEG, SEDA,
Department of Electronics and Communication,
Space Applications Centre, (SAC),
Gujarat Technological University,
Indian Space Research Organization, (ISRO),
Ahmedabad, India
Ahmedabad, India
E-mailld:
[email protected]
E-mailld:
[email protected]
Abstract-This paper presents a closed loop scan mechanism
With the help of this proposed module, the sensor being
using a stepper motor based Gimbal Technique. For its control,
used would face correct direction accurately. For this, a closed
Arduino microcontroller based drive electronics is developed. This paper proposes a flexible structure for usefulness in various applications
like
tracking,
satellite
imaging
etc.
This
paper
analyzes the programming and hardware structure for an easy implementation using the Arduino microcontroller. For a bipolar stepper motor drive, the full H-bridge driver based electronics is developed. Motor shaft position is sensed by incremental optical encoder. The proposed module has high accuracy (.06% in scan rate). Keywords: Scan Mechanism, Stepper Motor, Motor Driver, Arduino Mega, Rotary Encoder
loop mechanism is used, for continuous monitoring of the acquired encoder data. The sensors are mounted on the Gimbal, which works with the help of a Stepper Motor, which is connected to a microcontroller with the help of a motor controller
/ motor driver [9].
This proposed module also checks whether the Gimbal is working in the desired way; if there is any error in its functioning,
the
program
stored
in
the
microcontroller
automatically rectifies it by sending the appropriate signal pulse to the motor. Here we are using a commercially available
I.
INTRODUCTION
Arduino Microcontroller which is an open source user friendly
The sensors used in the INSAT series of satellites have a point area of scan or a pencil beam of light that are used to scan a wider area. As scan mechanisms are an essential part in the
field
of
Remote
Sensing,
Inertial
Navigation
and
Photography, the sensors used for scanning should be able to
electronic platform with high accuracy and simple features. This platform has been selected due to its low cost and its usage in various automation projects for similar systems. With this project, we will explore how it accurately helps out in the scan mechanism. Results are also discussed.
cover a wider area. II.
Scanning a larger plus a wider area can now be possible
METHODOLOGY
using electrical or electromechanical devices as actuators
For successfully accomplishing and designing this project
which have now become easier with the improvement in
it is divided into five sub tasks; each specifically focusing on the detailed and easy implementation of the project. First we
technology. For a point sensor having a point area of scan or a sensor having a pencil beam of light can only be able to scan larger and wider area with the help of some actuators which can make the sensors have a movement of-xo
--->
+xo. For this type
of rotations here we are using a Gimbal as an actuator for the front end of the sensor. These gimbals can be made up of stepper motors, dc motors or even solenoids. To improve the system accuracy it is operated in a closed loop. The existing scan mechanisms were developed using analog mechanisms, which always had accuracy issues making them not as reliable as this proposed digital system. The
analyzed the different types of motors to select an appropriate motor which has a precise stepping and also a high accuracy for the Gimbal [9]. The second task was to study each hardware precisely, it's working behavior with each other, and to study the steps by which we could proceed with this project. The third task was to design and develop a suitable motor driver for the stepper motor that is capable of micro stepping the motor in the Gimbal for maintaining the accuracy in the directions. The fourth task was to develop the code in the Arduino IDE. Finally, the fifth task was to implement the project by assembling it with all the studied conditions and maintaining its parameters for an easy implementation.
sensors that are being used for sensing should be perfectly
III. DETAILED DESCRlPTION
facing the desired direction and angle, with a high accuracy. This can only be possible, if the sensor is placed or mounted,
The Fig. 1 shows the functional block diagram of this
on such a device, which can have similar movements. For this
system and all its sub-blocks representing the overall flow of
type of mechanism we use the concept of a "Gimbal"[9].
program
978-1-4673-7541-2/15/$31.00 it 20151EEE
control
from the microcontroller to the various
system components i.e. the motor driver, stepper motor and the
The sensor that is mounted on the motor should be facing
rotary encoder. Sensors are mounted on the motor for their
the desired direction at the desired time. A rotary encoder is
appropriate movement.
attached to the motor which continuously updates itself and interrupts the microcontroller with the current position of the motor, which in turn shows the present position of the sensor. These pulses are then in turn used to correct the true position or compensate the error of the motor The microcontroller attends to the interrupt and monitors the data it receives from the output of the encoder Ch A and
Rotary Encoder
Ch B. If it finds any abnormal condition, the microcontroller would rectify it by providing the appropriate pulse to the
Fig. I: System Block Diagram •
Motors:
motor driver to correct it. The control system of the project is shown in the Fig. 3.
For the accurate movement and precise
stepping a stepper motor is used for this module. These
are
driven
by
the
motor
driver
/ motor
controller to which they are connected to. •
Motor Driver / Motor Controller:
The motor driver is
used to drive the motor according to the pulse that it receives from the microcontroller. Here we would be using a L293DNE motor driver
/ motor controller IC
manufactured by the Texas Instruments. •
Rotary Encoders:
Fig. 3: Project Control System
Rotary encoders are devices used
for obtaining the exact angle information about the
IV. IMPLEMENTATION
rotation and the direction of the motor it is connected
This project is divided into two different parts.
to, for data and correction purpose. •
Microcontroller:
The
microcontrollers
•
named
Arduino
"Arduino Mega" is used for collecting the encoder
on
the
motor
face
the
card,
the
motor
driver
motors and the mechanical structure on which it
pulse to the motor driver which would make the mounted
The module of this project consists of the
microcontroller
circuit, the rotary encoder that is connected to the
outputs, analyze them and to the give the appropriate sensor
Hardware:
would be mounted for easy movements.
correct
direction.
•
Software:
The software code which is fed into the
microcontroller would make the hardware's function according to our expectations. This project is built around the Arduino Mega consisting of the AT Mega 2560 microcontroller. A.
Hardware 1.
Motor:
A motor is simply a machine that works on the
principle
of
converting
electrical
energy
into
mechanical energy. Most of the motors function due to the interaction between the motor's winding currents and the magnetic field to generate force within the
Fig. 2: System Diagram
motor during its normal functioning [4][13].
The actual system block diagram with a closed loop
In this project a bipolar stepper motor is used with
digital feedback is shown in Fig. 2. The microcontroller
specifications such as Maximum voltage: 5V DC, Step angle:
obtains the true position of the motor and sends the appropriate
0.90 and Steps per revolution: 200. Due to its ability of rotating
pulse to the motor driver for rotating the motor according to
its shaft in small and precise steps of rotation or in a full rotation
/
the H-bridge logic. These pulses are given according to the
these motors are also used in the positioning of video cameras
desired direction of the motor rotation i.e. in the clockwise or
antennae at extremely low speeds (such as in astronomy),
anti clockwise direction. The motor driver then sends the
positioning of robots, computer peripherals (disk units, plotters,
appropriate pulse to drive the motor connected to it.
printers), space technique and military field etc [6] [15].
310
TABLE2: MOTOR INPUTS UL I 0 I 0 X
Enable I 1 I I 0
3.
Fig. 4: Example of a Stepper Motor
2.
Motor Driver! Motor Controller:
LL 0 1 0 1 X
UR 0 1 I 0 X
Rotary Encoder:
LR I 0 0 1 X
OutDut Clockwise Anti-Clockwise Motor Breaks No Output
A rotary encoder, also called a
shaft encoder, is an electro-mechanical device that
The pulse given out
converts the angular position or motion of a shaft or
from the microcontroller is not enough for the motor
axle to an analog or digital code. An example of
to run. For this purpose we need a motor controller,
Rotary Encoders is shown in Fig. 7. Rotary encoders
commonly known as the motor driver which would
are used in many applications that require precise
receive the input pulse from the microcontroller and
shaft rotation-including industrial controls, robotics,
send its output pulse to the input of the motor [11].
special purpose photographic lenses, computer input
The Motor driver works on the principle of H-Bridge
devices
which helps in rotating the motor in clockwise or anti
(such
as
opto-mechanical
mice
and
trackballs), controlled stress rheo meters, and rotating
clockwise direction [11].
radar platforms [14]. Encoders have outputs namely Ch. A, Ch. B, and Index in which Ch. A and Ch. B are 90 degrees out of phase so are called quadrature outputs. These pulses define the direction of the motor; when Ch. A leads Ch. B it is said to be in the clockwise direction and when Ch. B leads Ch. A it is said to be in
the
anti-clockwise
direction
[14].
Fig.
8
shows
the
quadrature output of a rotary encoder in clockwise direction.
Fig. 5: Using L293D Dual Half H Bridge
Here we use L293DNE a 16 pin DIP type bipolar motor driver IC by the Texas Instrument for driving the Motor. One Fig. 7: An Example of a Rotary Encoders
such IC is capable of driving 2 DC Motors or 1 Stepper Motor at a time. Each input pin is connected to the digital
110 pin of
the Arduino microcontroller [7].
A B
I
�
phase 1
I
I I I I
I
I
121 3
I I I
I I
411 I
I
I I I I
I
I I
I
I
I
I
12 13 I 411
�
I
I I I I
I
I I
I
I
I
I
12 131 41
Fig. 8. Quadrature Outputs of a Rotary Encoder Showing a Leading B [14] TABLE2: OUTPUTS OF THEROTARY ENCODER Channel A OFF-O OFF-O HlGH-I HIGH-I
Fig. 6: Connections with the Microcontroller and an Image of the Motor Driver IC L293 D [71
The microcontroller is programmed in such a way that it gives out pulses that can be given to the motor driver to drive
4.
the motor that is connected to it. These motor inputs viz.
Channel B OFF-O HIGH-I HIGH-I OFF-O
Microcontroller:
Output Position 0 Position 1 Position 2 Position 3
A microcontroller is an integrated
circuit that is used for automation purpose consisting
Upper Left (UL), Lower Left (LL), Upper Right (UR), Lower
of memory, and programmable
Right (LR) are given to the motor according to the H-bridge
110 peripherals [10].
An Arduino card known as "Arduino Mega" consists
logic are shown below in Table 1.
of a microcontroller AT Mega 2560 as shown in Fig. 311
9 is used in this project. It is used to monitor and
which interrupts the microcontroller processing by giving the
rectify the peripheral devices connected to it. There
current position data. The microcontroller on fmding an error
are different types of Arduino cards available [2]; Fig.
sends the appropriate signal pulse to make it more accurate
10 shows an example of one such Arduino card
A portion of the implemented code is as shown below.
known as the Arduino Uno.
This code is used to rotate the motor
void loop () { digitalWrite(a, HIGH); digitalWrite(abar, LOW); digitalWrite(b, LOW); digitalWrite(bbar, HIGH); digitalWrite(a, HIGH); digitalWrite(abar, LOW); digitalWrite(b, HIGH); digitalWrite(bbar, LOW); digitalWrite(a, LOW); digitalWrite(abar, HIGH); digitalWrite(b, HIGH); digitalWrite(bbar, LOW); digitalWrite(a, LOW); digitalWrite(abar, HIGH); digitalWrite(b, LOW); digitalWrite(bbar, HIGH); }
Fig. 9: Arduino Mega 2560 [2]
The Arduino Mega 2560 has an operating voltage of 5v and an input recommended voltage of 7-12V with its input voltage limits ranging from 6-20V. Consisting of 54 digital
110
pins of which 15 provide PWM output and 16 provide analog
V.
110 for digital and analog interfacing respectively, a power The
connector for the power requirements of the Arduino card and
various
RESULTS
experimental
results
performed
for
this
a USB connector for burning the software code into the
system show its accurate system performance. Fig. 11 and Fig.
microcontroller. The USB connector can also be used for the
12 shows its rotated angle and velocity profile respectively.
power requirements by keeping it connected to the Laptop
/
The achieved Velocity error is ;:::: 0.06 RPM at 10 RPM
PC in cases when no power adapters are available [1][3]. It
which is shown in Fig. 13. This velocity is limited by motor
also has a flash memory of 256KB of which 8KB is used by
position of 0.9 degree per step.
the boot loader and SRAM of 8 KB, and EEPROM of 4 KB and a Clock Speed of 16 MHz [1]. The encoder outputs via Ch. A and Ch. B are fed to this card which is continuously monitored and checked for their desired functioning. This software code has been developed in the Arduino IDE using the C language. This code has then been uploaded (fed
/ burned) into the microcontroller memory
using a USB cable provided with the Arduino Card. B.
Software The software portion of this project includes the coding of
the Arduino Microcontroller which is done in C language in the Arduino software also known as the Arduino IDE. This code is required to have an interaction with the motor driver
/
motor controller by providing the appropriate pulse to it for the easy motor rotation [5]. It is also capable of rectifying the errors by continuously Fig. 10: Arduino Uno with Descriptions of the 110 Locations
monitoring the outputs of the rotary encoder Ch. A and Ch. B
312
50 40
•
1
E 20 cu
10
c: c(
0
�
]
•
10
20
30
Elapsed Time (5)
40
project at SAC, to Mr. Sanjeev Mehta, Head of SFED-SEDA
50
for his precious support, to Mr. Arup Roy Choudhury, GD SEG and Mr. Saji Kuriakose, Deputy Director of SEDA-SAC
Fig. II: Profile of the Rotated Angle
for their constant encouragement and keen support during the work. The authors are also grateful to the reviewers Dr S.c.
t
Bera and Mr. D.R. Goswami for reviewing this paper and making it more accurate REFERENCES
5
[1] 0
[2] [3]
-5
-10 -15
[4]
II
j
[5]
0
10
20
30
Elapsed Time
(s)
40
50 [6]
Fig. 12: Profile of the Achieved Velocity [7] [8]
[9]
[10] [11] Fig. 13: Profile of Achieved Velocity Error
[12]
VI. CONCLUSION This
microcontroller
HRDD at SAC-ISRO for giving us an opportunity to do our 0
\l cu cu a. II)
the
The authors are grateful to 1. Ravishankar, Head of
-40
e-
of
ACKNOWLEDGMENT
-50
E
architecture
which is used to rectify the motor position in case or
-30
10
software
errors in the functioning.
-10
15
The
allows the continuous monitoring of the encoder data
... 0-20 �
which can also be preprogrammed
according to the user needs.
30
,g;
The Arduino platform performed the predefmed task automatically
paper
presents
the
implementation
[13]
of
scan
mechanism using the Gimbal on an Arduino Mega 2560
[14]
platform. With the implementation of this project, the scan
[15]
mechanisms can be done very precisely. This paper also concludes these various points:
31 3
Arduino-ArduinoBoardMega2560. [Online] [Cited: October 17, 2014.] http://arduino.cc/en/Mainl ArduinoBoardMega2560 Arduino-ArduinoProducts. [Online] [Cited: October 17, 2014.] http: //arduino.cc/en/Main/Products Badamasi, Y.A. (2014), "The Working Principle of an Arduino," Electronics, Computer and Computation (ICECCO), 11th International Conference on, pp. 1--4. Electric Motor. Wikipedia. [Online] [Cited: October 30, 2014.] https: llen.wikipedia.org/wiki/Electric_Motor Aguilar-Acevedo, Francisco and Alejo, Vignaud Granados (2007), "Using Open-source Platform for Trajectory Control of DC Motors", IEEE, Vol. 5, No. 6, pp. 718-724, December. Baluta, G. and Coteata, M. (2007), "Precision Microstepping System for Bipolar Stepper Motor Control", Electrical Machines and Power Electronics, 2007. ACEMP '07. International Aegean Conference on, pp. 291-296. L293 Datasheet. [Online] [Cited: March 14, 2015.] http: //www.ti.com/lit/ds/symlink/1293d.pdf Singh, Mandeep, Rekha and Singh, Balwinder (2010), "Microcontroller Based Clockwisel Anticlockwise Stepper Motor Controller Using PC Keyboard Via Com Port", International Journal of Computer Science & Communication, Vol. 1, No. 1, January-June, pp. 189-191. Chen, Michael Y., Edwards, Derrick H., Boehmer, Erin L., Eller, Nathan M., Slack, James T., Speck, Christian R., Brown, Sean M., Williams, Hunter G., Wilson, Samuel H., Gillum, Christopher S., Lewin, Greg C., Sherriff, Mark S. and Garner, Gavin T. (2013), "Designing a Spatially Aware and Autonomous Quadcopter," Proceedings of the 2013 IEEE Systems and information Engineering Design Symposium, University of Virginia, Charlottesville, VA, USA, April 26, Microcontroller. Wikipedia. [Online] [Cited: October 17, 2014.] http://en.wikipedia.org/wiki/Microcontroller Motor Driver. Robotix. [Online] [Cited: October 17, 2014.] http: //www.robotix.in/tutorials/category/auto/motor_driver Motors Drivers. Wikipedia. [Online] [Cited: October 17, 2014.] https: //en.wikipedia.org/wiki/Motor_controller Principles and Working of Electric Motors. Tutorvista. [Online] [Cited: October 17, 2014.] http: //www.tutorvista.comlcontent/science/science ii/magnetic-effects-electric-current/electric-motor.php Rotary Encoder. Wikipedia. [Online] [Cited: October 30, 2014.] https: //en.wikipedia.org/wiki/Rotary_encoder Stepper Motor. Wikipedia. [Online] [Cited: October 30, 2014.] https: //en.wikipedia.org/wiki/Stepper_motor