Вы находитесь на странице: 1из 4

Proceedings of the 5th National Conference; INDIACom-2011 Computing For Nation Development, March 10 11, 2011 Bharati Vidyapeeths

s Institute of Computer Applications and Management, New Delhi

An Ethnic Design of Line Follower Robot


1, 2

Govind Arora1 and Surabhi Mengi2 School of Electronics and Communication, Shri Mata Vaishno Devi University, Jammu & Kashmir, India 1 govindarora@yahoo.co.in and 2mengisurabhi@gmail.com
PIC Microcontroller [2], Atmel Microcontroller, and Freescale S12X Microcontroller [3]. PIC is generally 8-bit microcontroller but 16-bit and 32-bit are also available. ATMEL is 8-bit microcontroller.S12X is a 16bit or 32-bit microcontroller. Instruction sets of both ATMEL and PIC are quiet complex as compared to S12X. The Analog to Digital converter is not an inbuilt peripheral in ATMEL. The ATD present in the PIC is 8-bit and that in S12X is 8-bit as well as 10-bit also. In comparison to the other two microcontrollers the S12X microcontroller has 4 clock sources, which provides a wide range of frequencies for different purposes. But still the line following robots limits the choice of line that is made in the hardware abstraction and cannot be changed by software. The calibration is difficult, and it is not easy to set a perfect value. The steering mechanism is not easily implemented in huge vehicles and is impossible for nonelectric vehicles (petrol powered).There is a lack of a four wheel drive, which makes it not suitable for a rough terrain. It uses IR which even though solves a lot of problems pertaining to interference, but makes it hard to debug a faulty sensor. There is lack of speed control which makes the robot unstable at times. To overcome these limitations an ethnic line follower robot is designed using Freescales S12X microcontroller. Thus optimum results as compared to the conventional robot to the prototype robot have been obtained and these are: S12X microcontroller was used as its a RISC processor which is better suited for real-time operations. Thus the midrange devices were chosen because of low cost, low power consumption, code size efficiency and there is much faster execution of the program. However, in practical robotic systems the certain issues must be considered. The robot must be capable of following a line. It should be capable of taking various degrees of turns. It must be prepared of a situation that it runs into a territory which has no line to follow (Barren land syndrome). The robot must also be capable of following a line even if it has breaks. It should be insensitive to environmental factors such as lighting and noise. It must allow calibration of the lines darkest threshold value. The robot must be reliable. Scalability must be primary concern in the design. The color of the line must not be a factor as long as it is darker than the surroundings. 1.1. ANALOG SENSORS: Sensor circuit design consists of 4 SFH4550 Infrared LED and 8 SFH314 NPN phototransistor. Voltage across Phototransistor

ABSTRACT In this paper design improvements and control algorithms are presented for a line based path follower robot. A robot is a mechanical artificial agent. It is an electro-mechanical machine which is guided by a computer or electronic programming and is thus able to do tasks on its own. Robotic technology has become an integral part that deals with the automatic life. A prototype of a low cost robot which is capable of following the path and taking turns accordingly has been designed and built using Actuators arms, DC motor and Servo motor. A control system has been developed in order to control the robotic car operation and to improve the prototype behavior. The designed control system and results have been reported to show the operation of the prototype. KEYWORDS Analog sensors, DC Motor, Servo Motor, S12X Microcontroller, Control strategy(Methodology), Mechanism Design 1. INTRODUCTION The word "robot" originates from the Czech word for forced labor or serf [1]. Robots are electronic devices intended to perform a desired function. Robots have the potential to change our economy, our health, our standard of living, our knowledge and the world in which we live. As the technology progresses, we are finding new ways to use robots with the refinement of techniques. The line following robot, operates as the name specifies. It is programmed to follow a dark line on a white background and detect turns or deviations and operate the motors appropriately. The robot can be further enhanced to let the user decide whether it is a dark line on a white background or a white line on a dark background. The robot can also be programmed to decide what kind of line it is, instead of a user interface. The motor control could be modified to steer a convectional vehicle. Extra sensors could be attached to allow the robot to detect obstacles, and if possible bypass it and get back to the line. In other words, it must be capable of predicting the line beyond the obstacle. Speed control could also be incorporated. Position and distance sensing devices could also be built in which it can transmit information to a mother station, that will be useful in tracking a lost carrier. Many conventional line following robots are available using:

