Vision Based Path Planning and Tracking Control Using Mobile Robot

This paper proposes a novel methodology for autonomous mobile robot navigation utilizing the concept of tracking control. Vision-based path planning and subsequent tracking are performed by utilizing proposed stable adaptive state feedback fuzzy tracking controllers designed using the Lyapunov theory and particle-swarm-optimization (PSO)-based hybrid approaches. The objective is to design two self-adaptive fuzzy controllers, for x-direction and y-direction movements, optimizing both its structures and free parameters, such that the designed controllers can guarantee desired stability and, simultaneously, can provide satisfactory tracking performance for the vision-based navigation of mobile robot. The design methodology for the controllers simultaneously utilizes the global search capability of PSO and Lyapunovtheory-based local search method, thus providing a high degree of automation. Two different variants of hybrid approaches have been employed in this work. The proposed schemes have been implemented in both simulation and experimentations with a real robot, and the results demonstrate the usefulness of the proposed concept.


I. INTRODUCTION
Wireless communication, as the term implies, allows information to be exchanged between two devices without the use of wire or cable. A wireless keyboard sends information to the computer without the use of a keyboard cable; a cellular telephone sends information to another telephone without the use of a telephone cable. Changing television channels, opening and closing a garage door, and transferring a file from one computer to another can all be accomplished using wireless technology. In all such cases, information is being transmitted and received using electromagnetic energy, also referred to as electromagnetic radiation. One of the most familiar sources of electromagnetic radiation is the sun; other common sources include TV and radio signals, light bulbs and microwaves.
When an RF current is supplied to an antenna, it gives rise to an electromagnetic field that propagates through space. This field is sometimes called an RF field; in less technical jargon it is a "radio wave." Any RF field has a wavelength that is inversely proportional to the frequency.
As the frequency is increased beyond that of the RF spectrum, EM energy takes the form of infrared (IR), visible, ultraviolet (UV), X rays, and gamma rays. ), X rays, and gamma rays. Many types of wireless devices make use of RF fields.Some wireless devices operate at IR or visible-light frequencies, whose electromagnetic wavelengths are shorter than those of RF fields. This project (Remote Controlled Metal Detecting Robot with Image Transmission) consists of two sections-Transmitter section (Remote) and Receiver section (Robot).

