Pages

RObo Dog

Introduction 

The project, “Robodog?is an autonomous car that follows sound. The car can follow almost any audible sound that human can create by using three onboard microphones. This project was possible because of the fact that the speed of the sound is relatively slow compare to the MCU.



We took apart an old remote control car and replaced the internal circuit with our own driving circuit. For the sound detection, we used three ordinary omni-directional electret microphones.

High Level Design 

We picked this topic for our project because we wanted to make something that anyone can easily use. While remote control cars are very common, sound controlled cars are not, because of the complicate issues involved with sound processing. However, us people cannot create radio frequency signal! So we thought that it will be very interesting to design a car that can “hear?human voice.

Preparing for the project, we thought about using the difference of the sound intensity (power) through the different microphones depending on the distance from the sound source. However, we found out that it was not a good idea because the intensity of the sound decreases in quadratic fashion with distance, which meant that the car can only detect the direction of the sound from very short distance (2 or 3 feet away). Talking to the professor and the lab instructors, we realized that the speed of the sound is very slow relative to the speed of the MCU. Using this fact, we came up with an algorithm which computes the direction by looking at which microphone received the sound first.

We hoped to design a car that can approximately locate the sound source after hearing the sound once, but we failed to do that because of issues such as the sensitivity of the microphones, the attenuation of the sound, the reflection of the sound, etc. Instead, we designed so that after calling the car, the car moves for certain time in one direction, stop, then waits for the sound again. So it takes a couple of moves until reaching the caller.
[Figure1. Sound Wave Propagation]

We wanted to be able to control the car from fairly long distance. Since the signal from the microphone is very small, we used amplifier with high gain. Also in order to block out low frequency noise, we used a two level low frequency filter to filter out the noise.


[Figure2. Block Diagram]

Program Design 

Direction Detection

The most important part in detecting the direction of the sound was the speed of ADC. We needed the MCU to carry out ADC from 3 pins switching back and forth in maximum speed. The microphones were approximately 30cm away from each other, which meant that the maximum time the sound takes from one microphone to another was about 1ms. Since we did not need good quality of the sound, we ran the ADC at the speed of 16MHz/64 = 250kHz. Using ADC interrupt, we switched the pin and ran the ADC for all three microphones. Upon finishing ADC, we looked at the value and checked if any of the converted signal was over a certain value, which we picked by trial and error. If none of the microphone signal was over the value, which meant that none of the microphones received sound, we ran the ADC again. If only one microphone signal was over the value, it meant that that microphone received the sound first, hence it is the closest to the sound source. Then we stopped the ADC and drove the car in the direction corresponding to the microphone, which received the signal.

Driving the Car
Since we took out the original circuit in the RC car and made our own circuit, we had to write the program that can control the car correctly.

Rear Motor
The rear motor was relatively easy, since it was setup to drive in only forward direction. It was controlled by setting a pin (PORTB.7) high to drive and low to stop.

Steering Motor
The steering motor gave us the most trouble. There are two signals associated with the H-bridge, which controlled the motor. The first one was the direction (0: Left, 1: Right) and the second was for the PWM signal, which basically turned on and off the motor. There were two major problems, which arose from the mechanics of the car,
  1. Once the car steered to one direction, the wheels would stick to that position until some kind of external force was applied.
  2. Different force was needed for steering in different direction because of the motor was closed to left wheel of the car than the right.
To solve these issues, we set up a timer to control how long we were going to apply the signal to the motor. In order to get the wheels to the correct position, we found out the time we need to apply the signal by trial and error and to get the wheel back to the original position, we applied opposite direction for a set amount of time, which also was found by trial and error. For the second problem, we applied the signal for different amount of time for different direction of steering.

Hardware Design 

Sound Processing Unit
The voltage output from the microphone was very small, in the range of 10mV. In order to detect the sound, we built a high pass amplifier using LM358 op-amp. High pass filter was chosen to filter out the low frequency background noise such as 60Hz noise. Simple RC high pass filter was cascaded to improve the performance. The signal out of the filter was biased to approximately 3V in order to bias the amplifier at the high gain region, since we were using single 9V power supply for the op-amp. The op-amp was set up as non-inverting amplifier with gain of approximately 200. The output of the amplifier was connected to the voltage protection circuit consisting of a resistor and two diodes to prevent voltage going above 5V or below 0V, which can harm the MCU.

Motor Driving Unit
The driving unit consisted of two major parts; rear motor driver and steering motor driver.

Rear Motor
The car was setup to go only forward.  For that, the only circuit we needed was the opto-isolator circuit to protect the MCU from the voltage spikes of the motor.

