{"id":12450,"date":"2025-11-04T22:00:24","date_gmt":"2025-11-04T21:00:24","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=12450"},"modified":"2025-11-05T12:08:09","modified_gmt":"2025-11-05T11:08:09","slug":"aroweek-10","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=12450","title":{"rendered":"AROWEEK 10"},"content":{"rendered":"\n<p><strong>Week&nbsp;10<\/strong>&nbsp;<\/p>\n\n\n\n<p><strong>Bram van den&nbsp;Nieuwendijk<\/strong>&nbsp;<\/p>\n\n\n\n<p>This week, I started by laser cutting the base profiles to begin building the prototype. After the first round of laser cutting, I noticed some&nbsp;interface&nbsp;problems between the parts. I updated the designs and tried again, and this time it worked successfully.&nbsp;<\/p>\n\n\n\n<p>The frame of the car has now been built, so the next focus is on creating and testing the prototype for the rotating top frame. To do this,&nbsp;I\u2019ll&nbsp;need to do some more laser cutting and 3D&nbsp;print&nbsp;a few small parts.&nbsp;<\/p>\n\n\n\n<p>I also spent some time improving the visual design of the car model to make it look more appealing, instead of just a simple square box.&nbsp;<\/p>\n\n\n\n<p>We are still waiting for several parts to arrive, so the base frame&nbsp;hasn\u2019t&nbsp;been tested yet.&nbsp;There\u2019s&nbsp;a chance it might need to be updated later if the actual mounting holes turn out to be different from those in the 3D model.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"786\" height=\"651\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-41.png\" alt=\"\" class=\"wp-image-12463\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-41.png 786w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-41-300x248.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-41-768x636.png 768w\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" \/><\/figure>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<p><strong>Rick&nbsp;Embregts<\/strong>&nbsp;<\/p>\n\n\n\n<p>This&nbsp;week&nbsp;all parts have been&nbsp;shipped&nbsp;and the&nbsp;tests to test the boards are designed. See the tests in the images below.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"669\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-32.png\" alt=\"\" class=\"wp-image-12453\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-32.png 856w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-32-300x234.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-32-768x600.png 768w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"378\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-31.png\" alt=\"\" class=\"wp-image-12452\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-31.png 856w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-31-300x132.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-31-768x339.png 768w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/figure>\n\n\n\n<p>During this week we also found some problems with the electrical design.&nbsp;First&nbsp;priority&nbsp;is to get the entire system tested and operational.&nbsp;Afterword we can look for&nbsp;solutions&nbsp;to the problems.<\/p>\n\n\n\n<p><strong>Sulaf<\/strong><\/p>\n\n\n\n<p>This week, my focus shifted from standalone obstacle detection and avoidance to integration with the motion control system. \u00c5smund worked on the motor calibration and implemented speed control functions, which opened the door for me to eventually replace my simulated motor actions with real PWM-based commands.<\/p>\n\n\n\n<p><strong>Integration with Motion Control<\/strong><\/p>\n\n\n\n<p>Previously, my avoidance maneuvers were simple print statements for testing. Now, I am adapted them to use \u00c5smund\u2019s speed-setting functions to the best of my abilities, considering I am waiting for the 3D printing to test it out in real time, however I am still This means:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When an obstacle is detected, my module calls the calibrated speed function to stop the motors smoothly instead of abruptly.<\/li>\n\n\n\n<li>During avoidance, the robot can back up and turn using real speed values, interpolated from \u00c5smund\u2019s lookup table for PWM control.<\/li>\n<\/ul>\n\n\n\n<p><strong>Shared Flag System<\/strong><\/p>\n\n\n\n<p>The shared flag _is_blocked remains the core of communication between my module and navigation. The navigation system checks this flag before executing any movement.<\/p>\n\n\n\n<p><strong>Code Updates, Improvements &amp; Explanation<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"247\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-34.png\" alt=\"\" class=\"wp-image-12456\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-34.png 669w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-34-300x111.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/figure>\n\n\n\n<p>Still using threads for the detection and avoidance while navigating. Decided as usual to print the output to the console for easier debugging, and considering so far that is the only way I can check of the function I am doing are running as they should, seeing I am waiting for the other members responsible for the 3D printing and assembling the robot to be completely done. However, this still&nbsp; does not affect the code for obstacle detection and avoidance I am doing, having simulated results for the sensors. It is quite easy to replace them with actual readings later.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"264\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-35.png\" alt=\"\" class=\"wp-image-12455\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-35.png 743w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-35-300x107.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"86\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-36.png\" alt=\"\" class=\"wp-image-12458\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-36.png 625w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-36-300x41.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/figure>\n\n\n\n<p>The obstacle detection alerting if there is any obstacle by checking the sensors as always, and emergency stopping if needed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"660\" height=\"305\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-37.png\" alt=\"\" class=\"wp-image-12457\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-37.png 660w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-37-300x139.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/figure>\n\n\n\n<p>Here I maneuver around the obstacle when the object is detected, and decides which turn to take depending on the sensors.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"781\" height=\"274\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-40.png\" alt=\"\" class=\"wp-image-12461\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-40.png 781w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-40-300x105.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-40-768x269.png 768w\" sizes=\"auto, (max-width: 781px) 100vw, 781px\" \/><\/figure>\n\n\n\n<p>Making my own MotionControl that to simulate \u00c5smund\u2019s code. The reason being that I need a testable environment to validate my own obstacle detection and avoidance logic. By making a MotionControl Class, I can mimic \u00c5smund\u2019s interface (the set_motor_speed() and get_pwm_for_speed()), this way I can ensure compatibility early, further easing integration before it happens, rmaking sure that the integration will happen smoothly, and that my module and \u00c5smund\u2019s will work well together. This way I can also run this independently without depending on \u00c5smund or having to wait for the complete finished module, I can work on my own time and test my code early. Also, this way I can stimulate realistic behavior, so even though I am taking a small portion of \u00c5smund\u2019s part, it proves to be useful to my part at the end of the day.<\/p>\n\n\n\n<p><strong>Testing &amp; Results<\/strong><\/p>\n\n\n\n<p>Simulating the calibration and running the code:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"336\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-38.png\" alt=\"\" class=\"wp-image-12459\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-38.png 700w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-38-300x144.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>\n\n\n\n<p>Since the physical robot is still not available, I continued using simulated sensor readings. However, the motor commands now reflect actual PWM values rather than placeholders, making the transition to hardware more seamless for later.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"550\" height=\"438\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-39.png\" alt=\"\" class=\"wp-image-12460\" style=\"width:403px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-39.png 550w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-39-300x239.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/figure>\n\n\n\n<p>Here you can see the start, from navigating to detecting an obstacle (obstacle detection segment), stopping, then navigating around it (obstacle avoidance segment), then proceeding to navigate after the obstacle has been avoided and maneuvered around.&nbsp;This week has been quite fun, I got to integrate my module with a simulated module of \u00c5smund&#8217;s by my own recreation, keeping it as close to the possible end navigational system for the MotionControl function class, to ensure full integration.<\/p>\n\n\n\n<p><strong>\u00c5smund Wigen Thygesen<\/strong>&nbsp;<\/p>\n\n\n\n<p>This week my goal was to make a program to&nbsp;\u201ccalibrate\u201d&nbsp;the motors&nbsp;and implement the set motor speed functions in the motion control system.&nbsp;<\/p>\n\n\n\n<p>The calibration is pretty&nbsp;simple,&nbsp;I just&nbsp;need to run the motors with varying PWM and sample the speed it is going at each specific PWM value.&nbsp;Then we can graph it and\/or copy the values directly and use this to set the correct PWM value when we want to run the vehicle at a specific speed.&nbsp;<\/p>\n\n\n\n<p>This approach should be&nbsp;pretty reliable&nbsp;as long as&nbsp;we have the correct load when running the calibration.&nbsp;&nbsp;<\/p>\n\n\n\n<p>Implementation was&nbsp;pretty straight&nbsp;forward, set a&nbsp;pwm&nbsp;value on each motor, wait a little to make sure&nbsp;it&#8217;s&nbsp;up to speed, set the&nbsp;traveled&nbsp;distance to 0, save the current time and wait a predetermined amount of time.&nbsp;&nbsp;<\/p>\n\n\n\n<p>The distance variable will be updated with every encoder step in&nbsp;separate&nbsp;interrupt functions, then after the specified time we just&nbsp;divide the total distance for each motor by the&nbsp;time since&nbsp;we reset the distance.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"816\" height=\"387\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-33.png\" alt=\"\" class=\"wp-image-12454\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-33.png 816w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-33-300x142.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-33-768x364.png 768w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/figure>\n\n\n\n<p>Now we have a lookup table for speeds and the corresponding PWM value.&nbsp;<\/p>\n\n\n\n<p>Now for&nbsp;the implementation in the motion control system,&nbsp;we store the output from the calibration in a variable in the motion control system, then we mostly just need a function to convert a speed value to a PWM value.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"901\" height=\"157\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-42.png\" alt=\"\" class=\"wp-image-12466\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-42.png 901w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-42-300x52.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-42-768x134.png 768w\" sizes=\"auto, (max-width: 901px) 100vw, 901px\" \/><\/figure>\n\n\n\n<p>This is done by simply iterating through the lookup table until\u00a0we\u00a0find the first value that is greater than our desired speed. Then\u00a0since the speed is in ascending\u00a0order\u00a0we can interpolate between the closest value above and the closest value below the desired speed.\u00a0<\/p>\n\n\n\n<p>Then\u00a0it&#8217;s\u00a0just a matter of setting the motor direction and PWM accordingly<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"165\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-43.png\" alt=\"\" class=\"wp-image-12467\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-43.png 604w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-43-300x82.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Week&nbsp;10&nbsp; Bram van den&nbsp;Nieuwendijk&nbsp; This week, I started by laser cutting the base profiles to begin building the prototype. After the first round of laser cutting, I noticed some&nbsp;interface&nbsp;problems between the parts. I updated the designs and tried again, and this time it worked successfully.&nbsp; The frame of the car has now been built, so [&hellip;]<\/p>\n","protected":false},"author":114,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12450","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/12450","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\/114"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12450"}],"version-history":[{"count":4,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/12450\/revisions"}],"predecessor-version":[{"id":12468,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/12450\/revisions\/12468"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}