II. PROPOSED SYSTEM
Input / Output ports let you communicate with the outside world so you can control leds, LCDs or just about anything with the right interface. You can also set them as inputs to gather information. Most PIC microcontroller pins can be set as an input or and output and this can be done on the fly e.g. for a dallas 1 wire system a pin can be written to generate data and read at a later stage. The TRIS register controls the I/O direction and setting a bit in this register to zero sets the pin as output while setting it as one sets pin as input.
This allows you to use a pin for multiple operations e.g. the Real Time clock project uses RA0, the first pin of PORTA, to output data to a seven segment display and at a later point in the program read the analogue value as an input.
The PIC I/O ports are high current ports capable of directly driving LEDs (up to 25ma output current) -the total current allowed usually ~200mA this is often for the whole chip (or specified for several ports combined together).
Each PIC microcontroller has up to three timers that you can either use as a timer or a counter (Timer 1 & 2) or a baud clock (Timer 2). The original timer: Timer 0 was the first timer developed and you can find it in all the earliest devices e.g. 16F84 up to the most current e,g, 16F877A. Timer 1 is a 16 bit timer that generates an overflow interrupt when it goes from 65535 to zero.
It has an 8 bit programmable prescaler and you can drive it from the internal clock (Fosc/4) or an external pin. To eliminate false triggering it also has an optional input synchronizer for external pin input. This timer can be used in sleep mode and will generate a wakeup interrupt on overflow.
Timer 1 is also read by the CCP module to capture an event time. Using this timer in sleep mode will use more current. In addition it can be used to drive a low power watch crystal. This is something that sounds good but I don't recommend you do it as watch crystals are extremely difficult to drive correctly. You should only use it if you are going to make a pcb and follow all the guidelines in making it noise free. I used a DS1307 in the Real Time clock project which drives the crystal directly but even this is difficult to get operating accurately.
Timer 2 is an 8 bit timer with an 8 bit prescaler and an 8 bit postscaler. It takes its input only from the internal oscillator (Fosc/4). This timer is used for the timebase of a PWM when PWM is active and it can be software selected by the SSP module as a baud clock. It also has a period register that allows easy control of the period. When timer 2 reaches the PR2 register value then it resets. This saves having to check the timer value in software and then reset the timer and since it is done in hardware the operation is much faster -so you can generate fast clocks with periods that are multiples of the main clock.
The USART is a useful module and saves having to code up a software version so it saves valuable program memory. You can find more information on RS232 here and how to make it work. Look here for pin outs.All we need to interface it to a PC serial port is a MAX232 chip (or equivalent).
The Capture/Compare/PWM module has three modes of operation:  Capture -Capture the time of an event.  Compare -Generate an output when Timer 1 reaches a value.  PWM -Pulse Width Modulation.
Capture mode is used to capture the value of Timer 1 when a signal at the CCP pin goes high (or low depending on how the CCP is set up). The CCP can accurately capture the arrival time of a signal at the CCP pin so it can be used for pulse time measurement.
Compare mode is used to generate an output when Timer 1 reaches a value you put into CCPR1. One special event trigger mode lets you start the ADC when the compare mode triggers.
PWM gives you one Pulse Width Modulation output with 10 bit resolution and with no software overhead -once started it operates all by itself unless you want to change duty cycle.
The Synchronous Serial Port lets you communicate with devices that use either the SPI (Serial Peripheral Interface) or I2C (Inter IC communication) protocols. Note that for full Master mode I2C operation you need to choose a PIC device that has the MSSP device (Master Synchronous Serial Port).SPI and I2C are shared so you can only use one at a time (or you could use the I2C bit banged routines in the Real Time Clock project to have both at the same time).
The comparator is module that has two analogue comparators which can be set up in one of 8 different ways.
Either digital or analogue inputs can be compared to reference voltages.In one mode an internally generated voltage reference is used as an input to both comparators and in the same mode multiplexing lets you monitor up to four different input pins. You can even send the output of the comparator to a pin so that it is used independently from the microcontroller e.g. in a circuit where you need a comparator you don't need an extra chip! The analogue level must be between Vdd and Vss as protection diodes won't allow anything else. The module will generate an interrupt if the comparator output changes. You can use it in sleep mode and the interrupt will wake it up. The source impedance of the analogue signal must be smaller than 10k.
The ADC can be used during sleep but you have to use the RC clock mode. One benefit of this is that there will be no digital switching noise so you will get better conversion accuracy. For the 16F877A you can not just choose to use an analogue input if you feel the need as there are only a specific and limited number of ways that the analogue input pins can be enabled. It is best to start with AN0 and add more as necessary -see the datasheet for which analogue inputs can be enabled The Parallel Slave Port lets you to connect the PIC microcontroller directly into a microprocessor system. It provides an 8 bit read/write data bus and RD (read) WR (write) and CS (chip select) inputs -all active low. This will let you add a PIC microcontroller to a system so that the PIC microcontroller can be treated as a memory mapped peripheral. It will let the microcontroller behave just as though it was another microprocessor building block e.g. some memory or ram but in this case you have full control over exactly what the building block is i.e. you can re-program the PIC microcontroller to do just about anything.
This provides an easy route to adding a PIC microcontroller to an 8 bit system that already exists. If your software goes haywire then this timer resets the processor. To stop the reset the well behaved software must periodically issue the CLRWDT instruction to stop a resert. The WDT runs using its own oscillator. It runs during sleep and shares Timer 0 prescaler. Power On Reset starts PIC microcontroller initialization when it detects a rising edge on MCLR.
If you enable this then 72ms after a POR the PIC microcontroller is started.
Oscillator Startup Timer delays for 1024 oscillator cycles after PWRT (if PWRT is enabled) ensuring that the oscillator has started and is stable. It is automatic and only used for crystal oscillator modes and is active after POR or wake from sleep.
Sleep mode (or low power consumption mode) is entered by executing the 'SLEEP' command. The device can wake from sleep caused by an external reset, Watch Dog Timer timeout, INT pin RB port change or peripheral interrupt. When looking at the microchip site the memory size is kwords -ignore kbytes -you need the kword size as this is what each instruction occupies -the kbyte size is for comparison to other types of micros (probably). But the microcontroller data bus is 8 bits wide so it is an 8 bit microcontroller (different program memory and data memory due to using Harvard architecture).

