WALL-I Documentation

61
Government College of Engineering & Textile Technology, Serampore Department of Computer Science and Engineering Warehouse Automated Lifter Loader Image Guided Final year project submitted by Arindam Das, Ankita Banerjee, Bidhan Kumar Karan,

description

Complete documentation of the final year project- WALL-I, designed as a demonstrative scaled down model meant for warehouse jobs.

Transcript of WALL-I Documentation

Page 1: WALL-I Documentation

Government College of Engineering & Textile Technology, Serampore

Department of Computer Science and Engineering

Warehouse

Automated

Lifter

Loader

Image Guided

Final year project submitted by

Arindam Das, Ankita Banerjee, Bidhan Kumar Karan, Subhabrata Ghosh, Kiranshankar Paul, Aritra Mukherjee

Under the guidance of

Prof. Ashoke Kumar Mazumdar & Prof. Prasanta Mondal

Page 2: WALL-I Documentation

Prof. Asoke Kr. Mazumdar Prof. Prasanta Mondal

Prof. Diptesh Chakravarty Seal of the institution

This project has been submitted by:-

1. Arindam Das2. Ankita Banerjee3. Bidhan Kumar Karan4. Subhabrata Ghosh5. Kiranshankar Paul6. Aritra Mukherjee

Page 3: WALL-I Documentation

0 | P a g e

Table of Contents

Page 4: WALL-I Documentation

1 | P a g e

Acknowledgement

The satisfaction that accompanies the successful completion of any task would be

incomplete without the mention of people whose ceaseless cooperation made it possible,

whose constant guidance and encouragement crown all efforts with success.

We are grateful to our beloved Prof. Asoke Kumar Mazumdar for planting the seed of an

idea which today has flourished into this wonderful reality. But for his vision and constant

motivation, we wouldn’t see this day. Thank you, Sir, for the late hours that you put in

beyond your call of duty, chasing this vision with us with childish exuberance.

Our token of appreciation goes out to Dr. Subhasish Bhaumik, chair of the Dept. of

Mechatronics, BESUS, for his amazing patience in listening to every single detail of our

elaborate design-plans. Without his seasoned advice we would still be stuck with some

chimerical ideas.

Let’s take this opportunity to thank Prof. Prasanta Mondal and Prof. Manik Mondal of the

Dept. of Computer Science, GCETTS who were there as the beacon of hope in our times of

despondence with their ingenious ideas and sincere words of encouragement.

We would also like to thank the remaining faculty and non- teaching staff members across all departments who had to offer only the best of things towards our endeavour. Thank you all…

Page 5: WALL-I Documentation

2 | P a g e

Introduction

It’s been more than a century that men have been fervently striving to create the “Ideal Robot”. It’s been an object of craft, desire, enthusiasm, passion and even obsession for many. It was not until the 1950s that Alan Turing proposed his famous “Turing Test” that more effort started to be concentrated towards imparting “smartness” to our robotic-buddies thus paving way to the development of autonomous robots. Research houses and varsity labs opened their doors with the dream of ushering in a new age of thinking robots. During the ensuing decades, we have experienced many research successes in intelligent manufacturing, autonomous vehicles, space-related robots, medical robotics, nano-machines, computer vision and graphics and anthropomorphic robots.

Warehouse Autonomous Lifter-Loader- Image guided or simply WALL-I is a scaled-down demonstrative version of an intelligent warehouse robot that can be used as a stepping-stone to create the ideal intelligent warehouse-robot. It is an awesome ensemble of several technologies to give shape to an elegant vision. The inspiration behind WALL-I is quite straight- to be able to mimic a job that man has been doing quite precisely yet needlessly in this part of the world since time immemorial. It is also possible to take the research to the next level to explore uncharted waters where WALL-I can be seamlessly fitted into the scheme of things with one or few adjustments thereby giving it the universality of applicability that it was meant to fulfil.

Feasibility study

Since time immemorial, human beings have been wasting precious sweat in doing cumbersome dull labour. With the advent of technology, there has been a paradigm shift in the way humans are made to work. Keeping pace with the boom in economy and need for increased production capabilities, it becomes incumbent upon the techies of the 21st century world to conceive a system which addresses these limitations. WALL- I is a modest effort on our part to try and achieve the said goals.

WALL-I, as is implied by the name, automates and accelerates the cumbersome and dull labour that people have been putting in. Apart from the fact that the labour is demeaning, it also bears much less fruit compared to what WALL-I can achieve in a shorter span of time. WALL-I brings on board a degree of precision, unscalable by human standards.

To achieve the full spectrum of functionality as discussed above WALL-I needs a mechanical model with inbuilt electronic components and a sound Software interface which takes care of the handshake. The mechanical model can be developed by using a chassis and

Page 6: WALL-I Documentation

3 | P a g e

other items readily available in the nearest market. The electronic assembly is realized by using simple analog and digital circuits. The handshake is achieved by using MATLAB.

WALL-I essentially, spans multiple disciplines and entails a wide array of domain knowledge. Being from Computer Science background, we have had to go back to basics and conjure up the titbits that we picked up along the way. Since we are working with a scaled down model, it is possible to work with a limited budget worthy of a final year B.Tech project.

Requirement Analysis

The primary objective of WALL-I is achievement of autonomy (desired complete) in movement navigation, trajectory planning, object ranging and detection and object pick-n-placing. The different portions are desired to do the following jobs:-

Autonomous movement: WALL-I is required to be able to move about without human intervention. Autonomous movement means path planning for least time and cost, obstacle avoidance, coordinate (x, y) and bearing (ф from a fixed cardinal direction) sensing. WALL-I is expected to achieve autonomy in movement by implementing the aforementioned criteria.

Object ranging and detection: WALL-I is required to perform object detection in the arena (simulated warehouse). Objects include mock up versions of warehouse objects like parcels, drums etc. WALL-I is expected to detect different kind of objects in the arena, detect the shapes, estimate its size, detect the approximate distance and alignment of the object with respect to the WALL-I. This information is must to plan the trajectory and schedule the lifting and loading operations.

Object pick-n-planning: The primary objective of any warehouse lifter loader is to lift objects in the warehouse and so is one of the main requirements of WALL-I. Object picking and placing means picking the object, keeping it horizontal, and then taking it to a pre-planned place and then placing it in the proper alignment.

Page 7: WALL-I Documentation

4 | P a g e

Software Requirement Specification (SRS)

The functional requirements of WALL-I are as follows:

Robust mechanical model

Sturdy Structure resistant to mechanical injuries Jerk-free moving parts Light weight Proportionate dimensions so as to minimize torque and force

requirements in motors

Reliable electronic assembly

Reduced power requirement Overload tripping mechanism Proper heat sinking abilities Reduced noise generation & neat circuit design

Cohesive software system

Reduced processing time Less space usage overhead Easily deployable

