Difference between revisions of "ECE434 Project - RC Tank"

From eLinux.org
Jump to: navigation, search
(Installation Instructions)
m
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:ECE497 |PT]]
+
[[Category:ECE497Fall2019 |PT]]
[[Category:ECE497Fall2018 |PT]]
 
 
{{YoderHead}}
 
{{YoderHead}}
  
Line 29: Line 28:
  
 
== 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.
  
 
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.
 
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]]
 
[[File:RcTank.jpeg|thumb]]
  
We will be 3D printing an RC tank and using a Raspberry Pi 3 to interface with it. The tank will be remote controlled over WiFi and have a camera on it for FPV (first-person view).
+
== Packaging ==
 
 
As of right now, we have all of the parts ordered and the tank is in the process of being 3D printed.
 
 
 
Right now we are running into issues where the tank stops responding to the commands sent over blynk. We think that this issue is caused by the low battery state. If the tank stops responding frequently please charge the batteries.
 
 
 
This was a really cool project to work on as we were able to sit in B200 and drive the tank out into the hall using the camera to see where we were going. We were also able to connect the tank to RHIT-OPEN so we should be able to drive it around anywhere on campus. It was also very cool to see the progress we have made since we made a similar tank for the ECE230 final 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.
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.
 
  
 
== Installation Instructions ==
 
== Installation Instructions ==
Line 48: Line 41:
 
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.  
 
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/ECE434
+
     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 the suggested hardware.  
+
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
 
     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 parts room. We also used a 5V regulator to control the power input into the raspberry pi which was likewise sold in the parts room. Additionally we used a camera attachment for the raspberry pi which can be found at the link below.
+
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
+
    https://www.amazon.com/Raspberry-Pi-Camera-Module-Megapixel/dp/B01ER2SKFS?ref_=fsclp_pl_dp_1
  
 
== User Instructions ==
 
== User Instructions ==
  
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 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]]
 +
 
 +
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 ==
 
== 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 08:21, 22 July 2020

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.