Difference between revisions of "S15: Vision RC Car"

From Embedded Systems Learning Academy
Jump to: navigation, search
(Software Design)
(References)
Line 216: Line 216:
  
 
http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/
 
http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/
 
=== Appendix ===
 
You can list the references you used.
 

Revision as of 01:01, 24 May 2015

Grading Criteria

  • How well is Software & Hardware Design described?
  • How well can this report be used to reproduce this project?
  • Code Quality
  • Overall Report Quality:
    • Software Block Diagrams
    • Hardware Block Diagrams
      Schematic Quality
    • Quality of technical challenges and solutions adopted.

Vision RC Car

Abstract

The Vision RC Car will provide a video feed and controls to a user through a web-based GUI, with the goal of being able to roam wherever a network may be available.

The goal of the Vision RC Car is to be able to roam wherever a WiFi network is present. A user will utilize a web-based GUI to view a video-feed from the platform, and in turn control the vehicle from the GUI.

Objectives & Introduction

The Vision RC Car, here on out known as the system, was initially designed to spy on people. A user will have the ability to access a video-feed from the system, in addition to the ability to control the speed and direction of the system through the web-based GUI. It was determined that in addition to any nefarious activities that could be conducted with the system, a user could also utilize the system to make deliveries of small packages, to explore spaces inaccessible to humans, and for hobbyist purposes.

The system is composed of a gutted RC car, a dual-bridge motor controller, the SJSU One microcontroller, the Intel Edison microcontroller, and a webcam. At the center of the system is the Edison, which runs a lightweight Linux distro known as Yocto. The Edison is WiFi capable and will serve as the system bridge to wireless networks. The Edison will run a Node.js server that will host the system GUI. The webcam is interfaced with the Edison, and the video-feed is presented on the GUI. The system will utilize JavaScript to read commands from the user, and redirect the commands received to the SJSU One.

The SJSU One and Edison communicate through UART at a baud rate of 115200. The SJSU One will control the speed and direction of the system by interfacing with the dual-bridge motor-controller, which in turn drives the two-motors of the system. One of the motors is responsible for forward and backward movements, while the other motor is responsible for steering.

Team Members & Responsibilities

  • Team Member 1
    • Jonathon Hongpananon - Web Server
  • Team Member 2
    • Eduardo Espericueta - Motor Control
  • Team Member 3
    • Shangming Wang - IP Camera Support

Schedule

Week# Start Date End Date Task Status Actual Completion Date
1 4/14/2015 4/20/2015 Ed: Attach prototyping board to the RC car. Interface the SJSU One and the motor controller. Test the motor tasks, and verify that steering and drive work as expected.

Jon: Research setting up server on Edison. Flash OS onto the Intel Edison. Solder header pins onto the Edison mini breakout board.

Eric: Research streaming camera feed. Create system layout diagram.

Complete - Motors respond to 'a', 'w', 's', & 'd' terminal commands. Front wheels turn left and right. 4/20/15
2 4/21/2015 4/27/2015 Ed: Modify the Edison’s web page to form a first draft of what UI will look like. Write JavaScript for UI that will detect a user’s keyboard input.

Jon: Setup node.js server from Edison. Attempt first draft webserver implementation.

Eric: Setup streaming camera feed to browser - Part 1

Complete - Node.js server is setup and tested. Javascript page is able to echo key commands to console. 4/27/15
3 4/28/2015 5/4/2015 Ed: Integrate the Edison and the SJSU One. Write code to transfer command input from UI to the SJSU One.

Jon: Continuation of node.js server. Expand UI aesthetics and functionality.

Eric: Setup streaming camera feed to browser - Part 2

Complete 5/19/15
4 5/5/2015 5/11/2015 Ed: Integration on RC car platform, more specifically wiring layout, color, and verification of connections.

Jon: Integration on RC car platform (power supply)

Eric: Integration on RC car platform (mounting)

Complete 5/21/15
5 5/12/2015 5/18/2015 Ed: Test motor controls from web GUI.

Jon: Test accessibility and physical range.

Eric: Test webcam at distance.

Complete 5/23/15
6 5/19/2015 5/22/2015 Ed: Finish details. Work on Wiki.

Jon: Finish details. Work on Wiki.

Eric: Finish details. Work on Wiki

Complete 5/24/15

Parts List & Cost

Qty Description Manufacturer Part Number Total Cost
100 Jumper Wires $6.99
1 DC Stepper Motor $6.43
40 Male to Female Jumper Wires $4.99
10 PCB Board Pin Headers $5.74
200 Cable Ties Turnigy $6.31
10 PCB Female Pin Headers $5.29
1 Remote Control Car $59.99
1 SJOne Board $80.00
1 Intel Edison Intel $60.00
Total Cost (excluding shipping and taxes) $235.74

Design & Implementation

Hardware Design