III. SYSTEM DESIGN
The PIC microcontroller RAM size is also important as it stores all your variables and intermediate data.
PIC microcontroller EEROM : Electrically Erasable ROM is used to store data that must be saved between power up & power down. This area is readable and writable and has a much longer life than the main program store i.e. it has been designed for more frequent use.
The configuration bits can be programmed (read as '0'), or left unprogrammed (read as '1') to select various device configurations. The erased or unprogrammed value of the Configuration Word register is 3FFFh. These bits are mapped in program memory location 2007h. It is important to note that address 2007h is beyond the user program memory space which can be accessed only during programming.
1) Software emulation: Commercial and free emulators exist for the PIC family processors.
2) In-circuit debugging: Later model PICs feature an ICD (in-circuit debugging) interface, built into the CPU core. ICD debuggers (MPLAB ICD2 and other third party) can communicate with this interface using three lines. This cheap and simple debugging system comes at a price however, namely limited breakpoint count (1 on older pics 3 on newer PICs), loss of some IO (with the exception of some surface mount 44-pin PICs which have dedicated lines for debugging) and loss of some features of the chip. For small PICs, where the loss of IO caused by this method would be unacceptable, special headers are made which are fitted with PICs that have extra pins specifically for debugging.

3) In-circuit emulators:
Microchip offers three full in circuit emulators: the MPLAB ICE2000 (parallel interface, a USB converter is available); the newer MPLAB ICE4000 (USB 2.0 connection); and most recently, the REAL ICE. All of these ICE tools can be used with the MPLAB IDE for full source-level debugging of code running on the target.
The ICE2000 requires emulator modules, and the test hardware must provide a socket which can take either an emulator module, or a production device.
The REAL ICE connects directly to production devices which support in-circuit emulation through the PGC/PGD programming interface, or through a high speed Microchip, it supports "most" flash-based PIC, PIC24, and dsPIC processors. PICKit 2 has been an interesting PIC programmer from Microchip. It can program all PICs and debug most of the PICs (as of May-2009, only the PIC32 family is not supported for MPLAB debugging). Ever since its first releases, all software source code (firmware, PC application) and hardware schematic are open to the public. This makes it relatively easy for an end user to modify the programmer for use with a non-Windows operating system such as Linux or Mac OS. In the mean time, it also creates lots of DIY interest and clones. This open source structure brings many features to the PICKit 2 community such as Programmer-to-Go, the UART Tool and the Logic Tool, which have been contributed by PICKit 2 users. Users have also added such features to the PICKit 2 as 4MB Programmer-to-go capability, USB buck/boost circuits, RJ12 type connectors and others.  The basic principle of IR sensor is based on an IR emitter and an IR receiver. IR emitter will emit infrared continuously when power is supplied to it. On the other hand, the IR receiver will be connected and perform the task of a voltage divider. IR receiver can be imagined as a transistor with its base current determined by the intensity of IR light received. The lower the intensity of IR light cause higher resistance between collector-emitter terminals of transistor, and limiting current from collector to emiiter. This change of resistance will further change the voltage at the output of voltage divider. In others word, the greater the intensity of IR light hitting IR receiver, the lower the resistance of IR receiver and hence the output voltage of voltage divider will decreased. Usually the IR emitter and IR receiver will be mounted side by side, A relay is an electrical switch that opens and closes under control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay is able to control an output circuit of higher power than the input circuit, it can be considered, in a broad sense, to be a form of electrical amplifier.
These contacts can be either Normally Open (NO), Normally Closed (NC), or change-over contacts. Normally-open contacts connect the circuit when the relay is activated; the circuit is disconnected when the relay is inactive. It is also called Form A contact or "make" contact. Form A contact is ideal for applications that require to switch a high-current power source from a remote device. Normally-closed contacts disconnect the circuit when the relay is activated; the circuit is connected when the relay is inactive. It is also called Form B contact or "break" contact. Form B contact is ideal for applications that require the circuit to remain closed until the relay is activated.
When a current flows through the coil, the resulting magnetic field attracts an armature that is mechanically linked to a moving contact. The movement either makes or breaks a connection with a fixed contact. When the current is switched off, the armature is usually returned by a spring to its resting position. Latching relays exist that require operation of a second coil to reset the contact position.
By analogy with the functions of the original electromagnetic device, a solid-state relay operates a thyristor or other solid-state switching device with a transformer or light-emitting diode to trigger it.

