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

Synopsis

On

Color Sorting Machine Using MATLAB


For the fulfillment of Major Project

ECE Department

INDUS INSTITUTE OF ENGINEERING & TECHNOLOGY


Kinana (Jind)

Submitted To:
Er. Shelly Garg H.O.D. ECE Deptt.

Submitted By:
Anil Kumar (5608141) Hari Mohan (5608142) Vivek (5608131)

Introduction to MATLAB:
Overview of MATLAB: MATLAB is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include Math and computation Algorithm development Data acquisition Modeling, simulation, and prototyping Data analysis, exploration, and visualization Scientific and engineering graphics Application development, including graphical user interface building

MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar noninteractive language such as C or Fortran. The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects. Today, MATLAB engines incorporate the LAPACK and BLAS libraries, embedding the state of the art in software for matrix computation. MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis. MATLAB features a family of add-on application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (Mfiles) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.

The MATLAB System: The MATLAB system consists of these main parts: Desktop Tools and Development Environment This is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces. It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, a code analyzer and other reports, and browsers for viewing help, the workspace, files, and the search path. The MATLAB Mathematical Function Library This is a vast collection of computational algorithms ranging from elementary functions, like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms. The MATLAB Language This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create large and complex application programs. Graphics MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for twodimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications. MATLAB External Interfaces This is a library that allows you to write C and Fortran programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files.

Introduction to Data Acquisition:


Data Acquisition Toolbox is a collection of M-file functions and a MEX-file (shared library) built on the MATLAB technical computing environment. The toolbox also includes several dynamic link libraries (DLLs) called adaptors, which enable you to interface with specific hardware. The toolbox provides you with these main features: A framework for bringing live, measured data into MATLAB using PC-compatible, plug-in data acquisition hardware Support for analog input (AI), analog output (AO), and digital I/O (DIO) subsystems including simultaneous analog I/O conversions Support for these popular hardware vendors/devices: Advantech boards that use the Advantech Device Manager Agilent Technologies E1432A/33A/34A VXI modules Keithley boards that use DriverLINX drivers Measurement Computing Corporation (ComputerBoards) boards National Instruments boards that use Traditional NI-DAQ or NI-DAQmx software (except SCXI) Parallel ports LPT1-LPT3 Windows sound cards

Additionally, you can use the Data Acquisition Toolbox Adaptor Kit to interface unsupported hardware devices to the toolbox. Event-driven acquisitions

Data Acquisition System:


As a user of MATLAB and Data Acquisition Toolbox, you are interested in measuring and analyzing physical phenomena. The purpose of any data acquisition system is to provide you with the tools and resources necessary to do so. You can think of a data acquisition system as a collection of software and hardware that connects you to the physical world. A typical data acquisition system consists of these components.

The data acquisition components, and their relationship to each other, are shown below:

The figure depicts the two important features of a data acquisition system: Signals are input to a sensor, conditioned, converted into bits that a computer can read, and analyzed to extract meaningful information.For example, sound level data is acquired from a microphone, amplified, digitized by a sound card, and stored in MATLAB for subsequent analysis of frequency content. Data from a computer is converted into an analog signal and output to an actuator.For example, a vector of data in MATLAB is converted to an analog signal by a sound card and output to a loudspeaker.

Introduction to Digital Input and Output


Digital I/O (DIO) subsystems are designed to transfer digital values to and from hardware. These values are handled either as single bits or lines, or as a port, which typically consists of eight lines. While most popular data acquisition boards include some DIO capability, it is usually limited to simple operations and special dedicated hardware is required for performing advanced DIO operations. Data Acquisition Toolbox provides access to digital I/O subsystems through a digital I/O object. The DIO object can be associated with a parallel port or with a DIO subsystem on a data acquisition board. The purpose of this chapter is to show you how to perform data acquisition tasks using your digital I/O hardware. The sections are as follows: Digital I/O Objects Creating a Digital I/O Object You create a digital I/O (DIO) object with the digitalio function. digitalio accepts the adaptor name and the hardware device ID as input arguments. For parallel ports, the device ID is the port label (LPT1, LPT2, or LPT3). For data acquisition boards, the device ID refers to the number associated with the board when it is installed. Note that some vendors refer to the device ID as the device number or the board number. When using NI-DAQmx, this is usually a string such as 'Dev1'.) Use the daqhwinfo function to determine the available adaptors and device IDs. Each DIO object is associated with one parallel port or one subsystem. For example, to create a DIO object associated with a National Instruments board: dio = digitalio('nidaq','Dev1'); The Parallel Port The PC supports up to three parallel ports that are assigned the labels LPT1, LPT2, and LPT3. You can use any of these standard ports as long as they use the usual base addresses, which are (in hex) 378, 278, and 3BC, respectively. The port labels and addresses are typically configured through the PC's BIOS. Additional ports, or standard ports not assigned the usual base addresses, are not accessible by the toolbox. Most PCs that support MATLAB will include a single parallel port with label LPT1 and base address 378. To create a DIO object for this port, parport = digitalio('parallel','LPT1'); Adding Lines to a Digital I/O Object Using the Addline Function After creating the digital I/O (DIO) object, you must add lines to it. As shown by the figure in Hardware Channels or Lines, you can think of a device object as a container for lines. The collection of lines contained by the DIO object is referred to as a line group. A line group consists of a mapping between hardware line IDs and MATLAB indices (see below).

