Difference between revisions of "S15: Bug Rider"
Proj user14 (talk | contribs) (→Software Design) |
Proj user14 (talk | contribs) (→Software Design) |
||
Line 169: | Line 169: | ||
[[File:S15_244_BLOCKDIAGRAM_BUGRIDER.jpg]] | [[File:S15_244_BLOCKDIAGRAM_BUGRIDER.jpg]] | ||
− | === Software Design === | + | === Software Design and Implementation === |
'''Image Processing''' | '''Image Processing''' | ||
Line 212: | Line 212: | ||
− | Function to set the speed of the motor is as follows: | + | Function to set the speed of the motor and the direction of the dc motor and servo motor is as follows: |
[[File:S15_244_PWM3.jpg]] | [[File:S15_244_PWM3.jpg]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Testing & Technical Challenges == | == Testing & Technical Challenges == |
Revision as of 06:09, 25 May 2015
Contents
Bug Rider
Abstract
The "Bug Rider" is robotic toy car which is ridden by the fish in the aquarium tank on top of the vehicle!!!! Confused ???
Ok ,So the fish which is placed inside the fish tank placed on top of the car will be moving in random directions and its movement is captured by the camera attached to the supporting frame of the vehicle.The movements are image-processed and the data is given to the "SJ-ONE BOARD" which in turn sends the wireless signals to the "SJ-ONE BOARD" present on the car which finally drives the car in that particular direction as the Hex-Bug's direction.
Below is the sample pictorial representation of the project.
Objectives & Introduction
We are designing a prototype version of Fish on Wheels using a Mobile Camera,RC Vehicle for holding the Fish Tank setup and Sjoneboard for controlling the vehicle.Using the contrast of the fish with the bottom of the fish tank, the position is determined and used to send commands to the Sjoneboard for moving the car into that direction. We use Image Processing in Python for determining the Position of the Fish. Nordiac Wirless is used for wireless communication between RC Vehicle and Laptop. Uart Serial Communication is used for sending commands from Python to Sjoneboard.PWM driver is used for controlling the RC Vehicle.
Team Members & Responsibilities
- [Vishnuram Venkataswamy Sampathkumar]
- <Image Processing Module>
- [Krishna Sai Sevilimedu Veeravalli]
- <Nordiac Wireless & Serial Communication>
- [Saketh Ram Bhamidimarri]
- <Hardware Design and Integration>
- [Prakash Kurup]
- <PWM Driver and Ultrasonic-Sensor>
Schedule
Sl. No | Start Date | End Date | Task | Status |
---|---|---|---|---|
1 | 03/31/2015 | 04/07/2015 | Order required components | *Completed* |
2 | 04/08/2015 | 04/14/2015 | Image processing for object tracking | *Completed* |
3 | 04/15/2015 | 04/21/2015 | PWM driver and motor calibration | *Completed* |
4 | 04/22/2015 | 04/28/2015 | Serial communication & Nordic wireless communication | *Completed* |
5 | 05/29/2015 | 05/05/2015 | Platform design for the hexbug and building the framework to hold the camera on top | *Completed* |
6 | 05/06/2015 | 05/12/2015 | Ultrasonic sensor for obstacle avoidance | *Completed* |
7 | 05/13/2015 | 05/19/2015 | Integration of complete system and testing | *Completed* |
8 | 05/20/2015 | 05/26/2015 | Final Testing and demo | *Completed* |
Parts List & Cost
Item# | Qty | Description | Manufacturer | Part Number | Total Cost |
---|---|---|---|---|---|
1 | 1 | RC Car | New Bright | Jeep 9.6V | $60.00 |
2 | 1 | Bluetooth Camera | Adesso | CyberTrack V10 | $40.00 |
3 | 2 | SJ-One Board | NXP LPC1758 | SJSU development board, LPC1758 | $160.00 |
4 | 1 | HexBug | Innovation First | HexBug Larva - Green color | $8.96 |
5 | 1 | Dual H-Bridge Motor Drive | Drok | L298N | $8.48 |
6 | 1 | Acrylic sheet | Tap-Plastics | Pure opaque-milky white | $24.29 |
7 | 3 | Camera holding rods | Tap-Plastics | Plastic material | $ 17.40 |
8 | 2 | Antennas | University | 10-feet range antennas | $ 6.00 |
9 | 1 | Double-sided tape | Tap-Plastics | Double sided tape for plastic material | $ 5.06 |
10 | 3 | Welding work and Integration of the framework | Tap-Plastics | Glass Fibre rods for the support frame | $ 20.00 |
Total Cost | $350.19 |
Design & Implementation
The design section can go over your hardware and software design. Organize this section using sub-sections that go over your design and implementation.
Hardware Design
The main components required for this project are :
(1) A Toy Car of dimensions approximately 25*12 inches which we bought from WALMART.
(2) An Acrylic sheet of dimensions 30*15 milky white color with highest opaqueness for light bought at TAP-PLASTICS.
(3) A framework consisting of vertical rods attached to the front and back of the car and a horizontal rod which can be movable on the vertical rods.The camera will be attached right at the middle of the horizontal rod. The intention of the horizontal rod sliding on the vertical rods is to adjust the height of the camera position relative to the platform.
(4) Ultra-sonic sensors attached at the front portion of the car to provide the obstacle avoidance feature to the car.
(5) The "SJ-ONE" board will be placed underneath the platform,in the slot provided for the batteries of the car.
(6) 9V batteries for Powering "SJ-ONE" board and RC Car.
(7) L298H Motor Driver for Controlling RC Car
- Below is the equipment required for the project
Hardware Interface
- The "SJ-ONE BOARD" is used for the control of DC motor and SERVO motor control using Pulse Width Modulation(PWM).
- The DC motor and the SERVO motors are connected to the "SJ-ONE BOARD" using jumper cables.
- An Antenna is attached to the "SJ-ONE BOARD" which is used for the communication with the other "SJ-ONE BOARD" connected to the laptop through Nordic Wireless Communication.
- The wireless Camera attached to the horizontal section of the framework will be capturing the movement of the Hex-Bug toy and transmitting the data to the laptop via bluetooth.
- The ultra-Sonic Sensors which are placed at the front portion of the vehicle for the obstacle-avoidance feature is connected to the "SJ-ONE BOARD" through jumper cables.
- Below is the block diagram of the project:
Software Design and Implementation
Image Processing
The Software Design is divided into two parts. The first part of the software is running in the PC end and the second part of the software is running at the SJ One Board. The first part of the software running at the PC requires the Image Processing. Image Processing:
Image processing is done by using OpenCV libraries in Python.We also use NumPy (Numerical Python) Package which is used by OpenCV for image processing.
We capture the Video frames in Python by using VideoCapture() function and convert RGB image to HSV (Hue-Saturation-Value), for extracting a colored object. In HSV, it is more easier to represent a color than RGB color-space. After converting the image to HSV color-space,image will be threshold for a range of desired object color. Position of the image is returned by using moments() function of OpenCV library. It gives centroid of the object in terms of (x,y) co-ordinates. By using the (x,y) co-ordinates, the position of the object is determined in the tracking window and send the SJone Board through Serial Communication.
pySerial package provides required libraries for serial communication in python. Desired port number is set and data is send using write() function.
Flow Chart - Image Processing
The second part of software will be running in SJone board:
We use one SJone board for transferring data from PC to another SJone board which is used in RC car for controlling the car.
The Software which is running in the SJone board which is used for transferring data through UART serial communication from PC contains a task,once the task begins executing, it waits for the serial data from the PC. On receiving the data from PC,it transfer the data to Nordic wireless function which sends the data to other SJone board.
Flow Chart - SJone board:
Motor Controller
The dual H-Bridge DC Motor Controller is used to control the speed and the steering direction of both DC and Servo motor of the car. It has an enable pin and two interrupt pins for each motor.
The motor controller is initialized by setting two PWM pins of SJone board to 1KHz frequency using the inbuilt functions provided Prof. Preetpal Kang (CMPE 244 instructor). Four GPIO pins are used as interrupt pins for both the dc motor and servo motor. Code snippet as follows:
We set the GPIO pins for acceleration and steering as output as follows:
Function to set the speed of the motor and the direction of the dc motor and servo motor is as follows:
Testing & Technical Challenges
My Issue #1
We faced some issues which we would like to mention and how we overcame those.
Hardware items: After the idea was finalized and the how-to-do stuff was imagined and designed,the initial problem was to where to find the materials,the hardware tools which would exactly meet the requirements of the project. After searching various hardware stores,we would a really nice place called the "TAP-PLASTICS" where the technician named Kevin was really helpful in his suggestions and the improvisations which can be used.
My Issue #2
Image Processing Module: It took some time for us to finalize the HSV platform for detecting the Fish.We initially tried converted the image to Grey Scale Platform,but we failed to track the image.Finding a Platform for Image Processing also took sometime,as we initially tried to use C++ for Image Processing Platform,but we failed to apply image processing algorithms which in future, we will work on it.
Conclusion
The whole project experience was fun and very educational. At first we thought that Image Processing algorithms are available online, so just editing them will make our project work.But we learned a hard lesson that ,lot of our time would be saved if we write our own code instead of editing them.We learned to configure and use Nordiac wireless module.We got to know how PWM Driver and Serial Communication works.
The project can be expanded by making it as an standlone project.We are learning to write a driver for interfacing the camera to the microprocessor,which soon we will be implementing in our project.
Project Video
Upload a video of your project and post the link here.
Project Source Code
References
Acknowledgement
We,the team of Bug-Rider would like to wholeheartedly thank our friend,our guide and our Professor "Preet Pal Kang" for guiding us,encouraging us to do these projects and imparting knowledge and wisdom to us in our academics as well as for our career.Thank You "Preet".
References Used
(1) http://www.socialledge.com/sjsu/index.php?title=Main_Page
(2) https://learn.adafruit.com/series/learn-arduino
Appendix
You can list the references you used.