The non-functional requirements are:

Error and glitch free routines Aesthetically pleasing design Low cost design

Page 8: WALL-I Documentation

5 | P a g e

Design and implementation of theMechanical structure of WALL-I

The first chapter of robot building starts with efficient design and fabrication of the mechanical portion and so is also true for WALL-I. The WALL-I was to be designed to mainly work as a

> Differential drive rover controlled by real time video> A lifter loader to lift and put objects within the test area

These two features were achieved by mainly following the design strategy of fork lifters working in workshops hybridized with earth movers without the caterpillar track. Before going into the details the terms “fork-lifter” and “differential drive” is to be explained.

Fork LifterThe fork lifter is a load lifting mechanism in which the horizontal alignment of the object is kept undisturbed. Fork lifting has basically two advantages, 1 > boxes containing fragile objects and fluid loaded drums are best handled when kept horizontal 2> stacking and palletizing jobs are done very easily if objects are always horizontal.Fork lifting is achieved by either moving the fork vertically up and down with chain-sprocket or rack-pinion or hydraulic mechanism (typically done in fork lifters at workshops and warehouses); or by using a 1D robotic arm with another freely rotating connecting rod kept in such a way that it always keeps the fork vertical (applied in 4DOF palletizing robotic arm).

Differential DriveTo steer and navigate any vehicle we need a steering mechanism, our daily life vehicles like cur, bus etc. applies the Ackerman’s steering principle and unconventional vehicles like battle-tanks, tractors, earthmovers etc. use the differential drive principle. The Ackerman’s principal of steering turns the fore wheels of a vehicle with unequal angles so that the axes of the two fore wheels meet at a certain point and that point becomes the centre of turning for the vehicle. The Ackerman’s principle though complex in mechanism and difficult to fabricate, is a must on fast moving vehicles for a faster turn at high speed (because of the large turning radius), also the principle doesn’t need to change the direction of rotations of wheels but it do requires a different speed for the fore wheels which is easily achieved as the fore wheels of most vehicles are free to rotate. In most cars Ackerman’s steering principle is achieved through power steering giving the driver the ease of turning the vehicle, and this principle is also applied in warehouse fork-lifters.

Page 9: WALL-I Documentation

6 | P a g e

The Ackerman’s steering principle has a major setback that it cannot achieve zero turning radius under any circumstances thus to calculate and plan the trajectory or path of a vehicle in a crowded plane, much computational overhead is involved. But its main advantage is that it involves very less slippage (almost no slip model needs to be considered if open loop control is applied) and very less frictional losses.The differential drive on the other hand uses the principle that if the two wheel sets of a vehicle is turned with different speed or direction or both (that’s how the term “differential” comes to play), then the vehicle can turn through any angle with zero turning radius. The differential drive can be applied to wheel sets with or without caterpillar tracks. The differential drive technique, though simple to design and fabricate, is not applicable to vehicles with high speed and moreover this technique involves a lot of slippage thus a robust (most effectively adaptive) slip model is to be used if open loop control is applied. Though application of closed loop control is more preferred but as wheel rotation and actual turning relation varies with terrain topography, terrain texture, normal reaction force on the wheels and frictional coefficient of the terrain in question so design of the feedback control system is much costly (magnetic needle feedback or optical observation is likely the most effective and correct feedback techniques).

Differential Drive Technique diagrams

Page 10: WALL-I Documentation

7 | P a g e

Fig 1: Wheel rotation directions for differential drive technique

Page 11: WALL-I Documentation

8 | P a g e

Fig 2: meaning of parameters to estimate slip model and thus control differential drive

Slip ModelIn order to control a differential drive vehicle and prepare the command so that just the expected happens, one needs to estimate the slip model of the vehicle for the chassis dimensions, vehicle weight, terrain topography and frictional coefficient for rolling and sliding between the wheels and the surface. The figure above shows the how the expected direction of turning varies with the chassis dimensions; the angle of deviation θ is given asΘ = tan-1(b/a) and greater the θ, tougher is to estimate the relation between actual wheel rotation and vehicle rotation, an upper limit on θ can be 45°.

The mechanical equation for the motor contains the friction term for the robot. The robot runs on wheels and as a result the friction is classed as rolling friction. The coefficient for rolling friction is obtained from tables in various books, For the simulation the value chosen is that of rubber tires on a concrete surface, a value in the range of 0.015-0.02, (Young & Freedman, 2000). The friction equation is equation.

Ff = m× g × σ× (wheel _ r ×ω)

Page 12: WALL-I Documentation

9 | P a g e

Where Ff is the frictional force generated, m is the mass of robot, σ, represents the Friction Coefficient, g is gravity, wheel_r is the radius of the wheel (m) and ω is the wheel angular velocity (rad s-1). The final term, (wheel_ r ×ω), has the effect of scaling the frictional term to suit the current wheel velocity.

Slip is calculated using Equation (9) and is the relationship between the forward velocity and the sway velocity. This has been found, though experimental evidence, to be an acceptable method of calculating slip.

Where v is the sway velocity and u is the surge velocity, β is the slip angle. When the denominator is zero, β is assumed to be zero.

The design of WALL-I Keeping all the above factors in mind the design strategy of WALL-I was to make the robot use differential drive technique and fork lifting system in a simple and cost-effective manner. And the final design is something like this.

Fig 3: Design of WALL-I

Servo motor to lift the fork vertically like a 1 DOF robotic arm, connecting rod to keep the fork horizontal

Differential drive applied so provision of turning the wheels

Wireless (or wired) webcam

Electronics for power, signal reception and transfer above, and power booster and H-bridge circuits are below the chassis

Fork that will always remain horizontal

Page 13: WALL-I Documentation

10 | P a g e

The materials chosen for building WALL-I are

Polypropylene – Polypropylene (PP), also known as polypropene, is a thermoplastic polymer made from the monomer propylene; it is rugged and unusually resistant to many chemical solvents, bases and acids. Polypropylene is normally tough and flexible, especially when copolymerized with ethylene. This allows polypropylene to be used as an engineering plastic, competing with materials such as ABS. Polypropylene is reasonably economical, and can be made translucent when uncoloured but is not as readily made transparent as polystyrene, acrylic, or certain other plastics. It is often opaque or coloured using pigments. Polypropylene has good resistance to fatigue. Polypropylene can be glued together easily with alcohol based adhesives like feviquick® and also can be easily cut and drilled through which helps to bring down fabrication cost and time. The variant we used is HDPP (High Density Poly-Propylene) and it is uncoloured, opaque and inflexible. We used cut pieces from a sheet 6mm thick.

Aluminum – The first choice of metal for any robotic application is always aluminum, as the metal is strong yet light. The chassis of WALL-I is built with aluminum sheet, 1mm thick, and folds are given such as to impart strength as the chassis is main base of the whole vehicle. The screw, washers and nuts are made of aluminum too. HDPP is fastened with aluminum chassis with bolt and nut.

