https://elinux.org/api.php?action=feedcontributions&user=Hansenrl&feedformat=atomeLinux.org - User contributions [en]2024-03-19T10:05:34ZUser contributionsMediaWiki 1.31.0https://elinux.org/index.php?title=ECE497_Project_Rover&diff=192320ECE497 Project Rover2012-11-13T00:44:48Z<p>Hansenrl: /* Conclusions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the car can be directed to turn to a specified compass heading or move forward. A user is able to control the car with predefined movement code or in real-time over WiFi. The BeagleBone can also send back helpful information to the user over Wifi, such as GPS location and compass heading. Although not complete, functionality to direct the rover along a path by defining waypoints is currently in development.<br />
<br />
This work provides highly useful code even for applications outside of this specific rover project - digital compass and GPS sensor interfacing, Python-based networking, and RC car motor control code is all written and easily extendable into other applications. Additionally, the work performed for this project in the area of RC car reverse engineering and BeagleBone USB Wi-Fi can serve as useful community knowledge for other projects.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== Required Parts List ==<br />
1 x [http://www.toysrus.com/product/index.jsp?productId=12925248 RC Truck]<br />
<br />
1 x [http://beagleboard.org/buy BeagleBoard] (could be Bone/XM/Board)<br />
<br />
1 x [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx Battery]<br />
<br />
1 x [http://www.ti.com/product/lm2576hv Voltage Regulator]<br />
<br />
1 x [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD Barrel Connector]<br />
<br />
1 x [http://www.adafruit.com/products/814 Adafruit WiFi adapter]<br />
<br />
1 x [https://www.sparkfun.com/products/11466 GPS]<br />
<br />
1 x [https://www.sparkfun.com/products/7915 Compass]<br />
<br />
1 x BreadBoard<br />
<br />
Various Wires<br />
<br />
Soldering Tools<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
* This project is a two-dimensional navigation system for a ground-based rover, but could be extended for use on aerial vehicles. Additional requirements for this would include some sort of altimeter sensor interface, modification of control outputs to accommodate aerial control surfaces, and an addition of a third dimension to location and navigation code.<br />
<br />
== Conclusions ==<br />
<br />
BeagleRover is a functioning implementation of a rover intelligence platform for the BeagleBone. When mounted on an RC car, the BeagleBone can direct the car motors to move around and it can relay GPS and compass data across a Wi-Fi network.<br />
<br />
This project was highly interesting and enjoyable to work on. It incorporated a wide range of skills fundamental to embedded systems - hardware, sensor interfacing via multiple protocols, and both high and low-level software development. Although a complete project in its current status, even more exciting is the possibility for extension in the future; the basic system of network functionality, location and heading sensor data, and mobility provide an interesting platform for lots of different embedded work. Combined with the versatility of Linux running on the BeagleBone, this project provides an interesting application of the BeagleBone's potential and a flexible platform for future development.<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192314ECE497 Project Rover2012-11-13T00:44:33Z<p>Hansenrl: /* Conclusions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the car can be directed to turn to a specified compass heading or move forward. A user is able to control the car with predefined movement code or in real-time over WiFi. The BeagleBone can also send back helpful information to the user over Wifi, such as GPS location and compass heading. Although not complete, functionality to direct the rover along a path by defining waypoints is currently in development.<br />
<br />
This work provides highly useful code even for applications outside of this specific rover project - digital compass and GPS sensor interfacing, Python-based networking, and RC car motor control code is all written and easily extendable into other applications. Additionally, the work performed for this project in the area of RC car reverse engineering and BeagleBone USB Wi-Fi can serve as useful community knowledge for other projects.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== Required Parts List ==<br />
1 x [http://www.toysrus.com/product/index.jsp?productId=12925248 RC Truck]<br />
<br />
1 x [http://beagleboard.org/buy BeagleBoard] (could be Bone/XM/Board)<br />
<br />
1 x [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx Battery]<br />
<br />
1 x [http://www.ti.com/product/lm2576hv Voltage Regulator]<br />
<br />
1 x [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD Barrel Connector]<br />
<br />
1 x [http://www.adafruit.com/products/814 Adafruit WiFi adapter]<br />
<br />
1 x [https://www.sparkfun.com/products/11466 GPS]<br />
<br />
1 x [https://www.sparkfun.com/products/7915 Compass]<br />
<br />
1 x BreadBoard<br />
<br />
Various Wires<br />
<br />
Soldering Tools<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
* This project is a two-dimensional navigation system for a ground-based rover, but could be extended for use on aerial vehicles. Additional requirements for this would include some sort of altimeter sensor interface, modification of control outputs to accommodate aerial control surfaces, and an addition of a third dimension to location and navigation code.<br />
<br />
== Conclusions ==<br />
<br />
This project is a functioning implementation of a rover intelligence platform for the BeagleBone. When mounted on an RC car, the BeagleBone can direct the car motors to move around and it can relay GPS and compass data across a Wi-Fi network.<br />
<br />
This project was highly interesting and enjoyable to work on. It incorporated a wide range of skills fundamental to embedded systems - hardware, sensor interfacing via multiple protocols, and both high and low-level software development. Although a complete project in its current status, even more exciting is the possibility for extension in the future; the basic system of network functionality, location and heading sensor data, and mobility provide an interesting platform for lots of different embedded work. Combined with the versatility of Linux running on the BeagleBone, this project provides an interesting application of the BeagleBone's potential and a flexible platform for future development.<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192308ECE497 Project Rover2012-11-13T00:41:31Z<p>Hansenrl: /* Conclusions */ added a conclusion</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the car can be directed to turn to a specified compass heading or move forward. A user is able to control the car with predefined movement code or in real-time over WiFi. The BeagleBone can also send back helpful information to the user over Wifi, such as GPS location and compass heading. Although not complete, functionality to direct the rover along a path by defining waypoints is currently in development.<br />
<br />
This work provides highly useful code even for applications outside of this specific rover project - digital compass and GPS sensor interfacing, Python-based networking, and RC car motor control code is all written and easily extendable into other applications. Additionally, the work performed for this project in the area of RC car reverse engineering and BeagleBone USB Wi-Fi can serve as useful community knowledge for other projects.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== Required Parts List ==<br />
1 x [http://www.toysrus.com/product/index.jsp?productId=12925248 RC Truck]<br />
<br />
1 x [http://beagleboard.org/buy BeagleBoard] (could be Bone/XM/Board)<br />
<br />
1 x [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx Battery]<br />
<br />
1 x [http://www.ti.com/product/lm2576hv Voltage Regulator]<br />
<br />
1 x [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD Barrel Connector]<br />
<br />
1 x [http://www.adafruit.com/products/814 Adafruit WiFi adapter]<br />
<br />
1 x [https://www.sparkfun.com/products/11466 GPS]<br />
<br />
1 x [https://www.sparkfun.com/products/7915 Compass]<br />
<br />
1 x BreadBoard<br />
<br />
Various Wires<br />
<br />
Soldering Tools<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
* This project is a two-dimensional navigation system for a ground-based rover, but could be extended for use on aerial vehicles. Additional requirements for this would include some sort of altimeter sensor interface, modification of control outputs to accommodate aerial control surfaces, and an addition of a third dimension to location and navigation code.<br />
<br />
== Conclusions ==<br />
<br />
This project was highly interesting and enjoyable to work on. It incorporated a wide range of skills fundamental to embedded systems - hardware, sensor interfacing via multiple protocols, and both high and low-level software development. Although a complete project in its current status, even more exciting is the possibility for extension in the future; the basic system of network functionality, location and heading sensor data, and mobility provide an interesting platform for lots of different embedded work. Combined with the versatility of Linux running on the BeagleBone, this project provides an interesting application of the BeagleBone's potential and a flexible platform for future development.<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192302ECE497 Project Rover2012-11-13T00:35:11Z<p>Hansenrl: /* Executive Summary */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the car can be directed to turn to a specified compass heading or move forward. A user is able to control the car with predefined movement code or in real-time over WiFi. The BeagleBone can also send back helpful information to the user over Wifi, such as GPS location and compass heading. Although not complete, functionality to direct the rover along a path by defining waypoints is currently in development.<br />
<br />
This work provides highly useful code even for applications outside of this specific rover project - digital compass and GPS sensor interfacing, Python-based networking, and RC car motor control code is all written and easily extendable into other applications. Additionally, the work performed for this project in the area of RC car reverse engineering and BeagleBone USB Wi-Fi can serve as useful community knowledge for other projects.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== Required Parts List ==<br />
1 x [http://www.toysrus.com/product/index.jsp?productId=12925248 RC Truck]<br />
<br />
1 x [http://beagleboard.org/buy BeagleBoard] (could be Bone/XM/Board)<br />
<br />
1 x [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx Battery]<br />
<br />
1 x [http://www.ti.com/product/lm2576hv Voltage Regulator]<br />
<br />
1 x [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD Barrel Connector]<br />
<br />
1 x [http://www.adafruit.com/products/814 Adafruit WiFi adapter]<br />
<br />
1 x [https://www.sparkfun.com/products/11466 GPS]<br />
<br />
1 x [https://www.sparkfun.com/products/7915 Compass]<br />
<br />
1 x BreadBoard<br />
<br />
Various Wires<br />
<br />
Soldering Tools<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
* This project is a two-dimensional navigation system for a ground-based rover, but could be extended for use on aerial vehicles. Additional requirements for this would include some sort of altimeter sensor interface, modification of control outputs to accommodate aerial control surfaces, and an addition of a third dimension to location and navigation code.<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192296ECE497 Project Rover2012-11-13T00:34:38Z<p>Hansenrl: /* Executive Summary */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the car can be directed to turn to a specified compass heading and move forward. A user is able to control the car with predefined movement code or in real-time over WiFi. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Although not complete, functionality to direct the rover along a path by defining waypoints is currently in development.<br />
<br />
This work provides highly useful code even for applications outside of this specific rover project - digital compass and GPS sensor interfacing, Python-based networking, and RC car motor control code is all written and easily extendable into other applications. Additionally, the work performed for this project in the area of RC car reverse engineering and BeagleBone USB Wi-Fi can serve as useful community knowledge for other projects.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== Required Parts List ==<br />
1 x [http://www.toysrus.com/product/index.jsp?productId=12925248 RC Truck]<br />
<br />
1 x [http://beagleboard.org/buy BeagleBoard] (could be Bone/XM/Board)<br />
<br />
1 x [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx Battery]<br />
<br />
1 x [http://www.ti.com/product/lm2576hv Voltage Regulator]<br />
<br />
1 x [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD Barrel Connector]<br />
<br />
1 x [http://www.adafruit.com/products/814 Adafruit WiFi adapter]<br />
<br />
1 x [https://www.sparkfun.com/products/11466 GPS]<br />
<br />
1 x [https://www.sparkfun.com/products/7915 Compass]<br />
<br />
1 x BreadBoard<br />
<br />
Various Wires<br />
<br />
Soldering Tools<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
* This project is a two-dimensional navigation system for a ground-based rover, but could be extended for use on aerial vehicles. Additional requirements for this would include some sort of altimeter sensor interface, modification of control outputs to accommodate aerial control surfaces, and an addition of a third dimension to location and navigation code.<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192254ECE497 Project Rover2012-11-12T23:48:34Z<p>Hansenrl: /* Future Work */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
* This project is a two-dimensional navigation system for a ground-based rover, but could be extended for use on aerial vehicles. Additional requirements for this would include some sort of altimeter sensor interface, modification of control outputs to accommodate aerial control surfaces, and an addition of a third dimension to location and navigation code.<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192248ECE497 Project Rover2012-11-12T23:46:22Z<p>Hansenrl: /* Work Breakdown */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192242ECE497 Project Rover2012-11-12T23:46:06Z<p>Hansenrl: /* Work Breakdown */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Co-developed movement and navigation software<br />
<br />
'''Ross Hansen'''<br />
* Co-developed movement and navigation software<br />
* Developed software for network communication<br />
<br />
'''Tasks Remaining'''<br />
<br />
Although full rover functionality for movement and sensor data retrieval was completed, two additional features were currently in development at the end of the original timeframe of this project.<br />
<br />
1) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
2) Improve GPS library to allow for update rate configuration<br />
<br />
These two features were not necessary for this project, but are useful for a sister project in development by the same team; so development will continue on these two tasks. The code in the BeagleRover repository will be updated with final versions of the code as it is completed.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192236ECE497 Project Rover2012-11-12T23:37:18Z<p>Hansenrl: /* Hardware Interfaces */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192230ECE497 Project Rover2012-11-12T23:36:58Z<p>Hansenrl: /* Hardware Interfaces */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone Pin<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone Pin<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone Pin<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192224ECE497 Project Rover2012-11-12T23:36:29Z<p>Hansenrl: /* Hardware Interfaces */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 7 - P9 Header Layout]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure.<br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration. These pins are connected to relays on the RC car, so the motors are either on or off. <br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 7 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192218ECE497 Project Rover2012-11-12T23:33:43Z<p>Hansenrl: /* Hardware Interfaces */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is connected to the only usb port on the BeagleBone.<br />
<br />
Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the wooden box attenuated the signals excessively.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192212ECE497 Project Rover2012-11-12T23:31:16Z<p>Hansenrl: /* Highlights */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation. The jerky turning and vigorous stopping that the car displays in the video is due to the high traction of the tires on the track surface - reducing the traction on the tires would eliminate this.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192206ECE497 Project Rover2012-11-12T23:27:53Z<p>Hansenrl: /* Software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192200ECE497 Project Rover2012-11-12T23:26:19Z<p>Hansenrl: /* BeagleBone */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, it is advisable to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] for proper power connection. This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192194ECE497 Project Rover2012-11-12T23:25:30Z<p>Hansenrl: /* BeagleBone */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] page on elinux.org. <br />
<br />
However, if you are a purist Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V regulator that can supply that power [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192188ECE497 Project Rover2012-11-12T23:23:48Z<p>Hansenrl: </p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192182ECE497 Project Rover2012-11-12T23:21:12Z<p>Hansenrl: /* BeagleBone */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192176ECE497 Project Rover2012-11-12T23:20:59Z<p>Hansenrl: /* Modifying RC Truck/Car */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192170ECE497 Project Rover2012-11-12T23:20:42Z<p>Hansenrl: /* BeagleBone */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192164ECE497 Project Rover2012-11-12T23:18:41Z<p>Hansenrl: /* WiFi Network */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation we discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination we could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. We also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192158ECE497 Project Rover2012-11-12T23:16:40Z<p>Hansenrl: /* Software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
All hardware interfacing is accomplished in C, using the standard interfaces for each protocol. Motor control is done via GPIO, the compass is I2C, and the GPS is UART. Compass interfacing is provided in a compass library ''Compass/compass.c'', GPS interfacing is provided in a GPS library ''GPSLibs/gps.c'', and the motor control is provided in ''movement.c''. Waypoint storage and helper functions are provided in a library in ''Waypoints/waypoint.c''.<br />
<br />
For stand-alone operation, ''movement.c'' is compiled with the necessary libraries as a stand-alone binary. <br />
<br />
For network operation, the Python scripts utilize compiled libraries in sharedLibs. Currently, due to the structure of how the sensors are interfaced in the movement library, all interfacing is accomplished through a library ''movementLib.so'', which provides wrapper functions to the GPS and Compass. In the future, this functionality should be better divided out into each individual sub-library. This interfacing between Python and C is done with Python [http://docs.python.org/2/library/ctypes.html CTypes]. The BeagleBone and base station communicate over Wi-Fi using TCP sockets via the Python [http://docs.python.org/2/library/socket.html Socket] and [http://docs.python.org/2/library/socketserver.html SocketServer] modules. All of these Python modules, ctypes, socket, and SocketServer, are standard in Python 2.7.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192128ECE497 Project Rover2012-11-12T22:48:49Z<p>Hansenrl: /* Installation Instructions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192122ECE497 Project Rover2012-11-12T22:41:42Z<p>Hansenrl: /* Highlights */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
{{#ev:youtube|g_-srPShIiU}}<br />
<br />
In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192086ECE497 Project Rover2012-11-12T22:23:53Z<p>Hansenrl: /* Highlights */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video demonstration] of the rover. In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192080ECE497 Project Rover2012-11-12T22:23:19Z<p>Hansenrl: /* Highlights */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video demonstration] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we demonstrate how to set up the wireless server/client communication and the functionality present over the network interface, including sensor queries and movement commands. Although these movements are accomplished over Wi-Fi, they can also be programmed for stand-alone operation.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192062ECE497 Project Rover2012-11-12T22:20:47Z<p>Hansenrl: user interactiobn</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover is designed for two different operating modes.<br />
<br />
# Stand-alone control and navigation<br />
# Remote operation over Wi-Fi via Python<br />
<br />
The README file on the software [https://github.com/hansenrl/BeagleRover Github Page] includes details about running the software for each of these modes. For stand-alone operation, the compiled binary ''movement'' can be executed to run commands such as moving forward or turning to a specific heading. For remote operation, Python scripts are provided to setup a server/client interface to communicate with the BeagleBone. When communicating with the Bone over Wi-Fi, the Python script presents the user with options of what to send to the BeagleBone.<br />
<br />
Selection:<br />
1: FWD<br />
2: BCK<br />
3: TURN<br />
4: COMPASS QUERY<br />
5: GPS QUERY<br />
9: EXIT<br />
<br />
The user then inputs the selection number, and an option if necessary. For instance, the option for sending a "FWD" command is the duration in microseconds, while the option for a "TURN" command is the heading relative to magnetic north. FWD, TURN, COMPASS QUERY, and GPS QUERY are all implemented and functional, but BCK is currently unimplmented; the code is simple and implementation would be trivial, but for the end application of this software (emulating UAV movements) it was unnecessary.<br />
<br />
Upon sending the command, the BeagleBone will return feedback to the user over Wi-Fi. In the case of a movement command it will return that the command was executed successfully, and if a sensor was queried it will return the result. The Python script will then prompt the user for another command to send.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192032ECE497 Project Rover2012-11-12T22:04:22Z<p>Hansenrl: /* Software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ''movement'' and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192026ECE497 Project Rover2012-11-12T22:04:03Z<p>Hansenrl: /* Software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary ***movement*** and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192020ECE497 Project Rover2012-11-12T22:03:45Z<p>Hansenrl: /* Software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main binary *movement* and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192014ECE497 Project Rover2012-11-12T22:03:12Z<p>Hansenrl: /* Installation Instructions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main file movement and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=192002ECE497 Project Rover2012-11-12T22:01:45Z<p>Hansenrl: /* Software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
[[File:ECE497 Rover 5v regulator.JPG|thumb|Figure 5 - Regulator Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 3 amp [http://www.ti.com/product/lm2576hv voltage regulator]. To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen. Figure 5 is our Regulator circuit. It shows how to connect the regulator to the rest of the BeagleBone hardware.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main file movement and shared libraries for movement control over WiFi. <br />
<br />
See the README for detailed instructions on installation and documentation of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 6 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 7 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 8 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 9 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 6 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 7 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 8 shows how the pins for the gps and compass are connected to the P9 header. Figure 9 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191864ECE497 Project Rover2012-11-12T20:45:43Z<p>Hansenrl: /* software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 10 amp voltage regulator (again specs, website) (also add schematic photos). To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== Software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main file movement and shared libraries for movement control over WiFi. See the README for detailed instructions installation and documentaiton of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 5 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 7 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 8 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 5 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 7 shows how the pins for the gps and compass are connected to the P9 header. Figure 8 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191858ECE497 Project Rover2012-11-12T20:45:33Z<p>Hansenrl: /* software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 10 amp voltage regulator (again specs, website) (also add schematic photos). To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
A Makefile is provided, and the code can be compiled with the command "make" in the root directory of the project; this will build a main file movement and shared libraries for movement control over WiFi. See the README for detailed instructions installation and documentaiton of the code structure.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 5 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 7 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 8 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 5 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 7 shows how the pins for the gps and compass are connected to the P9 header. Figure 8 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191846ECE497 Project Rover2012-11-12T20:42:56Z<p>Hansenrl: /* software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 10 amp voltage regulator (again specs, website) (also add schematic photos). To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The code for the platform can be found on the [https://github.com/hansenrl/BeagleRover Github Page] and [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
See the README for instructions on the code structure and howto install.<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 5 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 7 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 8 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 5 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 7 shows how the pins for the gps and compass are connected to the P9 header. Figure 8 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191840ECE497 Project Rover2012-11-12T20:19:21Z<p>Hansenrl: /* Hardware Interfaces */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.4 Vdc 10400 mAh [http://www.all-battery.com/li-ion1865074v10400mahrechargeablebatterymodulewithpcb-31577.aspx battery]. Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 10 amp voltage regulator (again specs, website) (also add schematic photos). To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 5 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 7 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 8 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 5 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 7 shows how the pins for the gps and compass are connected to the P9 header. Figure 8 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is listed below. These are defined in movement.c, and can be redefined easily to match a different pin configuration.<br />
Motor Control BeagleBone<br />
Right Forward 40 - P8 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P8 header (software sysfs GPIO 73)<br />
Left Forward 42 - P8 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P8 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191828ECE497 Project Rover2012-11-12T20:18:10Z<p>Hansenrl: /* Hardware Interfaces */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
[[File:ECE497 Rover Power Circuit.jpg|thumb|Figure 4 - Power Circuit]]<br />
After several problems with the WiFi on the BeagleBone not working as expected, we decided to overwrite our Angstrom Beagle Image with Ubuntu. We followed the [http://elinux.org/BeagleBoardUbuntu BeagleBoardUbuntu] on elinux.org. Since WiFi is critical to this project, it seemed a better alternative to spending hours working on Angstrom and not really getting anywhere. <br />
<br />
However, if you are a true Beagle user and want to pursue the Angstrom route then I would suggest reading Dr. Yoder's [http://elinux.org/EBC_Exercise_02_Out-of-the-Box,_Bone Out of The Box, Bone]. ''Note: If you want WiFi to work properly, install the A5 image not the A6 image.''<br />
<br />
Whether you use the Angstrom image or Ubuntu is up to you. However, you will still need to wire the BeagleBone up so that it runs off of battery power. We bought a 7.2 11000 mA hours battery (add specs here, website). Since the BeagleBone runs off of 5V with a possible peak current of 1.5 amps we needed a 5V 10 amp voltage regulator (again specs, website) (also add schematic photos). To be safe and avoid short-circuiting the BeagleBone, we decided to buy a [http://www.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&keywords=CP3-1000-ND&x=0&y=0&cur=USD barrel connector] This barrel connector replaces the need to solder wires to the hardware of the BeagleBone, thus allowing for us to safely supply power the way the BeagleBone was designed. As seen in Figure 4, the barrel connector, battery and voltage regulator with heat sink can be seen.<br />
<br />
<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and want to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository].<br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
Here is a youtube.com [http://www.youtube.com/watch?v=g_-srPShIiU video] of the rover. Ross is recording the video while Jesse is controlling the rover. In the video we spend about a minute talking about how to set up the wireless network and server. Then they show the computer receiving gps and compass data. Then they turn the rover and move to a new location, receive gps and compass data. As expected the data changed and is correct according to Google maps.<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
[[File:Bone P9 pinout.jpg|thumb|Figure 5 - P9 Header Layout]]<br />
[[File:ECE497 Rover gpio Pins.jpg|thumb|Figure 6 - GPIO Pin Connections]]<br />
[[File:ECE497 Rover compass.jpg|thumb|Figure 7 - Compass and GPS Pin layout]]<br />
[[File:ECE497 Rover gpsCompass mount.jpg|thumb| Figure 8 - Compass, GPS, and WiFi mount]]<br />
<br />
The BeagleBone is connected to the RC truck via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. Tank-style means that each side is controlled independently, as opposed to a standard steering where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by rotating the front axle. (See Figure 4, in connecting the wires to the PCB) Figure 5 is the BeagleBone P9 Header layout and provides a good reference in knowing which pins in the header connect to pins on the BeagleBone. Figure 6 shows how the GPIO pins on BeagleBone are connected to the motor control PCB. As seen in Figure 4 the motor control wires are white. The GPIO pins are the two orange and two yellow wires labeled in the figure. Figure 7 shows how the pins for the gps and compass are connected to the P9 header. Figure 8 shows where the Compass, GPS and WiFi module are mounted. We had to mount them outside of the box because placing them inside of the box caused interference among the signals and created extreme levels of noise. <br />
<br />
The Motor Control pin layout is as follows:<br />
Motor Control BeagleBone<br />
Right Forward 40 - P9 header (software sysfs GPIO 77)<br />
Right Reverse 44 - P9 header (software sysfs GPIO 73)<br />
Left Forward 42 - P9 header (software sysfs GPIO 75)<br />
Left Reverse 46 - P9 header (software sysfs GPIO 71)<br />
<br />
WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module]. The USB WiFi Module is obviously connected to the only usb port on the BeagleBone.<br />
<br />
The [https://www.sparkfun.com/products/11466 GPS] is connected to the BeagleBone over UART serial. The GPS pin layout is as follows:<br />
GPS BeagleBone<br />
1 - tx 24 - P9 header<br />
2 - rx 26 - P9 header<br />
3 - gnd 1 or 2 - P9 header<br />
4 - 3.3v 3 or 4 - P9 header<br />
5 - nc<br />
6 - nc<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the BeagleBone via I2C. The Compass pin layout is as follows:<br />
Compass BeagleBone<br />
1 - P9 header<br />
2 - P9 header<br />
3 - P9 header<br />
4 - P9 header<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* Wireless communication hardware: ''Michael Junge'', ''Jesse Brannon''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, won't be fully completed due to hardware/software issues between Angstrom and Beagle''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Decided and installed an Ubuntu image instead of Anstrom specifically for the WiFi functionally<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
'''Tasks Remaining'''<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191588ECE497 Project Rover2012-11-12T16:38:45Z<p>Hansenrl: /* Modifying RC Truck/Car */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. <br />
<br />
Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. Originally, we thought these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R labels are incorrect. The pins attach to relays on each motor, and correspond to "right forward", "right backward", "left forward", and "left backward", and are digital control signals. Therefore, in order to turn left you would drive the "right backward" and "left forward" pins high. Fortunately, motor conflicts are not destructive and exact pin mappings can be determined by experimentation - if you mistakenly drive the "right forward" and "right backward" pins high, for instance, the relay will click and the motors will not move, without any damage to the motors or electronics.<br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall adapter with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and wants to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
<span style="color:red">(I look forward to seeing the details)</span><br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191582ECE497 Project Rover2012-11-12T16:30:49Z<p>Hansenrl: /* Modifying RC Truck/Car */ figure captions</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1 - Electronics housing]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2 - Motor control PCB]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3 - Motor control pins]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. We figured these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R naming is false and incorrect. <br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall wart with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and wants to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
<span style="color:red">(I look forward to seeing the details)</span><br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191576ECE497 Project Rover2012-11-12T16:29:45Z<p>Hansenrl: /* Installation Instructions */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys 'R Us] and modified it to become an intelligent platform by utilizing a BeagleBone. There are two types of communications with the RC car, commands and queries. An command tells the BeagleBone to move to a different location based on the user input. A query asks the BeagleBone to send data to the user. The data could be either a GPS location or compass heading, depending on what the user asked for. To successfully recreate our work, certain skills will be helpful: dremel-based hardware modification, soldering, experience with Beagle Bone or an equivalent embedded processor bases system, familiarity with the Python and C programming languages, and basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. We figured these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R naming is false and incorrect. <br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall wart with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and wants to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
<span style="color:red">(I look forward to seeing the details)</span><br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191474ECE497 Project Rover2012-11-12T14:49:46Z<p>Hansenrl: /* Modifying RC Truck/Car */ respectfully -> respectively</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toy's R Us] and modified it to receive commands from an external source. There are two types of commands, active and passive. An active command tells the BeagleBone to move to a different location based on the user input. The passive commands tell the BeagleBone to send data to the user. The data could either be gps location or compass heading, depending on what the user asked for. To successfully repeat our design, these certain skills will be needed: reverse engineering, soldering, experience with Beagle Bone or an equivalent Omap processor bases system, Linux and C programming languages, networking protocols as well as basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectively power and ground, the same for all electrical work. Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. We figured these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R naming is false and incorrect. <br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall wart with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground.<br />
<br />
=== BeagleBone ===<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
===WiFi Network===<br />
Connecting to WiFi is an important part of our project. We intended this project to receive data from a user on a mobile laptop. We decided to use WiFi to avoid following the RC truck around a field with the laptop in our hands. WiFi helps the user stay in the same place while the RC truck moves around the field. We ordered an [http://www.adafruit.com/products/814 Adafruit WiFi adapter] that Adafruit specifically sponsors for the BeagleBone. They also have an install tutorial. After several days of researching WiFi capabilities for the BeagleBone, we continually ran into many difficulties. One of the many difficulties is with 'opkg upgrade' that Adafruit says to run. Do not run this, I repeat DO NOT RUN 'opkg upgrade'. Depending on what software image you are running, you will receive an error that for some reason cannot be resolved. There are many reported cases on [http://forums.adafruit.com/viewforum.php?f=49&sid=1a1b1e0fba73bb5659a3446079a5f423 Adafruit's help forums]. There are also several more reported cases for the BeagleBone group on google groups. After researching and WiFi experimentation I discovered that the Adafruit WiFi adapter works well on the A6 version of the BeagleBone hardware while running A5 version of Angstrom. This is the only valid combination I could find. The A5 hardware shows and detects the adapter, but for some reason the adapter does not connect to a wireless router. When the same SD card is plugged into an A6 hardware, it connects fine without issue to a router. I also noticed that the A6 software image does not even recognize the BeagleBone following the same procedure as for the A5 software.<br />
Because of the difficulties, we decided to not use the Angstrom images supported by Beagle. We instead installed Ubuntu Operating system on our A6 hardware. With Ubuntu installed it was as easy as plug and play. All we did after installing Ubuntu was to physically plug in the adapter and it was recognized immediately. However, if you are a true Beagle user and wants to stay with Angstrom I would suggest following the directions in [http://elinux.org/ECE497_Beagle_Bone_WiFi ECE497 Beagle Bone WiFi].<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
<span style="color:red">(I look forward to seeing the details)</span><br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=191324ECE497 Project Rover2012-11-11T23:50:45Z<p>Hansenrl: /* software */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Grading Template ==<br />
I'm using the following template to grade. Each slot is 10 points.<br />
0 = Missing, 5=OK, 10=Wow!<br />
<br />
<pre style="color:red"><br />
05 Executive Summary<br />
05 Installation Instructions (waiting details)<br />
00 User Instructions<br />
00 Highlights<br />
00 Theory of Operation (Looking forward to more details)<br />
00 Work Breakdown<br />
00 Future Work<br />
00 Conclusions<br />
00 Demo<br />
00 Late<br />
Comments: I'm looking forward to seeing this.<br />
<br />
Score: 10/100<br />
<br />
</pre><br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries currently allow us to type line by line directions to move the rover.<br />
<br />
Time permitting and by the end ECE497, the rover may not move autonomously. We are currently working on setting GPS waypoints for the rover to move autonomously so all we have to do is run the program and it will update real-time GPS as it is moving. <br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
We bought an RC car from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toy's R Us] and modified it to receive commands from an external source. There are two types of commands, active and passive. An active command tells the BeagleBone to move to a different location based on the user input. The passive commands tell the BeagleBone to send data to the user. The data could either be gps location or compass heading, depending on what the user asked for. To successfully repeat our design, these certain skills will be needed: reverse engineering, soldering, experience with Beagle Bone or an equivalent Omap processor bases system, Linux and C programming languages, networking protocols as well as basic circuit knowledge such as power regulation from batteries.<br />
<br />
<br />
=== Modifying RC Truck/Car ===<br />
[[File:ECE497 Rover truck hardware.JPG|thumb|Figure 1]]<br />
[[File:ECE497 Rover circuitBoard.JPG|thumb|Figure 2]]<br />
[[File:ECE497 Rover circuitBoard2.JPG|thumb|Figure 3]]<br />
<br />
As shown in Figure 1, we removed the aesthetic cover form the truck. We also cut out most of the plastic with a Dremel tool. We did this to expose the circuity below. Cutting out most of the plastic is necessary unless you are skilled enough to drill only a small hole to feed the wires through and can replace the circuit board back into place without viewing it. Figure 1 also shows, four screw slots. In order to obtain access to the circuity, you must remove the screws from their sockets. Now turn the truck so that it's undercarriage is facing up, remove the housing unit of the battery. The battery unit should be loose and thus be removed since you already removed the four place holder screws. Be careful though to not pullout or detach any wires from the their respected places as you are pulling out the circuit board. Figure 2 shows the circuit board removed from it's housing with the wires exposed. The red and black wires you see are respectfully power and ground, the same for all electrical work. Figure 3 is focused on the specific connections that we soldered to the board. We choose the top left corner (where three of the connections are) because when we reverse engineered the board, this area is where the wireless signals are received and sent to the motor controllers. The fourth wire was supposed to be the pin on the right but as you can see by the picture, the circuit pad is burned off. We just followed the hard trace and soldered at the next available node. After testing, this improvised step seemed suitable for our needs. The same four pins are labeled on the circuit board as F,W,L,R. We figured these meant forward, backward, left and right. However the RC Truck is designed with tank steering so in order to go forward it theoretically should require two separate signals. We tested this theory and found out that it did in fact require two signals, thus the F,W,L,R naming is false and incorrect. <br />
<br />
If you want to reverse engineer this circuit board for yourself instead of just following this guide, you will need a separate 5V dc power supply as well as the 9V battery that was included, a 5V wall wart with stripped wires will be suffient for the extra power supply. Then you should look for the wireless adapter board. Most RC electronics will have a separate wireless circuit board. Ours happened to be already physically attached to the motor controllers. Find the output signals from the wireless adapter and test which signals control which motors and direction of motors. To test this just attach the 5V to the pin on the circuit board while the truck battery is installed and switched on. Also you will need to find a ground wire to attach for common ground. We just soldered directly to the terminal on the installed battery for our ground. <br />
<br />
<br />
=== BeagleBone ===<br />
''Note: We specifically used a BeagleBone for it's smaller size and less cost due to less capabilities. However, you could use any board that has an Omap processor, such as the Beagle XM Board.''<br />
<br />
=== software ===<br />
<br />
The work-in-progress code for the platform can be found on the [git://github.com/hansenrl/BeagleRover.git BeagleRover Github Repository]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
<span style="color:red">(I look forward to seeing the details)</span><br />
<br />
== User Instructions ==<br />
The rover will be able to be controlled using a simple browser based interface. Additionally, waypoints will be able to be selected in order by clicking on intended location on an Google map interface.<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module. Browser controls are based on node.js and Google Maps API.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Soldered and interfaced battery subsystem to power BeagleBone<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
<br />
* A GUI is being developed that could be used to send commands to control the rover. Work on it can be seen here: [[ECE497_Project_RoverGUI]]<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=User:Hansenrl&diff=190526User:Hansenrl2012-11-08T16:48:39Z<p>Hansenrl: /* Interest Areas */</p>
<hr />
<div>User Page for Ross Hansen. He is an Electrical Engineering Major.<br />
<br />
=== Interest Areas ===<br />
* Pattern Recognition<br />
* Networking, Mesh Networks<br />
* Electromagnetics<br />
<br />
<br />
[[Category:ECE497 |Uh]]</div>Hansenrlhttps://elinux.org/index.php?title=User:Hansenrl&diff=190502User:Hansenrl2012-11-08T16:47:28Z<p>Hansenrl: /* Interest Areas */</p>
<hr />
<div>User Page for Ross Hansen. He is an Electrical Engineering Major.<br />
<br />
=== Interest Areas ===<br />
* Pattern Recognition<br />
* Networking, Mesh Networks<br />
* Electromagnetics<br />
<br />
<br />
[[Category:ECE497 [Uh]]]</div>Hansenrlhttps://elinux.org/index.php?title=User:Hansenrl&diff=190496User:Hansenrl2012-11-08T16:47:18Z<p>Hansenrl: </p>
<hr />
<div>User Page for Ross Hansen. He is an Electrical Engineering Major.<br />
<br />
=== Interest Areas ===<br />
* Pattern Recognition<br />
* Networking, Mesh Networks<br />
* Electromagnetics<br />
<br />
<br />
[[Category:ECE497] [Uh]]</div>Hansenrlhttps://elinux.org/index.php?title=EBC_Contributions_and_Project_Status&diff=186530EBC Contributions and Project Status2012-11-02T04:56:14Z<p>Hansenrl: </p>
<hr />
<div>[[Category:ECE497 |Contributions]]<br />
{{YoderHead}}<br />
<br />
== Fall 2012 ==<br />
<br />
=== Project Status ===<br />
<br />
Please edit this page and add your project to this list. Copy my [[ECE497 Project Template]] to your own eLinux page and include the title of your project in the name of the page. <br />
<br />
Please make the list alphabetical by family name.<br />
<br />
Take a look at what you and others have contributed.<br />
<br />
{|<br />
|- <br />
! Name<br />
! Contributions<br />
! Project<br />
! git repository<br />
|-<br />
| [[User:atniptw | Tom Atnip]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/atniptw/ atniptw]<br />
|-<br />
| [[User:larmorgs | Greg Larmore]]<br />
| <br />
| [[ECE497 Project Template | My Beagle Project]]<br />
| [https://github.com/larmorgs/ larmorgs]<br />
|-<br />
| [[User:jessebrannon | Jesse Brannon]]<br />
| <br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/brannojs/ brannojs]<br />
|-<br />
| [[User:Xinyu1991 | Xinyu Cheng]]<br />
| <br />
| [[ECE497 Project Template | My Beagle Project]]<br />
| [https://github.com/xinyu1991]<br />
|-<br />
| [[User:correlbn | Bryan Correll]]<br />
| [[Special:Contributions/correlbn|contrib]]<br />
| [[BeagleBone PRU | BeagleBone PRU]]<br />
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]<br />
|-<br />
| [[User:draneaw | Alex Drane]]<br />
| <br />
| [[ECE497 draneaw Project | My Beagle Project]]<br />
| [https://github.com/draneaw/My-Beagle-Project draneaw]<br />
|-<br />
| [[User:duganje | Josh Dugan]]<br />
| <br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/duganje/ duganje]<br />
|-<br />
| [[User:Geislekj | Kevin Geisler]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/geislekj/ geislekj]<br />
| <br />
|-<br />
| [[User:chris.good | Christopher A Good]]<br />
| [[Special:Contributions/Chris.good|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/goodca/ goodca]<br />
| <br />
|-<br />
| [[User:hansenrl | Ross Hansen]]<br />
| [[Special:Contributions/hansenrl|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/hansenrl/ Hansenrl]<br />
| <br />
|-<br />
| [[User:jungeml | Michael Junge]]<br />
| [[Special:Contributions/jungeml|contrib]]<br />
| [[ECE497 Project Rover | Rover]]<br />
| [https://github.com/jungeml/ Jungeml]<br />
|-<br />
|<br />
|-<br />
| [[User:Lix | Xia Li]]<br />
| [[Special:Contributions/Lix|contrib]]<br />
| [[ECE497 Lix Project | My Beagle Project]]<br />
| [https://github.com/1984xiali/ xiali]<br />
|-<br />
| [[User:mmoravec | Matthew Moravec]]<br />
| [[Special:Contributions/mmoravec|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/mmoravec/ mmoravec]<br />
|-<br />
| [[User:ngop | Peter Ngo]]<br />
| <br />
| [[ECE497 ngop Project: Beaglebone PRU|Beaglebone PRU]]<br />
| [https://github.com/ngop/ ngop]<br />
|<br />
|-<br />
| [[User:shinnsm|Stephen Shinn]]<br />
| [[Special:Contributions/shinnsm|contrib]]<br />
| [[ECE497 Project: XBee|XBee]]<br />
| [https://github.com/shinnsm shinnsm]<br />
|-<br />
| [[User:Yoder | Mark A. Yoder]]<br />
| [[Special:Contributions/Yoder | contrib]]<br />
| [[ECE497 Project Template | My Beagle Project]]<br />
| [https://github.com/MarkAYoder MarkAYoder]<br />
|-<br />
| [[User:Popenhjc | James Popenhagen]]<br />
| <br />
| [[BeagleBone PRU | BeagleBone PRU]]<br />
| [https://github.com/popenhjc/ popenhjc]<br />
|-<br />
| [[User:Whiteer | Elias White]]<br />
| <br />
| [[ECE497 whiteer Project | My Beagle Project]]<br />
| [https://github.com/whiteer whiteer]<br />
|-<br />
| [[User:ruff | Ruffin White]]<br />
| <br />
| [[ECE497 Beagle VNS | Beagle VNS]]<br />
| [https://github.com/ruffsl/ ruffsl]<br />
|<br />
|-<br />
| [[User:Richarsm | Sean Richardson]]<br />
| <br />
| [[ECE497 richarsm Project | My Beagle Project]]<br />
| [https://github.com/seanrich Sean Richardson]<br />
|-<br />
| [[User:Millerap | Andrew Miller]]<br />
|<br />
| [[ECE 497 millerap Project | My Beagle Project]]<br />
| [https://github.com/millerap millerap]<br />
|-| <br />
| [[User:Astroricks | Yue Zhang]]<br />
| <br />
| [[ECE497 Yue Zhang Project | My Beagle Project]]<br />
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]<br />
|-<br />
| [[User:Lobdeljt | John Lobdell]]<br />
| <br />
| [[ECE 497 lobdeljt Project | My Beagle Project]]<br />
| [https://github.com/jtlobdell jtlobdell]<br />
|-<br />
|<br />
|}<br />
<br />
== Winter 2011-2012 ==<br />
<br />
=== Contributions ===<br />
<br />
# [[Special:Contributions/Yuming | Yuming Cao]]<br />
# [[Special:Contributions/Yifei | Yifei Li]]<br />
# [[Special:Contributions/Harrisgw | Greg Harrison]]<br />
# [[Special:Contributions/mac | Jack Ma]]<br />
# [[Special:Contributions/Gemini91 | Guanqun Wang]]<br />
# [[Special:Contributions/Yanj | Mona Yan]]<br />
# [[Special:Contributions/Yoder | Mark A. Yoder]]<br />
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]<br />
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]<br />
# [[Special:Contributions/Zitnikdj | David Zitnik]]<br />
# [[Special:Contributions/Zitnikdj | Alex Drane]]<br />
# [[Special:Contributions/jessebrannon | Jesse Brannon]]<br />
# [[Special:Contributions/larmorgs | Greg Larmore]]<br />
# [[Special:Contributions/jungeml | Michael Junge]]<br />
# [[Special:Contributions/millerap | Andrew Miller]]<br />
# [[Special:Contributions/correlbn | Bryan Correll]]<br />
<br />
=== Project Status ===<br />
<br />
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]<br />
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]<br />
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]<br />
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]<br />
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]<br />
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]<br />
<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=186506ECE497 Project Rover2012-11-02T04:54:41Z<p>Hansenrl: Hansenrl moved page ECE497 Project AutoPilot to ECE497 Project Rover: more accurate</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries are currently being developed to add drive command and waypoint functionality.<br />
<br />
In the next week the team hopes to complete the code to drive the rover over the network - this involves polishing the networking code and developing the waypoint/movement management code. The team also needs to implement more features in the GPS library to allow configuration of the GPS location update frequency (it is currently limited to 1 Hz).<br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
The work-in-progress code for the platform can be found on [https://github.com/brannojs/Senior-Design Github]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
== User Instructions ==<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Currently soldering and interfacing battery subsystem to power BeagleBone ''**to be completed 11/3; functional circuitry complete as of 11/1''<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
* A GUI interface could be built to provide access to the waypoint management interface or drive base controls ''Currently in development by Chris Good as a BeagleBone project''<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_AutoPilot&diff=186512ECE497 Project AutoPilot2012-11-02T04:54:41Z<p>Hansenrl: Hansenrl moved page ECE497 Project AutoPilot to ECE497 Project Rover: more accurate</p>
<hr />
<div>#REDIRECT [[ECE497 Project Rover]]</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=186500ECE497 Project Rover2012-11-02T04:53:45Z<p>Hansenrl: /* Work Breakdown */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries are currently being developed to add drive command and waypoint functionality.<br />
<br />
In the next week the team hopes to complete the code to drive the rover over the network - this involves polishing the networking code and developing the waypoint/movement management code. The team also needs to implement more features in the GPS library to allow configuration of the GPS location update frequency (it is currently limited to 1 Hz).<br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
The work-in-progress code for the platform can be found on [https://github.com/brannojs/Senior-Design Github]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
== User Instructions ==<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''**still under invesgitation, completion TBD''<br />
* Currently soldering and interfacing battery subsystem to power BeagleBone ''**to be completed 11/3; functional circuitry complete as of 11/1''<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''**to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''**to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''**to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
* A GUI interface could be built to provide access to the waypoint management interface or drive base controls ''Currently in development by Chris Good as a BeagleBone project''<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrlhttps://elinux.org/index.php?title=ECE497_Project_Rover&diff=186488ECE497 Project Rover2012-11-02T04:53:14Z<p>Hansenrl: /* Work Breakdown */</p>
<hr />
<div>[[Category:ECE497 |Project]]<br />
{{YoderHead}}<br />
<br />
Team members: [[user:Hansenrl|Ross Hansen]], [[user:jessebrannon|Jesse Brannon]], [[User:jungeml|Michael Junge]] <br />
<br />
== Executive Summary ==<br />
<br />
This project is a BeagleBone implementation of a ground-based rover platform. Through a BeagleBone mounted on an RC car, the user will be able to control the car over WiFi - the user can give commands to drive forward, drive backward, turn left, and turn right. The BeagleBone will also send back helpful information to the user over Wifi, such as GPS location and compass heading. Development time permitting, the user will also be able to guide the rover along a path by defining waypoints for movement.<br />
<br />
Currently, the project is well underway. The RC car has been acquired and reverse-engineered to gain access to the motor electronics, and the BeagleBone GPIO outputs have been interfaced to allow motor control. A WiFi module has been selected and a procedure has been developed to get it working on the BeagleBone (harder than it seems!). Libraries for the GPS sensor and compass have been written and tested. Code for the network communication to control the BeagleBone over WiFi has been written, and the protocol and libraries are currently being developed to add drive command and waypoint functionality.<br />
<br />
In the next week the team hopes to complete the code to drive the rover over the network - this involves polishing the networking code and developing the waypoint/movement management code. The team also needs to implement more features in the GPS library to allow configuration of the GPS location update frequency (it is currently limited to 1 Hz).<br />
<br />
When completed, the project will serve as a neat demonstration of the capabilities of the BeagleBone as a robotics platform. The GPIO output, I2C and serial interfaces, WiFi dongle compatibility, and embedded Linux OS of the BeagleBone provide an excellent platform for mobile robotics development.<br />
<br />
== Installation Instructions ==<br />
<br />
The work-in-progress code for the platform can be found on [https://github.com/brannojs/Senior-Design Github]. The drive base used for the platform was purchased from [http://www.toysrus.com/product/index.jsp?productId=12925248 Toys R Us], and the modifications to access the motor electronics can be accomplished with a dremel tool. Pictures and a detailed explanation will be provided at the end of the project, when the procedure is finalized.<br />
<br />
Currently, the WiFi dongle works best when Ubuntu is flashed to the Bone. Further investigation is underway into the problems present in certain images of Angstrom, and when that investigation is complete the team will decide on which BeagleBone OS to use. Detailed instructions to install the BeagleBone and setup the software will be provided at that time. In general, all of the software needed is provided on the github repository. All custom code is written in C and python, and a Makefile is provided on github.<br />
<br />
== User Instructions ==<br />
<br />
As the code is currently in development, UI details are not finalized. These instructions will be updated.<br />
<br />
== Highlights ==<br />
<br />
Coming Soon!<br />
<br />
== Theory of Operation ==<br />
<br />
=== Hardware Interfaces ===<br />
<br />
The BeagleBone is connected to the RC car via 4 GPIO pins and a ground wire. The four GPIO pins control left forward, left reverse, right forward, and right reverse on the tank-style drive base. (Tank-style means that each side is controlled independently, as opposed to a standard car where the user controls whether the car as a whole is moving forward or reverse and turns are accomplished by steering).<br />
<br />
The [https://www.sparkfun.com/products/7915 compass] is connected to the Bone via I2C, and the [https://www.sparkfun.com/products/11466 GPS] is connected to the Bone over UART serial. WiFi is achieved with Adafruit's [http://www.adafruit.com/products/814 USB WiFi Module].<br />
<br />
=== Software ===<br />
<br />
The motors are interfaced with GPIO controls in a C library. Movement, waypoint management, and sensor code are all also implemented as C libraries. Data is sent over WiFi to and from the Bone using TCP sockets in Python; the C libraries are accessed by the Bone in Python using the ctypes Python standard module.<br />
<br />
More detail regarding the interaction of different parts of the code and important interfaces will be provided as they are finalized.<br />
<br />
== Work Breakdown ==<br />
<br />
A summary of the major development areas and the primary contributor(s) to each subsystem:<br />
<br />
* RC car hardware interfacing and mounting: ''Michael Junge''<br />
* Power subsystem development: ''Michael Junge''<br />
* GPS and Compass sensor interfacing: ''Jesse Brannon''<br />
* Movement and navigation software development: ''Jesse Brannon'', ''Ross Hansen''<br />
* Network communication software development: ''Ross Hansen''<br />
<br />
Tasks completed and in development by each team member:<br />
<br />
'''Michael Junge''' <br />
* Constructed hardware interfaces to compass sensor and drive base electronics<br />
* Investigated WiFi issues on Angstrom - determined that the Angstrom A5 image on BeagleBone A6 hardware is a known working configuration ''*still under invesgitation, completion TBD''<br />
* Currently soldering and interfacing battery subsystem to power BeagleBone ''*to be completed 11/3; functional circuitry complete as of 11/1''<br />
<br />
'''Jesse Brannon'''<br />
* Researched and purchased compass and GPS sensors<br />
* Wrote libraries to interface to compass and GPS sensor<br />
* Currently coo-developing movement and navigation software ''*to be completed 11/7; code to add waypoints complete as of 10/31''<br />
<br />
'''Ross Hansen'''<br />
* Currently co-developing movement and navigation software ''*to be completed 11/7; code for basic movement complete as of 10/24''<br />
* Developed prototype software for network communication, currently developing more robust network protocol implementation ''*to be completed 11/3; basic prototype code completed 10/31''<br />
<br />
The major remaining tasks to be completed are<br />
<br />
1) Solidify the interface from the networking code to the motor control<br />
<br />
2) Code to manage waypoints and drive the motors based off of waypoint inputs<br />
<br />
3) Improve GPS library to allow for update rate configuration<br />
<br />
Task 1 is absolutely necessary to fulfilling the goals of the project, while tasks 2 and 3 are good features, but not core requirements.<br />
<br />
== Future Work ==<br />
<br />
This project has the possibility to branch into several interesting areas.<br />
* The BeagleBone platform has the processing power for various interesting sensory systems, such as computer vision. The RC car interface and networking platform allows for a variety of interesting applications of sensor systems, where driving decisions are made based off of sensor inputs or sensor data is relayed remotely back to a powerful processing node.<br />
* A GUI interface could be built to provide access to the waypoint management interface or drive base controls ''Currently in development by Chris Good as a BeagleBone project''<br />
<br />
== Conclusions ==<br />
<br />
TBD....<br />
<br />
{{YoderFoot}}</div>Hansenrl