IV. RESULTS AND DISCUSSION
When AC is applied to the primary winding of the power transformer it can either be stepped down or up depending on the value of DC needed. In our circuit the transformer of 230v/15-0-15v is used to perform the step down operation where a 230V AC appears as 15V AC across the secondary winding. In the power supply unit, rectification is normally achieved using a solid-state diode. Diode has the property that will let the electron flow easily in one direction at proper biasing condition. As AC is applied to the diode, electrons only flow when the anode and cathode is negative. Reversing the polarity of voltage will not permit electron flow.A commonly used circuit for supplying large amounts of DC power is the bridge rectifier. A bridge rectifier of four diodes (4*IN4007) is used to achieve full wave rectification. Two diodes will conduct during the negative cycle and the other two will conduct during the positive half cycle.
The DC voltage appearing across the output terminals of the bridge rectifier will be somewhat less than 90% of the applied RMS value. Filter circuits, which is usually capacitor acting as a surge arrester always follow the rectifier unit. This capacitor is also called as a decoupling capacitor or a bypassing capacitor, is used not only to 'short' the ripple with frequency of 120Hz to ground but also to leave the frequency of the DC to appear at the output. The voltage regulators play an important role in any power supply unit. The primary purpose of a regulator is to aid the rectifier and filter circuit in providing a constant DC voltage to the device. Power supplies without regulators have an inherent problem of changing DC voltage values due to variations in the load or due to fluctuations in the AC liner voltage. With a regulator connected to the DC output, the voltage can be maintained within a close tolerant region of the desired output. IC7812 and 7805 are used in this project for providing +12v and +5v DC supply.
PIC16F877A is a 40 Pin DIP pack IC with 33 I/O pins. Out of which 8 pins can be used either as Digital I/O pins or Analog Input pins. The micro controller is having 5 ports Port A, Port B, Port C, Port D and Port E. Here Port A consists of 6Pins and can be used as Analog Pins and Digital Pins, in the same way Port E consists of 3Pins all of them can either be used as Analog Pins or Digital Pins. The Port pins of Port D are connected to LCD pins. RD4 to RD7 as data pins and RD0 to RD2 as control pins. The Pins of Port B are connected to relay drivers, which in turn drives the relays. The Pins 13 and 14 are connected to Oscillators. This Oscillator provides required clock reference for the PIC micro controller. Either Pins 11 and 12 or 31 and 32 can be used as This paper proposes a novel methodology for autonomous mobile robot navigation utilizing the concept of tracking control. Vision-based path planning and subsequent tracking are performed by utilizing proposed stable adaptive state feedback fuzzy tracking controllers designed using the Lyapunov theory and particle-swarm-optimization (PSO)-based hybrid approaches. The objective is to design two self-adaptive fuzzy controllers, for x-direction and y-direction movements, optimizing both its structures and free parameters, such that the designed controllers can guarantee desired stability and, simultaneously, can provide satisfactory tracking performance for the vision-based navigation of mobile robot. The design methodology for the controllers simultaneously utilizes the global search capability of PSO and Lyapunov-theory-based local search method, thus providing a high degree of automation. Two different variants of hybrid approaches have been employed in this work. The proposed schemes have been implemented in both simulation and experimentations with a real robot, and the results demonstrate the usefulness of the proposed concept.