Other materials used are readymade LEGO® robotics 75mm diameter rubber-plastic wheels, metal chips (as counterbalance weights on fork) and rod for making the axis of rotation of the fork, feviquick®. The tools used are hacksaw, chisel, hammer, electric gun-drill, files, and some other common workshop tools.

The design features of the mechanical structure of WALL-I The fork of WALL-I is a simple 1D robotic arm and with a parallel connecting rod, it

can keep the load always horizontal. The maximum stall load capacity can be easily calculated as 5Kgf ÷ (distance of servo connecting pin to fork connecting pin) (approximately) and the calculated value is 5/8 = 625gf. We are using blocks of mass 200g (max) so even with 2 blocks WALL-Is servo can do the lifting job easily. Lifting is o be done slowly to assure prevention of toppling.

The wheel chassis and wheel widths are chosen such as to keep the value of θ (refer to differential drive) less than 45°, for WALL-I the value of θ is tan-1110 / (34+105) = 38.35° thus slip is controllable (though not a very good figure).

The height of camera deck is well above all for a clear view of the front. Most of the heavy mass of WALL-I is kept as below as possible to assure a low centre

of gravity and thus better stability during turn. The plan and elevation of WALL-I follows.

Page 14: WALL-I Documentation

11 | P a g e

Fig 4:

Plan of WALL-I

Page 15: WALL-I Documentation

12 | P a g e

Fig 5: Side elevation of WALL-I

Page 16: WALL-I Documentation

13 | P a g e

Now some perspective views of WALL-I to clarify the positions of different electronic boards, motors etc.

Fig 6: perspective views of WALL-I from different vantage points

Wireless/ wired webcam

PC-MC interfacing board

DAC board

8051 board

Power terminals

Power board

Board deck holder

Counterweight bar to help servo pick up heavy loads

Fork assembly holder

Servo motor

Fork

Page 17: WALL-I Documentation

Hi, I am WALL-I

Hi, I am WALL-I

14 | P a g e

Fig 7: view below the chassis of WALL-I

The mechanical assembly of WALL-I being over we will now move onto the electronics and hardware assembly portion. The model shown above though represent WALL-I but is not exactly to the scale as improvements were done later but the dimensions are updated as per latest model.

We tried hard to make the robot aesthetically pleasing by giving it a look more like a robot than just some mechanical machine automated to do its job by itself. We do not know up to what level did the model looked beautiful as beauty lies in the eyes of the spectator but still it’s a beauty to us! --- Arindam Das (team leader)Design and implementation of the

DC motors, 300 RPM 12V supply. Torque 2 Kgf/cm (stall)

Power boost-up board or SL100 board

H-Bridge board or L293D board

Plastic wheels with rubber rim, screw fitted to motor shaft

Page 18: WALL-I Documentation

15 | P a g e

Electronics (Hardware) of WALL-I

The mechanical portion being ready its now time to move on to the design and implementation section of the electronics portion. WALL-I is a small robot and too small to carry a onboard computer light enough to analyze real time video to take navigation decisions and further task planning, so the main difference of WALL-I from other autonomous robots is that its brain resides outsides its body though the receptor (camera) and actuators (DC motors and servo) resides in it! The brain of WALL-I, a high end PC to process the image and steer it ahead links with the WALL-I through serial link either through wire or wirelessly. The electronics onboard WALL-I is mainly categorized according to boards (Vero-board circuits). These are

8051 Microcontroller Board - responsible for reception of data from PC (in UART mode) and use it to drive and control the pair of DC motors and the servo.

Digital-to-Analog (DAC) conversion Board - responsible for translation of digital data from the microcontroller into analog reference signal for speed controlling the motor.

Signal Boost-Up Board – responsible for boosting the signal or amplifying the power of the reference voltage from DAC board high enough to drive the DC motors.

H-Bridge Circuit Board – responsible for controlling the direction of motors and also braking the motors.

Power Board – responsible for supplying VCC (5V DC), 12VDC and Ground from ±12V supply, and also regulating the power and voltage.

PC-MC interfacing Board – responsible for translating the CMOS voltage levels from serial line of PC to TTL voltage levels of microcontroller and vice-versa.

The list of electronic and electrical components for making WALL-I are as follows

Table1: for electronic component list of WALL-I

Sl no.

Specifications Units

1 Permanent Magnet DC motors (12V) 42 5 Kgfcm-1 180° sway servo motor (6V) 13 8051 Microcontroller (we used Atmel 89S51 40 pin DIP) 14 L293D quad half bridge IC 25 SL 100 power transistors 67 OpAmp IC (we used UA741 8 pin DIP) 48 Maxim 232 CMOS - TTL level converter 19 7805 power regulator IC 110 40 DIP IC base 111 8 DIP IC base 4

Page 19: WALL-I Documentation

16 | P a g e

12 16 DIP IC base 313 Vero Board 4” x 6” continuous parallel linier track 115 Vero Board 2” x 4” continuous parallel linier track 316 8 pin RMC Connectors 216 3 pin RMC Connectors 117 2 pin RMC Connectors 1218 11.0592 MHz Crystal 119 LED (different colored) for indicators 3-520 Push button switch 121 Resistors

8KΩ4KΩ2Ω1KΩ100Ω 8.2KΩ

2242441

22 Capacitors30pF1µF10µF

242

23 IN4007 power diode 824 Heat sink 125 Jumper wires Few

meters26 Solder wire -do-27 Flexible 3wire and 2 wire(twisted) bus 2-3

meters

Before discussing about the circuits and design procedures, let us first get acquainted with the major electronic components used in WALL-I. The components worth individual introduction and discussion are:

PMDC motors Servo motor 8051 microcontroller L293D quad half H-Bridge IC UA741 OpAmp IC MAX 232 level converter IC 7805 power regulator IC Power transistor SL100

PMDC motor

Page 20: WALL-I Documentation

17 | P a g e

Most of the world's adjustable speed business is addressed by DC motors. DC motor speeds can easily be varied; therefore they are utilized in applications where speed control, servo control, and/or positioning needs exist. The stator field is produced by either a field winding, or by permanent magnets. This is a stationary field (as opposed to the AC stator field which is rotating). The second field, the rotor field, is set up by passing current through a commutator and into the rotor assembly. The rotor field rotates in an effort to align itself with the stator field, but at the appropriate time (due to the commutator) the rotor field is switched. In this method then, the rotor field ever catches up to the stator field. Rotational speed (i.e. how fast the rotor turns) is dependent on the strength of the rotor field. In other words, the more voltage on the motor, the faster the rotor will turn. The predominant motor configuration utilized in demanding incrementing (start-stop) applications is the permanent magnet DC (PMDC) motor. Since the stator field is generated by permanent magnets, no power is used for field generation. The magnets provide constant field flux at all speeds. Therefore, linear speed torque curves result. This motor type provides relatively high starting, or acceleration torque, is linear and predictable, and has a smaller frame and lighter weight compared to other motor types and provides rapid positioning.

