{"id":8217,"date":"2023-10-29T18:41:17","date_gmt":"2023-10-29T17:41:17","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=8217"},"modified":"2023-10-30T10:47:06","modified_gmt":"2023-10-30T09:47:06","slug":"andreas","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=8217","title":{"rendered":"Group 1 &#8211; Week 9"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Andreas<\/h2>\n\n\n\n<p>This week has been very unproductive as I was sick for most of it, though I began to feel better this Thursday, so I have been trying to work with smart systems and my exam in PCB design. Despite this, I have tried to assist Bendik in implementing digital filtering with mediocre success. This comes from some bad research before attempting to implement the function. Though I believe we are on the right track now, making a good filter is quite close to accomplished.<\/p>\n\n\n\n<p>Looking at last week&#8217;s work I used MATLAB to find the filter coefficients I need to create a filter. I originally began implementing the transfer function directly without considering the plane I was working in, giving us very weird results when testing on the actual prototype. Hopefully, we will be able to implement the new filter function I have found, and with some luck, it will work perfectly.<\/p>\n\n\n\n<p>Until this is done all other tasks are set on the back burner since precise sensory input has to be the backbone of our autonomous movement.<\/p>\n\n\n\n<p>The next week will be spent trying to implement this filter with Bendik, and plan how we will use the rotary encoders, including how we will mount them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bendik<\/h2>\n\n\n\n<p>This weekend has been spent soldering the IR sensors, as well as implementing a digital filter with the help of Andreas.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"355\" height=\"378\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-154.png\" alt=\"\" class=\"wp-image-8218\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-154.png 355w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-154-282x300.png 282w\" sizes=\"auto, (max-width: 355px) 100vw, 355px\" \/><\/figure>\n\n\n\n<p>I am aware that the soldering does not look great, but it is a temporary solution until Andreas is able to make a PCB. It functions as it should. The sensors are now soldered directly to the pins on the microbit via the motor driver board.<\/p>\n\n\n\n<p>I tried to implement a band-pass filter using a formula from the book that Jan-Dyre talked about when he gave his lecture on signal processing. This is the formula:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"164\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-155.png\" alt=\"\" class=\"wp-image-8219\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-155.png 940w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-155-300x52.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-155-768x134.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p>Here the x\u2019es are input values and the y\u2019es are output values.<\/p>\n\n\n\n<p>To calculate the coefficients I had these formulas:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"403\" height=\"685\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-156.png\" alt=\"\" class=\"wp-image-8220\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-156.png 403w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-156-176x300.png 176w\" sizes=\"auto, (max-width: 403px) 100vw, 403px\" \/><\/figure>\n\n\n\n<p>Where BW is the band width that I want to pass, and f is the target frequency. However, using a target frequency of 10 Hz, which the frequency of our IR LED, and a BW of 2, still only gave messy results. I consulted Andreas on this, and he suggested using a 4<sup>th<\/sup> order Butterworth bandpass filter and he used MatLab to calculate the coefficients. After implementing, this was the result:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Screenshot_20231030_083620_Gallery-778x1024.jpg\" alt=\"\" class=\"wp-image-8267\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Screenshot_20231030_083620_Gallery-778x1024.jpg 778w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Screenshot_20231030_083620_Gallery-228x300.jpg 228w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Screenshot_20231030_083620_Gallery-768x1011.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Screenshot_20231030_083620_Gallery.jpg 1080w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/figure>\n\n\n\n<p>This is much closer to a good filter then we have been before, so I think we are on the right track. That\u2019s it for now, me and Andreas will look closer into this the coming week.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Marte<\/h2>\n\n\n\n<p>This week I have been working on improving the wheels grip and started designing the motor encoder.<\/p>\n\n\n\n<p>After having a talk with Richard Monday morning, he gave me a tip to research the use of rubber O-ring to substitute the rings printed in TPU, surrounding the wheels.<\/p>\n\n\n\n<p>I went straight to Tess and found fitting measures for the O-rings by trying them on one of the wheels. I ended up buying 4 O-rings, two for each wheel \u2013 and it gave a big improvement in friction.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"809\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-157.png\" alt=\"\" class=\"wp-image-8221\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-157.png 940w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-157-300x258.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-157-768x661.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p>Next on the agenda was to start working on the motor encoder. We want to use motor encoders to obtain information about speed, position and direction. Unfortunately, Andreas was sick this week, but we had already decided on using what optical encoder we wanted to use last week. Steven ordered them last week, and they had arrived already.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"199\" height=\"448\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-158.png\" alt=\"\" class=\"wp-image-8222\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-158.png 199w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-158-133x300.png 133w\" sizes=\"auto, (max-width: 199px) 100vw, 199px\" \/><figcaption class=\"wp-element-caption\">Photomicrosensor (Transmissive) \u2013 EE-SX3081\/-SX4081<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-159.png\" alt=\"\" class=\"wp-image-8223\" width=\"462\" height=\"593\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-159.png 462w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/image-159-234x300.png 234w\" sizes=\"auto, (max-width: 462px) 100vw, 462px\" \/><\/figure>\n\n\n\n<p>Steven gave me a tip about how to deisgn the disc, especially considering how many transparent segments that would be needed. It would be smart to start with a minimum, and later increase if needed.<\/p>\n\n\n\n<p>I then modelled the sensor in SolidWorks, and designed a disc. The disc modelled is only 15mm in diameter and the eight transparent segments are only 2mm in height and 1mm in width. It would be important to have consistency and accuracy in placement of the segments, so after talking with Richard about manufacturing techniques, I will try to produce the disc both with plywood and a laser cutter and with 3D printed PLA. After production we will test and decided which one gives the best result.<\/p>\n\n\n\n<p>Next week I will continue working with the motor encoders together with Andreas. In addition I will work on a new design for the MicroMouse with smaller motors (we are removing the gear box on both motors).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Vendel<\/h2>\n\n\n\n<p>As everyone seemed to have things mostly under control this week, I focused still on the bits to follow the drag race, judging that there wouldn\u2019t be much to gain by being an extra pair of eyes on the digital filters or the motor encoders.&nbsp;<\/p>\n\n\n\n<p>The mouse now can know that it exists, and that there are cells adjacent to it. I broke the code in multiple places trying to implement walls existing, but it has gone back to working again, now with walls, particularly walls preexisting along the perimeters of the maze. Turning the array three-dimensional to fit both the distance from the goal and the wall info broke the pretty display in the console print, but I guess we will just have to deal with that. It\u2019s just a visual aid for us humans after all.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"366\" height=\"493\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Skjermbilde-2023-10-30-091401-1.png\" alt=\"\" class=\"wp-image-8285\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Skjermbilde-2023-10-30-091401-1.png 366w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Skjermbilde-2023-10-30-091401-1-223x300.png 223w\" sizes=\"auto, (max-width: 366px) 100vw, 366px\" \/><\/figure>\n\n\n\n<p>This is the bottom row of the maze, \u201cobviously\u201d. Isn\u2019t it beautiful! Or not.&nbsp;<\/p>\n\n\n\n<p>My reasoning was to use a four bit style encoding, one for each of the walls, giving me a number between 0 and 15 for each cell, representing whether or not it had a wall in the given orientation, zero being no walls, then in binary going from left to right: west, south, east and north. In Python this is done with integers, but the hope is to do this all the way down at the bit level in an optimal implementation, with the data of each cell fitting in 12bits, one byte for the distance from the goal(an integer up to 255), and a nibble for the wall data. Considering the space we have available on the Micro:Bit however, this isn\u2019t a major concern. Could the map take less than a kilobyte of space? Sure, but with several megabytes of available space, making it work at all is far more important than making it fit in the smallest possible space.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"769\" height=\"415\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Skjermbilde-2023-10-30-100223-1.png\" alt=\"\" class=\"wp-image-8284\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Skjermbilde-2023-10-30-100223-1.png 769w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Skjermbilde-2023-10-30-100223-1-300x162.png 300w\" sizes=\"auto, (max-width: 769px) 100vw, 769px\" \/><\/figure>\n\n\n\n<p>Deceptively simple, isn\u2019t it? Hopefully it will stay that way, but there is plenty of code hidden behind the functions. Some of it I\u2019m suspecting is needlessly complicated.&nbsp;<\/p>\n\n\n\n<p>But the long and short of it is that the map now has the capacity for walls, and I have outlined a filter to check for the walls being there or not, making both exploration and pathfinding possible.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Andreas This week has been very unproductive as I was sick for most of it, though I began to feel better this Thursday, so I have been trying to work with smart systems and my exam in PCB design. Despite this, I have tried to assist Bendik in implementing digital filtering with mediocre success. This [&hellip;]<\/p>\n","protected":false},"author":94,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8217","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/8217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/users\/94"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8217"}],"version-history":[{"count":5,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/8217\/revisions"}],"predecessor-version":[{"id":8286,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/8217\/revisions\/8286"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}