Steering Motor
The steering motor had to be able to change the direction of the rotation in order to steer the wheels, for which we built an H-bridge circuit. We first tried using LMD18200 H-bridge that we sampled, however, LMD18200 needed at least 12V to operate and the packaging of the component needed a special board, which caused some difficulties. Our H-bridge consisted of 4 transistors (TIP31, TIP32) with 4 input resistors. There was a diode connecting the emitter and the collector of the BJT to prevent negative voltage. The H-bridge operated with 6V power supply and has 4 inputs which were, FORWARD, ~FORWARD, REVERSE, ~REVERSE. Theses input signals were created from a digital circuit, which took the opto-isolated DIRECTION and PWM signals from the MCU and created above signals. 

The H-bridge took these signals and outputted 2 signals, which were connected to the motor. The opto-isolation was needed since the power supply of the digital circuit and the H-bridge was different from the power supply of  the MCU. The 5V power for the digital gates was created by connecting a 1N4001 to the 6V power supply from the 4 AA batteries of the car, which caused a voltage drop of 0.7V, providing 5.3V power.


Results 

The speed of execution was very quick as expected. The microphones picked up the audio signals every time and the car would immediately respond. The only mechanism slowing the car down was a delay we put in to ensure that the microphones do not react to the noise from the motors while they are in operation.

The accuracy was also very good. The proper microphone consistently picks up the correct direction of the signal. The car could only go forward, right and left, which limited the movement of the car a little. One of the things that we wanted to fix was the large turning radius of the car, which caused for somewhat wide turns.

Safety was not a major issue for our project. There was no human contact with the car during the operation, so most safety considerations are avoided. The wires are taped down to prevent anything from coming loose during the operation. The range of operation is about 10 meters, so there is always needs to be an operator within that distance for the motors to run. Also, the car, after hearing the call, only moves for 1 second, so even if the car collided with other objects, it was not critical.

Interference from other projects was not a problem due to the filters we used before the amplifiers input. Background lab noise did not cause the car to operate because the audio signal needed to go over the voltage threshold to trigger the car. However, constant clapping and whistling of certain “malicious?individuals such as Eric to trigger our car did become a bit of interference.

The usability of our project is very good. Any person with a voice or who can clap can operate the vehicle. There was no training needed to operate our car.


Conclusions 

The results of our project exceeded both of our expectations. Our original goal was to get a range of about 5 meters. The real range is approximately 10 meters and maybe further depending on the intensity of the signal. Although we ran into a lot of small battles in designing this project, if we have to do it over, we will design the project again in the similar fashion.

There are no standards that needed to be followed since we used signals in the auditory range to control the vehicle.

The code we generated were totally original, the hardware aspects we learned about are also available in the public domain. The project was inspired in part by the Blind Bot project of ECE 476 Spring 2004. ECE 476’s labs were referenced for our hardware. (H-bridge, opto-isolator) We do not believe that our project probably has a patent opportunity.

Ethics
  1. ...to accept responsibility in making engineering decisions consistent with the safety, health and welfare of the public, and to disclose promptly factors that might endanger the public or the environment; Our projet was in any way dangerous or harmful to the public. The way of calling the car did create some level or noise, but we are pretty sure that almost everyone enjoyed our whistling. Our only worry is endangering the job of canine species as pets, because our car was so good!
  2. ...to avoid real or perceived conflicts of interest whenever possible, and to disclose them to affected parties when they do exist;To our knowledge, there was no other group who were working on the similar project. Within our group, we were both very excited about the project.
  3. ...to be honest and realistic in stating claims or estimates based on available data; We did not in any way manipulate the result of the project or over exaggerate our result. Even though we started out with a larger claim, as we experimented with various options, we were able to bring down the claim to more practical level. In fact being honest and realistic were about the only things we had going for us for about the first three weeks; it didn’t work and we didn’t know why.
  4. ...to reject bribery in all its forms; To our knowledge, we did not receive any bribery of any kind. I know for sure that I didn’t get paid at all for this project, I have to check with my partner though; he just bought a Dodge Viper now that I think about?/font>
  5. ...to improve the understanding of technology, its appropriate application, and potential consequences; Through the project, we learned to approach and conquer a set goal, by following the process of planning, analyzing, experimenting, simulating, debuggin, etc. It was a valueable time for us because we learned how to integrate our previous knowledge on different technology into a solid project.


Appendix 
Commented Program Listing

Schematics
[Schematic1. Microphone Amplifier: Cascaded High Pass Filter with Biased Amplifier for Single Power Supply]
[Schematic2. Opto-Isolator Circuit]
[Schematic2. Digital Logic that creates input signals for H-bridge]
[Schematic4. H-Bridge]
[Schematic5. Opto-Isolated Motor Control Circuit]


Pictures: click to download videos
[Picture1. Front View]

[Picture2. Side View]

[Picture3. Top View]

[Picture4. Microphone Amplifier]

[Picture5. Amplifier and Driving Circuits]

0 comments:

Post a Comment

Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.