Servo Motor

A Servo is a small device that has an output shaft. This shaft can be positioned to specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. As the coded signal changes, the angular position of the shaft changes. Servos are extremely useful in robotics. The motors are small, have built in control circuitry, and are extremely powerful for their size. A standard servo such as the Futaba S-148 has 42 oz/inches of torque, which is pretty strong for its size. It also draws power proportional to the mechanical load. How does a servo work? The servo motor has some control circuits and a potentiometer (a variable resistor, or pot) 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. The control is mainly done by comparing the voltage levels from integrating a PWM control signal and the divider voltage obtained from the pot which is proportional to the angle turned. If the circuit finds that the angle is not correct, it will turn the motor the correct direction until the angle is correct (or the voltage levels match). The output shaft of the servo is capable of travelling somewhere around 180 degrees. Usually, it is 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. A normal servo is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear.

8051 Microcontroller

Page 21: WALL-I Documentation

18 | P a g e

The 8051 microcontroller is like a true computer on a single chip. It has a CPU which contains ALU, PC, SP, FLAG registers. In addition with a fixed amount of RAM, ROM and I/O ports including serial communication, external interrupt and timers are all embedded together on a 40 pin DIP single chip. The main features of the 8051 microcontroller are:• 8 bit CPU with registers A and B• 16 bit Program Counter (PC) and Data Pointer (DPTR)• 8 bit Program Status Word (PSW)• 8 bit Stack Pointer (SP)• Internal ROM and Internal RAM (128 Bytes RAM and 4 Kilobytes ROM )• 4 Ports of each 8 bit, P0-P3• 2 timers of each 16 bit, T0 and T1• Full Duplex serial data Transmitter/ Receiver• Control Registers: TCON,TMOD,SCON,PCON,IE,IP• 2 external and 3 internal interrupt sources• Oscillator and Clock circuitA brief description of the Special Function Registers is given below:• Special Function Registers (SFR) are areas of memory that control specific

functionality of the 8051 microcontroller.• The SFRs allow the user to access the ports, serial communication, control and

access timers, configure the 8051’s interrupt system and power control system.• Some SFRs can be accessed with bit operations also, i.e. they are bit addressable

Special Function Registers.• SCON: (Serial Control) SCON is used to configure the behaviour of the 8051’s serial

port.• SBUF: (Serial Buffer) SBUF is used to send and received data via serial port.• IE: (Interrupt Enable) IE register is used to enable and disable specific interrupt.• IP: (Interrupt Priority) IP register is used to specify the priority of each interrupt.• PCON: (Power Control) PCON register is used to control the 8051’s power control

mode.• TCON: (Timer Control) TCON is used to control the 8051’s timer and counter

operation.• TMOD: (Timer Mode) TMOD is used to control the mode of operation of timer and

counter.• TL0/TH0: (Timer 0 Low/High )• TL1/TH1: (Timer 1 Low/High )

Other than this the registers like Accumulator(A) is used for many operation, including Addition, Subtraction, Integer Multiplication, Division and other logical operation, it is also used for all data transfers between the 8051 and any external memory. The Program Counter (PC) and Data Pointer (DPTR composed of DPH and DPL) are two 16 bit registers used for pointing the location of the memory; the PC is used to hold the address of the next memory location which is to be executed, DPTR is used to hold the memory address for

Page 22: WALL-I Documentation

19 | P a g e

internal and external code memory and external data memory. The Program Status Word (PSW) is used as a flag register to know about the status of operations in the accumulator. A very useful feature of the 8051 microcontroller registers and a portion of the RAM is that they are bit addressable and thus we ca read or write to those registers in words and also by their individual bits.

A picture speaks a thousand words so the diagram below shows the architecture of the 8051 in blocks for a complete understanding.

Fig 8: Block diagram of 8051

Page 23: WALL-I Documentation

20 | P a g e

The pin description is – pin 1-8 is port1, pin 9 is reset, pin 10-17 is port3 but their alternative use is 10-RXD, 11-TXD, 12-INT0’, 13-INT1’, 14-T0, 15-T1, 16-WR’, 17-RD, pin 18 and 19 are crystal input pins, pin 21-28 is port2, pin 29-PSEN’ pin 30-ALE’/PROG, pin 30-EA’/VPP, pin 39-32 is port0(in order of LSB to MSB the others are automatically in order), and pin 40 is VCC.We used Atmel 89S52 which has the following features, the AT89S51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.The Absolute maximum ratings (design constrains) are:

Operating Temperature.................................. -55°C to +125°C Storage Temperature ..................................... -65°C to +150°CVoltage on Any Pinwith Respect to Ground .....................................-1.0V to +7.0VMaximum Operating Voltage............................................ 6.6VDC Output Current...................................................... 15.0 mA***other details are available in datasheet

L293D quad half H-Bridge ICThe L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications.

Typical multi usage circuit diagram.

Page 24: WALL-I Documentation

21 | P a g e

Fig 9: Typical circuit diagram of L293D showing different use of half H-bridges

Absolute maximum ratings (design constrains) of L293D

Supply voltage, VCC1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 VOutput supply voltage, VCC2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 VInput voltage, VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 VOutput voltage range, VO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –3 V to VCC2 + 3 VPeak output current, IO (nonrepetitive, t ≤ 5 ms): L293 . . . . . . . . . . . . . . . ±2 APeak output current, IO (nonrepetitive, t ≤ 100 μs): L293D . . . . . . . . . . . . ±1.2 AContinuous output current, IO: L293 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±1 AContinuous output current, IO: L293D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±600 mAContinuous total dissipation at (or below) 25°C free-air temperature . . . 2075 mWContinuous total dissipation at 80°C case temperature . . . . . . . . . . . . . . . 5000 mWMaximum junction temperature, TJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150°CLead temperature 1,6 mm (1/16 inch) from case for 10 seconds . . . . . . . 260°CStorage temperature range, TSTG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –65°C to 150°C

***Other details are available in datasheet

UA 741 OpAmp IC

The UA741 series are general purpose operational amplifiers which feature improved performance over industry standards like the LM709. The amplifiers offer many features which make their application nearly foolproof: overload protection on the input and

Page 25: WALL-I Documentation

22 | P a g e

output, no latch-up when the common mode range is exceeded, as well as freedom from oscillations.

Fig 10: DIP package details of UA741

The absolute maximum ratings (Design constrains) are

