CHAPTER 1
INTRODUCTION
Robotic arms are used in lifting heavy objects and carrying out tasks that require extreme concentration and expert accuracy. This study mainly focuses on the accuracy in control mechanism of the arm while gripping and placing of objects. The system facilitates autonomous object detection within its limitations. A user interface is incorporated with the system for human input feed on the desired destination within the working frontiers. The targeted destination is specified in terms of height, radius and angle. In addition the orientation of the object can be provisioned along with the destination. Determining real time and highly accurate characteristics of small objects in a fast flowing stream would open new directions for industrial sorting processes. The present paper relates to an apparatus and method for classify in and sorting small-sized objects, using electronic systems and advanced sensors operating on the basis of a physical and geometric characterization of each element. Recent advances in electronics and printed circuit board technology open new perspectives for industrial application in this field. The proposed selection process is based on a multisensorial characterization, and more specifically on crossed optical and impedimetric analysis of the objects to be sorted. Parallel guides, also called channels, are created on a slanted plant support. The objects to be sorted are immersed in a continuous, free-falling flow along said guides. By another way this project can be treated an automated material handling system & can be designed by following way. It aims in classifying the colored objects by picking and placing the objects in its respective pre-programmed place. Thereby eliminating the monotonous work done by human, achieving accuracy and speed in the work. The project involves camera that senses the object’s color and sends the signal to the microcontroller. The microcontroller sends signal to circuit which drives the various motors of the robotic arm to grip the object and place it in the specified location. Based upon the color detected, the robotic arm moves to the specified location, releases the object and comes back to the original position.
CHAPTER 2
LITERATURE SURVEY
Robotic arm is a type of mechanical arm, usually programmable, with similar functions to a human arm. Types of robot arms depend on their range, working capability and reach. Cartesian robot is used for pick and place work, plotting and handling arc welding. Its range is mostly 2 dimensional. Cylindrical robot is also used for the above mentioned working categories, but since it operates in a cylindrical co-ordinate system, it can be used to do the operations more precisely and accurately, furthermore it also has a wider reachable range. Spherical robot works on the polar coordinate system. RB 50 robot arm is mainly used for pick and place work. It has to parallel rotary joints to provide flexibility in a plane. Then for a three dimensional reach it is usually combined with other mechanisms. Articulated robot has three rotary joints. Parallel robots are used in the mobile platform handling cockpit flight simulators. It is a robot whose arms have concurrent prism shaped or rotary joints. Anthropomorphic robot this resembles a human hand, with independent fingers and thumbs.
And gripper is an end-of-arm device often used in material handling applications. Generally, the gripper is a device that is capable of generating enough grip force to retain an object while the robot performs a task on the part such a pick-and-place operation. Any gripper must be capable of performing the task of opening and closing with a prescribed amount of force over many years of daily operation The most commonly used grippers are finger grippers. These grippers generally have two opposing fingers or three fingers like a lathe chuck. The fingers are driven together such that once gripped any part is centered in the gripper. This gives some flexibility to the location of components at the pick-up point. Two finger grippers can be further split into parallel motion or angular motion fingers. Angular jaw gripper open and close around a central pivot point, moving in an arcing motion.
CHAPTER 3
EXISTING SYSTEM
In earlier days, industrial control was purely by human beings which required lot of efforts. To overcome the drawbacks of this system there came the concept of automation in industries. There are two types of existing system. They are Human effort heavy vehicles and machineries and the second type is automated machineries but its method of operation uses a set of inductive, capacitive and optical sensors do differentiate object color. . When this system is used, there is a need of huge effort of human and its having a long time. And existing automated machineries based on sensors and half automated like systems
3.1 DISADVANTAGES OF EXISTING SYSTEM
ü Manual effort must require to operate the system
ü Its taken a long time to complete the tasks
ü Its require high energy and fuel consumption.
ü Maintenance is difficult in multiple levels.
ü Sensor based automated system may not shows a stability.
CHAPTER 4
PROPOSED SYSTEM
The Proposed system is a smart approach for a real time inspection and selection of objects in continuous flow. Image processing in today’s world grabs massive attentions as it leads to possibilities of broaden application in many fields of high technology. The real challenge is how to improve existing sorting system in the modular processing system which consists of four integrated stations of identification, processing, selection and sorting with a new image processing feature. Existing sorting method uses a set of inductive, capacitive and optical sensors do differentiate object color. This paper presents a mechatronics color sorting system solution with the application of image processing. Image processing procedure senses the objects in an image captured in real-time by a webcam and then identifies color and information out of it. This information is processed by image processing for pick-and-place mechanism. The Project deals with an automated material handling system. It aims in classifying the colored objects by color, size, which are coming on the conveyor by picking and placing the objects in its respective pre-programmed place. Thereby eliminating the monotonous work done by human, achieving accuracy and speed in the work. The project involve sensors that senses the object’s color, size and sends the signal to the microcontroller. The microcontroller sends signal to circuit which drives the various motors of the robotic arm to grip the object and place it in the specified location. Based upon the detection, the robotic arm moves to the specified location, releases the object and comes back to the original position.
4.1 DEVELOPMENT OF THE PROJECT:
The basic theme of this project is object flowing on conveyor are sensed, selected and sorted depending on their color and size. For this, camera is used as input sensor, camera is overhead camera which will be mounted on PC, and will be connected to PC by USB. The camera will take a snap and it will feed to PC for color processing. In PC MATLAB is used for processing on color, depending on this signal will be given to microcontroller Atmega 328. The microcontroller in turn will control the servomotors by PWM signals. These servomotors will control the movement of robotic arm, by controlling their angular movement. Thus the robotic arm will be fully controlled by servomotors. The gripper of robotic arm will pick the object place it depending on its size. This is full automatic process no manual support is needed. The microcontroller used here is with the support of Arduino kit. The Arduino is good platform for robotics application. It is the software and hardware also, using both the above system is developed. Thus the real time, continuous object sorting can be done.
4.2 BLOCK DIAGRAM
Figure 4.1: Block Diagram
4.3 BLOCK DIAGRAM DESCRIPTION
4.3.1 Microcontroller(ATMega328) : ATMega328 is the ATMEL Microcontroller on which Arduino UNO is based. This product let you to realize your small project without using a full size Arduino board. To make this microcontroller working with the Arduino IDE you need a 16Mhz crystal, a 5 V power supply and a serial connection.And its a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the Atmega 328 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The Atmega 328 provides the following features: 4K/8Kbytes of In-System Programmable Flash with Read-While-Write capabilities, 256/512/512/1Kbytes EEPROM, 512/1K/1K/2Kbytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes. This allows very fast start-up combined with low power consumption.The 16 MHz Crystal Oscillator module is designed to handle off-chip crystals that have a frequency of 16 MHz. The crystal oscillator output is fed to the System. As an alternative to using a crystal, you can use an externally generated 16 MHz clock source as input tothe on-chip 16 MHz oscillator.
4.3.2 Camera
Fig. 4.2 logitech webcam
The camera used in this case will be overhead camera, it will take the snapshot of the object for color sensing purpose. The image captured by the camera will be processed by image processing using matlab. The camera used in this case is Logitech PN 960-000748
whose technical specifications are:
ü Video calling (640 x 480 pixels)
ü Video capture: Up to 1024 x 768 pixels
ü Fluid Crystal Technology
ü Photos: Up to 1.3 megapixels (software enhanced)
ü Built-in mic with noise reduction
ü Hi-Speed USB 2.0 certified (recommended)
ü Universal clip fits laptops, LCD or CRT monitors
4.3.3 Matlab and Image Processing
The name MATLAB stands for Matrix Laboratory. MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB is a high performance language for technical computing. It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object oriented programming. These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. It has powerful built-in routines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available. Applications are collected in packages referred to as toolbox. There are tool boxes for signal processing, symbolic computation, control theory, simulation, optimization, and several other of applied science and engineering . Image can be assumed as the visualization of what vision senses that is captured by camera. Image is considered as a two dimensional function with variables that represent the spatial coordinate. It holds information about color as well as shapes. In color image, RGB color model mixes those three prime color components, red, green and blue, to produce another color. Image capturing and processing have been used widely in diverse applications, such in medical and surveillance applications.
4.3.4 Arduino
Fig. 4.3 Arduino Kit
Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be standalone, or they can be communicating with software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards can be assembled by hand or
purchased preassembled; the open-source IDE can be downloaded for free. The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment.
An Arduino board consists of an 8-bit Atmel AVR microcontroller with complementary components to facilitate programming and incorporation into other circuits. An important aspect of the Arduino is the standard way that connectors are exposed, allowing the CPU board to be connected to a variety of interchangeable add-on modules (known as shields).
Most boards include a 5 volt linear regulator and a 16 MHz crystal oscillator. The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. There are many other microcontrollers and microcontroller platforms available for physical computing. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems:
ü Inexpensive -The least expensive version of the Arduino module can be assembled by hand.
ü Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems.
ü Simple, clear programming.
ü Open source and extensible software- The Arduino software is published as open source tools, available for extension by experienced programmer.
ü Open source and extensible hardware – The Arduino is based on Atmel's ATMEG328
ü ATMEGA328 microcontrollers. There are a great many Arduino compatible and Arduino derived boards.
Fig 4.4 ATmega 328 Pin Diagram
Some are functionally equivalent to an Arduino and may be used interchangeably. Many are the basic Arduino with the addition of commonplace output drivers, often for use in school level education to simplify the construction of buggies and small robots.
4.3.5 Robotic Arms & Servomotors
Arms are types of jointed robot manipulator that allow robots to interact with their environment. Many have onboard controllers or translators to simplify communication, though they may be controlled directly or in any number of ways. Due to this fact, standalone arms are often classified as full robots. The robot used in this project is 4 Axis Robotic Arm. 4 Axis Robotic Arm is designed for small mobile robots. It can grip objects with the size up to 60mm with the force up to 250gms. Arm has reach of 23cm. It can lift the payload up to 400gms. Robotic Arm comes fully assembled and ready to use. First two axis of the arm are made up of NRS-995 dual bearing heavy duty metal gear motors and remaining 2 axis and gripper uses NRS-585 dual bearing plastic gear servo motors. Axis 2 and 3 enables gripper to
maintain its angle constant with the surface while moving up and down. Robotic arm can do Left-Right, Up-Down while keeping gripper parallel to surface, Twist motions and Gripping action. Robotic Arm will require current up to 5Amps. Make sure that your robot can supply that much amount of current for proper operation of the arm. The robotic arm has following specifications.
ü Number of Axis: 4 + Gripper
ü Gripping force: 250gms (Maximum)
ü Gripping jaw length: 43mm
ü Gripping jaw width: 60mm
ü Weight: 541gms (Including 2 NRS-995 and 3 NRS-585 servo motors)
ü Operating voltage: 5V to 6V
ü Reach: 23cm
Servos are DC motors with built in gearing and feedback control loop circuitry. And no motor drivers required. A servomotor is a rotary actuator that allows for precise control of angular position. They consist of a motor coupled to a sensor for position feedback, through a reduction gearbox. They also require a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors. Servomotors are used in applications such as robotics, CNC machinery or automated manufacturing. The servo motor has some control circuits and a potentiometer (a variable resistor) that is connected to the output shaft. This pot allows the control circuitry to monitor the current angle of the servo motor. If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the angle is not correct, it will turn the motor the correct direction until the angle is correct. The output shaft of the servo is capableof traveling somewhere around 180 degrees.Usually, its somewhere in the 210 degree range, but it varies by manufacturer. A normal servo is used to control an angular motion of between 0 and 180 degrees.
Table 4.1 Axis Capabilities
A normal servo is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear. The amount of power applied to the motor is proportional to the distance it needs to travel. So, if the shaft needs to turn a large distance, the motor will run at full speed. If it needs to turn only a small amount, the motor will run at a slower speed.
Fig. 4.5 Four Axis Robot
The motor is paired with some type of encoder to provide position and speed feedback. In the simplest case, only the position is measured. The measured position of the output is compared to the command position, the external input to the controller. If the output position differs from that required, an error signal is generated which then causes the motor to rotate in either direction, as needed to bring the output shaft to the appropriate position. As the positions approach, the error signal reduces to zero and the motor stops.More sophisticated servomotors measure both the position and also the speed of the output shaft. They may also control the speed of their motor, rather than always running at full speed. Both of these enhancements, usually in combination with a PID control algorithm, allow the servomotor to be brought to its commanded position more quickly and more precisely, with less overshooting. The servo turn rate, or transit time, is used for determining servo rotational velocity. This is the amount of time it takes for the servo to move a set amount, usually 60
degrees. For example, suppose you have a servo with a transit time of 0.17sec/60 degrees at no load, this means it would take nearly half a second to rotate an entire 180 degrees
Fig. 4.6 Servomotor Rotation
4.3.6 L293D Motor Driver IC:
L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive on either direction. L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It means that you can control two DC motor with a single L293D IC. Dual H-bridge Motor Driver integrated circuit (IC).The l293d can drive small and quiet big motors as well. It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be flown in either direction. As you know voltage need to change its direction for being able to rotate the motor in clockwise or anticlockwise direction, Hence H-bridge IC are ideal for driving a DC motor. In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc motor independently. Due its size it is very much used in robotic application for controlling DC motors. Given below is the pin diagram of a L293D motor controller.
Fig. 4.7 Pin out of l293d
There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in the corresponding section will suspend working. It’s like a switch. You can simply connect the pin16 VCC (5v) to pin 1 and pin 9 to make them high.
Working of L293D
The there 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected across left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1.In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.
L293D Logic Table.
Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise direction the input pins has to be provided with Logic 1 and Logic 0.
ü Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction
ü Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
ü Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
ü Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
In a very similar way the motor can also operated across input pin 15,10 for motor on the right hand side.
Circuit Diagram of L293D
Fig. 4.8 Circuit Diagram of L293D
Voltage Specification
VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this voltage for driving the motor. For driving the motors it has a separate provision to provide motor supply VSS (V supply). L293d will use this to drive the motor. It means if you want to operate a motor at 9V then you need to provide a Supply of 9V across VSS Motor supply. The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per channel.Since it can drive motors Up to 36v hence you can drive pretty big motors with this l293d. VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges from 5v and upto 36V. Don’t Exceed the Vmax Voltage of 36 volts or it will cause damage.
4.3.7 Graphical user interface (Gui)
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent appearance and with intuitive controls like pushbuttons, list boxes, sliders, menus, and so forth. The GUI should behave in an understandable and predictable manner, so that a user knows what to expect when he or she performs an action. For example, when a mouse click occurs on a pushbutton, the GUI should initiate the action described on the label of the button. This chapter introduces the basic elements of the MATLAB GUIs. The chapter does not contain a complete description of components or GUI features, but it does provide the basics required to create functional GUIs for your programs.
Fig. 4.9 GUI
How a Graphical User Interface Works
A graphical user interface provides the user with a familiar environment in which to work. This environment contains pushbuttons, toggle buttons, lists, menus, text boxes, and so forth, all of which are already familiar to the user, so that he or she can concentrate on using the application rather than on the mechanics involved in doing things. However, GUIs are harder for the programmer because a GUI-based program must be prepared for mouse clicks (or possibly keyboard input) for any GUI element at any time. Such inputs are known as events, and a program that responds to events is said to be event driven. The three principal elements required to create a MATLAB Graphical User Interface are
1. Components. Each item on a MATLAB GUI (pushbuttons, labels, edit boxes, etc.) is a graphical component. The types of components include graphical controls (pushbuttons, edit boxes, lists, sliders, etc.), static elements (frames and text strings), menus, and axes. Graphical controls and static elements are created by the function uicontrol, and menus are created by the functions uimenu and uicontextmenu. Axes, which are used to display graphical data, are created by the function axes.
2. Figures. The components of a GUI must be arranged within a figure, which is a window on the computer screen. In the past, figures have been created automatically whenever we have plotted data. However, empty figures can be created with the function figure and can be used to hold any combination of components.
3. Callbacks. Finally, there must be some way to perform an action if a user clicks a mouse on a button or types information on a keyboard. A mouse click or a key press is an event, and the MATLAB program must respond to each event if the program is to perform its function. For example, if a user clicks on a button, that event must cause the MATLAB code that implements the function of the button to be executed. The code executed in response to an event is known as a call back. There must be a callback to implement the function of each graphical component on the GUI.
Creating and Displaying a Graphical User Interface
MATLAB GUIs are created using a tool called guide, the GUI Development Environment. This tool allows a programmer to layout the GUI, selecting and aligning the GUI components to be placed in it. Once the components are in place, the programmer can edit their properties: name, color, size, font, text to display, and so forth. When guide saves the GUI, it creates working program including skeleton functions that the programmer can modify to implement the behavior of the GUI. The large white area with grid lines is the layout area, where a programmer can layout the GUI. The Layout Editor window has a palate of GUI components along the left side of the layout area. A user can create any number of GUI components by first clicking on the desired component, and then dragging its outline in the layout area. The top of the window has a toolbar with a series of useful tools that allow the user to distribute and align GUI components, modify the properties of GUI components, add menus to GUIs, and so on. The basic steps required to create a MATLAB GUI are:
1. Decide what elements are required for the GUI and what the function of each element will be. Make a rough layout of the components by hand on a piece of paper.
4.4 CIRCUIT DIAGRAM
Figure 4.10: Circuit Diagram
The circuit includes a custom made Atmega328 board acting as a main controller. This board will be interfaced to the PC using USB interface. A 4-axis Pick and Place robot using SERVO motors will be build and interfaced to the atmega328 board through PWM lines which will be used to control the pick and place action.
A Matlab based code will interface with a USB web cam on PC/laptop which will sense objects and its colors and according command will be sent to the microcontroller to pick and place object We’ll primarily sense three Colors RED GREEN and BLUE
4.5 CIRCUIT DESCRIPTION 4.5.1 ATMEGA328
HISTORY
The AVR architecture was conceived by two students at the (NTH), Alf Egil Bogen and Vegard Wollan. He original AVR MCU was developed at a local ASIC house in Trondheim, Norway, called Nordic VLSI at the time, now Nordic Semiconductor, where Bogen and Wollan were working as students. It was known as a μRISC (Micro RISC)and was available as silicon IP/building block from Nordic VLSI. When the technology was sold to Atmel from Nordic VLSI, the internal architecture was further developed by Bogen and Wollan at Atmel Norway, a subsidiary of Atmel. The designers worked closely with compiler writers at IAR Systems to ensure that the instruction set provided for more efficient compilation of high-level languages. Atmel says that the name AVR is not an acronym and does not stand for anything in particular. The creators of the AVR give no definitive answer as to what the term "AVR" stands for. However, it is commonly accepted that AVR stands for Alf (Egil Bogen) and Vegard (Wollan)'s RISC processor. Note that the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel AVR Microcontrollers. Among the first of the AVR line was the AT90S8515, which in a 40-pin DIP package has the same pinout as an 8051 microcontroller, including the external multiplexed address and data bus. The polarity of the RESET line was opposite (8051's having an active-high RESET, while the AVR has an active-low RESET), but other than that the pinout was identical.
Internal registers
Fig 4.11: Atmel ATxmega128A1 in 100-pin TQFP package
The AVRs have 32 single-byte registers and are classified as 8-bit RISC devices.In the tinyAVR and megaAVR variants of the AVR architecture, the working registers are mapped in as the first 32 memory addresses (000016–001F16), followed by 64 I/O registers (002016–005F16). In devices with many peripherals, these registers are followed by 160 “extended I/O” registers, only accessible as memory-mapped I/O (006016–00FF16).Actual SRAM starts after these register sections, at address 006016 or, in devices with “extended I/O”, at 010016.Even though there are separate addressing schemes and optimized opcodes for accessing the register file and the first 64 I/O registers, all can still be addressed and manipulated as if they were in SRAM.
The very smallest of the tinyAVR variants use a reduced architecture with only 16 registers (r0 through r15 are omitted) which are not addressable as memory locations. I/O memory begins at address 000016, followed by SRAM. In addition, these devices have slight deviations from the standard AVR instruction set. Most notably, the direct load/store instructions (LDS/STS) have been reduced from 2 words (32 bits) to 1 word (16 bits), limiting the total direct addressable memory (the sum of both I/O and SRAM) to 128 bytes. Conversely, the indirect load instruction's (LD) 16-bit address space is expanded to also include non-volatile memory such as Flash and configuration bits; therefore, the LPM instruction is unnecessary and omitted.
In the XMEGA variant, the working register file is not mapped into the data address space; as such, it is not possible to treat any of the XMEGA's working registers as though they were SRAM. Instead, the I/O registers are mapped into the data address space starting at the very beginning of the address space. Additionally, the amount of data address space dedicated to I/O registers has grown substantially to 4096 bytes (000016–0FFF16). As with previous generations, however, the fast I/O manipulation instructions can only reach the first 64 I/O register locations (the first 32 locations for bitwise instructions). Following the I/O registers, the XMEGA series sets aside a 4096 byte range of the data address space, which can be used optionally for mapping the internal EEPROM to the data address space (100016–1FFF16). The actual SRAM is located after these ranges, starting at 200016.
GPIO ports Each GPIO port on a tiny or mega AVR drives up to eight pins and is controlled by three 8-bit registers: DDRx, PORTx and PINx, where x is the port identifier.
EEPROM Almost all AVR microcontrollers have internal EEPROM for semi permanent data storage. Like flash memory, EEPROM can maintain its contents when electrical power is removed. In most variants of the AVR architecture, this internal EEPROM memory is not mapped into the MCU's addressable memory space. It can only be accessed the same way an external peripheral device is, using special pointer registers and read/write instructions, which makes EEPROM access much slower than other internal RAM. However, some devices in the SecureAVR (AT90SC) family. use a special EEPROM mapping to the data or program memory, depending on the configuration. The XMEGA family also allows the EEPROM to be mapped into the data address space.
Since the number of writes to EEPROM is not unlimited Atmel specifies 100,000 write cycles in their datasheets a well designed EEPROM write routine should compare the contents of an EEPROM address with desired contents and only perform an actual write if the contents need to be changed. Note that erase and write can be performed separately in many cases, byte-by-byte, which may also help prolong life when bits only need to be set to all 1s (erase) or selectively cleared to 0s (write).
Program execution Atmel's AVRs have a two-stage, single-level pipeline design. This means the next machine instruction is fetched as the current one is executing. Most instructions take just one or two clock cycles, making AVRs relatively fast among eight-bit microcontrollers.The AVR processors were designed with the efficient execution of compiled C code in mind and have several built-in pointers for the task.
Instruction set The AVR instruction set is more orthogonal than those of most eight-bit microcontrollers, in particular the 8051 clones and PIC microcontrollers with which AVR competes today. However, it is not completely regular:
MCU speed The AVR line can normally support clock speeds from 0 to 20 MHz, with some devices reaching 32 MHz. Lower-powered operation usually requires a reduced clock speed. All recent (Tiny, Mega, and Xmega, but not 90S) AVRs feature an on-chip oscillator, removing the need for external clocks or resonator circuitry. Some AVRs also have a system clock prescaler that can divide down the system clock by up to 1024. This prescaler can be reconfigured by software during run-time, allowing the clock speed to be optimized.Since all operations (excluding multiplication and 16-bit add/subtract) on registers R0–R31 are single-cycle, the AVR can achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up to 8 MIPS. Loads and stores to/from memory take two cycles, branching takes two cycles. Branches in the latest "3-byte PC" parts such as ATmega2560 are one cycle slower than on previous devices
Features Current AVRs offer a wide range of features:
ISP
Fig 4.12: 6 and 10 pin ISP header diagrams
The in-system programming (ISP) programming method is functionally performed through SPI, plus some twiddling of the Reset line. As long as the SPI pins of the AVR are not connected to anything disruptive, the AVR chip can stay soldered on a PCB while reprogramming. All that is needed is a 6-pin connector and programming adapter. This is the most common way to develop with an AVR.The Atmel AVRISP mkII device connects to a computer's USB port and performs in-system programming using Atmel's software.AVRDUDE (AVR Downloader/UploaDEr) runs on Linux, FreeBSD, Windows, and Mac OS X, and supports a variety of in-system programming hardware, including Atmel AVRISP mkII, Atmel JTAG ICE, older Atmel serial-port based programmers, and various third-party and "do-it-yourself" programmers.
PDI The Program and Debug Interface (PDI) is an Atmel proprietary interface for external programming and on chip debugging of XMEGA devices. The PDI supports high speed programming of all non-volatile memory (NVM) spaces; flash, EEPROM, fuses, lock bits and the User Signature Row. This is done by accessing the XMEGA NVM controller through the PDI interface, and executing NVM controller commands. The PDI is a 2-pin interface using the Reset pin for clock input (PDI_CLK) and a dedicated data pin (PDI_DATA) for input and output.
High-voltage serial High voltage serial programming (HVSP) is mostly the backup mode on smaller AVRs. An 8-pin AVR package does not leave many unique signal combinations to place the AVR into a programming mode. A 12-volt signal, however, is something the AVR should only see during programming and never during normal operation.
High-voltage parallel High-voltage parallel programming (HVPP) is considered the "final resort" and may be the only way to correct bad fuse settings on an AVR chip.
Bootloader Most AVR models can reserve a bootloader region, 256 B to 4 KB, where re-programming code can reside. At reset, the bootloader runs first and does some user-programmed determination whether to re-program or to jump to the main application. The code can re-program through any interface available, it could read an encrypted binary through an Ethernet adapter like PXE. Atmel has application notes and code pertaining to many bus interfaces.
ROM The AT90SC series of AVRs are available with a factory mask-ROM rather than flash for program memory. Because of the large up-front cost and minimum order quantity, a mask ROM is only cost effective for high-production runs.
aWire The Atmel 8-bit AVR RISC-based microcontroller combines 32 KB ISP flash memory with read-while-write capabilities, 1 KB EEPROM, 2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts. The device achieves throughputs approaching 1 MIPS per MHz In our days, there have been many advancement in the field of Electronics and many cutting edge technologies are being developed every day, but still 8 bit microcontrollers have its own role in the digital electronics market dominated by 16-32 & 64 bit digital devices. Although powerful microcontrollers with higher processing capabilities exist in the market, 8bit microcontrollers still hold its value because of their easy-to-understand-operation, very much high popularity, ability to simplify a digital circuit, low cost compared to features offered, addition of many new features in a single IC and interest of manufacturers and consumers.Today’s microcontrollers are much different from what it were in the initial stage, and the number of manufacturers are much more in count than it was a decade or two ago. At present some of the major manufacturers are Microchip (publication: PIC microcontrollers), Atmel (publication: AVR microcontrollers), Hitachi, Phillips, Maxim, NXP, Intel etc. Our interest is upon ATmega32. It belongs to Atmel’s AVR series micro controller family. Let’s see the features.
PIN count: Atmega32 has got 40 pins. Two for Power (pin no.10: +5v, pin no. 11: ground), two for oscillator (pin 12, 13), one for reset (pin 9), three for providing necessary power and reference voltage to its internal ADC, and 32 (4×8) I/O pins.
About I/O pins: ATmega32 is capable of handling analogue inputs. Port A can be used as either DIGITAL I/O Lines or each individual pin can be used as a single input channel to the internal ADC of ATmega32, plus a pair of pins AREF, AVCC & GND together can make an ADC channel.No pins can perform and serve for two purposes (for an example: Port A pins cannot work as a Digital I/O pin while the Internal ADC is activated) at the same time. It’s the programmers responsibility to resolve the conflict in the circuitry and the program. Programmers are advised to have a look to the priority tables and the internal configuration from the datasheet.
Digital I/O pins: ATmega32 has 32 pins (4portsx8pins) configurable as Digital I/O pins.
Timers: 3 Inbuilt timer/counters, two 8 bit (timer0, timer2) and one 16 bit (timer1).
ADC: It has one successive approximation type ADC in which total 8 single channels are selectable. They can also be used as 7 (for TQFP packages) or 2 (for DIP packages) differential channels. Reference is selectable, either an external reference can be used or the internal 2.56V reference can be brought into action. There external reference can be connected to the AREF pin.
Communication Options: ATmega32 has three data transfer modules embedded in it. They are
· External Interrupt: 3External interrupt is accepted. Interrupt sense is configurable.
· Memory: It has 32Kbytes of In-System Self-programmable Flash program memory, 1024 Bytes EEPROM, 2Kbytes Internal SRAM. Write/Erase Cycles: 10,000 Flash / 100,000 EEPROM.
· Clock: It can run at a frequency from 1 to 16 MHz. Frequency can be obtained from external Quartz Crystal, Ceramic crystal or an R-C network. Internal calibrated RC oscillator can also be used.
· More Features: Up to 16 MIPS throughput at 16MHz. Most of the instruction executes in a single cycle. Two cycle on-chip multiplication. 32 × 8 General Purpose Working Registers
· Debug: JTAG boundary scan facilitates on chip debug.
· Programming: Atmega32 can be programmed either by In-System Programming via Serial peripheral interface or by Parallel programming. Programming via JTAG interface is also possible. Programmer must ensure that SPI programming and JTAG are not be disabled using fuse bits; if the programming is supposed to be done using SPI programming and JTAG are not be disabled using fuse bits; if the programming is supposed to be done using SPI or JTAG .
4.5.2 L293D L293D Description L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive on either direction. L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It means that you can control two DC motor with a single L293D IC. Dual H-bridge Motor Driver integrated circuit (IC). The l293d can drive small and quiet big motors as well, check the Voltage Specification at the end of this page for more info.Concept It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be flown in either direction. As you know voltage need to change its direction for being able to rotate the motor in clockwise or anticlockwise direction, Hence H-bridge IC are ideal for driving a DC motor. In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc motor independently. Due its size it is very much used in robotic application for controlling DC motors. Given below is the pin diagram of a L293D motor controller. There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in the corresponding section will suspend working. It’s like a switch. TIP: you can simply connect the pin16 VCC (5v) to pin 1. Working of L293D The there 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected across left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1.In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.
L293D Logic Table. Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise direction the input pins has to be provided with Logic 1 and Logic 0.
• Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
• Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
Voltage Specification VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this voltage for driving the motor. For driving the motors it has a separate provision to provide motor supply VSS (V supply). L293d will use this to drive the motor. It means if you want to operate a motor at 9V then you need to provide a Supply of 9V across VSS Motor supply.The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per channel.Since it can drive motors Up to 36v hence you can drive pretty big motors with this l293d.VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges from 5v and upto 36v.
CHAPTER 5
SYSTEM SPECIFICATION
5.1 SOFTWARE REQUIREMENTS:
5.1.1 MATLAB
The name MATLAB stands for Matrix Laboratory. MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB is a high performance language for technical computing. It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object oriented programming. These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. It has powerful built-in routines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available. Applications are collected in packages referred to as toolbox. There are tool boxes for signal processing, symbolic computation, control theory, simulation, optimization, and several other of applied science and engineering . Image can be assumed as the visualization of what vision senses that is captured by camera. Image is considered as a two dimensional function with variables that represent the spatial coordinate. It holds information about color as well as shapes. In color image, RGB color model mixes those three prime color components, red, green and blue, to produce another color. Image capturing and processing have been used widely in diverse applications, such in medical and surveillance applications.
MATLAB® is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications. The language, tools, and built- in math functions enable you to explore multiple approaches and reach a solution faster than with spreadsheets or traditional programming languages, such as C/C++ or Java®. You can use MATLAB for a range of applications, including signal processing and communications, image and video processing, control systems, test and measurement, computational finance, and computational biology. More than a million engineers and scientists in industry and academia use MATLAB, the language of technical computing.
Key Features • High-level language for numerical computation, visualization, and application development • Interactive environment for iterative exploration, design, and problem solving • Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, numerical integration, and solving ordinary differential equations • Built-in graphics for visualizing data and tools for creating custom plots • Development tools for improving code quality and maintainability and maximizing performance • Tools for building applications with custom graphical interfaces • Functions for integrating MATLAB based algorithms with external applications and languages such as C, Java, .NET, and Microsoft® Excel®
5.1.2 ARDUINO SOFTWARE IDE:
The Arduino integrated development environment (IDE) is a cross platform application witten in java, and is derived from the IDE for the processing programming language and the wiring projects. It is designed to introduce programming to artists and other newcomers unfamiliar with software development. It includes a code editor with features such as syntax highlighting , brace matching , automatic indentation, and is also capable of compiling and uploading programs to the board with a single click. A program or code written for Arduino is called a “sketch”.Arduino programs are written in C or C++. The Arduino IDE comes with a software library called “wiring” from the original wiring project, which makes many common input/output operations much easier.
5.2 HARDWARE SPECIFICATION
No
Hardware
Specification
1
Stepdown transformer
230v AC – 12-0 /500 Ma
2
Bridge rectifier
1N 4007
3
Arduino Development Board
ATMEGA 328
4
Servo motors
12 V
5
Motor Driver IC
L293D H-Bridge
Table 5.1 List of hardware used
5.2.1 POWER SUPPLY
Alternating voltage is the input to the power supply. Starting with an ac voltage, a steady dc voltage is obtained by rectifying the ac voltage, then filtering to a dc level, and finally, regulating to obtain a desired fixed dc voltage. The regulation is usually obtained from an integrated circuit (IC) voltage regulator unit, which takes a dc voltage and provides a somewhat lower dc voltage, which remains the same even if the input dc voltage varies, or the output load connected to the dc voltage changes. The ac voltage, typically 120 Vrms, is connected to a transformer, which steps that ac voltage down to the level for the desired dc output. A diode rectifier then provides a full wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage variation. A regulator circuit can use this dc input to provide a dc voltage that not only has much less ripple voltage but also remains the same dc value even if the input dc voltage varies somewhat, or the load connected to the output dc voltage changes. This voltage regulation is usually obtained using one of a number of popular voltage regulator IC units. The block diagram of power supply is shown in Figure 5.1.
Transformer
RECTIFIER
FILTER
IC REGULATOR
LOAD
Figure 5.1 Block Diagram of Power Supply
5.2.2 BRIDGE RECTIFIER:
A single phase rectifier uses four individual rectifying diodes connected in a closed loop "bridge" configuration to produce the desired output. The transformer will step down the power supply voltage 0-230V to 0-6V level. Then the secondary of the potential transformer will be connected to the precision rectifier, which is constructed with the help of opamp. The advantages of using precision rectifier are it will give peak voltage output as direct current; rest of the circuits will give only root mean square output. A single phase rectifier uses four individual rectifying diodes connected in a closed loop "bridge" configuration to produce the desired output. The main advantage of this bridge circuit is that it does not require a special centre tapped transformer, thereby reducing its size and cost. The main advantage of this bridge circuit is that it does not require a special centre tapped transformer. The single secondary winding is connected to one side of the diode bridge network and the load to the other side. The bridge rectifier is shown in Figure5.2.2.
Figure5.2 Bridge Rectifier
The four diodes labeled D1 to D4 are arranged in “series pairs" with only two diodes conducting current during each half cycle. During the positive half cycle of the supply, diodes D1 and D2 conduct in series while diodes D3 and D4 are reverse biased and the current flows through the load. During the negative half cycle of the supply, diodes D3 and D4 conduct in series, but diodes D1 and D2 switch "off" as they are in reverse biased. The current flowing through the load is the same direction as before. As the current flowing through the load is unidirectional, so the voltage developed across the load is also unidirectional the same as for the previous two diode full-wave rectifier, therefore the average DC voltage across the load is 0.637Vmax. However in reality, during each half cycle the current flows through two diodes instead of just one so the amplitude of the output voltage is two voltage drops ( 2 x 0.7 = 1.4V ) less than the input VMAX amplitude. The ripple frequency is now twice the supply frequency (e.g. 100Hz for a 50Hz supply). The smoothing capacitor converts the full-wave rippled output of the rectifier into a smooth DC output voltage. Generally for DC power supply circuits the smoothing capacitor is an aluminum electrolytic type that has capacitance value 100 µF. The circuit diagram and waveform of bridge rectifier is shown in Figure 6.2.2.2.
Figure 5.3 Circuit Diagram and Waveform of Bridge Rectifier
However, there are two important parameters to consider when choosing a suitable smoothing capacitor and these are its working voltage, which must be higher than the no-load output value of the rectifier and its capacitance value, which determines the amount of ripple that will appear superimposed on top of the DC voltage. Too low a value and the capacitor has little effect but if the smoothing capacitor is large enough (parallel capacitors can be used) and the load current is not too large, the output voltage will be almost as smooth as pure DC. The main advantages of a full-wave bridge rectifier is that it has a smaller AC ripple value for a given load and a smaller reservoir or smoothing capacitor than an equivalent half-wave rectifier.
Therefore, the fundamental frequency of the ripple voltage is twice that of the AC supply frequency (100Hz) where for the half-wave rectifier it is exactly equal to the supply frequency (50Hz).
5.2.3 IC VOLTAGE REGULATORS:
Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the circuitry for reference source, comparator amplifier, control device, and overload protection all in a single IC. Although the internal construction of the IC is somewhat different from that described for discrete voltage regulator circuits, the external operation is much the same. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage, or an adjustably set voltage. A power supply can be built using a transformer connected to the ac supply line to step the ac voltage to desired amplitude, then rectifying that ac voltage, filtering with a capacitor and RC filter, if desired, and finally regulating the dc voltage using an IC regulator. The regulators can be selected for operation with load currents from hundreds of milli amperes to tens of amperes, corresponding to power ratings from milli watts to tens of watts. IC units provide regulation of either a fixed positive voltage.
Three Terminal Voltage Regulators:
The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to one input terminal, a regulated output dc voltage, Vo, from a second terminal, with the third terminal connected to ground. For a selected regulator, IC device specifications list a voltage range over which the input voltage can vary to maintain a regulated output voltage over a range of load current. The specifications also list the amount of output voltage change resulting from a change in load current which is called load regulation. The fixed positive voltage regulator is shown in Figure.
Figure 5.4 Fixed Positive Voltage Regulators
CHAPTER 6
ALGORITHM
Step 1: Start
Step 2: Start Video
Step 3: Get snapshot from video.
Step 4: Resize the image.
Step 5: Save the image temporarily.
Step 6: Read image from the file and extract information of the image.
Step 7: Get the red, green, blue matrices.
Step 8: Displaying the subplots of red, blue, green components of the images.
Step 9: Initiate the loop for finding maximum value of the matrices.
Step 10: Print red if red component is greater. Print green if green component is greater. Else print blue.
Step 11: Send command to the ARDUINO board from MATLAB serially
Step 12: The microcontroller receives the commands.
Step 13: According to the command from microcontroller the robotic arm will pick the object then came back to the normal position.
Step 14: Based on the color the arm will place the object in desired position.
Step 15: Go to step1.
CHAPTER 7
ADVANTAGES AND LIMITATIONS
The main advantages of the proposed approach rely on the high discriminatory capacity of the object classes and on the high degree of parallelism, capable of processing large amounts of material on production lines. The use of modern electronic systems also allows high operative speed, easy calibration and flexibility (due to a programmable sorting algorithm) to the required classification features. It has high efficiency with higher quality of sorting. It has high sensitivity and ability to distinguish between the objects. It will be always better than human sorting. Some of the prominent advantages are
ü High efficiency: the sorting speed can be very high.
ü High precision: the margin of error can be reduced to great extent.
ü This type of sorter can be used for various objects of different colors.
ü Also suit to select pears, orange and other fruits of this kind.
ü High degree of intelligence if used with PLC control. The machine with a high degree of intelligent , can control it.
ü Good quality and low failure rate with long life.
ü Reliable operation and maintenance.
CHAPTER 8
RESULTS AND DISCUSSION
The following results were observed in our project
ü ON-OFF controlling of devices can be denoted by lighting up particular LEDs driven by relays. Robotic arm has been successfully developed and testing was done in the dummy industrial environment developed in the laboratory. The objective is met by sorting the objects based on the color feature from a group of objects. A GUI in MATLAB was successfully created in order to display the video of the incoming object and displaying the color of the object to the user. The user has to select the COM Port. After the Connection is made the camera detects the RED, GREEN and BLUE object and using serial communication the robotic arm picks the object and places in the desired location
ü System able to detect the object and place it in the desired location.
ü By image processing, we can detect all colors of objects for sorting.
ü This system reduce the human efforts and risk in sorting fields.
CHAPTER 9
CONCLUSION
Fully functional sorter machine can be implemented by using a structure of parallel and independent channels in order to increase the overall throughput which results with a forecasted performance. The project can work successfully. There are two main steps in sensing part, objects detection and recognition. The system can successfully perform handling station task, namely pick and place mechanism with help of sensor. Thus a cost effective Mechatronics system can be designed using the simplest concepts and efficient result can be observed. The project can work successfully and can sort the object depending on their color .Hence for color sorting. Is done in Matlab based code will interface with a USB web cam on PC/laptop which will sense objects and its colors and according command will be sent to the microcontroller to pick and place object We’ll primarily sense three Colors RED GREEN and Blue
CHAPTER 10
APPLICATION AND FUTURE ENHANCEMENTS
The developed Robotic arm is able to detect the Red, Blue, Green colored object and place it in the desired location. The color detection capability can be increased to other secondary colors by advanced image processing and which can sort out. There are many applications in this sorting system. Mainly this finds the important application in agriculture field where it can be used to sort the different agriculture products like grains, lemons, almonds, grapes, and many more. For human beings it becomes comber sum task to sort out the objects with high quality also the possibility of accuracy is less. In industry it can be used for sorting of various objects, tools, with high degree of accuracy and quality with an automation. By this way the proposed project can be used. It finds application in enormous way in agriculture, industry.
REFERENCES
[1] Alessandro Golfarelli, Rossano Codeluppi and Marco Tartagni, ― A Self-Learning Multi-Sensing Selection Process: Measuring Objects One by One by‖,ARCES – LYRAS LAB University of Bologna, Campus of Forlì, 1-4244-1262-5/07/$25.00 ©2007 IEEE, IEEE SENSORS 2007 Conference.
[2] Sahu, S., Lenka, P.; Kumari, S.; Sahu, K.B.; Mallick, B.; ―Design a color sensor: Application to robot handling radiation work‖, Vol. 56, No. 10, pp. 365- 368, 2007, Industrial. Engineering.
[3] www.google.com/microepsilon.com/catcolorsensor—e
[4] www.shortcourse.com/www.sensors.com/optical/imagesensors
[5] wwwgoogle.com/wisegeek.com/what is optical sensors.html
[6]www.google.com/osa.org/sensors
[7] www.pdfgenicom/compacsort.com/sorters
[8]www.pdfgenicom/indiamart.com/sorting machine
[9] www.google.com/ATMEGA 48A/PA/328/P/DATASHEET SUMMARY [10]www.google.com/zimbio.com/clip-base cam
[11] www.google.com/pdfsb.com/smps
[12] www.google.com/pdfgeni.com/vermnlstweb.nl
[13] www.google.com/arduino.cc/main/software
[14] www.google.com/eyantra.org/home/project
[15] Project on― Pick n Place Robot‖, made by Bharat Jain and Dinesh Rajput, under guidance of Prof. KaviArya, IIT Mumbai,2010.
[16] www.pdfgeni.com/servo-tutorial
[17] www.pdfgeni.com/matlab- mathematical lab/pdf
INTRODUCTION
Robotic arms are used in lifting heavy objects and carrying out tasks that require extreme concentration and expert accuracy. This study mainly focuses on the accuracy in control mechanism of the arm while gripping and placing of objects. The system facilitates autonomous object detection within its limitations. A user interface is incorporated with the system for human input feed on the desired destination within the working frontiers. The targeted destination is specified in terms of height, radius and angle. In addition the orientation of the object can be provisioned along with the destination. Determining real time and highly accurate characteristics of small objects in a fast flowing stream would open new directions for industrial sorting processes. The present paper relates to an apparatus and method for classify in and sorting small-sized objects, using electronic systems and advanced sensors operating on the basis of a physical and geometric characterization of each element. Recent advances in electronics and printed circuit board technology open new perspectives for industrial application in this field. The proposed selection process is based on a multisensorial characterization, and more specifically on crossed optical and impedimetric analysis of the objects to be sorted. Parallel guides, also called channels, are created on a slanted plant support. The objects to be sorted are immersed in a continuous, free-falling flow along said guides. By another way this project can be treated an automated material handling system & can be designed by following way. It aims in classifying the colored objects by picking and placing the objects in its respective pre-programmed place. Thereby eliminating the monotonous work done by human, achieving accuracy and speed in the work. The project involves camera that senses the object’s color and sends the signal to the microcontroller. The microcontroller sends signal to circuit which drives the various motors of the robotic arm to grip the object and place it in the specified location. Based upon the color detected, the robotic arm moves to the specified location, releases the object and comes back to the original position.
CHAPTER 2
LITERATURE SURVEY
Robotic arm is a type of mechanical arm, usually programmable, with similar functions to a human arm. Types of robot arms depend on their range, working capability and reach. Cartesian robot is used for pick and place work, plotting and handling arc welding. Its range is mostly 2 dimensional. Cylindrical robot is also used for the above mentioned working categories, but since it operates in a cylindrical co-ordinate system, it can be used to do the operations more precisely and accurately, furthermore it also has a wider reachable range. Spherical robot works on the polar coordinate system. RB 50 robot arm is mainly used for pick and place work. It has to parallel rotary joints to provide flexibility in a plane. Then for a three dimensional reach it is usually combined with other mechanisms. Articulated robot has three rotary joints. Parallel robots are used in the mobile platform handling cockpit flight simulators. It is a robot whose arms have concurrent prism shaped or rotary joints. Anthropomorphic robot this resembles a human hand, with independent fingers and thumbs.
And gripper is an end-of-arm device often used in material handling applications. Generally, the gripper is a device that is capable of generating enough grip force to retain an object while the robot performs a task on the part such a pick-and-place operation. Any gripper must be capable of performing the task of opening and closing with a prescribed amount of force over many years of daily operation The most commonly used grippers are finger grippers. These grippers generally have two opposing fingers or three fingers like a lathe chuck. The fingers are driven together such that once gripped any part is centered in the gripper. This gives some flexibility to the location of components at the pick-up point. Two finger grippers can be further split into parallel motion or angular motion fingers. Angular jaw gripper open and close around a central pivot point, moving in an arcing motion.
CHAPTER 3
EXISTING SYSTEM
In earlier days, industrial control was purely by human beings which required lot of efforts. To overcome the drawbacks of this system there came the concept of automation in industries. There are two types of existing system. They are Human effort heavy vehicles and machineries and the second type is automated machineries but its method of operation uses a set of inductive, capacitive and optical sensors do differentiate object color. . When this system is used, there is a need of huge effort of human and its having a long time. And existing automated machineries based on sensors and half automated like systems
3.1 DISADVANTAGES OF EXISTING SYSTEM
ü Manual effort must require to operate the system
ü Its taken a long time to complete the tasks
ü Its require high energy and fuel consumption.
ü Maintenance is difficult in multiple levels.
ü Sensor based automated system may not shows a stability.
CHAPTER 4
PROPOSED SYSTEM
The Proposed system is a smart approach for a real time inspection and selection of objects in continuous flow. Image processing in today’s world grabs massive attentions as it leads to possibilities of broaden application in many fields of high technology. The real challenge is how to improve existing sorting system in the modular processing system which consists of four integrated stations of identification, processing, selection and sorting with a new image processing feature. Existing sorting method uses a set of inductive, capacitive and optical sensors do differentiate object color. This paper presents a mechatronics color sorting system solution with the application of image processing. Image processing procedure senses the objects in an image captured in real-time by a webcam and then identifies color and information out of it. This information is processed by image processing for pick-and-place mechanism. The Project deals with an automated material handling system. It aims in classifying the colored objects by color, size, which are coming on the conveyor by picking and placing the objects in its respective pre-programmed place. Thereby eliminating the monotonous work done by human, achieving accuracy and speed in the work. The project involve sensors that senses the object’s color, size and sends the signal to the microcontroller. The microcontroller sends signal to circuit which drives the various motors of the robotic arm to grip the object and place it in the specified location. Based upon the detection, the robotic arm moves to the specified location, releases the object and comes back to the original position.
4.1 DEVELOPMENT OF THE PROJECT:
The basic theme of this project is object flowing on conveyor are sensed, selected and sorted depending on their color and size. For this, camera is used as input sensor, camera is overhead camera which will be mounted on PC, and will be connected to PC by USB. The camera will take a snap and it will feed to PC for color processing. In PC MATLAB is used for processing on color, depending on this signal will be given to microcontroller Atmega 328. The microcontroller in turn will control the servomotors by PWM signals. These servomotors will control the movement of robotic arm, by controlling their angular movement. Thus the robotic arm will be fully controlled by servomotors. The gripper of robotic arm will pick the object place it depending on its size. This is full automatic process no manual support is needed. The microcontroller used here is with the support of Arduino kit. The Arduino is good platform for robotics application. It is the software and hardware also, using both the above system is developed. Thus the real time, continuous object sorting can be done.
4.2 BLOCK DIAGRAM
Figure 4.1: Block Diagram
4.3 BLOCK DIAGRAM DESCRIPTION
4.3.1 Microcontroller(ATMega328) : ATMega328 is the ATMEL Microcontroller on which Arduino UNO is based. This product let you to realize your small project without using a full size Arduino board. To make this microcontroller working with the Arduino IDE you need a 16Mhz crystal, a 5 V power supply and a serial connection.And its a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the Atmega 328 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The Atmega 328 provides the following features: 4K/8Kbytes of In-System Programmable Flash with Read-While-Write capabilities, 256/512/512/1Kbytes EEPROM, 512/1K/1K/2Kbytes SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes. This allows very fast start-up combined with low power consumption.The 16 MHz Crystal Oscillator module is designed to handle off-chip crystals that have a frequency of 16 MHz. The crystal oscillator output is fed to the System. As an alternative to using a crystal, you can use an externally generated 16 MHz clock source as input tothe on-chip 16 MHz oscillator.
4.3.2 Camera
Fig. 4.2 logitech webcam
The camera used in this case will be overhead camera, it will take the snapshot of the object for color sensing purpose. The image captured by the camera will be processed by image processing using matlab. The camera used in this case is Logitech PN 960-000748
whose technical specifications are:
ü Video calling (640 x 480 pixels)
ü Video capture: Up to 1024 x 768 pixels
ü Fluid Crystal Technology
ü Photos: Up to 1.3 megapixels (software enhanced)
ü Built-in mic with noise reduction
ü Hi-Speed USB 2.0 certified (recommended)
ü Universal clip fits laptops, LCD or CRT monitors
4.3.3 Matlab and Image Processing
The name MATLAB stands for Matrix Laboratory. MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB is a high performance language for technical computing. It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object oriented programming. These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. It has powerful built-in routines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available. Applications are collected in packages referred to as toolbox. There are tool boxes for signal processing, symbolic computation, control theory, simulation, optimization, and several other of applied science and engineering . Image can be assumed as the visualization of what vision senses that is captured by camera. Image is considered as a two dimensional function with variables that represent the spatial coordinate. It holds information about color as well as shapes. In color image, RGB color model mixes those three prime color components, red, green and blue, to produce another color. Image capturing and processing have been used widely in diverse applications, such in medical and surveillance applications.
4.3.4 Arduino
Fig. 4.3 Arduino Kit
Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be standalone, or they can be communicating with software running on your computer (e.g. Flash, Processing, MaxMSP.) The boards can be assembled by hand or
purchased preassembled; the open-source IDE can be downloaded for free. The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment.
An Arduino board consists of an 8-bit Atmel AVR microcontroller with complementary components to facilitate programming and incorporation into other circuits. An important aspect of the Arduino is the standard way that connectors are exposed, allowing the CPU board to be connected to a variety of interchangeable add-on modules (known as shields).
Most boards include a 5 volt linear regulator and a 16 MHz crystal oscillator. The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. There are many other microcontrollers and microcontroller platforms available for physical computing. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems:
ü Inexpensive -The least expensive version of the Arduino module can be assembled by hand.
ü Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems.
ü Simple, clear programming.
ü Open source and extensible software- The Arduino software is published as open source tools, available for extension by experienced programmer.
ü Open source and extensible hardware – The Arduino is based on Atmel's ATMEG328
ü ATMEGA328 microcontrollers. There are a great many Arduino compatible and Arduino derived boards.
Fig 4.4 ATmega 328 Pin Diagram
Some are functionally equivalent to an Arduino and may be used interchangeably. Many are the basic Arduino with the addition of commonplace output drivers, often for use in school level education to simplify the construction of buggies and small robots.
4.3.5 Robotic Arms & Servomotors
Arms are types of jointed robot manipulator that allow robots to interact with their environment. Many have onboard controllers or translators to simplify communication, though they may be controlled directly or in any number of ways. Due to this fact, standalone arms are often classified as full robots. The robot used in this project is 4 Axis Robotic Arm. 4 Axis Robotic Arm is designed for small mobile robots. It can grip objects with the size up to 60mm with the force up to 250gms. Arm has reach of 23cm. It can lift the payload up to 400gms. Robotic Arm comes fully assembled and ready to use. First two axis of the arm are made up of NRS-995 dual bearing heavy duty metal gear motors and remaining 2 axis and gripper uses NRS-585 dual bearing plastic gear servo motors. Axis 2 and 3 enables gripper to
maintain its angle constant with the surface while moving up and down. Robotic arm can do Left-Right, Up-Down while keeping gripper parallel to surface, Twist motions and Gripping action. Robotic Arm will require current up to 5Amps. Make sure that your robot can supply that much amount of current for proper operation of the arm. The robotic arm has following specifications.
ü Number of Axis: 4 + Gripper
ü Gripping force: 250gms (Maximum)
ü Gripping jaw length: 43mm
ü Gripping jaw width: 60mm
ü Weight: 541gms (Including 2 NRS-995 and 3 NRS-585 servo motors)
ü Operating voltage: 5V to 6V
ü Reach: 23cm
Servos are DC motors with built in gearing and feedback control loop circuitry. And no motor drivers required. A servomotor is a rotary actuator that allows for precise control of angular position. They consist of a motor coupled to a sensor for position feedback, through a reduction gearbox. They also require a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors. Servomotors are used in applications such as robotics, CNC machinery or automated manufacturing. The servo motor has some control circuits and a potentiometer (a variable resistor) that is connected to the output shaft. This pot allows the control circuitry to monitor the current angle of the servo motor. If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the angle is not correct, it will turn the motor the correct direction until the angle is correct. The output shaft of the servo is capableof traveling somewhere around 180 degrees.Usually, its somewhere in the 210 degree range, but it varies by manufacturer. A normal servo is used to control an angular motion of between 0 and 180 degrees.
Table 4.1 Axis Capabilities
A normal servo is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear. The amount of power applied to the motor is proportional to the distance it needs to travel. So, if the shaft needs to turn a large distance, the motor will run at full speed. If it needs to turn only a small amount, the motor will run at a slower speed.
Fig. 4.5 Four Axis Robot
The motor is paired with some type of encoder to provide position and speed feedback. In the simplest case, only the position is measured. The measured position of the output is compared to the command position, the external input to the controller. If the output position differs from that required, an error signal is generated which then causes the motor to rotate in either direction, as needed to bring the output shaft to the appropriate position. As the positions approach, the error signal reduces to zero and the motor stops.More sophisticated servomotors measure both the position and also the speed of the output shaft. They may also control the speed of their motor, rather than always running at full speed. Both of these enhancements, usually in combination with a PID control algorithm, allow the servomotor to be brought to its commanded position more quickly and more precisely, with less overshooting. The servo turn rate, or transit time, is used for determining servo rotational velocity. This is the amount of time it takes for the servo to move a set amount, usually 60
degrees. For example, suppose you have a servo with a transit time of 0.17sec/60 degrees at no load, this means it would take nearly half a second to rotate an entire 180 degrees
Fig. 4.6 Servomotor Rotation
4.3.6 L293D Motor Driver IC:
L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive on either direction. L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It means that you can control two DC motor with a single L293D IC. Dual H-bridge Motor Driver integrated circuit (IC).The l293d can drive small and quiet big motors as well. It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be flown in either direction. As you know voltage need to change its direction for being able to rotate the motor in clockwise or anticlockwise direction, Hence H-bridge IC are ideal for driving a DC motor. In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc motor independently. Due its size it is very much used in robotic application for controlling DC motors. Given below is the pin diagram of a L293D motor controller.
Fig. 4.7 Pin out of l293d
There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in the corresponding section will suspend working. It’s like a switch. You can simply connect the pin16 VCC (5v) to pin 1 and pin 9 to make them high.
Working of L293D
The there 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected across left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1.In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.
L293D Logic Table.
Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise direction the input pins has to be provided with Logic 1 and Logic 0.
ü Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction
ü Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
ü Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
ü Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
In a very similar way the motor can also operated across input pin 15,10 for motor on the right hand side.
Circuit Diagram of L293D
Fig. 4.8 Circuit Diagram of L293D
Voltage Specification
VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this voltage for driving the motor. For driving the motors it has a separate provision to provide motor supply VSS (V supply). L293d will use this to drive the motor. It means if you want to operate a motor at 9V then you need to provide a Supply of 9V across VSS Motor supply. The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per channel.Since it can drive motors Up to 36v hence you can drive pretty big motors with this l293d. VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges from 5v and upto 36V. Don’t Exceed the Vmax Voltage of 36 volts or it will cause damage.
4.3.7 Graphical user interface (Gui)
A graphical user interface (GUI) is a pictorial interface to a program. A good GUI can make programs easier to use by providing them with a consistent appearance and with intuitive controls like pushbuttons, list boxes, sliders, menus, and so forth. The GUI should behave in an understandable and predictable manner, so that a user knows what to expect when he or she performs an action. For example, when a mouse click occurs on a pushbutton, the GUI should initiate the action described on the label of the button. This chapter introduces the basic elements of the MATLAB GUIs. The chapter does not contain a complete description of components or GUI features, but it does provide the basics required to create functional GUIs for your programs.
Fig. 4.9 GUI
How a Graphical User Interface Works
A graphical user interface provides the user with a familiar environment in which to work. This environment contains pushbuttons, toggle buttons, lists, menus, text boxes, and so forth, all of which are already familiar to the user, so that he or she can concentrate on using the application rather than on the mechanics involved in doing things. However, GUIs are harder for the programmer because a GUI-based program must be prepared for mouse clicks (or possibly keyboard input) for any GUI element at any time. Such inputs are known as events, and a program that responds to events is said to be event driven. The three principal elements required to create a MATLAB Graphical User Interface are
1. Components. Each item on a MATLAB GUI (pushbuttons, labels, edit boxes, etc.) is a graphical component. The types of components include graphical controls (pushbuttons, edit boxes, lists, sliders, etc.), static elements (frames and text strings), menus, and axes. Graphical controls and static elements are created by the function uicontrol, and menus are created by the functions uimenu and uicontextmenu. Axes, which are used to display graphical data, are created by the function axes.
2. Figures. The components of a GUI must be arranged within a figure, which is a window on the computer screen. In the past, figures have been created automatically whenever we have plotted data. However, empty figures can be created with the function figure and can be used to hold any combination of components.
3. Callbacks. Finally, there must be some way to perform an action if a user clicks a mouse on a button or types information on a keyboard. A mouse click or a key press is an event, and the MATLAB program must respond to each event if the program is to perform its function. For example, if a user clicks on a button, that event must cause the MATLAB code that implements the function of the button to be executed. The code executed in response to an event is known as a call back. There must be a callback to implement the function of each graphical component on the GUI.
Creating and Displaying a Graphical User Interface
MATLAB GUIs are created using a tool called guide, the GUI Development Environment. This tool allows a programmer to layout the GUI, selecting and aligning the GUI components to be placed in it. Once the components are in place, the programmer can edit their properties: name, color, size, font, text to display, and so forth. When guide saves the GUI, it creates working program including skeleton functions that the programmer can modify to implement the behavior of the GUI. The large white area with grid lines is the layout area, where a programmer can layout the GUI. The Layout Editor window has a palate of GUI components along the left side of the layout area. A user can create any number of GUI components by first clicking on the desired component, and then dragging its outline in the layout area. The top of the window has a toolbar with a series of useful tools that allow the user to distribute and align GUI components, modify the properties of GUI components, add menus to GUIs, and so on. The basic steps required to create a MATLAB GUI are:
1. Decide what elements are required for the GUI and what the function of each element will be. Make a rough layout of the components by hand on a piece of paper.
4.4 CIRCUIT DIAGRAM
Figure 4.10: Circuit Diagram
The circuit includes a custom made Atmega328 board acting as a main controller. This board will be interfaced to the PC using USB interface. A 4-axis Pick and Place robot using SERVO motors will be build and interfaced to the atmega328 board through PWM lines which will be used to control the pick and place action.
A Matlab based code will interface with a USB web cam on PC/laptop which will sense objects and its colors and according command will be sent to the microcontroller to pick and place object We’ll primarily sense three Colors RED GREEN and BLUE
4.5 CIRCUIT DESCRIPTION 4.5.1 ATMEGA328
HISTORY
The AVR architecture was conceived by two students at the (NTH), Alf Egil Bogen and Vegard Wollan. He original AVR MCU was developed at a local ASIC house in Trondheim, Norway, called Nordic VLSI at the time, now Nordic Semiconductor, where Bogen and Wollan were working as students. It was known as a μRISC (Micro RISC)and was available as silicon IP/building block from Nordic VLSI. When the technology was sold to Atmel from Nordic VLSI, the internal architecture was further developed by Bogen and Wollan at Atmel Norway, a subsidiary of Atmel. The designers worked closely with compiler writers at IAR Systems to ensure that the instruction set provided for more efficient compilation of high-level languages. Atmel says that the name AVR is not an acronym and does not stand for anything in particular. The creators of the AVR give no definitive answer as to what the term "AVR" stands for. However, it is commonly accepted that AVR stands for Alf (Egil Bogen) and Vegard (Wollan)'s RISC processor. Note that the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel AVR Microcontrollers. Among the first of the AVR line was the AT90S8515, which in a 40-pin DIP package has the same pinout as an 8051 microcontroller, including the external multiplexed address and data bus. The polarity of the RESET line was opposite (8051's having an active-high RESET, while the AVR has an active-low RESET), but other than that the pinout was identical.
- The AVR 8-bit microcontroller architecture was introduced in 1997. By 2003, Atmel had shipped 500 million AVR flash microcontrollers.
- In 2006 Atmel released microcontrollers based on the 32-bit AVR32 architecture. They include SIMD and DSP instructions, along with other audio and video processing features. This 32-bit family of devices is intended to compete with the ARM based processors. The instruction set is similar to other RISC cores, but it is not compatible with the original AVR or any of the various ARM cores.
Internal registers
Fig 4.11: Atmel ATxmega128A1 in 100-pin TQFP package
The AVRs have 32 single-byte registers and are classified as 8-bit RISC devices.In the tinyAVR and megaAVR variants of the AVR architecture, the working registers are mapped in as the first 32 memory addresses (000016–001F16), followed by 64 I/O registers (002016–005F16). In devices with many peripherals, these registers are followed by 160 “extended I/O” registers, only accessible as memory-mapped I/O (006016–00FF16).Actual SRAM starts after these register sections, at address 006016 or, in devices with “extended I/O”, at 010016.Even though there are separate addressing schemes and optimized opcodes for accessing the register file and the first 64 I/O registers, all can still be addressed and manipulated as if they were in SRAM.
The very smallest of the tinyAVR variants use a reduced architecture with only 16 registers (r0 through r15 are omitted) which are not addressable as memory locations. I/O memory begins at address 000016, followed by SRAM. In addition, these devices have slight deviations from the standard AVR instruction set. Most notably, the direct load/store instructions (LDS/STS) have been reduced from 2 words (32 bits) to 1 word (16 bits), limiting the total direct addressable memory (the sum of both I/O and SRAM) to 128 bytes. Conversely, the indirect load instruction's (LD) 16-bit address space is expanded to also include non-volatile memory such as Flash and configuration bits; therefore, the LPM instruction is unnecessary and omitted.
In the XMEGA variant, the working register file is not mapped into the data address space; as such, it is not possible to treat any of the XMEGA's working registers as though they were SRAM. Instead, the I/O registers are mapped into the data address space starting at the very beginning of the address space. Additionally, the amount of data address space dedicated to I/O registers has grown substantially to 4096 bytes (000016–0FFF16). As with previous generations, however, the fast I/O manipulation instructions can only reach the first 64 I/O register locations (the first 32 locations for bitwise instructions). Following the I/O registers, the XMEGA series sets aside a 4096 byte range of the data address space, which can be used optionally for mapping the internal EEPROM to the data address space (100016–1FFF16). The actual SRAM is located after these ranges, starting at 200016.
GPIO ports Each GPIO port on a tiny or mega AVR drives up to eight pins and is controlled by three 8-bit registers: DDRx, PORTx and PINx, where x is the port identifier.
- DDRx: Data Direction Register, configures the pins as either inputs or outputs.
- PORTx: Output port register. Sets the output value on pins configured as outputs. Enables or disables the pull-up resistor on pins configured as inputs.
- PINx: Input register, used to read an input signal. On some devices (but not all, check the datasheet), this register can be used for pin toggling: writing a logic one to a PINx bit toggles the corresponding bit in PORTx, irrespective of the setting of the DDRx bit.
EEPROM Almost all AVR microcontrollers have internal EEPROM for semi permanent data storage. Like flash memory, EEPROM can maintain its contents when electrical power is removed. In most variants of the AVR architecture, this internal EEPROM memory is not mapped into the MCU's addressable memory space. It can only be accessed the same way an external peripheral device is, using special pointer registers and read/write instructions, which makes EEPROM access much slower than other internal RAM. However, some devices in the SecureAVR (AT90SC) family. use a special EEPROM mapping to the data or program memory, depending on the configuration. The XMEGA family also allows the EEPROM to be mapped into the data address space.
Since the number of writes to EEPROM is not unlimited Atmel specifies 100,000 write cycles in their datasheets a well designed EEPROM write routine should compare the contents of an EEPROM address with desired contents and only perform an actual write if the contents need to be changed. Note that erase and write can be performed separately in many cases, byte-by-byte, which may also help prolong life when bits only need to be set to all 1s (erase) or selectively cleared to 0s (write).
Program execution Atmel's AVRs have a two-stage, single-level pipeline design. This means the next machine instruction is fetched as the current one is executing. Most instructions take just one or two clock cycles, making AVRs relatively fast among eight-bit microcontrollers.The AVR processors were designed with the efficient execution of compiled C code in mind and have several built-in pointers for the task.
Instruction set The AVR instruction set is more orthogonal than those of most eight-bit microcontrollers, in particular the 8051 clones and PIC microcontrollers with which AVR competes today. However, it is not completely regular:
- Pointer registers X, Y, and Z have addressing capabilities that are different from each other.
- Register locations R0 to R15 have different addressing capabilities than register locations R16 to R31.
- I/O ports 0 to 31 have different addressing capabilities than I/O ports 32 to 63.
- CLR affects flags, while SER does not, even though they are complementary instructions. CLR set all bits to zero, and SER sets them to one. (Note that CLR is pseudo-op for EOR R, R; and SER is short for LDI R,$FF. Math operations such as EOR modify flags, while moves/loads/stores/branches such as LDI do not.)
- Accessing read only data stored in the program memory (flash) requires special LPM instructions; the flash bus is otherwise reserved for instruction memory.
MCU speed The AVR line can normally support clock speeds from 0 to 20 MHz, with some devices reaching 32 MHz. Lower-powered operation usually requires a reduced clock speed. All recent (Tiny, Mega, and Xmega, but not 90S) AVRs feature an on-chip oscillator, removing the need for external clocks or resonator circuitry. Some AVRs also have a system clock prescaler that can divide down the system clock by up to 1024. This prescaler can be reconfigured by software during run-time, allowing the clock speed to be optimized.Since all operations (excluding multiplication and 16-bit add/subtract) on registers R0–R31 are single-cycle, the AVR can achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up to 8 MIPS. Loads and stores to/from memory take two cycles, branching takes two cycles. Branches in the latest "3-byte PC" parts such as ATmega2560 are one cycle slower than on previous devices
Features Current AVRs offer a wide range of features:
- Multifunction, bi-directional general-purpose I/O ports with configurable, built-in pull-up resistors
- Multiple internal oscillators, including RC oscillator without external parts
- Internal, self-programmable instruction flash memory up to 256 kB (384 kB on XMega)
- In-system programmable using serial/parallel low-voltage proprietary interfaces or JTAG
- Optional boot code section with independent lock bits for protection
- On-chip debugging (OCD) support through JTAG or debugWIRE on most devices
- The JTAG signals (TMS, TDI, TDO, and TCK) are multiplexed on GPIOs. These pins can be configured to function as JTAG or GPIO depending on the setting of a fuse bit, which can be programmed via ISP or HVSP. By default, AVRs with JTAG come with the JTAG interface enabled.
- debugWIRE uses the /RESET pin as a bi-directional communication channel to access on-chip debug circuitry. It is present on devices with lower pin counts, as it only requires one pin.
- Internal data EEPROM up to 4 kB
- Internal SRAM up to 16 kB (32 kB on XMega)
- External 64 kB little endian data space on certain models, including the Mega8515 and Mega162.
- The external data space is overlaid with the internal data space, such that the full 64 kB address space does not appear on the external bus and accesses to e.g. address 010016 will access internal RAM, not the external bus.
- In certain members of the XMega series, the external data space has been enhanced to support both SRAM and SDRAM. As well, the data addressing modes have been expanded to allow up to 16 MB of data memory to be directly addressed.
- AVRs generally do not support executing code from external memory. Some ASSPs using the AVR core do support external program memory.
- 8-bit and 16-bit timers
- PWM output (some devices have an enhanced PWM peripheral which includes a dead-time generator)
- Input capture that record a time stamp triggered by a signal edge
- Analog comparator
- 10 or 12-bit A/D converters, with multiplex of up to 16 channels
- 12-bit D/A converters
- A variety of serial interfaces, including
- I²C compatible Two-Wire Interface (TWI)
- Synchronous/asynchronous serial peripherals (UART/USART) (used with RS-232, RS-485, and more)
- Serial Peripheral Interface Bus (SPI)
- Universal Serial Interface (USI): a multi-purpose hardware communication module that can be used to implement an SPI, I2C or UART] interface.
- Brownout detection
- Watchdog timer (WDT)
- Multiple power-saving sleep modes
- Lighting and motor control (PWM-specific) controller models
- CAN controller support
- USB controller support
- Proper full-speed(12 Mbit/s) hardware & Hub controller with embedded AVR.
- Also freely available low-speed(1.5Mbit/s)(HID) bitbanging software emulations
- Ethernet controller support
- LCD controller support
- Low-voltage devices operating down to 1.8 V (to 0.7 V for parts with built-in DC–DC upconverter)
- picoPower devices
- DMA controllers and "event system" peripheral communication.
- Fast cryptography support for AES and DES
ISP
Fig 4.12: 6 and 10 pin ISP header diagrams
The in-system programming (ISP) programming method is functionally performed through SPI, plus some twiddling of the Reset line. As long as the SPI pins of the AVR are not connected to anything disruptive, the AVR chip can stay soldered on a PCB while reprogramming. All that is needed is a 6-pin connector and programming adapter. This is the most common way to develop with an AVR.The Atmel AVRISP mkII device connects to a computer's USB port and performs in-system programming using Atmel's software.AVRDUDE (AVR Downloader/UploaDEr) runs on Linux, FreeBSD, Windows, and Mac OS X, and supports a variety of in-system programming hardware, including Atmel AVRISP mkII, Atmel JTAG ICE, older Atmel serial-port based programmers, and various third-party and "do-it-yourself" programmers.
PDI The Program and Debug Interface (PDI) is an Atmel proprietary interface for external programming and on chip debugging of XMEGA devices. The PDI supports high speed programming of all non-volatile memory (NVM) spaces; flash, EEPROM, fuses, lock bits and the User Signature Row. This is done by accessing the XMEGA NVM controller through the PDI interface, and executing NVM controller commands. The PDI is a 2-pin interface using the Reset pin for clock input (PDI_CLK) and a dedicated data pin (PDI_DATA) for input and output.
High-voltage serial High voltage serial programming (HVSP) is mostly the backup mode on smaller AVRs. An 8-pin AVR package does not leave many unique signal combinations to place the AVR into a programming mode. A 12-volt signal, however, is something the AVR should only see during programming and never during normal operation.
High-voltage parallel High-voltage parallel programming (HVPP) is considered the "final resort" and may be the only way to correct bad fuse settings on an AVR chip.
Bootloader Most AVR models can reserve a bootloader region, 256 B to 4 KB, where re-programming code can reside. At reset, the bootloader runs first and does some user-programmed determination whether to re-program or to jump to the main application. The code can re-program through any interface available, it could read an encrypted binary through an Ethernet adapter like PXE. Atmel has application notes and code pertaining to many bus interfaces.
ROM The AT90SC series of AVRs are available with a factory mask-ROM rather than flash for program memory. Because of the large up-front cost and minimum order quantity, a mask ROM is only cost effective for high-production runs.
aWire The Atmel 8-bit AVR RISC-based microcontroller combines 32 KB ISP flash memory with read-while-write capabilities, 1 KB EEPROM, 2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts. The device achieves throughputs approaching 1 MIPS per MHz In our days, there have been many advancement in the field of Electronics and many cutting edge technologies are being developed every day, but still 8 bit microcontrollers have its own role in the digital electronics market dominated by 16-32 & 64 bit digital devices. Although powerful microcontrollers with higher processing capabilities exist in the market, 8bit microcontrollers still hold its value because of their easy-to-understand-operation, very much high popularity, ability to simplify a digital circuit, low cost compared to features offered, addition of many new features in a single IC and interest of manufacturers and consumers.Today’s microcontrollers are much different from what it were in the initial stage, and the number of manufacturers are much more in count than it was a decade or two ago. At present some of the major manufacturers are Microchip (publication: PIC microcontrollers), Atmel (publication: AVR microcontrollers), Hitachi, Phillips, Maxim, NXP, Intel etc. Our interest is upon ATmega32. It belongs to Atmel’s AVR series micro controller family. Let’s see the features.
PIN count: Atmega32 has got 40 pins. Two for Power (pin no.10: +5v, pin no. 11: ground), two for oscillator (pin 12, 13), one for reset (pin 9), three for providing necessary power and reference voltage to its internal ADC, and 32 (4×8) I/O pins.
About I/O pins: ATmega32 is capable of handling analogue inputs. Port A can be used as either DIGITAL I/O Lines or each individual pin can be used as a single input channel to the internal ADC of ATmega32, plus a pair of pins AREF, AVCC & GND together can make an ADC channel.No pins can perform and serve for two purposes (for an example: Port A pins cannot work as a Digital I/O pin while the Internal ADC is activated) at the same time. It’s the programmers responsibility to resolve the conflict in the circuitry and the program. Programmers are advised to have a look to the priority tables and the internal configuration from the datasheet.
Digital I/O pins: ATmega32 has 32 pins (4portsx8pins) configurable as Digital I/O pins.
Timers: 3 Inbuilt timer/counters, two 8 bit (timer0, timer2) and one 16 bit (timer1).
ADC: It has one successive approximation type ADC in which total 8 single channels are selectable. They can also be used as 7 (for TQFP packages) or 2 (for DIP packages) differential channels. Reference is selectable, either an external reference can be used or the internal 2.56V reference can be brought into action. There external reference can be connected to the AREF pin.
Communication Options: ATmega32 has three data transfer modules embedded in it. They are
- Two Wire Interface
- USART
- Serial Peripheral Interface
· External Interrupt: 3External interrupt is accepted. Interrupt sense is configurable.
· Memory: It has 32Kbytes of In-System Self-programmable Flash program memory, 1024 Bytes EEPROM, 2Kbytes Internal SRAM. Write/Erase Cycles: 10,000 Flash / 100,000 EEPROM.
· Clock: It can run at a frequency from 1 to 16 MHz. Frequency can be obtained from external Quartz Crystal, Ceramic crystal or an R-C network. Internal calibrated RC oscillator can also be used.
· More Features: Up to 16 MIPS throughput at 16MHz. Most of the instruction executes in a single cycle. Two cycle on-chip multiplication. 32 × 8 General Purpose Working Registers
· Debug: JTAG boundary scan facilitates on chip debug.
· Programming: Atmega32 can be programmed either by In-System Programming via Serial peripheral interface or by Parallel programming. Programming via JTAG interface is also possible. Programmer must ensure that SPI programming and JTAG are not be disabled using fuse bits; if the programming is supposed to be done using SPI programming and JTAG are not be disabled using fuse bits; if the programming is supposed to be done using SPI or JTAG .
4.5.2 L293D L293D Description L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive on either direction. L293D is a 16-pin IC which can control a set of two DC motors simultaneously in any direction. It means that you can control two DC motor with a single L293D IC. Dual H-bridge Motor Driver integrated circuit (IC). The l293d can drive small and quiet big motors as well, check the Voltage Specification at the end of this page for more info.Concept It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be flown in either direction. As you know voltage need to change its direction for being able to rotate the motor in clockwise or anticlockwise direction, Hence H-bridge IC are ideal for driving a DC motor. In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc motor independently. Due its size it is very much used in robotic application for controlling DC motors. Given below is the pin diagram of a L293D motor controller. There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in the corresponding section will suspend working. It’s like a switch. TIP: you can simply connect the pin16 VCC (5v) to pin 1. Working of L293D The there 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown on the pin diagram. Left input pins will regulate the rotation of motor connected across left side and right input for motor on the right hand side. The motors are rotated on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1.In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.
L293D Logic Table. Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor in clockwise direction the input pins has to be provided with Logic 1 and Logic 0.
• Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
• Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]
Voltage Specification VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this voltage for driving the motor. For driving the motors it has a separate provision to provide motor supply VSS (V supply). L293d will use this to drive the motor. It means if you want to operate a motor at 9V then you need to provide a Supply of 9V across VSS Motor supply.The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per channel.Since it can drive motors Up to 36v hence you can drive pretty big motors with this l293d.VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges from 5v and upto 36v.
CHAPTER 5
SYSTEM SPECIFICATION
5.1 SOFTWARE REQUIREMENTS:
5.1.1 MATLAB
The name MATLAB stands for Matrix Laboratory. MATLAB was written originally to provide easy access to matrix software developed by the LINPACK (linear system package) and EISPACK (Eigen system package) projects. MATLAB is a high performance language for technical computing. It integrates computation, visualization, and programming environment. Furthermore, MATLAB is a modern programming language environment: it has sophisticated data structures, contains built-in editing and debugging tools, and supports object oriented programming. These factors make MATLAB an excellent tool for teaching and research. MATLAB has many advantages compared to conventional computer languages (e.g., FORTRAN) for solving technical problems. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. It has powerful built-in routines that enable a very wide variety of computations. It also has easy to use graphics commands that make the visualization of results immediately available. Applications are collected in packages referred to as toolbox. There are tool boxes for signal processing, symbolic computation, control theory, simulation, optimization, and several other of applied science and engineering . Image can be assumed as the visualization of what vision senses that is captured by camera. Image is considered as a two dimensional function with variables that represent the spatial coordinate. It holds information about color as well as shapes. In color image, RGB color model mixes those three prime color components, red, green and blue, to produce another color. Image capturing and processing have been used widely in diverse applications, such in medical and surveillance applications.
MATLAB® is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications. The language, tools, and built- in math functions enable you to explore multiple approaches and reach a solution faster than with spreadsheets or traditional programming languages, such as C/C++ or Java®. You can use MATLAB for a range of applications, including signal processing and communications, image and video processing, control systems, test and measurement, computational finance, and computational biology. More than a million engineers and scientists in industry and academia use MATLAB, the language of technical computing.
Key Features • High-level language for numerical computation, visualization, and application development • Interactive environment for iterative exploration, design, and problem solving • Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, numerical integration, and solving ordinary differential equations • Built-in graphics for visualizing data and tools for creating custom plots • Development tools for improving code quality and maintainability and maximizing performance • Tools for building applications with custom graphical interfaces • Functions for integrating MATLAB based algorithms with external applications and languages such as C, Java, .NET, and Microsoft® Excel®
5.1.2 ARDUINO SOFTWARE IDE:
The Arduino integrated development environment (IDE) is a cross platform application witten in java, and is derived from the IDE for the processing programming language and the wiring projects. It is designed to introduce programming to artists and other newcomers unfamiliar with software development. It includes a code editor with features such as syntax highlighting , brace matching , automatic indentation, and is also capable of compiling and uploading programs to the board with a single click. A program or code written for Arduino is called a “sketch”.Arduino programs are written in C or C++. The Arduino IDE comes with a software library called “wiring” from the original wiring project, which makes many common input/output operations much easier.
5.2 HARDWARE SPECIFICATION
No
Hardware
Specification
1
Stepdown transformer
230v AC – 12-0 /500 Ma
2
Bridge rectifier
1N 4007
3
Arduino Development Board
ATMEGA 328
4
Servo motors
12 V
5
Motor Driver IC
L293D H-Bridge
Table 5.1 List of hardware used
5.2.1 POWER SUPPLY
Alternating voltage is the input to the power supply. Starting with an ac voltage, a steady dc voltage is obtained by rectifying the ac voltage, then filtering to a dc level, and finally, regulating to obtain a desired fixed dc voltage. The regulation is usually obtained from an integrated circuit (IC) voltage regulator unit, which takes a dc voltage and provides a somewhat lower dc voltage, which remains the same even if the input dc voltage varies, or the output load connected to the dc voltage changes. The ac voltage, typically 120 Vrms, is connected to a transformer, which steps that ac voltage down to the level for the desired dc output. A diode rectifier then provides a full wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage variation. A regulator circuit can use this dc input to provide a dc voltage that not only has much less ripple voltage but also remains the same dc value even if the input dc voltage varies somewhat, or the load connected to the output dc voltage changes. This voltage regulation is usually obtained using one of a number of popular voltage regulator IC units. The block diagram of power supply is shown in Figure 5.1.
Transformer
RECTIFIER
FILTER
IC REGULATOR
LOAD
Figure 5.1 Block Diagram of Power Supply
5.2.2 BRIDGE RECTIFIER:
A single phase rectifier uses four individual rectifying diodes connected in a closed loop "bridge" configuration to produce the desired output. The transformer will step down the power supply voltage 0-230V to 0-6V level. Then the secondary of the potential transformer will be connected to the precision rectifier, which is constructed with the help of opamp. The advantages of using precision rectifier are it will give peak voltage output as direct current; rest of the circuits will give only root mean square output. A single phase rectifier uses four individual rectifying diodes connected in a closed loop "bridge" configuration to produce the desired output. The main advantage of this bridge circuit is that it does not require a special centre tapped transformer, thereby reducing its size and cost. The main advantage of this bridge circuit is that it does not require a special centre tapped transformer. The single secondary winding is connected to one side of the diode bridge network and the load to the other side. The bridge rectifier is shown in Figure5.2.2.
Figure5.2 Bridge Rectifier
The four diodes labeled D1 to D4 are arranged in “series pairs" with only two diodes conducting current during each half cycle. During the positive half cycle of the supply, diodes D1 and D2 conduct in series while diodes D3 and D4 are reverse biased and the current flows through the load. During the negative half cycle of the supply, diodes D3 and D4 conduct in series, but diodes D1 and D2 switch "off" as they are in reverse biased. The current flowing through the load is the same direction as before. As the current flowing through the load is unidirectional, so the voltage developed across the load is also unidirectional the same as for the previous two diode full-wave rectifier, therefore the average DC voltage across the load is 0.637Vmax. However in reality, during each half cycle the current flows through two diodes instead of just one so the amplitude of the output voltage is two voltage drops ( 2 x 0.7 = 1.4V ) less than the input VMAX amplitude. The ripple frequency is now twice the supply frequency (e.g. 100Hz for a 50Hz supply). The smoothing capacitor converts the full-wave rippled output of the rectifier into a smooth DC output voltage. Generally for DC power supply circuits the smoothing capacitor is an aluminum electrolytic type that has capacitance value 100 µF. The circuit diagram and waveform of bridge rectifier is shown in Figure 6.2.2.2.
Figure 5.3 Circuit Diagram and Waveform of Bridge Rectifier
However, there are two important parameters to consider when choosing a suitable smoothing capacitor and these are its working voltage, which must be higher than the no-load output value of the rectifier and its capacitance value, which determines the amount of ripple that will appear superimposed on top of the DC voltage. Too low a value and the capacitor has little effect but if the smoothing capacitor is large enough (parallel capacitors can be used) and the load current is not too large, the output voltage will be almost as smooth as pure DC. The main advantages of a full-wave bridge rectifier is that it has a smaller AC ripple value for a given load and a smaller reservoir or smoothing capacitor than an equivalent half-wave rectifier.
Therefore, the fundamental frequency of the ripple voltage is twice that of the AC supply frequency (100Hz) where for the half-wave rectifier it is exactly equal to the supply frequency (50Hz).
5.2.3 IC VOLTAGE REGULATORS:
Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the circuitry for reference source, comparator amplifier, control device, and overload protection all in a single IC. Although the internal construction of the IC is somewhat different from that described for discrete voltage regulator circuits, the external operation is much the same. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage, or an adjustably set voltage. A power supply can be built using a transformer connected to the ac supply line to step the ac voltage to desired amplitude, then rectifying that ac voltage, filtering with a capacitor and RC filter, if desired, and finally regulating the dc voltage using an IC regulator. The regulators can be selected for operation with load currents from hundreds of milli amperes to tens of amperes, corresponding to power ratings from milli watts to tens of watts. IC units provide regulation of either a fixed positive voltage.
Three Terminal Voltage Regulators:
The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to one input terminal, a regulated output dc voltage, Vo, from a second terminal, with the third terminal connected to ground. For a selected regulator, IC device specifications list a voltage range over which the input voltage can vary to maintain a regulated output voltage over a range of load current. The specifications also list the amount of output voltage change resulting from a change in load current which is called load regulation. The fixed positive voltage regulator is shown in Figure.
Figure 5.4 Fixed Positive Voltage Regulators
CHAPTER 6
ALGORITHM
Step 1: Start
Step 2: Start Video
Step 3: Get snapshot from video.
Step 4: Resize the image.
Step 5: Save the image temporarily.
Step 6: Read image from the file and extract information of the image.
Step 7: Get the red, green, blue matrices.
Step 8: Displaying the subplots of red, blue, green components of the images.
Step 9: Initiate the loop for finding maximum value of the matrices.
Step 10: Print red if red component is greater. Print green if green component is greater. Else print blue.
Step 11: Send command to the ARDUINO board from MATLAB serially
Step 12: The microcontroller receives the commands.
Step 13: According to the command from microcontroller the robotic arm will pick the object then came back to the normal position.
Step 14: Based on the color the arm will place the object in desired position.
Step 15: Go to step1.
CHAPTER 7
ADVANTAGES AND LIMITATIONS
The main advantages of the proposed approach rely on the high discriminatory capacity of the object classes and on the high degree of parallelism, capable of processing large amounts of material on production lines. The use of modern electronic systems also allows high operative speed, easy calibration and flexibility (due to a programmable sorting algorithm) to the required classification features. It has high efficiency with higher quality of sorting. It has high sensitivity and ability to distinguish between the objects. It will be always better than human sorting. Some of the prominent advantages are
ü High efficiency: the sorting speed can be very high.
ü High precision: the margin of error can be reduced to great extent.
ü This type of sorter can be used for various objects of different colors.
ü Also suit to select pears, orange and other fruits of this kind.
ü High degree of intelligence if used with PLC control. The machine with a high degree of intelligent , can control it.
ü Good quality and low failure rate with long life.
ü Reliable operation and maintenance.
CHAPTER 8
RESULTS AND DISCUSSION
The following results were observed in our project
ü ON-OFF controlling of devices can be denoted by lighting up particular LEDs driven by relays. Robotic arm has been successfully developed and testing was done in the dummy industrial environment developed in the laboratory. The objective is met by sorting the objects based on the color feature from a group of objects. A GUI in MATLAB was successfully created in order to display the video of the incoming object and displaying the color of the object to the user. The user has to select the COM Port. After the Connection is made the camera detects the RED, GREEN and BLUE object and using serial communication the robotic arm picks the object and places in the desired location
ü System able to detect the object and place it in the desired location.
ü By image processing, we can detect all colors of objects for sorting.
ü This system reduce the human efforts and risk in sorting fields.
CHAPTER 9
CONCLUSION
Fully functional sorter machine can be implemented by using a structure of parallel and independent channels in order to increase the overall throughput which results with a forecasted performance. The project can work successfully. There are two main steps in sensing part, objects detection and recognition. The system can successfully perform handling station task, namely pick and place mechanism with help of sensor. Thus a cost effective Mechatronics system can be designed using the simplest concepts and efficient result can be observed. The project can work successfully and can sort the object depending on their color .Hence for color sorting. Is done in Matlab based code will interface with a USB web cam on PC/laptop which will sense objects and its colors and according command will be sent to the microcontroller to pick and place object We’ll primarily sense three Colors RED GREEN and Blue
CHAPTER 10
APPLICATION AND FUTURE ENHANCEMENTS
The developed Robotic arm is able to detect the Red, Blue, Green colored object and place it in the desired location. The color detection capability can be increased to other secondary colors by advanced image processing and which can sort out. There are many applications in this sorting system. Mainly this finds the important application in agriculture field where it can be used to sort the different agriculture products like grains, lemons, almonds, grapes, and many more. For human beings it becomes comber sum task to sort out the objects with high quality also the possibility of accuracy is less. In industry it can be used for sorting of various objects, tools, with high degree of accuracy and quality with an automation. By this way the proposed project can be used. It finds application in enormous way in agriculture, industry.
REFERENCES
[1] Alessandro Golfarelli, Rossano Codeluppi and Marco Tartagni, ― A Self-Learning Multi-Sensing Selection Process: Measuring Objects One by One by‖,ARCES – LYRAS LAB University of Bologna, Campus of Forlì, 1-4244-1262-5/07/$25.00 ©2007 IEEE, IEEE SENSORS 2007 Conference.
[2] Sahu, S., Lenka, P.; Kumari, S.; Sahu, K.B.; Mallick, B.; ―Design a color sensor: Application to robot handling radiation work‖, Vol. 56, No. 10, pp. 365- 368, 2007, Industrial. Engineering.
[3] www.google.com/microepsilon.com/catcolorsensor—e
[4] www.shortcourse.com/www.sensors.com/optical/imagesensors
[5] wwwgoogle.com/wisegeek.com/what is optical sensors.html
[6]www.google.com/osa.org/sensors
[7] www.pdfgenicom/compacsort.com/sorters
[8]www.pdfgenicom/indiamart.com/sorting machine
[9] www.google.com/ATMEGA 48A/PA/328/P/DATASHEET SUMMARY [10]www.google.com/zimbio.com/clip-base cam
[11] www.google.com/pdfsb.com/smps
[12] www.google.com/pdfgeni.com/vermnlstweb.nl
[13] www.google.com/arduino.cc/main/software
[14] www.google.com/eyantra.org/home/project
[15] Project on― Pick n Place Robot‖, made by Bharat Jain and Dinesh Rajput, under guidance of Prof. KaviArya, IIT Mumbai,2010.
[16] www.pdfgeni.com/servo-tutorial
[17] www.pdfgeni.com/matlab- mathematical lab/pdf