2. Speed oriented NFS
Using PULSE WIDTH MODULATION
Work Carried outat:
Thinklabs
TRI Technosolutions Pvt Ltd., S.I.N.E
INDIAN INSTITUE OF TECHNOLOGY,BOMBAY
&
Department of CIVIL Engineering
National Institute of Technology Karnataka, Surathkal
By:
Rushil Goyal, 2nd
Year B.Tech[Civil Engineering]
National Institute of Technology Karnataka, Surathkal
Siddharth Agarwal,2nd
Year B.TECH[Chemical Engineering]
University of MANCHESTER,Manchster
Under the Supervision of:
Vinayak Raina
Technical Associate, ThinkLABS, TRI Technosolutions Pvt. Ltd.
3. ACKNOWLEDGEMENTS
The project work in this report is an outcome of continual work & draws
intellectual support from various sources. Obligations thus incurred in
completing the work have been many. It is therefore almost impossible to
express adequately the debts owed to many persons who have been
instrumental in imparting this work a successful status. It is however a matter
of great pleasure to express my gratitude and appreciation to those who have
been contributing to bring about this project.
We take this opportunity to thank ThinkLABS IIT Bombay for giving us an
opportunity to attend “Summer Training & Internship Program” [STIP] 2010 at
Rithala, Delhi and Department of Mechanical and Civil Engineering at NITK
Surathkal for providing the Workshops.
We would also like to thank our project guide Mr Vinayak Rana, Technical
Associate, ThinkLABS not only for giving us his invaluable guidance and
frequent suggestions during the course of the project. His suggestions helped
us maintain a good quality of work. We express my deep gratitude to him.
Finally we would like to thank Shivesh Kumar, 3rd year Mechanical Engineering
Student at NITK Surathkal,for his constant support and our families which
encouraged us at each and every step.
4. INTRODUCTION
What we learnt in thinklabs was to control our robot with a
keyboard,but our aim of this project is to control the speed of that robot too.
Basically what we did is transmitting a speed from a range of 1-254 (bitwise
not in any speed specific units) on our UART,and our robot will be working on
that specified speed. We used the concept of PULSE WIDTH MODULATION
here.
PULSE WIDTH MODULATION
The phase correct Pulse Width Modulation or phase correctPWM mode
(WGM13:0 = 1,2,3,10,
or 11) provides a high resolution phase correctPWM waveform
generation option. The phase
correctPWM mode is, like the phase and frequencycorrectPWM mode,
based on a dual-slope
operation. The counter counts repeatedly from BOTTOM(0x0000)to
TOP and then from TOP to
BOTTOM.In non-inverting Compare Output mode, the Output Compare
(OC1x) is cleared on
the compare match between TCNT1 and OCR1xwhile upcounting, and
set on the compare
match while downcounting. In inverting Output Compare mode,the
operation is inverted. The
dual-slope operation has lower maximum operation frequencythan
single slope operation. However,
due to the symmetric feature of the dual-slope PWM modes,these
modes are preferred for
motor control applications.
The PWM resolution for the phase correctPWM mode can be fixed to 8-
bit, 9-bit, or 10-bit, or
defined by either ICR1 or OCR1A.The minimum resolution allowed is 2-
bit (ICR1 or OCR1A set
to 0x0003),and the maximum resolution is 16-bit (ICR1 or OCR1A setto
MAX). The PWM resolution
in bits can be calculated by using the following equation:
In phase correctPWM mode the counter is incremented until the counter
value matches either
one of the fixed values 0x00FF,0x01FF,or 0x03FF (WGM13:0 = 1, 2, or
3), the value in ICR1
5. (WGM13:0 = 10), or the value in OCR1A (WGM13:0 = 11). The counter
has then reached the
TOP and changes the count direction. The TCNT1 value will be equal to
TOP for one timer clock
cycle.
ITEMS USED
MOTORS:
Stepper Motor: Need for locking was of the utmost importance to make
sure that the arm stopped right before the player the card needed to be
given to. Over-swinging was unacceptable as it would have made the
algorithm worthless.
DC Motor: Locking was not so necessary in lifting a card as we just
needed the arm to lift the card and then place it in front of the user
which does not need much calibration. None the less, a good quality
metal geared DC motor was used to make life easier.
ELECTRONICS PART:
Atmega16: The microcontroller unit (MCU) used in this project was
Atmega16 manufactured by Atmel. We preferred this microcontroller
over others because it was cheap, fast and provided us enough
programming memory and input/output pins.
L293D motor drivers: Weused L293D as our motor drivers. We used two
L293D I.Cs to drive one stepper and one DC motor. Though heating
problems were there with this I.Cs but somehow we managed.
Three active-low Switches: We used three active-low switches for taking
the input from user. These three switches were named as sw1, sw2 and
sw3. Sw1 was for setting the number of players as 2, sw2 was for setting
the number of players as 3, sw3 was for setting the number of players as
4.
Three LEDs: We used three different LEDs for the debugging process.
6. USB stk50v2 programmer: This programmer was used for programming
the microcontroller. It had a USB interface which was easily connectable
to any desktop/laptop.
16x2 LCD Display: A user interface was needed for better use of this
product. So we used a 16x2 LCD Display to show user the welcome
message, options available to him and finally to show users the names of
its developers.
AC-DC Adapter: A 12V adapter was used to convert the 230V AC voltage
to 12V DC output voltage.
POWER SOURCE:
Standard 230V AC voltage supply @ 50 Hz was used as the only power
source. To make the card dealer more portable and handy to use,
standard 12V Li-ion batteries can be used.
BUILDING MATERIALS:
The basic kit we got from thinklabs only……we did some modificatrion in
the coding.
SOFTWARE USED
WinAVR: WinAVR was used for programming the microcontroller. We used C
programming language and this software was used to convert the C code to
assembly/machine code.
Microsoft Office 2010: This software was used for preparing this
documentation.
7. FURTHER IMPROVEMENTS
Actually we tried making it WIRELESS but one of my wireless modules got
damaged,so couldn’tmanage it but I have ordered a new one frm Bangalore,so
I am hopeful that I’ll be able to make a wireless speed controlled robot .
I AM PROVIDING THE FULL PROGRAM CODE HERE WITH THIS REPORT. PLEASE
FEEL FREE TO DROP YOUR FEEDBACKS, COMMENTS AND DOUBTS ETC.
PROGRAM CODE
/*
=====================================================
=====================================================
===================
Header File -- motorcontrol.h
Description:A library to easily run two dc motors
simultaneously in steps with the help of encoder
module and encoder disc with AVR series of MCUs from
Atmel. Use with AVR studio and WinAVR.
Author – Rushil Goyal
[rushil33d@gmail.com]
Web -- avrdude.blogspot.com
Date -- 07/08/2011
NOTE==Please change these ports according to your
readymade board/your connections.
****************************************************************
********************************END*****************************
14. 3. Sensors and actuators and,
4. Artificial intelligence.
The manipulator
The body of a robotis the mechanical manipulator. Itis basically a mechanism
made of severallinks with severalactuated joints. The mechanism could be a
serial chain, or mixture of serial and parallel arrangements of links. The serial
chain mechanismis most widely used. Parallel and hybrid manipulators,
though not commonly used, have definite edge over serial manipulator when a
small precise motion is required and/or a large load has to be carried by the
robot.
A manipulator/robotconsists of severallinks connected by joints which allow
constrained motion between the links. The joints used in manipulators
generally allow one degree of freedom. Common joints used are revolute
which allows relative rotation of the links about an axis, and prismatic which
allow telescopic/sliding motion between the links. Sometimes spherical(allows
sphericalrotation), screw (converts rotation to linear motion) and cylindrical
(Allows rotation and sliding about same axis) joints are also used.
Classificationof Robots
Depending on the arrangements of links and types of joints used, robots can
be classified. One such classification could be:
Parallel manipulators: having closed chain of links
Serial manipulators: having open chain of links
HybridManipulators: having both serial and parallel linkages
The serial manipulators may be further classified as
1. CartesianRobots:
A Cartesian coordinate robot(also called linear robot) is an industrial robot
whosethree principal axes of controlare linear (i.e. they movein a straightline
rather than rotate) and are at right angles to each other.
15. 2. Cylindrical Robots
These robots have a naturalmotion in polar co-ordinatesystem. The
manipulator will have one revolute and two prismatic joints.
3. Spherical Robots
As the name suggests they have natural sphericalworkspace.
17. Control systemensures that the robot works theway it was programmed to.
Knowledgeof systemkinematics and dynamics are usefulin designing a control
system. Issueof tracking the trajectory with desired accuracy, stability of the
systemis to be addressed while designing the controlsystem. Depending on
application and type of actuators, controller could operate in open loop or
closed loop.
Locomotion
If the manipulator motion is comparablewith that of a human arm, then
locomotion is motion of the body as a whole, i.e., motion of the robot as a
whole. The robotcould be wheeled or legged. If robothas legs then one has to
plan gait (sequenceof leg movement) and take care of the stability of robot
during walking. Obstacle avoidance, kinematics, dynamics and control of
locomotion are the issues to be addressed.
Sensors and actuators
Whenever we wish to lift something by hand, we see the object, movethe arm
to reach the object, touch it, sense the force of grip, and then move the arm
back. Eyes, skin act as sensors (vision, tactile, force) and our muscles act as
actuators. Similarly when we wanta robotto do some task, it requires sensors
and actuators.
Sensors area must when we use closed-loop control. Sensors could be
encoders, resolvers, proximity sensors, tactile, force sensors, camera etc.
Stepper motors and DC servo motors are commonly used actuators in robotics.
Artificial intelligence
Fromtraditional symbolic computation to modern artificial neural network and
fuzzy logic, artificial intelligence as a discipline is growing fast. Artificial
intelligence can be incorporated in robotics which makes a robot autonomous.
20. We have an ideaactually inspiredfrom our seniors whichis as follows..:
To make an ‘engineering drafter’ controlledmechanically by computer ,
which will replicate the drawing made by us on computer on the actual
Engineering Graphics sheet.(specially for mechanical andcivil engineering
students). Sowe will be very thankful and grateful toyou for your any kind
of assistance inour project..
THAnk You
Rushil Goyal and SiddharthAgarwal
Internat THINKLABS,SINEIITBOMBAY