Supply Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±22V ±18V Power Dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 mW Differential Input Voltage . . . . . . . . . . . . . . . . . . . . . . . . . ±30VInput Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±15VOutput Short Circuit Duration . . . . . . . . . . . . . . . . . . . . . . ContinuousOperating Temperature Range . . . . . . . . . . . . . . . . . . . . . −55°C to +125°CStorage Temperature Range . . . . . . . . . . . . . . . . . . . . . . . −65°C to +150°C***other details are available in datasheet

MAX232 RS232 TTL level interconverter IC

The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V and a typical hysteresis of 0.5 V, and can accept ±30-V inputs. Each driver converts TTL/CMOS input levels into EIA-232 levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments LinASIC library.

Page 26: WALL-I Documentation

23 | P a g e

Fig 11: Pin diagram and definition of MAX 232

Absolute maximum ratings (design constrains)

Input supply voltage range, VCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to 6 VPositive output supply voltage range, VS+ . . . . . . . . . . . . . . . . . . . . VCC – 0.3 V to 15 VNegative output supply voltage range, VS - . . . . . . . . . . . . . . . . . . –0.3 V to –15 VInput voltage range, VI: Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to VCC + 0.3 VReceiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ±30 VOutput voltage range, VO: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . VS– – 0.3 V to VS+ + 0.3 VR1OUT, R2OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . –0.3 V to VCC + 0.3 VShort-circuit duration: T1OUT, T2OUT . . . . . . . . . . . . . . . . . . . . . . . Unlimited

***other details are available in datasheet

7805 power regulator IC

The KA78XX/KA78XXA series of three-terminal positive regulator are available in the TO-220/D PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.Here we are using the 5V output variant also called 7805

Features• Output Current up to 1A• Thermal Overload Protection• Short Circuit Protection• Output Transistor Safe Operating Area Protection

Fig 12: Internal block diagram of 7805Absolute maximum ratings (design constrains)

Input Voltage (for VO = 5V to 18V) V . . . . . . . . . . . . . . . . . . 35VThermal Resistance Junction-Cases (TO-220) RθJC . . . . . . . 5°C/WThermal Resistance Junction-Air (TO-220) RθJA . . . . . . . . . 65°C/WOperating Temperature Range (KA78XX/A/R) TOPR . . . . . . 0 - 125°CStorage Temperature Range TSTG . . . . . . . . . . . . . . . . . . . . -65 – 150°C

***Other details are available in datasheet

Page 27: WALL-I Documentation

24 | P a g e

SL100 power transistor

The SL100 is a general purpose medium power transistor. Its polarity type is N-P-N and it is available in TO39 package (drum with 3 pin and notch showing the emitter). The β value (hfe) lies within 100-300.

The absolute maximum ratings (design constrains) are

Collector – Emitter voltage BVCEO . . . . . . . . . . . . . . . . . . . . . . . 50VCollector – Base voltage BVCBO . . . . . . . . . . . . . . . . . . . . . . . . . 60VEmitter – Base voltage BVEBO . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.0 VPower dissipation at TA = 25°C PD . . . . . . . . . . . . . . . . . . . . . . . 800mWCollector current IC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500mAOperating and Storage Junction temperature TJ, TSTG . . . . . . . -65 - 200°C

***Other details are available in datasheet

After describing the major components (characteristics, block diagrams, absolute maximum ratings) we further proceed into the design phase of the hardware.

Overall architecture of WALL-I

Page 28: WALL-I Documentation

25 | P a g e

Fig 13: overall architecture of WALL-Is electronics

The above figure shows the overall architecture of WALL-I. As evident from the diagram that the hardware of WALL-I is the aggregation of 6 boards mentioned earlier, now in the following sections circuit of each board and its corresponding designing reasons will be discussed. The analog electronics oriented boards namely the DAC board and the power booster boards showed some variation from the actual theoretical calculations which are displayed in the form of line charts for better understanding.

The 8051 Microcontroller board

One of the most important boards of WALL-I is the 8051 board, whose job is to receive and forward the signals for controlling the DC motors and the servo in their own way. Though simple in its task, but it is very important for it to function properly, as an error in this board will be propagated in a magnified way to the subsequent boards.

Page 29: WALL-I Documentation

26 | P a g e

Fig 14: circuit diagram of 8051 board

The features of this board are:-

The components used in this board are: Atmel89S52 microcontroller, capacitors, resistors, RMC connectors, crystal and LED.

Pull up of 1KΩ resistance is attached to pin 1 of port 1 as well as to the upper nibble of port0 and the entire port2 to nullify any loading effect of the devices they are controlling. With 1KΩ resistance current supply capability is as high as 5/1000 = 5mA well below the mark of maximum constrain of 15mA.

The crystal frequency is chosen at 11.0592 MHz as when it divides down for the UART mode of serial transmission 9600 baud rate can be achieved exactly (which needs to be there for communicating with the PC correctly).

The lower nibble of port0 is free to be used for other bit addressable jobs such as lighting status LED’s and or lighting lasers etc.

A capacitor of 10µF is placed across the reset switch in order to nullify the de-bounce effect of mechanical switching.

The rest connections are made as per specifications and requirements of a general 8051 project with PC-MC connection.

Next comes the board that is converting the digital bytes into analog voltages, the DAC board.

Page 30: WALL-I Documentation

27 | P a g e

The Digital-to-Analog conversion board

Fig 15: circuit diagram of DAC board

The main features of this board are:- It uses simple weighted summer circuit and inverting gain circuit of OpAmp to give a

positive voltage reference for the power boost-up board. The general equation for output reference voltage (theoretical) for the above design

is VOUT = 10 x (0.125D3 + 0.25D2 + 0.5D1 + D0) where Di is either 1 or 0 ; the equation for the other nibble is same just the bits vary.

Though theoretically VOUT is to range from 0 to 18.75 volts and with step size of 1.25 volts but practically the upper limit is 12V (as max supply voltage is 12V) and step size is 1.25V at lower bits but decreases from 8 onwards.

A little offset voltage is there which adds to the VOUT the voltage is too low to be considered yet a preset was placed later (not shown in circuit) between pin 1 and 5 of each OpAmp to nullify the offset.

The supply voltage, differential input voltage and input voltage are well within the safety limits, and the power dissipation is 20-30 mW at full load, well below the limit.

Page 31: WALL-I Documentation

28 | P a g e

The next in the list is the signal boost-up board whose job is to power amplify the voltage reference from the DAC board to drive the H-Bridge board and thus the DC motors

The Power boost-up board

Fig 16: Circuit diagram of the SL100 board

The main features of this board are:- It is a pure analog circuit board which needed revision of the working of transistors,

their amplifier types, biasing circuits, noise reduction etc. Though noise reduction is not a subject to be considered as it does not involves amplification of signals with harmonics but signals that are pure DC levels. The maximum supply voltage is 12V so this circuit cannot boost a signal with more voltage.

No biasing is done to get maximum linearity and correspondence with reference voltage, the power supply from the OpAmp is high enough not to cause a loading effect.

