{"id":551,"date":"2022-12-16T20:07:24","date_gmt":"2022-12-16T20:07:24","guid":{"rendered":"https:\/\/portfolio.wcu.edu\/hjhester1\/?p=551"},"modified":"2022-12-16T22:23:08","modified_gmt":"2022-12-16T22:23:08","slug":"final-project-fire-fighting-robot","status":"publish","type":"post","link":"https:\/\/portfolio.wcu.edu\/hjhester1\/2022\/12\/16\/final-project-fire-fighting-robot\/","title":{"rendered":"Final Project: Fire-Fighting Robot"},"content":{"rendered":"<h3>Intro<\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0In my ENGR 199 (Intro to Engineering Practice and Principles) class, taught by Dr. Adam Harris, I had a group project instead of the traditional test for a final. The project was to build a robot that could \u201csolve\u201d a maze and blow out a small flame. My teammates, Joshua and Shaneil both wrote blog posts about the project.<\/span><\/p>\n<p><a href=\"https:\/\/portfolio.wcu.edu\/jlchandler4\/2022\/12\/16\/firefighting-robot-project\/\"><span style=\"font-weight: 400;\">Link to Joshua\u2019s blog post<\/span><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Link to Shaneil\u2019s blog post<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Goals<\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 My team\u2019s goal was to build a robot that could smoothly navigate a maze and put out a flame. The maze had 2 turns, but it could be set-up with only left turns or only right turns. However, my group decided to go a step further. We (successfully) designed our robot to be capable of solving the left and right versions of the maze.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-560\" src=\"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-content\/uploads\/sites\/1698\/2022\/12\/IMG_5132-1-300x238.jpg\" alt=\"\" width=\"300\" height=\"238\" \/><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-561 alignnone\" src=\"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-content\/uploads\/sites\/1698\/2022\/12\/IMG_5132-300x238.jpg\" alt=\"\" width=\"300\" height=\"238\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>3D Printing<\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0Throughout the semester, I had been designing some of the 3D parts that I would need for this project. My motor mount (<a href=\"https:\/\/portfolio.wcu.edu\/hjhester1\/2022\/11\/04\/how-to-import-and-scale-an-image-in-onshape\/\">full post here<\/a>) and wheel (<a href=\"https:\/\/portfolio.wcu.edu\/hjhester1\/2022\/12\/14\/3d-printing-wheel-with-hub\/\">full post here<\/a>) were both used on the robot. I was careful to print every part with at least 15% infill. This prevented my parts from breaking when they were carrying the weight of the chassis and hardware. My group\u2019s biggest difficulty with the wheels was that the rubber bands we were using for traction kept slipping off. We eventually just taped the rubber bands to the wheels.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Hardware<\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0The ultrasonic sensor (<a href=\"https:\/\/portfolio.wcu.edu\/hjhester1\/2022\/11\/11\/ultrasonic-sensors-and-servos\/\">full post here<\/a>) was one of the most important components of the robot. Without the sensor, the robot would not know when to turn to avoid hitting a wall. An Infrared sensor was used to detect the flame. When the flame was detected, a relay turned on a small flame (<a href=\"https:\/\/portfolio.wcu.edu\/hjhester1\/2022\/12\/05\/infrared-sensors-and-relays\/\">full post here<\/a>). In the program, these sensors had to be activated in a very specific order. Before the robot drove forward, it had to check for a flame and then check for a wall.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-571\" src=\"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-content\/uploads\/sites\/1698\/2022\/12\/IMG_5143-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Program<\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0Throughout the semester I wrote code to control the sensors and stepper motors individually. To control the robot and blow out the flame multiple programs had to be combined. Using functions was unique to this project and many if-statements were used to give the robot the ability to make \u201cchoices\u201d. Joshua did most of the extra coding that was needed to combine the separate programs. We used functions to make the robot drive forwards, backwards, left, right, and pivot. If we hadn\u2019t used functions, the robot would have just spun in a circle. This is because only one wheel can spin at a time. The function still makes the wheels spin one at a time, but it alternates between the two motors so quickly that the robot can drive straight\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0In the early stages of testing, the robot would start the maze by turning instead of driving forwards. I figured out that the problem was the ultrasonic sensor was detecting our hands while we were setting it on the ground. The solution was to add an 8 sec delay before the actual program started. When the ultrasonic sensor started detecting impossible values, I solved the issue by inserting a piece of code that Dr. Harris showed me from a different project I used an if-statement with a maximum value to \u201cthrow away\u201d readings that were too high. This prevented the robot from acting based on faulty data. My biggest contribution to the programming of the robot was figuring out how the if-statements needed to be written. The nested if-statements makes the robot capable of checking 2 directions before making the decision to drive forwards or turn. Here is a picture of the pseudocode that I wrote.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-568\" src=\"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-content\/uploads\/sites\/1698\/2022\/12\/IMG_5931-1-230x300.jpg\" alt=\"\" width=\"276\" height=\"360\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Final Product<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-557\" src=\"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-content\/uploads\/sites\/1698\/2022\/12\/IMG_5136-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Conclusion<\/h3>\n<p><span style=\"font-weight: 400;\">\u00a0 \u00a0 \u00a0Overall, this project was really fun and helped introduce me to engineering in a unique way. It wasn\u2019t too difficult and the experience I gained in CAD and programming will be useful in future classes. If I did this project again, I would 3D print a hollow chassis that could contain all of the wires and electronics. I would also write a flame function in the program. Currently, the entire flame if-statement loop is copied wherever it is needed and this makes the program very hard to read and debug.\u00a0<\/span><\/p>\n<p>&nbsp;<\/p>\n<h3>Demo<\/h3>\n<p><iframe loading=\"lazy\" style=\"border: 1px solid #464646;\" src=\"https:\/\/wcu.hosted.panopto.com\/Panopto\/Pages\/Embed.aspx?id=7488fa11-c251-411b-8690-af6d016ea872&amp;autoplay=false&amp;offerviewer=true&amp;showtitle=true&amp;showbrand=true&amp;captions=false&amp;interactivity=all\" width=\"720\" height=\"405\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Intro \u00a0 \u00a0 \u00a0In my ENGR 199 (Intro to Engineering Practice and Principles) class, taught by Dr. Adam Harris, I had a group project instead of the traditional test for a final. The project was to build a robot that could \u201csolve\u201d a maze and blow out a small flame. My teammates, Joshua and Shaneil [&hellip;]<\/p>\n","protected":false},"author":1919,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-engr-199-fall-2022"],"_links":{"self":[{"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/users\/1919"}],"replies":[{"embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":11,"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":575,"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/posts\/551\/revisions\/575"}],"wp:attachment":[{"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/portfolio.wcu.edu\/hjhester1\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}