Difference between revisions of "ECE434 Project - RC Tank"
|Line 96:||Line 96:|
== Conclusions ==
== 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
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 app was intuitive
that the tank the of .
Revision as of 08:34, 20 November 2019
Embedded Linux Class by Mark A. Yoder
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
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).
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.
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.
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.
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 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.
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.
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.
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
in a separate terminal run the following command.
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.
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.
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
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.
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.