The transistors are connected in parallel, the input current to the base is limited to 12 mA and thus it does not cause any loading effect on the OpAmp whose maximum output voltage is 200 mA.

The maximum current output of any SL100 is 500mA and a set of three is for each wheel set, which consumes a maximum of 350*2 = 700 mA. So a factor of safety of 1500/700 = 2.14 is there and thus heat dissipation is kept well in control. Physically also the SL100s are placed much apart to prevent thermal overrun.

The ground to the circuit is made common, and the transistors are working in common collector mode.

Next comes the H-Bridge board, the main motor driver board.

Page 32: WALL-I Documentation

29 | P a g e

The H-Bridge board

Fig 17: circuit diagram of L293D board

The main features of this board are:- The circuit of L293D is already given in the datasheets, so no discussion here! The

diodes are IN4007 power diodes mainly used as flywheel diodes to prevent hysteresis current from freely moving DC motors.

The control bits are directly from the 8051 board and are powered enough to prevent any loading effect.

The DC motors has a stall consumption of 350mA, even below the continuous current supply capability per channel of L293D. So no heat sink is provided as the ICs are working well below their maximum limits (high factor of safety).

Page 33: WALL-I Documentation

30 | P a g e

How the PC know, what value to give to the DAC for motor speed control? In which direction the motors are to rotate? How much the servo is to rotate? It gets all these information from the PC continuously through the PC-MC interfacing board AKA the MAX 232 board. Next in the list is the max 232 board.

PC - MC interfacing board

Fig 18: Circuit diagram of MAX232 board

The main features of this board are:- The MAX 232 board is a simple board which interconnects the computer and the

8051 microcontroller. The serial link of any PC uses the RS232 logic levels which vary from ±5V to ±25V, the PC we used has a RS 232 level of ±12V and to convert these voltage levels to TTL compatible voltage levels the MAX 232 IC is used. The IC along with 4 capacitors can do this job at very high frequencies also much above 9600 baud rate.

One MAX 232 IC can parallely handle two serial links, though we used 1 trans-receiver relay only.

The circuit ground is to be connected with the ground in the serial port, any other ground will not set up a closed two port circuit and thus transmission will stop.

In future this board is likely to be replaced by a wireless serial linker board or a Bluetooth dongle.

Without power all boards are dead so last of all the smallest board which keeps all board working, the power board.

Page 34: WALL-I Documentation

31 | P a g e

The Power board

Fig 19: circuit diagram of the power board

The main features of this board are:- It has a LED to show fitness status. It acts like a central hub to give appropriate voltage levels to all the other boards. It has a black heat sink attached to it to dissipate the heat generated, its maximum

current capacity is 1 A and in practical it do not needs to furnish more than 300 mA, so thermal overrun do not occurs.

A similar voltage regulator IC LM7806 is used for the servo (not shown in diagram) in the general two port fashion.

The power supply it requires is +12V, ground, -12V from an external source. In future it is likely to be connected to two 12V Li-ion batter in opposite connection for an onboard power supply.

Page 35: WALL-I Documentation

32 | P a g e

Software & Interface

Objective of software: To control the robot properly and detect the object shape as well as its distance from the robot the software is required. After detection the object must be placed at its designated place. All this is effectively achieved by the software interface.

Language Selection: This is the most important part of any successful project. For selecting an appropriate language for a project an analysis must be done about it. The basic requirement of our project is accessing serial ports, getting video from webcam, extraction of frame from it, using different types of operator to detect the shape of object and getting pixel value of each pixel so that we can find the distance of the object. Finally we have to send the values through serial ports to control WALL-I. MATLAB (Mathematics Laboratory) is the appropriate language satisfying all the criteria we require for our project.

Features of MATLAB: MATLAB® is a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation. Using the MATLAB product, you can solve technical computing problems faster than with traditional programming languages, such as C, C++, and FORTRAN.

Algorithm: The basic works and steps to do that work by the robot are as follows:

1. Video acquisition2. Image acquisition from video 3. Object and shape identification4. Object distance determination5. Selection of direction6. Reach to the object7. Lift the object8. Place it as pre-assigned position

Video acquisition: The very first requirement of the software is to acquire video trough a webcam. As we are using a wireless webcam so its receiver is connected to a serial port. In MATLAB the webcam can be detected by a function named videoinput(adaptername,deviceid). This function automatically detects the port where the device is connected. The argument adaptername is the name of webcam adapter which is installed in the system. In our case it is ‘winvideo’. The adapter name can be found in MATLAB by typing imaqhwinfo. There are several other property that can be set using different argument in the function videoinput() like format which say the format in which the video will be acquired.

Image acquisition from video: As we all know that video is nothing but the still images or frame. If a number of frames are shown in a very less time then we think that the pictures

Page 36: WALL-I Documentation

33 | P a g e

are moving or we are seeing a movie or real time video. We can take a frame or a snapshot in MATLAB by two function getframe() or getsnapshot(). These two function take the name of the device as argument through which it take the picture. But by the function getframe() we cannot show the frame as a picture. By getsnapshot() function the picture which has taken is not of so good quality that an object can be seen from it . This happen because at the same time two thread i. videoinput() ii. Snapshot() want to access the same device. The best way to do this is to get a printed screen in a particular window where the video is shown. To do this a window is created by the function java.awt.Rectangle(xpos,ypos,ht,wt).Here xpos and ypos are the starting position of the window and ht and wt is the height and width of the window. To take the screenshot robo.createScreenCapture(rectangle) function is used. Here rectangle is the object which is created by the function java.awt.Rectangle(xpos,ypos,ht,yt). So finally we have our image. But the image is in buffered form. To convert it into RGB format imge.getRGB(0,0,ht,wt,[],0,ht) is used where image is the image taken by the image acquiring function. Now the colours are separated from each other and stored in an array so that image processing can be done on it by rasta=256^3+rasta;B=uint8(mod(rasta,256));G=uint8(mod((rasta-int32(B))./256,256));R=uint8(mod((rasta-256*int32(G))./65536,256))Here R G B defines the value of red green and blue pixel value. Finally it is stored in a three dimensional array by following manner X.cdata=uint8(zeros(wt,ht,3));

X.cdata(:,:,1)=reshape(R,[ht wt])';X.cdata(:,:,2)=reshape(G,[ht wt])';X.cdata(:,:,3)=reshape(B,[ht wt])';

X.colormap=[];

Now we have an image on which image-processing can be done.

Object and shape detection: This is the most important part of the software where the object and its shape is determined. There are several way to detect an object from image such as Sobel edge detection method, Canny edge detection method, Hough transform etc. but we choose Hough transform as it is most efficient among all. The basic description of Hough Transform is given below:

Hough Transform: The Hough transform is a technique which can be used to isolate features of a particular shape within an image. Because it requires that the desired features be specified in some parametric form, the classical Hough transform is most commonly used for the detection of regular curves such as lines, circles, ellipses, etc. A generalized Hough transform can be employed in applications where a simple analytic description of a feature(s) is not possible.

