Difference between revisions of "ECE434 Project - RC Tank"

From eLinux.org
Jump to: navigation, search
(Created page with "PT PT {{YoderHead}} Team members: Connor Mattox and Eric Fast == Grading Template == I'm using the follo...")
 
(Executive Summary)
 
(25 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
{{YoderHead}}
 
{{YoderHead}}
  
Team members: [[user:Mattoxcw|Connor Mattox]] and Eric Fast
+
Team members: [[user:Mattoxcw|Connor Mattox]] and [[user:Efast616|Eric Fast]]
  
  
Line 29: Line 29:
  
 
== Executive Summary ==
 
== Executive Summary ==
 +
We designed a miniature RC tank that can be controlled over WiFi anywhere on campus with a camera that can be used for FPV (first-person view). To accomplish this, we utilized some open source 3D models of a tank from EdRover (link shown in later section). We selected our parts based on availability and compatibility with our system, such as an h-bridge, a 5V regulator, etc. Lastly for the controller of our system, we elected to use a Raspberry Pi 3. The tank body was premade with mounting for that controller and due to its built in WiFi module, we were able to connect over WiFi very reliably. Lastly we utilized ssh to pipe the video feed into our host computer from the on-board camera, and we used Blynk to control the motors over WiFi.
  
Picture that summarizes the project.
+
A picture of the tank can be seen to the right. The blynk app is also shown in the picture along with the batteries that we are using to power the system.
 +
[[File:RcTank.jpeg|thumb]]
  
Give two sentence intro to the project.
+
== Packaging ==
 +
 
 +
All of the packaging that was done for our project was fitting the circuitry and the Raspberry Pi 3 into the 3D printed body (provided by EdRover on Thingiverse). A miniature breadboard was used to mount the dual H bridge as well as the 5V regulator. The mounting holes were 3D printed and therefore the size of the screw can be adjusted based on what is available.
 +
 
 +
== Installation Instructions ==
  
Give two sentences telling what works.
+
The link below is to the github where we kept all the files for this project. The readme.md has instructions for what to download and should be followed before trying to run any of the other provided code. The github also includes the code that we have written that can be used to run the tank.  
  
Give two sentences telling what isn't working.
+
    https://github.com/mattoxcw/fpvTank
 +
 +
The website that is shown in the link below was used for all the 3d printed parts as well as some suggested hardware for a different build. While we know it works, we opted to choose different parts as noted below.  
  
End with a two sentence conclusion.
+
    https://www.thingiverse.com/thing:3671909
  
The sentence count is approximate and only to give an idea of the expected length.
+
In place of the suggested mx1616 dual h bridge we used the L293d dual h bridge as this was previously used in ECE230 and is sold at the Rose-Hulman ECE parts room. We also used a 5V regulator to control the power input into the Raspberry Pi 3 which was likewise sold in the parts room (and we noted pushes out much less heat than expected). Additionally we used a camera attachment for the raspberry pi which can be found at the link below.
  
== Packaging ==
+
    https://www.amazon.com/Raspberry-Pi-Camera-Module-Megapixel/dp/B01ER2SKFS?ref_=fsclp_pl_dp_1
If you have hardware, consider [http://cpprojects.blogspot.com/2013/07/small-build-big-execuition.html Small Build, Big Execuition] for ideas on the final packaging.
+
 
 +
== User Instructions ==
 +
 
 +
Once everything is installed by following the README, create an App on blynk that has five buttons arranged in a cross pattern. The top button should be attached to virtual pin five, the middle should be attached to virtual pin nine, the bottom should be attached to virtual pin six. The button on the left of the cross should be attached to virtual pin seven while the button on the right should be attached to virtual pin eight. A picture of this layout can be seen to the right.
 +
[[File:Blynk.jpg|thumb]]
  
== Installation Instructions ==
+
After making the blynk app, be sure to update the AUTH variable in the motorDrive.py and rename it to yournameRCtank.py. Then run the file by using the command
  
Give step by step instructions on how to install your project.
+
    ./yournameRCtank.py
 +
   
 +
in a separate terminal run the following command.
  
* Include your [https://github.com/ github] path as a link like this to the read-only git site:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].
+
    sh fpvTank.sh
* Be sure your README.md is includes an up-to-date and clear description of your project so that someone who comes across you git repository can quickly learn what you did and how they can reproduce it.
 
* Include a Makefile for your code if using C.
 
* Include any additional packages installed via '''apt'''.  Include '''install.sh''' and '''setup.sh''' files.
 
* Include kernel mods.
 
* If there is extra hardware needed, include links to where it can be obtained.
 
  
== User Instructions ==
+
This will start a video feed from the camera that will play on your screen and show you what the tank sees.
  
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.
+
Once running the Blynk app use the buttons to drive the tank around, being careful not to bump into things to hard.
  
 
== Highlights ==
 
== Highlights ==
  
Here is where you brag about what your project can do.
+
Our tank was completely 3D printed so all of the features can be customized to a specific need. We followed the 3D prints that were given since we were using the same setup(Raspberry Pi 3 with similar parts). Our tank is able to driven using the Blynk app anywhere on campus. As long as the internet connection doesn't cut out the tank should be able to drive anywhere where RHIT-OPEN is available and we can control it from our computer. We were able to drive the tank out into the hallway of Moench while sitting in B200 watching the camera feed.
 
 
Include a [http://www.youtube.com/ YouTube] demo the audio description.
 
  
 
== Theory of Operation ==
 
== Theory of Operation ==
  
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline. Are you running multiple tasks?  Show what they do and how they interact.
+
In this project we are using the RPi.GPIO library to control the motor input signals via PWM. We set the PWM frequency to 40Hz as this is a reasonable speed for the tank. Four GPIO pins are connected to the dual h bridge to signal when and how to turn the motor. When the user wants a motor to spin forward the first input signal needs to be high while the second should be low. The opposite is true for turning the motor backwards. In order to turn each direction we set one motor driving forward and the other driving backwards. Our software accepts a blynk button press and upon the press runs a section of code that will turn the motors in a way that the user has requested. In the code we had to account for the motors driving at slightly different speeds so we introduced an offset variable which ensures that the tank drives in a straight line. This offset variable will need to be adjusted to new motors that are used for this project or future projects.
  
 
== Work Breakdown ==
 
== Work Breakdown ==
  
List the major tasks in your project and who did what.
+
The major tasks for this project are as follows:
  
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.
+
    1. Order and print all of the 3d printed parts - Connor
 +
    2. Develop the hardware on a breadboard - Eric
 +
    3. Integrate the camera into the system - Connor
 +
    4. Assemble the 3d printed parts and integrate motors -Eric
 +
    5. Work on the PWM control and the motor tuning - Both
 +
    6. Work on the Documentation - Both
  
 
== Future Work ==
 
== Future Work ==
  
Suggest addition things that could be done with this project.
+
In the future more features could be implemented on the blink app such as a feature that allows you to change the speed of the tank, and a joystick controller would be preferred. Additionally an on board charger would be really nice so you do not have to remove the batteries but rather just plug in a USB to charge. Lastly a way to notify the user which WiFi the tank is currently on along with its IP address.
  
 
== Conclusions ==
 
== Conclusions ==
  
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.
+
At the end of this project we were really happy with the ability to drive the tank around using the camera to view the landscape. During the final demonstration we were able to drive the tank around the room avoiding people and objects using the camera feed. The Blynk app was incredibly intuitive and reliable.  
  
{{YoderFoot}}
+
For us this was also somewhat of a fun throwback. We made a simpler tank back in ECE230 that was controlled over Bluetooth. To one up that previous design, my partner and I spent a lot of time working out various improvements to our parts list and updated the tank for a more modern feel, particularly with the live camera feed and WiFi connectivity. All said and done, I believe we are both proud of how it turned out.

Latest revision as of 07:39, 20 November 2019

thumb‎ Embedded Linux Class by Mark A. Yoder


Team members: Connor Mattox and Eric Fast


Grading Template

I'm using the following template to grade. Each slot is 10 points. 0 = Missing, 5=OK, 10=Wow!

00 Executive Summary
00 Installation Instructions 
00 User Instructions
00 Highlights
00 Theory of Operation
00 Work Breakdown
00 Future Work
00 Conclusions
00 Demo
00 Late
Comments: I'm looking forward to seeing this.

Score:  10/100

(Inline Comment)

Executive Summary

We designed a miniature RC tank that can be controlled over WiFi anywhere on campus with a camera that can be used for FPV (first-person view). To accomplish this, we utilized some open source 3D models of a tank from EdRover (link shown in later section). We selected our parts based on availability and compatibility with our system, such as an h-bridge, a 5V regulator, etc. Lastly for the controller of our system, we elected to use a Raspberry Pi 3. The tank body was premade with mounting for that controller and due to its built in WiFi module, we were able to connect over WiFi very reliably. Lastly we utilized ssh to pipe the video feed into our host computer from the on-board camera, and we used Blynk to control the motors over WiFi.

A picture of the tank can be seen to the right. The blynk app is also shown in the picture along with the batteries that we are using to power the system.

RcTank.jpeg

Packaging

All of the packaging that was done for our project was fitting the circuitry and the Raspberry Pi 3 into the 3D printed body (provided by EdRover on Thingiverse). A miniature breadboard was used to mount the dual H bridge as well as the 5V regulator. The mounting holes were 3D printed and therefore the size of the screw can be adjusted based on what is available.

Installation Instructions

The link below is to the github where we kept all the files for this project. The readme.md has instructions for what to download and should be followed before trying to run any of the other provided code. The github also includes the code that we have written that can be used to run the tank.

    https://github.com/mattoxcw/fpvTank

The website that is shown in the link below was used for all the 3d printed parts as well as some suggested hardware for a different build. While we know it works, we opted to choose different parts as noted below.

    https://www.thingiverse.com/thing:3671909

In place of the suggested mx1616 dual h bridge we used the L293d dual h bridge as this was previously used in ECE230 and is sold at the Rose-Hulman ECE parts room. We also used a 5V regulator to control the power input into the Raspberry Pi 3 which was likewise sold in the parts room (and we noted pushes out much less heat than expected). Additionally we used a camera attachment for the raspberry pi which can be found at the link below.

    https://www.amazon.com/Raspberry-Pi-Camera-Module-Megapixel/dp/B01ER2SKFS?ref_=fsclp_pl_dp_1

User Instructions

Once everything is installed by following the README, create an App on blynk that has five buttons arranged in a cross pattern. The top button should be attached to virtual pin five, the middle should be attached to virtual pin nine, the bottom should be attached to virtual pin six. The button on the left of the cross should be attached to virtual pin seven while the button on the right should be attached to virtual pin eight. A picture of this layout can be seen to the right.

Blynk.jpg

After making the blynk app, be sure to update the AUTH variable in the motorDrive.py and rename it to yournameRCtank.py. Then run the file by using the command

    ./yournameRCtank.py
    

in a separate terminal run the following command.

    sh fpvTank.sh

This will start a video feed from the camera that will play on your screen and show you what the tank sees.

Once running the Blynk app use the buttons to drive the tank around, being careful not to bump into things to hard.

Highlights

Our tank was completely 3D printed so all of the features can be customized to a specific need. We followed the 3D prints that were given since we were using the same setup(Raspberry Pi 3 with similar parts). Our tank is able to driven using the Blynk app anywhere on campus. As long as the internet connection doesn't cut out the tank should be able to drive anywhere where RHIT-OPEN is available and we can control it from our computer. We were able to drive the tank out into the hallway of Moench while sitting in B200 watching the camera feed.

Theory of Operation

In this project we are using the RPi.GPIO library to control the motor input signals via PWM. We set the PWM frequency to 40Hz as this is a reasonable speed for the tank. Four GPIO pins are connected to the dual h bridge to signal when and how to turn the motor. When the user wants a motor to spin forward the first input signal needs to be high while the second should be low. The opposite is true for turning the motor backwards. In order to turn each direction we set one motor driving forward and the other driving backwards. Our software accepts a blynk button press and upon the press runs a section of code that will turn the motors in a way that the user has requested. In the code we had to account for the motors driving at slightly different speeds so we introduced an offset variable which ensures that the tank drives in a straight line. This offset variable will need to be adjusted to new motors that are used for this project or future projects.

Work Breakdown

The major tasks for this project are as follows:

    1. Order and print all of the 3d printed parts - Connor 
    2. Develop the hardware on a breadboard - Eric
    3. Integrate the camera into the system - Connor
    4. Assemble the 3d printed parts and integrate motors -Eric
    5. Work on the PWM control and the motor tuning - Both
    6. Work on the Documentation - Both

Future Work

In the future more features could be implemented on the blink app such as a feature that allows you to change the speed of the tank, and a joystick controller would be preferred. Additionally an on board charger would be really nice so you do not have to remove the batteries but rather just plug in a USB to charge. Lastly a way to notify the user which WiFi the tank is currently on along with its IP address.

Conclusions

At the end of this project we were really happy with the ability to drive the tank around using the camera to view the landscape. During the final demonstration we were able to drive the tank around the room avoiding people and objects using the camera feed. The Blynk app was incredibly intuitive and reliable.

For us this was also somewhat of a fun throwback. We made a simpler tank back in ECE230 that was controlled over Bluetooth. To one up that previous design, my partner and I spent a lot of time working out various improvements to our parts list and updated the tank for a more modern feel, particularly with the live camera feed and WiFi connectivity. All said and done, I believe we are both proud of how it turned out.