When adding lines to a DIO object, you must follow these rules: 1. The lines must reside on the same hardware device. You cannot add lines from different devices, or from different subsystems on the same device. 2. You can add a line only once to a given digital I/O object. However, a line can be added to as many different digital I/O objects as you desire. 3. You can add lines that reside on different ports to a given digital I/O object. You add lines to a digital I/O object with the addline function. addline requires the device object, at least one hardware line ID, and the direction (input or output) of each added line as input arguments. You can optionally specify port IDs, descriptive line names, and an output argument. For example, to add eight output lines from port 0 to the device object dio created in the preceding section: hwlines = addline(dio,0:7,'out'); Line and Port Characteristics As described in the preceding section, when you add lines to a DIO object, they must be configured for either input or output. You read values from an input line and write values to an output line. Whether a given hardware line is addressable for input or output depends on the port it resides on. You can classify digital I/O ports into these two groups based on your ability to address lines individually: Port-configurable devices You cannot address the lines associated with a portconfigurable device individually. Therefore, you must configure all the lines for either input or output. If you attempt to mix the two configurations, an error is returned.You can add any number of available port-configurable lines to a DIO object. However, the engine will address all lines behind the scenes. For example, if one line is added to a DIO object, then you automatically get all lines. Therefore, if a DIO object contains lines from a portconfigurable device, and you write a value to one or more of those lines, then all the lines are written to even if they are not contained by the device object. Line-configurable devices You can address the lines associated with a line-configurable device individually. Therefore, you can configure individual lines for either input or output. Additionally, you can read and write values on a line-by-line basis. Note that for National Instruments E-Series hardware, port 0 is always line-configurable, while all other ports are port-configurable. Port 0 is line-configurable only for E-Series devices of the traditional National Instruments drivers. Note that NI-DAQmx devices do not support this.

Block Diagram:
The block diagram used is shown below

In this block diagram we use two motors attached with a mechanical section. D.C. motor is used to rotate conveyor belt and Stepper motor is used to rotate selection arm. Both motors have their motor control section connected with Computer so that motors can be controlled by MATLAB. A power supply of 220 volt is provided to motors. Here we also use a camera for conveyor belt surveillance as shown in figure.

Components Used:
1. 2. 3. 4. 5. 6. 7. 8. 9. Mechanical Section Conveyor Belt D.C. Motor Stepper Motor Motor Controls Camera Computer MATLAB Software Power Supply

Applications/Scope of Color Sorting Machine:


Colour sorters (sometimes electronic colour sorters) are machines are that are used on the production lines in bulk food processing and other industries. They separate items by their colours, detecting the colours of things that pass before them, and using mechanical ejection devices to divert items whose colours do not fall within acceptable (or fall within rejectable) colour ranges. Colour sorters are used for colour sorting harvested foodstuffs (such as coffee, rice, and pulses), with the goal of separating items that are discoloured or not as ripe as required. They are also used in the diamond industry. The transparency of the diamond is measured by the colour sorter and used as a measurement of its purity, and the diamonds are mechanically sorted accordingly. This has an advantage over X-Ray fluorescence methods of robotically detecting purity, since purer diamonds are less likely to fluoresce in the first place. Colour sorters are used in the recycling industry as well. Colour sorters can distinguish between coloured and colourless PET and coloured and colourless HDPE flake.

References:
MATLAB Software http://www.mathworks.in http://www.wikipedia.com

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