The generalized Hough transform is used when the shape of the feature that we wish to isolate does not have a simple analytic equation describing its boundary. In this case,

Page 37: WALL-I Documentation

34 | P a g e

instead of using a parametric equation of the curve, we use a look-up table to define the relationship between the boundary positions and orientations and the Hough parameters. (The look-up table values must be computed during a preliminary phase using a prototype shape.)

The mathematical description of Hough transform is as following:-

Page 38: WALL-I Documentation

35 | P a g e

For a line we know the parametric normalized equation of a line is xcosѲ+ysinѲ =ρ where ρ is the perpendicular distance and Ѳ is the angle of the perpendicular line from origin. From above equation we can see that point in a picture but representing it as a sinusoidal parameter. Reverse is also possible. Now all parametric sinusoidal curve of collinear point cuts each other at a unique point. From the picture it can easily be seen. Now in general concept all the edge pixel can be calculated and edge can be shown be following manner-

Let ρ є [-R, R] and Ѳ є [0, ∏ ). Now for each edge point (x, y) calculate ρ’ = xicosѲ’+yicosѲ’ for all Ѳ’ є [0, ∏). The index of accumulator is incremented by one as A(ρ’, Ѳ’) = A(ρ’, Ѳ’) +1. Now finally get the threshold value to get the parameter of a line. Suppose if threshold value is set to 30 then the sharpen edge will be shown. It 20 is kept as threshold then little sharp edge will also be shown.

We can use the Hough Transform to detect the circle in following manner---

Equation of a circle can be given by

(x-a)2 + (Y-b)2 = r2

This is for a circle having center (a, b) and radius r. Now the parameter space is three dimensional i.e. (a, b, r). Each point in image space gives rise to a locus of voting points in the 3D Hough space that will be a surface. For a given radius, the locus of possible circle centers for a given image point will itself be a circle of radius r centered on the given point. Therefore, in the 3D Hough space, the locus of possible parameter values sweeps out the surface of an inverted cone with axis parallel to the r axis and vertex at (a, b, 0). If a set of edge pixels in an image are arranged on a circle with parameters (a, b, r) the resultant loci of parameter for each such point will pass through the same (a, b, r)in parameter space. There for many such right circular cones will intersect at a common point. By using the equation with its derivative (directional information), the number of free parameters is reduced by one. Above equation of circle can be written as-

f (x, p) = (x − a)2 + (y − b)2 − r 2 = 0 Here parameters p = (a, b, r ), and x = (x, y).Now update the accumulator with that parameter values for which f(x, p)=0 and df(x,p)/dx = 0 dy/dx = tan[Ф(x) - ∏/2 ] where Ф(x) is gradient derivative. Now we can show the use of Hough transform for general arbitrary shaped body. All the body is nothing but the set of boundary points. Let the boundary points be B = Xb. Now for a shape it is defined that parameter p = x0,S, Ѳ where x0 is the reference point , S is scaling factor and Ѳ is rotational angle. Now we have to calculate R table i.e. for each Xb r = x0-xb

and store it as a function of Ф. So the table will be look like-----

i Фi R Фi

1 0 r|x0 − r = xb, xb є B, Ф (xb)= 02 ∆Ф r|x0 − r = xb, xb є B, Ф (xb)= ∆Ф3 2∆Ф r|x0 − r = xb, xb є B, Ф (xb)= 2∆Ф

Page 39: WALL-I Documentation

36 | P a g e

…. ……. …….

After making the R table now build a 4 dimensional accumulator over (xc,yc,s,θ) (A[xc][yc][θ][s]) where xcyc is the coordinate of x0. Next for each edge point (x, y) calculate the surface

normal value Ф. Now for each pair of r and where is atan((y-yc)/(x-xc)) convert (r, ) to

potential (xc,yc). Now for each value of s’ between smax and smin in A and for each value of θ’ between θmax and θmin in A rotate and scale (xc,yc) to form (xc,yc)’ Add one to A[xc’][yc’][θ’][s’] = A[a]++. Now the local minima of accumulator will give the shape of object.

To implement Hough Transform in MATLAB at first we have to convert the image into gray scale image then convert finally this image to binary image. The gray scale image is those images whose pixel value lies between 0 to 255. The binary images are those image whose pixel value is either 0 or 1. After doing these all Hough Transform is applied with three parameters. It is called by following manner:

Img = imread(‘Imagefile’) ;

Imggray = rgb2gray(Img);

Imgbinary = im2bw(Imggray);

[H,rho,theta]=hough(Imgbinary);

[H, theta, rho] = hough(Imgbinary) computes the Standard Hough Transform (SHT) of the binary image Imaginary. Here H is Hough matrix theta is the value of the perpendicular line from origin and rho is the perpendicular distance of the point from the origin. The values of theta and rho are responsible for making Hough matrix. BW can be logical or numeric, and it must be real, 2-D, and non-sparse.

Next we have to find the shape of object which is done by summing the median values of Hough transform and putting the point of Hough matrix in polyfit() function so that a polynomial can be drawn through the points. If the no of points is less than number of variable in polyfit() function then no curve can be drawn. Now if the median value lies between a pre-assigned value den we give the name of object as well as keep the shape of object in memory.

Selection of direction: By Hough transform we can get the shape of the body as well as its presence in arena. Now we have to join the direction of the vehicle and center of mass of the object so that the vehicle can proceed in right direction. As we know that all vehicles moving on ground move in a 2D plane. So the viewing plane of a camera will be along x-z or y-z plane. We will get a position of an object at certain position in an image. Now we can find the centre of mass of object from image and find the distance of y coordinate of centre of image and the centre of mass. Finally we rotate the vehicle as

Page 40: WALL-I Documentation

37 | P a g e

much angle so that the y coordinates of both the centre coincide. For getting the centre of mass of object from image in MATLAB there is a function regionprops(L, properties). This function measures a set of properties for each labelled region L. L can be a label matrix or a multidimensional array. When L is a label matrix, positive integer elements of L correspond to different regions. For example, the set of elements of L equal to 1 corresponds to region 1; the set of elements of L equal to 2 corresponds to region 2; and so on. The return value STATS is a structure array of length max(L(:)). The fields of the structure array denote different measurements for each region, as specified by properties. In MATLAB there are mainly two properties which can be used PixelIdxList which is p-element vector containing the linear indices of the pixels in the region and PixelList which is p-by-n dimensions level matrix specifying the locations of pixels in the region. Each row of the matrix has the form [x y z ...] and specifies the coordinates of one pixel in the region. Since we are using the image after converting it into a binary image it will have only two levels. Finally we calculate a average of all the x and y coordinate having level 1. So this will be the centre of mass of an arbitrary shaped object in an image. In MATLAB we have done it in following manner—