Copy Right INDIACom-2011 ISSN 0973-7529 ISBN 978-93-80544-00-7

Proceedings of the 5th National Conference; INDIACom-2011

is given to Analog input of Micro controller. When more light falls on phototransistor's base, it will conduct and voltage drop across collector and emitter of photo transistor will decrease. When less light falls on phototransistor's base, voltage across collector and emitter of phototransistor will increase. Analog Signal from Sensor IN0-IN7 is connected to AN0-AN7 analog channels.

Fig.1: Circuit diagram of Phototransistor [4] 1.2. DC MOTOR DC motor is driven by Freescale MC33931VW H-bridge motor driver [5]. DC motor will rotate according to the voltage difference applied between its 2 terminals. The polarity of the applied voltage will change the direction of rotation. Using PWM signal we can change voltage applied to DC motor. Operation of H-Bridge

Fig.2: Shows the two basic states of an H-bridge [6] The H-Bridge arrangement is generally used to reverse the polarity of the motor[7], but can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motor's terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively disconnected from the circuit. 1.3. SERVO MOTOR The servo motor is used to control the turning action of the car [8]. The servo will move based on the pulses sent over the control wire, which set the angle of the actuator arm. The servo expects a pulse every 20 ms in order to gain correct information about the angle. The width of the servo pulse indicates the range of the servo's angular motion [9]. A servo pulse of 1.5 ms width will set the servo to its "neutral" position, or 90. Pulse width less than 1.5ms will set position left to neutral or towards 0 and pulse width more than 1.5ms will set position Right to neutral or towards 180

1.4. S12X MICROCONTROLLER A microcontroller is a computer-on-a-chip used to control the electronic devices. It is a type of microprocessor emphasizing self sufficiency and cost- effectiveness, in contrast to general purpose microprocessor used in the normal PCs. A typical microcontroller contains all the memory and interfaces needed for a simple application, whereas the general purpose microprocessor requires additional chips to perform the same functions. In a robot as in this case the Car, microcontroller is embedded to implement intelligent control algorithms. Freescale S12X microcontroller is used to implement the design to run the sensor based robotic car. The MC9S12XD family retains low power consumption, EMC and code-size efficiency are the advantages that are enjoyed by users of Freescale's existing 16-Bit MC9S12 MCU Family. (It uses RISC processor). S12X introduces the performance boosting XGATE module. Using enhanced DMA parallel processing module offloads the CPU by providing high-speed data processing and transfer between peripheral modules, RAM, Flash EEPROM and I/O ports. Providing up to 80 MIPS of performance additional to the CPU, the XGATE can access all peripherals, Flash EEPROM and the RAM block. 512 Kbytes of Flash EEPROM, 32 Kbytes of RAM, 4 Kbytes of EEPROM, six asynchronous serial communications interfaces (SCI), three serial peripheral interfaces (SPI), an 8-channel IC/OC enhanced capture timer, an 8-channel, 10-bit analog-to-digital converter, a 16-channel, 10-bit analog-to-digital converter, an 8-channel pulse-width modulator (PWM), five CAN 2.0 A, B software compatible modules (MSCAN12), two inter-IC bus blocks, and a periodic interrupt timer. The MC9S12XD family has full 16bit data paths throughout. System power consumption can be further improved with the new fast exit from stop mode feature. Four timers with independent time-out periods, CRG (clock and reset generator), PLL, COP watchdog, Real time interrupt, Clock monitor, Fast wake-up from stop mode, Memory(512, 256 and 128-Kbyte Flash EEPROM, 4 and 2Kbyte EEPROM, 32, 16 and 12-Kbyte RAM), One 16-channel and one 8-channel ADC (analog-to-digital converter), 8 PWM (pulse-width modulator) channels. 2. METHODOLOGY The control strategy refers to the nature and direction of the linkages between the variables measured and control variables. The control system used in the car is very simple and it just requires the basic details and manipulations of the different outputs and inputs that are received and transmitted in some way or the other. For the control action of the car two things are to be kept in mind, the turning of the car and the speed of the car. The turning is controlled by moving the actuator arm of the servo either in left or right direction according to the track. This is done by changing the duty cycle of the PWM. The speed is also controlled by changing the duty cycle of the PWM used to control the DC motor. When the light falls from the infrared led used, then the phototransistors conducts the voltage drop accordingly. These analog readings are then converted