The hardware consists of several different types of hardware devices. The Vision RC car uses a 12V battery pack to power both the SJSU One board, the motor controller, and the Intel Edison. The 12V battery pack is connected to a power circuit which uses a LM7805 5 Volt regulator to control the voltage supply to the devices. The SJSU One board communicates to the dual-bridge motor controller using pulse width modulation (PWM) signals. The signals are decoded by the motor controller, which in turn controls the spinning rate of the motors. The web cam is connected to the Intel Edison and transfers the user input commands to the SJSU One board.

S15 244 G8 newHW.jpg

Intel Edison

INSERT INFO ABOUT EDISON HERE

S15 244 G8 Minibreakout.jpg

SJSU One

INSERT INFO ABOUT SJSU ONE HERE

Sjone board.jpg

Dual Bridge Motor Controller

The L298N allows us to control the speed and direction of two DC motors. It can be used with motors that have a voltage of between 5 and 35V DC. It is also capable of outputting 5V with the onboard 5V regulator. These dual motor controllers are inexpensive and make motor control operation a simple task. The motors are connected to the A and B ports of the L298N module. There are 2 ports from the SJSU One board to the L298N which use the PWM pins.

S15 244 G8 L298ndiagram.jpg
S15 244 G8 L298n.png


USB Web Cam

The web cam used in this project is a Creative Live Cam Sync HD sensor. It is a 720p HD sensor capable of up to 30fps @ 1280 x 720 resolution. It is a simple USB web cam that is connected via USB port on the Edison.

S15 244 G8 Creativecam.jpeg

Hardware Interface

S15 244 G8 pwm.gif

UART - Client Side commands from the web-browser are sent to the server-side of the Intel Edison. The server on the Intel Edison outputs serial commands through the UART bus to the SJSU One board.

Pulse Width Modulation (PWM) - The SJSU One board outputs 1ms to 2ms wide pulse signals to the motor controller. The motor controller controls the speed of the motors based upon the duty cycle of the signals. The duty cycles are from 0% to 100%.


Software Design

S15 244 G8 Software.jpg
S15 244 G8 softwaredesign1.jpg

The primary component used in this project is the Intel Edison, since it acts as the web server which the user can connect to via web browser and internet. The Edison is highly connected and enabled with built-in Wifi and network capabilities. The Edison runs a web server and contains an html page which can be accessed locally. The contents of the html page utilizes NoseJS and javascript based framework. The NodeJS creates the html page, sends it over the network, and the user browser connected displays the result. The client and server communication requires a communication protocol so we opted for socket.io to direct the keyboard commands from the client browser to the Edison server. The Edison interfaced with the SJSU One board sends the resulting commands to control the speed of the motors. The end result is an IoT (Internet of Things) connected device on a network that can be controlled remotely.

Implementation

Server Communication

  1. Start up web server to display html page
  2. Activate yaler for user to connect to specific URL.
  3. Listen for 'w', 'a', 's', & 'd' letters using javascript and socket.io.
  4. Output resulting command to UART of SJSU One.

SJSU One Board Initialization

  1. Start tasks, set priority levels, and initialize task scheduler.
  2. Initialize UART driver.
  3. Listen for 'w', 'a', 's', & 'd' commands from UART.
  4. Set PWM output for motor controller from specific commands.

Testing & Technical Challenges

Describe the challenges of your project. What advise would you give yourself or someone else if your project can be started from scratch again? Make a smooth transition to testing section and described what it took to test your project.

Include sub-sections that list out a problem and solution, such as:

Issue #1

Issue - Originally, we were listening for user keyboard commands built into the server, but we later realized that there is a distinct difference between the server and client side of the NodeJS server. The original code listening for keyboard input was being displayed on the console but not being directed to UART serial.

Solution - Research and use a communication protocol from client to server. Our choice was socket.io.

Conclusion

In conclusion, we learned a lot from this project. At first, we thought this project was going to be semi-easy considering it was just using UART communication from an Edison to the SJSU One board. What proved to be a difficult task was learning the IoT aspects of the Edison. At one point, we were able to have a web cam feed, a simple web-page with simple buttons, and console output from keyboard commands, but integrating them all together proved to be the most difficult task. Integration was the most challenging part of the entire project because of dependencies and syntax. We have learned many valuable things from this project and hope to use lessons learned for future work. This project has expanded our knowledge because team-work and task-utilization is critical. We mustn't waste time and if we plan ahead then our time will be used more efficiently. This is where the design process before actual design is critical. Teamwork is also critical because one person alone cannot complete all of the components themselves. If there is teamwork then the project flow will be much more efficient.

Project Video

Upload a video of your project and post the link here.

Project Source Code

References

Acknowledgement

Any acknowledgement that you may wish to provide can be included here.

References Used

http://www.intel-software-academic-program.com/pages/courses

http://tronixlabs.com/news/tutorial-l298n-dual-motor-controller-module-2a-and-arduino/