bw = I < 255;L = bwlabel(bw);s = regionprops(L, 'PixelIdxList', 'PixelList');s(1).PixelList(1:4, :)idx = s(1).PixelIdxList;sum_region1 = sum(I(idx));x = s(1).PixelList(:, 1);y = s(1).PixelList(:, 2);xbar = sum(x .* double(I(idx))) / sum_region1ybar = sum(y .* double(I(idx))) / sum_region1imshow(I)

Here I is the image coming from the source.

Page 41: WALL-I Documentation

38 | P a g e

Distance determination: Now we have to find the distance of the object which is done by following manner:

From above picture we can easily say that the real world image of length D is shown in Y pixel of picture of viewing area. So we can derive a ratio as

rto = D/Y

Now the height of Laser light source is at a distance h from the camera. Now it’s point is shown at a distance P in viewing area. So we can say that h distance is shown at P distance in viewing area. So we can write that---

h/P = D/Y

From here we can derive the value of D as (h*Y)/P.

Now in ∆OPR we can write that

Tan(A/2) = (D/2)/ d where d is the actual distance which we have to find.

So in above equation we can put the value of D so the equation become

Page 42: WALL-I Documentation

39 | P a g e

Tan(A/2) = (h*Y)/(2*P*d)

From here we can find the value of d as

d = ( h*Y* cot(A/2)) / (2*P)

Since both h, Y, A are constant so the value of d is only depend on P i.e. the distance of pixel in image viewing area.

In above picture the axis of camera is parallel to horizontal but when the camera will bent down by an angle B as shown in figure below the distance will be change

From above (h – d *tan B) is shown with a pixel p in view port . Let us assume that the ratio be “Rat”. Then

Rat = p/(h – d *tan B)

Page 43: WALL-I Documentation

40 | P a g e

Again from above we can say that Rat = L/D

So L/D = p/(h-d*tanB)

Or D =( L*(h- d*tanB))/p ----------------(1)

Now in ∆OPQ

y/d = tan(A/2 -B) [The axis of camera divides the angle of camera in two equal halves]

Or, Y = d * tan(A/2 – B)

Again in ∆OQT

x/d = tan(A/2 + B)

Or x = d * tan(A/2 + B)

Now from the figure we can easily deduce that D = x + y. So

D = d*tan (A/2 - B) + d * tan (A/2 + B) ----------------- (2)

Equating the value of D then

d * (tan(A/2 –B) + tan(A/2 + B)) = ( L*(h- d*tanB))/p

Or, p*d (tan (A/2 –B) + tan (A/2 + B)) =L*h – L *d *tan B

Or, p*d(tan(A/2 - B) + tan(A/2 + B)) + L*d*tan B = L * h

Or d * ( p*(tan(A/2 - B) + tan(A/2 + B)) + L*tan B) = L * h

Or d = (L*h) / (p*(tan (A/2 - B) + tan (A/2 + B)) + L*tan B)

So the distance between the object and the vehicle is found. Finally we use the port value to control the time and voltage. For e.g. If 6 volt give a speed of 5ft/min then we write the value 6 in port for a time got by dividing distance by the speed. We will send 3 values in serial port one each for the following units attached with WALL-I

1. Left motor value2. Right motor value3. Servo control value

These 3 units receive the control signal and generate the corresponding functions which in turn completes the routine.

Page 44: WALL-I Documentation

41 | P a g e

Future prospects of WALL-I

We tried to build WALL-I up to the SRS as much as possible but due to lack of funding and time we were not able to build everything as specified. Also during the construction of the different phases we faced various difficulties and we also thought out various solutions for them but it was not feasible to apply as time was short. In this section we discuss the different improvements that could be done on WALL-I for making it better and more efficient in its tasks.

Possible improvements in the mechanical assembly

The steering mechanism used here is the differential drive technique. The main problem of this technique is that it is very difficult to predict the slip model of the vehicle with respect to a certain terrain, and so prediction of number of rotation of the wheels is very difficult. But we already discussed earlier that Ackerman principle of steering do provides an almost slip less steering mechanism, but its main disadvantage is its cost and construction complexity. Thus we thought of a tradeoff between the two techniques and sort out a way to use both of them partially to attain a slip less, zero turning radius, easy to control steering mechanism by putting the whole motor assembly of a wheel on a revolving base that will align the wheel to the circle of turning at the time of turning. This mechanism is used in MARS rover, the main idea is to rotate the wheel-motor on the axis which is perpendicular to the ground and is on the midpoint of the line of contact of the wheel. The following sketch illustrates. The turning pin the diagram is where the turning torque is applied. The thrust bearing and the wheel rotation axle is intended to be low lateral play.

The fork assembly can be with a hydraulic power unit or pulley driven so as to handle more loads. Another improvement that must be incorporated is that the fork lifters should be provided with shock absorbing springs to ensure that the product handle remains safe and out of vibration even if the robot is negotiating a bumpy terrain.

Possible improvements in electronics

Page 45: WALL-I Documentation

42 | P a g e

The main desired improvements in the electronics and electrical portion of WALL-I areas follows

The image processing should be made on-board, to reduce the communication overload and also to increase the speed of computation and processing of video. This requires a fully fledged computer to be carried onboard with processor, RAM, motherboard and I/O devices. This can only be achieved in a scaled up version of WALL-I which may use a gas driven power station to generate its own power rather that consuming battery power.

The feed-back system can be made optical, i.e. the mode of action used in optical mouse can be used here to get an optical feedback of the movements rather that optical encoding of wheel rotation which may not give a good figure for feedback due to slip uncertainty. The idea is to use the digital signal processor of an optical mouse to get the pattern of movement of the robot on the ground. The serial data from the mouse circuit can be fed into the driving processor to check whether the robot has done what it was commanded to do. This can be easily tested by reverse engineering an optical mouse and its incorporation with the driving control circuit. The inspiration of this idea is to make the robot use the same principle of feedback that is done by human beings.

The step size of voltage increment for the DC motors can be reduced to get a finer response.

Possible improvements in Software Interface

The following is a compilation of the features that ought to be implemented in the software interface design to give WALL-I the full range of the functionalities that it was conceived to fulfill-

Intelligent control software should be designed which is “aware” of its surroundings, capable of reactive as well as proactive. Further research needs to be pursued to determine if at all it is feasible to implement some form of learning system to allow WALL-I to better marshal its resources.

The software routine driving the system should allow it to detect obstacles along the way and effectively bypass them. Under present circumstances such considerations have been waived. The system needs to be able to discern between a target object and an obstacle. More detailed pattern matching algorithm needs to be effected for realizing this goal.

Features like Terrain-mapping and Shortest path detection should be incorporated for effective movement. This would allow WALL-I to save time by getting rid of superfluous movement on the floor.

Bibliography