An Ethnic Design of Line Follower Robot

into the digital values using the inbuilt ATD converter in the S12X microcontroller. These sensor values are then calibrated accordingly to find the black line and accordingly the PWM is set for the DC Motor and the Servo Motor. The digital readings are stored and accordingly the path is detected exactly under that sensor whose reading is the darkest. Accordingly the algorithm follows that pattern and turns towards that side under which the sensor reading is the darkest. The development and implementation of the software was based on the needs that were presented, divided by modules, in order to cope with each of the needs independently.

START Set the Switch Initialize DC Motor Initialize PWM Initialize ATD Delay Calibrate Sensors Find the Path Set PWM for Servo Set PWM for DC Motor
6. CONCLUSION In this designed model, the speed is automatically controlled by the path it follows. Earlier two DC motors were used for controlling speed and steering both, but in this designed model one DC motor is used for controlling the speed and one servo motor is used for steering purpose. This method of line follower can be implemented in various applications such as: Industrial automated equipment carriers, Entertainment and small household applications, Automated cars, Tour guides in museums and other similar applications, Second wave robotic reconnaissance operations. REFERENCES [1]. Theory on Robot. [Online].Available http://en.wikipedia.org/wiki/Robot [2]. Programming and Customizing the PIC microcontroller by Myke Predko 2nd edition McGraw Hill. [3]. MC9S12XDP512RMV2 datasheet of S12X Microcontroller by Freescale Semiconductor [4]. Datasheet of Smart Car Sensor by Freescale Semiconductor [5]. Theory of DC motor. [Online].Available http://en.wikipedia.org/wiki/DC_motor and

Fig.3: Block Schematic of Designed Model 3. PROPOSED ALGORITHM FOR THE DESIGNED MODEL Initialization of different ports that are used for interfacing; Setting up the clock; Initialization of the ATD; Initialization of the DC Motor; Initialization of the Servo Motor; Calibration of the sensor; Setting up the PWM for Servo Motor; Setting up the PWM for DC motor[10]. The pseudo code of the designed model is as follows 4. WORKING When the light falls from the infrared led used, then the phototransistors conducts the voltage drop accordingly. These analog readings are then converted into the digital values using the inbuilt ATD converter in the S12X microcontroller. These sensor values are then calibrated accordingly to find the black line and accordingly the PWM is set for the DC Motor and the Servo Motor. The digital readings are stored and accordingly the path is detected exactly under that sensor whose reading is the darkest. 5. RESULT AND DISCUSSIONS The robot was finally running on a black track with a few glitches here and there which were sorted in the later revisions of the firmware. The line following robot still has a few shortcomings but achieves most of the objectives. Results achieved proved that the proposed line follower robot provides reasonable and optimum performance in terms of speed, turning action, power used and accuracy to follow the line. The algorithm used is such that since it is small the execution is much faster in comparison to the other line following algorithms used for the same purpose.

Proceedings of the 5th National Conference; INDIACom-2011

http://www.solarbotics.net/starting/200111_dcmotor/2001 11_dcmotor2.html [6]. Theory of H-Bridge. [Online]. Avialable at http://en.wikipedia.org/wiki/H-bridge and http://www.robotroom.com/HBridge.html [7]. MC33931datasheet of a Throttle Control H-bridge by Freescale Semiconductor [8]. Theory of Servo motor. [Online].Available homepage of http://www.qcontrol.com/ [9]. Servo mechanism. [Online].Available http://en.wikipedia.org/wiki/Servomechanism [10]. Speed control of DC motor using PWM. [Online]. Available at http://ugpro143.blogspot.com/2008/04/speed-control-ofdc-motor-using-pwm.html

Вам также может понравиться