S15: Vision RC Car
- 1 Vision RC Car
- 2 Abstract
- 3 Objectives & Introduction
- 4 Schedule
- 5 Parts List & Cost
- 6 Design & Implementation
- 7 Implementation
- 8 Testing & Technical Challenges
- 9 Conclusion
- 10 References
Vision RC Car
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 propulsion and steering motors 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 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
|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|
Jon: Setup node.js server from Edison. Attempt first draft webserver implementation.
Eric: Setup streaming camera feed to browser - Part 1
|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
|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)
|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.
|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
Parts List & Cost
|Qty||Description||Manufacturer||Part Number||Total Cost|
|1||DC Stepper Motor||$6.43|
|40||Male to Female Jumper Wires||$4.99|
|10||PCB Board Pin Headers||$5.74|
|10||PCB Female Pin Headers||$5.29|
|1||Remote Control Car||$59.99|
|Total Cost (excluding shipping and taxes)||$235.74|
Design & Implementation
The hardware design incorporates five major devices: the Intel Edison, SJ One, motor controller, power-supply, and the web-cam. The Vision RC car uses a 12V battery pack to power the SJSU One, the motor controller, and the Intel Edison. The power-supply utilizes 8 AA batteries. The Edison is the center of the system. The Edison accepts user input, and translates that data to the SJ One through UART. The UART is operating on standard 8N1, at a baudrate of 115200. The SJ One accepts single-character commands for the standard movement keys W, A, S, and D. The characters determine what digital signals the SJ One sends to the motor-controller, which subsequently drives the system. The webcam is directly interfaced to the Edison, which can act as a host to a peripheral device when powered by 7V-15V. The webcam feed is processed and displayed to the user on the web-browser.
The Intel Edison, released in 2014, is a relatively new, but an extremely powerful SoC. The device is powered by the dual-core Z34XX Atom processor, which is of the x86 architecture. Additionally, there is a Quark microcontroller on board the Edison for real-time applications, but as of Spring 2015 it has not been unlocked for developers. The Edison has 4GB of flash, and 1GB of RAM. The device also has WiFi and Bluetooth capability. The Edison can do it all!
The SJ One board runs FreeRTOS. The board has a number of peripheral's that include: 4 switches & 4 LED's, temperature sensor, IR remote control, 2-Digit 7-Segment Display, and a few others. The device has 512K ROM, 64K RAM, and is powered by the ARM Cortex-M3.
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.
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.
The primary hardware interfaces are from the Intel Edison to the SJ One, from the SJ One to the Dual-Bridge Motor Controller, and from the motor controller to the two motors. The Edison's UART1_TX pin is connected to the SJ One's RXD3 ping. The Edison interprets command input from the user, and serially outputs a character to the SJ One. The SJ One takes the Edison's commands, and outputs the appropriate digital signals to the motor controller. The motor controller drives the steering and propulsion motors.
The software design on the SJ One utilized FreeRTOS queue's for cooperative context switching, as well as the UART driver's provided with the development environment. The UART3 driver was contained within the "command" task, and would wait infinitely for data, in the form of single characters, to be received from the Intel Edison. Once the data is received, the command task distributes the command to the appropriate task. The three task's that wait for commands are in charge of steering, propulsion, and combined steering and propulsion commands. The motor controller has two inputs for each bridge. Mismatching digital signals, e.g. H and L, drive the motors, while equal digital signals turn the motor controller off. In the case of the combined commands task, all four signals are distributed.
Lastly, the server was created using a combination of node.js and express. When the server is up and running, it will serve one page at a time to users. The page can be accessed by using the devices ip at port 8080, or if a user is on an external network to the Edison, the Yaler domain will redirect users to the Vision RC Car. The web-GUI presents the user a video-feed from the Edison, and takes key commands from the user to drive the RC car. The reading of the key commands is done with the help of the Mousetrap library
This was implemented by using the SJ one to relay commands from the Intel Edison to the motor-controller. The SJ One utilizes 3 tasks: command, propulsion, and steering. The command task is the highest priority task, priority 4, and waits for WASD commands from the Edison on the UART3 port. The propulsion and steering tasks have a priority of 3. The propulsion and steering task will sleep on an empty queue until the command task sends the appropriate command to the shared queue. Depending on the command received by the propulsion and steering tasks, the SJ One outputs the appropriate digital signals to the motor-controller, that in turn drives the motor. The digital signals drive the motor-controller for a minimum of 50ms.
Server to Client Communication
The server was implemented on the Intel Edison. The server consisted of node.js and express. Initially, a server was made that could present the user with any .html file that existed, but later on in the project when the webcam server was integrated, this functionality was lost. The implemented server was a modified version of the webcam server created by Dr. Esther Jun Kim. This server was hard-coded to present users with the "index.html" file. Dr. Kim's code can be found at https://github.com/drejkim/edi-cam. When a command is received from the client, the server relays the message to the SJ One board.
The client is presented the index.html page by the server. The page is very spartan, and only contains a centered video-feed from the webcam, and waits for input key commands from the user.
Testing & Technical Challenges
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.
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 we learned that 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 Source Code
Any acknowledgement that you may wish to provide can be included here.