{"id":12676,"date":"2025-11-10T02:57:19","date_gmt":"2025-11-10T01:57:19","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=12676"},"modified":"2025-11-11T18:02:09","modified_gmt":"2025-11-11T17:02:09","slug":"pickmebot-week-10-2","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=12676","title":{"rendered":"PickMeBot-week 11"},"content":{"rendered":"\n<p><strong>Sondre:<\/strong><\/p>\n\n\n\n<p>This week was both fun and frustrating. I didn\u2019t manage to solve everything I planned, partly because another course needed attention, but I still made solid progress.&nbsp;<\/p>\n\n\n\n<p>The original sprint goal for these two weeks was to make the car navigate without touching the walls, which we actually finished earlier. Now that Theo is working on a maze-solving algorithm, my focus has shifted to making the car drive more smoothly through the path.&nbsp;<\/p>\n\n\n\n<p>To improve stability, I\u2019ve been combining the ultrasonic sensors and the IMU in a PID controller, and we also added motors with encoders as a backup in case the sensors give bad readings. Most of my time this week went into implementing these encoders.&nbsp;<\/p>\n\n\n\n<p>I first tried integrating Theo\u2019s servo code, but ran into a pin conflict: the pins he used were the same ones I needed for ESP32 communication. Moving the servos wasn\u2019t as simple as expected, since the ports use an external I2C driver, which would require bigger code changes. After wasting too much time on it, I put that issue on hold and will revisit it with Theo later.&nbsp;<\/p>\n\n\n\n<p>Even though not everything got solved, the encoder setup is progressing well, and the car is getting closer to driving as reliably as we want.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"167\" height=\"205\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-60.png\" alt=\"\" class=\"wp-image-12677\" \/><\/figure>\n\n\n\n<p>My next task was to install the new motors with encoders. We received some motors from Steven, but the encoder housing made them too large to fit in the chassis. Instead, I used the motors I bought earlier, which came without housings and had just enough space to fit, as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"189\" height=\"252\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-61.png\" alt=\"\" class=\"wp-image-12678\" \/><\/figure>\n\n\n\n<p>Next, I wired the encoders to the ESP32. Each motor has six wires: two for power to the motor, two for encoder signals, and two for encoder power. The signal wires went straight to the ESP32, while the 5V and ground were shared between the encoders, ESP32, and Micro:bit. For communication, the ESP32\u2019s RX pin was connected to the Micro:bit\u2019s TX pin, and vice versa.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"169\" height=\"224\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-62.png\" alt=\"\" class=\"wp-image-12679\" \/><\/figure>\n\n\n\n<p>After wiring everything, I used ChatGPT to generate a test program for the ESP32 to check if it could read position and speed data from the encoders. The test worked, as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"325\" height=\"171\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-63.png\" alt=\"\" class=\"wp-image-12680\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-63.png 325w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-63-300x158.png 300w\" sizes=\"auto, (max-width: 325px) 100vw, 325px\" \/><\/figure>\n\n\n\n<p>The next step was to send encoder data from the ESP32 to the Micro:bit. After updating the ESP32 code, I suddenly couldn\u2019t upload anything\u2014only error messages. I spent a long time troubleshooting (restarting the PC, switching USB ports, forcing boot mode, etc.), but the issue turned out to be simple: the RX and TX pins can\u2019t be connected during upload because they create noise on the board. Disconnecting them fixed it instantly.&nbsp;<\/p>\n\n\n\n<p>Then I tried writing the Micro:bit code to receive the data, but ran into another issue: the Micro:bit uses the mbed framework for UART, while we are coding in Arduino, which doesn\u2019t include a working UART by default. I tried creating a manual UART instance and even a software UART, but nothing worked. So instead of UART, I switched to I\u00b2C communication. It\u2019s slower, but much easier to implement\u2014and it also solved the pin conflict with the servos.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"104\" height=\"55\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-64.png\" alt=\"\" class=\"wp-image-12681\" \/><\/figure>\n\n\n\n<p>After flashing the updated ESP32 code and switching the connection to I\u00b2C, I modified the Micro:bit code and ran a test. Data did come through in the terminal, but it was just unreadable gibberish.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"122\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-65.png\" alt=\"\" class=\"wp-image-12682\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-65.png 623w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-65-300x59.png 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/figure>\n\n\n\n<p>And that\u2019s where I had to stop for the week.&nbsp;<\/p>\n\n\n\n<p><strong>Anette:<\/strong><\/p>\n\n\n\n<p>This week I have been looking at the pins we need for the microcontroller and compared it to the ones we already have on the microbit. I also looked into how I was going to design the circuit. When looking at the datasheet I found different reference circuits that I could use as a basis for the design. The circuit below is the one I am going to look at due to this being the only one containing an antenna.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"779\" height=\"519\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-66-edited-1.png\" alt=\"\" class=\"wp-image-12685\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-66-edited-1.png 779w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-66-edited-1-300x200.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-66-edited-1-768x512.png 768w\" sizes=\"auto, (max-width: 779px) 100vw, 779px\" \/><\/figure>\n\n\n\n<p>Having a reference circuit also helps because I will likely be unable to simulate the circuit in PSpice. This is due to there being no premade PSpice models for the NRF52833. It&#8217;s possible to make a custom model, but from my understanding this is a new and&nbsp; time-consuming process that I will not be able to finish in the limited time. I also started making a part library for the circuit so I can finally finish the design and proceed to the PCB itself. My goal is to finish the PCB before the end of next week at the latest, and I hope this is possible.<\/p>\n\n\n\n<p><strong>Matias:<\/strong><\/p>\n\n\n\n<p>This week I didn\u2019t make a lot of progress on the design itself. I mainly focused on checking how to order the PCB and understanding the process and requirements for submission. I also sent the <strong>BOM (Bill of Materials)<\/strong> to Steven so he could review it and make sure everything is ready before placing the order.<\/p>\n\n\n\n<p>It\u2019s been a lighter week in terms of hands-on work, but an important step toward getting the board manufactured. Hopefully, next week we can move forward with the PCB order and start preparing for the next stage of the project.<\/p>\n\n\n\n<p><strong>Robin:<\/strong><\/p>\n\n\n\n<p>Here, after finding all the components, I was able to add them to my electronic design software, and here is the result.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"535\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-85-1024x535.png\" alt=\"\" class=\"wp-image-12802\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-85-1024x535.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-85-300x157.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-85-768x401.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-85-1536x802.png 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/image-85-2048x1070.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"414\" data-id=\"12803\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/shema-elec-BMS-sans-batterrie-1024x414.jpg\" alt=\"\" class=\"wp-image-12803\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/shema-elec-BMS-sans-batterrie-1024x414.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/shema-elec-BMS-sans-batterrie-300x121.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/shema-elec-BMS-sans-batterrie-768x310.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/shema-elec-BMS-sans-batterrie-1536x620.jpg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/shema-elec-BMS-sans-batterrie-2048x827.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/figure>\n\n\n\n<p>Here, after finding all the components, I was able to add them to my electronic design software, and here is the result.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"413\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/First-simulation-1024x413.jpeg\" alt=\"\" class=\"wp-image-12804\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/First-simulation-1024x413.jpeg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/First-simulation-300x121.jpeg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/First-simulation-768x310.jpeg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/First-simulation-1536x619.jpeg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/11\/First-simulation-2048x825.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>On the third schematic, I removed the central chip because it isn&#8217;t easily simulatable in SPICE, but I am simulating the rest of the schematic to see the values I have at the input and see what I get.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th><strong>Type<\/strong><\/th><th><strong>Name<\/strong><\/th><th><strong>Value<\/strong><\/th><\/tr><\/thead><tbody><tr><td><\/td><td><\/td><td><\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.1)<\/td><td>1.657760795107259e-16<\/td><\/tr><tr><td>current<\/td><td>i(e.x_q1.egd)<\/td><td>-6.277435765354723e-21<\/td><\/tr><tr><td>current<\/td><td>i(e.x_q2.egd)<\/td><td>-8.579167147515032e-21<\/td><\/tr><tr><td>voltage<\/td><td>v(n_1)<\/td><td>8.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(n_2)<\/td><td>4.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(n_3)<\/td><td>1.200000000000000e+01<\/td><\/tr><tr><td>voltage<\/td><td>v(n_4)<\/td><td>1.200000000000000e+01<\/td><\/tr><tr><td>voltage<\/td><td>v(n_5)<\/td><td>4.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(n_7)<\/td><td>1.200000000000000e+01<\/td><\/tr><tr><td>voltage<\/td><td>v(n_8)<\/td><td>1.657760795107270e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(n_9)<\/td><td>8.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(n_10)<\/td><td>-1.079776969240537e-18<\/td><\/tr><tr><td>voltage<\/td><td>v(n_11)<\/td><td>1.662366746862610e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(n_12)<\/td><td>1.653514107423402e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(n_13)<\/td><td>-1.187754666164550e-18<\/td><\/tr><tr><td>voltage<\/td><td>v(n_14)<\/td><td>-4.036564748676257e-31<\/td><\/tr><tr><td>voltage<\/td><td>v(n_15)<\/td><td>1.653514107423402e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(n_16)<\/td><td>1.662366746862610e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(n_17)<\/td><td>1.662366746862610e-16<\/td><\/tr><tr><td>current<\/td><td>i(v.x_q1.vfb)<\/td><td>7.713284310313707e-31<\/td><\/tr><tr><td>current<\/td><td>i(v.x_q2.vfb)<\/td><td>4.484155085839415e-44<\/td><\/tr><tr><td>current<\/td><td>i(v_v1)<\/td><td>0.000000000000000e+00<\/td><\/tr><tr><td>current<\/td><td>i(v_v2)<\/td><td>0.000000000000000e+00<\/td><\/tr><tr><td>current<\/td><td>i(v_v3)<\/td><td>0.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.1)<\/td><td>1.657760795107269e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.2)<\/td><td>1.662366746862597e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.3)<\/td><td>1.662366746862610e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.12)<\/td><td>4.605951755327956e-19<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.13)<\/td><td>3.138716013698980e-21<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.14)<\/td><td>0.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q1.15)<\/td><td>4.574564557811399e-19<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.2)<\/td><td>1.653514107423402e-16<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.3)<\/td><td>1.079365239635769e-27<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.12)<\/td><td>-4.246687683857223e-19<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.13)<\/td><td>4.289583628900372e-21<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.14)<\/td><td>0.000000000000000e+00<\/td><\/tr><tr><td>voltage<\/td><td>v(x_q2.15)<\/td><td>-4.289583519043370e-19<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>I&#8217;m not yet sure if these values are correct. I need to check the datasheet for the main component. These values:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>voltage v(n_1) 8.000000000000000e+00<\/li>\n\n\n\n<li>voltage v(n_2) 4.000000000000000e+00<\/li>\n\n\n\n<li>voltage v(n_3) 1.200000000000000e+01<\/li>\n\n\n\n<li>voltage v(n_4) 1.200000000000000e+01<\/li>\n<\/ul>\n\n\n\n<p>&#8230;may not correspond to the main component.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sondre: This week was both fun and frustrating. I didn\u2019t manage to solve everything I planned, partly because another course needed attention, but I still made solid progress.&nbsp; The original sprint goal for these two weeks was to make the car navigate without touching the walls, which we actually finished earlier. Now that Theo is [&hellip;]<\/p>\n","protected":false},"author":113,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[104],"class_list":["post-12676","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-pickmebot"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/12676","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\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12676"}],"version-history":[{"count":4,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/12676\/revisions"}],"predecessor-version":[{"id":12805,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/12676\/revisions\/12805"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}