{"id":8226,"date":"2023-10-29T21:08:02","date_gmt":"2023-10-29T20:08:02","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=8226"},"modified":"2023-10-29T21:08:02","modified_gmt":"2023-10-29T20:08:02","slug":"keeping-up-with-the-microbros-week-10","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=8226","title":{"rendered":"Keeping Up With the MicroBros &#8211; Week 10"},"content":{"rendered":"\n<p>This week we competed in the robot drag race and got second place out of four! \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f389.png\" alt=\":tada:\" width=\"20\" height=\"20\"> The main limiting factor was the janky plastic-geared TT-motors in the Mecanum car kit having quite limited speed, however (even though it was remote controlled) it did work, so that is something \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f642.png\" alt=\":slight_smile:\" width=\"20\" height=\"20\"> .<\/p>\n\n\n\n<p>After the drag race (with candy won in hand \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f36c.png\" alt=\":candy:\" width=\"20\" height=\"20\">) we started working on decisions for placement of sensors to attach this week, it made sense to put the HC-SR04 ultrasonic ones in front and back as the requirement for low range and short latency is lower than the sides that we need to avoid bumping into walls. On the sides custom IR sensor assemblies from Iver is getting connected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Jonathan \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f9d9-200d-2642-fe0f.png\" alt=\":man_mage:\" width=\"20\" height=\"20\"><\/h2>\n\n\n\n<p>&nbsp;Shortly after the drag race we had a first iteration of a mouse that could sense front\/left\/right, rotate, strafe and adjust speed based on walls in proximity. So at this point we know that we have somewhat control of the mouse, and need only implement the \u201csmart\u201d functionality.<\/p>\n\n\n\n<p>My tasks going forward is to perfect the PID controller that should make sure the mouse is centerred and perpendicular (more tuning is needed), and recognize walls in the correct tile while keeping track of what tile the mouse is in.<\/p>\n\n\n\n<p>Some work has been done to start it off: Here\u2019s how we currently calculate forward \/ strafe \/ rotation:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"609\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-17.png\" alt=\"\" class=\"wp-image-8227\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-17.png 811w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-17-300x225.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-17-768x577.png 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/figure>\n\n\n\n<p>Furthermore, I\u2019ve implemented a moving average filter to cancel out \u201cjumpy\u201d sensor values:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"383\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1.png\" alt=\"\" class=\"wp-image-8228\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1.png 727w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1-300x158.png 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/figure>\n\n\n\n<p>Lastly, I\u2019ve added methods to find minima and maxima when turning to determine when a turn is finished (since we cant rely on sensor values mid-turn):<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"533\" height=\"442\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-18.png\" alt=\"\" class=\"wp-image-8229\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-18.png 533w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-18-300x249.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Mats \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f9d1-200d-1f4bb.png\" alt=\":technologist:\" width=\"20\" height=\"20\"><\/h2>\n\n\n\n<p>Other than the drag race, planning the sensing and helping out with debugging I\u2019ve been fairly busy with other subjects, university things, and preparing to enter the workforce \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f4aa.png\" alt=\":muscle:\" width=\"20\" height=\"20\"> . Still I have put time in to ensure goals within the project timeline are met.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Remote debugging<\/h3>\n\n\n\n<p>I\u2019ve implemented a BLE service to start\/stop running autonomously, manually stepping moving one tile and see live positioning \/ state of maze.<\/p>\n\n\n\n<p>Implementing these was just like the remote motor control quite a journey as the BLE Generic Attribute Profile is not really meant to be used for RPC.<\/p>\n\n\n\n<p>Some things like update of position, maze updates and start\/stop uses notify instead of polling to avoid wasting the CPU-time of the Micro:bit.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"589\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-2-1024x589.png\" alt=\"\" class=\"wp-image-8230\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-2-1024x589.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-2-300x173.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-2-768x442.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-2-1536x884.png 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-2.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Remote controls and state of MicroMouse<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Iver \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f474.png\" alt=\":older_man:\" width=\"20\" height=\"20\"><\/h2>\n\n\n\n<p>This week I have been assembling the car. This has mainly consisted of finding a place for the sensors and building them so they can fit on the car.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1-768x1024.jpg\" alt=\"\" class=\"wp-image-8231\" width=\"601\" height=\"801\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1-768x1024.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1-225x300.jpg 225w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1-1152x1536.jpg 1152w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1-1536x2048.jpg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-1-1.jpg 1600w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><\/figure>\n\n\n\n<p>The IR-sensors were placed inside the car on the sides. I soldiered them to one prototype board each and made sure that the diodes were alone on one side of the board. Then I made holes in the car to stick them through the plastic between the wheels.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-2-1-768x1024.jpg\" alt=\"\" class=\"wp-image-8232\" width=\"546\" height=\"727\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-2-1-768x1024.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-2-1-225x300.jpg 225w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-2-1-1152x1536.jpg 1152w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-2-1-1536x2048.jpg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2023\/10\/Untitled-2-1.jpg 1600w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/figure>\n\n\n\n<p>The sonar sensors fit perfectly between the wheels in the front and back of the car. So I used some velcro tape to fasten the sensors. All in all it was a good result I think. I hope the solider sticks, as the sensor I had finished had to be fixed again when I got home.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Next week on Keeping Up With the MicroBros \u200b<img loading=\"lazy\" decoding=\"async\" width=\"20\" height=\"20\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1fac2.png\" alt=\":people_hugging:\"><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Babies (robot) first autonomous step<\/li>\n\n\n\n<li>First turn? \u200b<img loading=\"lazy\" decoding=\"async\" width=\"20\" height=\"20\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f697.png\" alt=\":red_car:\"><\/li>\n\n\n\n<li>Calibrated IR sensors with signal processing (maybe)<\/li>\n\n\n\n<li>More Math. \u200b<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/pf-emoji-service--cdn.us-east-1.prod.public.atl-paas.net\/standard\/caa27a19-fc09-4452-b2b4-a301552fd69c\/32x32\/1f393.png\" alt=\":mortar_board:\" width=\"20\" height=\"20\"><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This week we competed in the robot drag race and got second place out of four! \u200b The main limiting factor was the janky plastic-geared TT-motors in the Mecanum car kit having quite limited speed, however (even though it was remote controlled) it did work, so that is something \u200b . After the drag race [&hellip;]<\/p>\n","protected":false},"author":95,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8226","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/8226","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\/95"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8226"}],"version-history":[{"count":1,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/8226\/revisions"}],"predecessor-version":[{"id":8233,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/8226\/revisions\/8233"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}