{"id":11492,"date":"2025-10-13T22:37:05","date_gmt":"2025-10-13T21:37:05","guid":{"rendered":"https:\/\/dronesonen.usn.no\/?p=11492"},"modified":"2025-10-13T22:48:01","modified_gmt":"2025-10-13T21:48:01","slug":"hydrawlics-week-8","status":"publish","type":"post","link":"https:\/\/dronesonen.usn.no\/?p=11492","title":{"rendered":"Hydrawlics &#8211; Week 8:"},"content":{"rendered":"\n<p><br>Hello and welcome back!\ud83d\udc4b<\/p>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<p>This week marked another milestone for the Hydrawlics team. We completed our midterm presentation, and it went really well! With Sprint 3 now behind us, we\u2019re starting to see more and more of the arm come to life; both physically and digitally.<\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile\" style=\"grid-template-columns:85% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Hydrawlics-Logo-1.png\" alt=\"\" class=\"wp-image-11545 size-full\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Hydrawlics-Logo-1.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Hydrawlics-Logo-1-300x300.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Hydrawlics-Logo-1-150x150.png 150w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Hydrawlics-Logo-1-768x768.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p><\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<p>Here\u2019s what the team has been working on this week \ud83d\udc47<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Fredrik:<\/h2>\n\n\n\n<p>This week we completed sprint 3. From the mechanical side, our goal was to have a prototype of the arm structure. I was responsible for the arm segments, joints and end effector prototype.<\/p>\n\n\n\n<p>To achieve this, the layout first needed to be defined. I have played around with different arm segment lengths and cylinder placements for a couple of weeks now, to see how it would affect the drawing area and shape of the arm. The layout I landed on gives a large drawing area, but might demand too much from the hydraulic system. This will need to be tested when this is possible. The tentative layout is shown in the picture below. (The picture is for visualizing distances only, and is not a technical drawing)<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1459\" height=\"820\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-layout-edited.png\" alt=\"\" class=\"wp-image-11530\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-layout-edited.png 1459w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-layout-edited-300x169.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-layout-edited-1024x576.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-layout-edited-768x432.png 768w\" sizes=\"auto, (max-width: 1459px) 100vw, 1459px\" \/><\/figure>\n\n\n\n<p>Seeing as what we are currently developing is a prototype, I think it would be beneficial to design it with the ability to be disassembled. Earlier in this course, while working on the hydraulic cylinder, I fastened parts to each other by pressfit, without the ability to remove them again. This turned out to be a nuisance. Therefor, I wanted another non permanent way to fasten components, and turned to 3d-printed bolts. This is something I have wanted to learn how to do for a long time, and thought now would be the perfect opportunity. I watched some YouTube videos and tested for myself, and it worked great. It opened the door for secure fastening, with easy assembly and disassembly.&nbsp;<br><\/p>\n\n\n\n<p>While the arm segments would be made out of lasercut material, I decided that the joint should be made out of 3d-printed components. In the design, the two lasercut plates are separated with a bushing in between to prevent them from rubbing against each other. That would lead to a lot of friction, and variable friction area based on the position of the segments. PLA has relatively low friction against PLA, so I design the bushing and joint shaft accordingly. Finally, a bolt on each side to hold everything in place. I choose inner threads and a bolt over outer threads and a nut because I think it would be easier to print, and easier to assemble.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"972\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-drawing-1024x972.jpg\" alt=\"\" class=\"wp-image-11531\" style=\"width:288px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-drawing-1024x972.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-drawing-300x285.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-drawing-768x729.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-drawing.jpg 1030w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I have included images of the 3d-model of the joint below. I included notches in the interface with the lasercut plates, to lock their rotation to each joint component. Now the inner plate rotates with the bushing, and the outer plate rotates with the joint shaft. This ensures that all rotation takes place between the PLA components, and not the lasercut plates. Locking the outer plate to the joint shaft also ensures that the bolt&#8217;s rotation is always the same as the plate directly below it, greatly reducing the risk of it loosening during operation.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"643\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-section-1024x643.jpg\" alt=\"\" class=\"wp-image-11532\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-section-1024x643.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-section-300x188.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-section-768x482.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-section.jpg 1350w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"747\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-iso-1024x747.jpg\" alt=\"\" class=\"wp-image-11533\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-iso-1024x747.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-iso-300x219.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-iso-768x561.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-iso.jpg 1370w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>The arm segments was lasercut at school from mdf plates. After a couple of mishaps, the results looked promising. The plates seemed strong enough, and it was really cool to see the true scale of the arm segments. The printed parts fit together with the lasercut parts perfectly, and the joint system worked as intended. After successfully combining my design of the arm segments with Erlings design of the base, the arm structure was complete. This meant that we now need to finish designing and start implementing the hydraulic system, before we can run our first real tests.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"2560\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-printed-edited-scaled.jpg\" alt=\"\" class=\"wp-image-11535\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-printed-edited-scaled.jpg 1920w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-printed-edited-225x300.jpg 225w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-printed-edited-768x1024.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-printed-edited-1152x1536.jpg 1152w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Joint-printed-edited-1536x2048.jpg 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-building-1024x768.jpg\" alt=\"\" class=\"wp-image-11536\" style=\"width:369px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-building-1024x768.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-building-300x225.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-building-768x576.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-building-1536x1152.jpg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-building-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1080\" height=\"1080\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-complete-edited.jpg\" alt=\"\" class=\"wp-image-11538\" style=\"width:488px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-complete-edited.jpg 1080w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-complete-edited-300x300.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-complete-edited-1024x1024.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-complete-edited-150x150.jpg 150w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Arm-complete-edited-768x768.jpg 768w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><figcaption class=\"wp-element-caption\">Finished arm structure, including Erling&#8217;s base design<\/figcaption><\/figure>\n\n\n\n<p>I didn&#8217;t have the time to include the end effector prototype in the physical model this week, but the 3d-model is shown below. It fits only one type of marker, but is fastened with bolts to enable easy swap for other designs. This design holds the marker down to the holder by elastic rubber band, which should at least be good enough for a prototype.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"936\" height=\"944\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/End-effector-prototype.jpg\" alt=\"\" class=\"wp-image-11540\" style=\"width:254px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/End-effector-prototype.jpg 936w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/End-effector-prototype-297x300.jpg 297w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/End-effector-prototype-150x150.jpg 150w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/End-effector-prototype-768x775.jpg 768w\" sizes=\"auto, (max-width: 936px) 100vw, 936px\" \/><\/figure>\n\n\n\n<p>The valves we ordered arrived this week, and need some attachment module for our tubes. Me and Erling was thinking of using push-in fittings, but realized this would cost around 500-600 NOK. We are therefor looking into alternatives. The valve has 1\/8 inch taper pipe threads, so I am looking into 3d-printing threads to match this. Using online resources to calculate the diameter and thread pitch, I managed to print an attachment that fit the valve surprisingly well. Safe to say I have learned a lot about threads this week. I think making sure it does not leak will be a challenge moving forward, but this is a good start.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"746\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-model.jpg\" alt=\"\" class=\"wp-image-11541\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-model.jpg 764w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-model-300x293.jpg 300w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1440\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-scaled.jpg\" alt=\"\" class=\"wp-image-11544\" style=\"width:370px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-scaled.jpg 2560w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-300x169.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-1024x576.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-768x432.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-1536x864.jpg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Valve-attachment-in-valve-edited-1-2048x1152.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Lisa:<\/h2>\n\n\n\n<p>After a week away, I\u2019m finally back in full swing and ready to continue developing.<br>This week, we successfully held our midterm presentation, which I think went really well! After the presentation, I continued focusing on my task, which was to <strong>extrapolate the angle of the potentiometer<\/strong> used to measure the rotation of one of our hydraulic joints (J-2), as shown in the figure below.<br><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"966\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_2-966x1024.png\" alt=\"\" class=\"wp-image-11501\" style=\"width:243px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_2-966x1024.png 966w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_2-283x300.png 283w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_2-768x814.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_2.png 1203w\" sizes=\"auto, (max-width: 966px) 100vw, 966px\" \/><figcaption class=\"wp-element-caption\">Overview<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<p><strong>Understanding the challenge<\/strong><br>A potentiometer provides an analog voltage signal that varies as it rotates. The Arduino reads this signal as a number between 0 and 1023, this is also known as the ADC (Analog-to-Digital Conversion) value. However, this raw number doesn\u2019t directly tell us the joint\u2019s angle in degrees. To make the data useful, it had to be converted into a physical angle that matches the actual movement of the joint.<\/p>\n\n\n\n<div class=\"wp-block-media-text is-stacked-on-mobile is-vertically-aligned-bottom\" style=\"grid-template-columns:85% auto\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_27_00-2.png\" alt=\"\" class=\"wp-image-11526 size-full\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_27_00-2.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_27_00-2-300x300.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_27_00-2-150x150.png 150w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_27_00-2-768x768.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<p><\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<p><strong>Establishing the ADC angle<\/strong><br>To obtain specific and accurate angle values from the potentiometer, I first needed to <strong>calibrate the system<\/strong>. A potentiometer only gives raw analog readings (0\u20131023), so to make these meaningful, I had to map them to the actual physical angles of the joint.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Turned the potentiometer to its <strong>minimum position<\/strong> and recorded the lowest ADC value (<em>a_min<\/em>).<\/li>\n\n\n\n<li>Rotated it to the <strong>maximum position<\/strong> and recorded the highest ADC value (<em>a_max<\/em>).<\/li>\n<\/ol>\n\n\n\n<p>From simulations, we know that J-2 moves between <strong>54\u00b0 (min)<\/strong> and <strong>98.2\u00b0 (max)<\/strong>.<\/p>\n\n\n\n<p class=\"has-text-align-left\">With these two known points, we can describe a linear relationship between ADC readings (<em>a<\/em>) and the corresponding angle (<em>\u03c6<\/em>):<\/p>\n\n\n\n<p class=\"has-text-align-center\"><em>\u03c6<\/em>=m\u22c5a+b<\/p>\n\n\n\n<p class=\"has-text-align-left\">where;<br><strong>m: <\/strong>&nbsp;is the slope (degrees per ADC step)<br><strong>b: <\/strong>&nbsp;is the offset ensuring the output starts at the correct base angle.<br><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"382\" height=\"662\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_1-1.png\" alt=\"\" class=\"wp-image-11502\" style=\"width:255px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_1-1.png 382w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilL_1-1-173x300.png 173w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/figure>\n\n\n\n<p>This means that each ADC step corresponds to roughly <strong>0.043\u00b0<\/strong> of rotation.<br><br><strong>Implementation&nbsp;<\/strong><\/p>\n\n\n\n<p>Once calibrated, I implemented the formula in code and connected a <strong>LCD display<\/strong> to visualize the live angle values. The screen now shows the current <strong>angle in degrees<\/strong>, along with a <strong>progress bar<\/strong> that moves as the joint rotates. When the potentiometer reaches its limits, the display clearly indicates <strong>\u201cMIN\u201d<\/strong> or <strong>\u201cMAX\u201d<\/strong>.<\/p>\n\n\n\n<p>This small addition turned out to be incredibly useful, and it gave a nice, interactive feel to the setup.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_3527.mp4\"><\/video><figcaption class=\"wp-element-caption\">Angle values from potentiometer<\/figcaption><\/figure>\n\n\n\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\n<p><strong>Relay testing<\/strong><br>With the potentiometer system up and running, I looked attesting the 8-channel relay module, and the main goal was simply to confirm that everything worked as expected. The relays will later be used to control the pumps and valves in our hydraulic system, but for now, I focused on getting the basic setup running.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"683\" height=\"1024\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_32_19-683x1024.png\" alt=\"\" class=\"wp-image-11508\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_32_19-683x1024.png 683w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_32_19-200x300.png 200w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_32_19-768x1152.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/ChatGPT-Image-13.-okt.-2025-21_32_19.png 1024w\" sizes=\"auto, (max-width: 683px) 100vw, 683px\" \/><figcaption class=\"wp-element-caption\">8-channel relay module<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>After identifying the control pins (IN1\u2013IN8), power, and logic connections, I uploaded a short test sketch to switch each relay on and off. All channels responded correctly, and the distinct clicking sound confirmed that the module was functioning properly.<\/p>\n\n\n\n<p>To make it a bit more fun, I also added a simple pattern where the relays activated one after another in quick succession<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_3533.mp4\"><\/video><figcaption class=\"wp-element-caption\">8-Channel Relay Module<\/figcaption><\/figure>\n\n\n\n<p>Overall, everything worked as intended! Everything from reading stable angle values in the potentiometer to controlling all eight relays in sequence.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Syver:<\/h2>\n\n\n\n<p>Hello! Last week we mentioned that much of the planning and design on the software side was done. We needed somewhere to test the software before we could integrate with the hardware. Therefore, the next natural step was to enter The Matrix and test our arm there. This is what I\u2019ve done this week.<\/p>\n\n\n\n<p>To build the simulation, I first needed the mechanical specifications. Our mechanical engineers have defined a preliminary layout for each joint, arm segment and piston; fully defining the domain of freedom. See Fredrik\u2019s part for the diagram. Using this, I started throwing together its ugly twin in Unity.<\/p>\n\n\n\n<p>This was new territory for me. I haven\u2019t really had any experience in Unity or C# before, so some time went into learning how it works, with AI as my tutor and assistant. After a while, I got the hang of the scripting basics, and implementing code went a lot smoother. I grew to enjoy the way C# interfaces with game objects through tooltips on public variables, which made it really simple to treat each joint as an instance of a class, and assign the HydraulicJoint script to each of the joints.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"615\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlSy_1-1024x615.png\" alt=\"\" class=\"wp-image-11516\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlSy_1-1024x615.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlSy_1-300x180.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlSy_1-768x461.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlSy_1.png 1277w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">The Unity object tree and viewport<\/figcaption><\/figure>\n\n\n\n<p>The hierarchy of the Unity objects makes the movement pretty intuitive. Being a child of an object means that you rotate with it. In this case, if Joint1 rotates, all its child segments and joints will rotate with it, propagating movement outwards. This is perfect for structuring our arm segments.<\/p>\n\n\n\n<p>With the game objects in place, we need to rotate the joints (and thus their children) to a given target orientation. Each Joint object, seen in the object tree on the left, has its own HydraulicJoint.cs script attached handling rotation. A simple task at surface level, but we wanted the simulation to include as many of the real-world elements as possible. This includes the binary valve switching and piston placements, making the implementation a tad bit harder.<\/p>\n\n\n\n<p>First, we need target angles for each joint. Accurately modeling piston movement is challenging because the pump\u2019s flow rate is hard to predict. Therefore, each joint is using potentiometers for angle feedback with PID-control for correction. This isn\u2019t ideal for quickly following predefined values, but we can mitigate inconsistencies through positional \u201ccheckpoints\u201d for each vertex\/command, as well as lowering the speed or flow rate. PID should be enough for our project requirements, though other control methods might be worth checking out if we have time.<\/p>\n\n\n\n<p>Using these outputs, we can convert the corrective values into duty cycles. These are fed into a valve simulator, multiplying the piston direction with the guesstimated piston velocity if within the PWMs on-state. This would\u2019ve been fairly straightforward if it weren\u2019t for the mechanical 5Hz action frequency limit of both the relays and the solenoids. This means that the smallest interval between two state toggles is 0.2s. The maths can be seen below, but in summary, with a 1Hz PWM frequency, we need to clamp the duty cycle to 0%, 20%-80%, 100% as seen in the bottommost graph. This will somewhat degrade the resolution in movement, but we already knew this would be a limitation to some degree.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"773\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilSy_2-1024x773.png\" alt=\"\" class=\"wp-image-11517\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilSy_2-1024x773.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilSy_2-300x226.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilSy_2-768x580.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilSy_2.png 1122w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Some scribbles visualizing the PWM clamping<\/figcaption><\/figure>\n\n\n\n<p>Once these elements were implemented, the virtual arm was moving as expected! Each joint\u2019s target angle can be manipulated with the arrow keys. Having this interactive model made it much easier to visualize the different piston movements, including speed, stability and the performance of the PID-controller. See the arm in action!:<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Skjermopptak_fra_2025-10-13_21-07-28.mp4\"><\/video><\/figure>\n\n\n\n<p>The next step will be to add a virtual whiteboard where the arm can draw. After that\u2019s landed, we\u2019ll implement the reverse kinematics, which will be much easier with this virtual arm, keeping our software bugs from having any real world consequences (yet).&nbsp;<\/p>\n\n\n\n<p>This Unity project is our third and final project repository, available at <a href=\"https:\/\/github.com\/7RST1\/hydrawlics-sim-unity\">https:\/\/github.com\/7RST1\/hydrawlics-sim-unity<\/a>. The scripts discussed in this blog post are Scripts\/HydraulicJoint.cs and Scripts\/HydraulicArmController.cs.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Emory:<\/h2>\n\n\n\n<p>This week, I continued working on the code to convert coordinates into G-code. The code starts with read_coords, which reads the coordinates from the csv file that contains the polygon IDs and the x, y coordinates for them. The longest part of this part of the code is to make sure that each polygons get saved separately and then saved into ID.<\/p>\n\n\n\n<p>Then path_to_gcode converts all the coordinates into g-code commands. It starts with setting the header and then getting to the starting point. It got a set z_safe, which is the safe height it starts at. After each polygon, it draws it goes back to the start point G0, it also goes back to G0 when it\u2019s drawn.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"786\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_1.png\" alt=\"\" class=\"wp-image-11509\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_1.png 752w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_1-287x300.png 287w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"833\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_2.png\" alt=\"\" class=\"wp-image-11510\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_2.png 987w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_2-300x253.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_2-768x648.png 768w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/><\/figure>\n\n\n\n<p>I had a problem in the beginning with the output of the g-code coordinates, where they looked like this:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"627\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_3.png\" alt=\"\" class=\"wp-image-11511\" style=\"width:501px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_3.png 825w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_3-300x228.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm_3-768x584.png 768w\" sizes=\"auto, (max-width: 825px) 100vw, 825px\" \/><\/figure>\n\n\n\n<p>I solved this by realising the ID was being put into the x coordinates and the y into x. So by fixing this like the code above, the output looks correct. So now we get the g-code like the image below from the code.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"457\" height=\"652\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlEM4.png\" alt=\"\" class=\"wp-image-11512\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlEM4.png 457w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTIlEM4-210x300.png 210w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/figure>\n\n\n\n<p>This works in making sure the image is what we want it to be now in g-code, which is better for the arm to use for movements.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"797\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm5-1024x797.png\" alt=\"\" class=\"wp-image-11513\" style=\"width:561px;height:auto\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm5-1024x797.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm5-300x233.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm5-768x598.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/BildeTilEm5.png 1041w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I removed the minimize_path function for now, as it works fine for what we need it at the moment, and might add it later if we feel there\u2019s a need to optimise the drawing pattern.&nbsp;<br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Erling:<\/h2>\n\n\n\n<p><br>The week started with Midway presentation. Which to me seemed to go pretty well.<\/p>\n\n\n\n<p>This week we continued the development of our system. This week was the last week of Sprint 3 for us, where our goal was to have a &#8220;functional&#8221; prototype with 2 or 3 Degrees of Freedom.<\/p>\n\n\n\n<p>I took the preliminary design of the arm by Fredrik a few weeks ago, and did the detail design for the base of the arm so that it will function as we want it. In the image below we see the Azimuth axis of the arm at this stage of development. We are utilizing axial bearings in order to constrain the 5 other degrees of freedom in this joint of the arm. This design was chosen because it would be cheap for us to produce, and that we could realize it relatively quickly using 3D-Prints and laser cutting using the equipment at school.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"625\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/base-modell-1024x625.png\" alt=\"\" class=\"wp-image-11493\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/base-modell-1024x625.png 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/base-modell-300x183.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/base-modell-768x469.png 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/base-modell.png 1126w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p>Below we see a crosssection of the base of the arm. Here the Axial bearings are clearly visible in blue. In reality these aren&#8217;t actually purely <em>Axial<\/em> bearings, as the rolling elements are rolling in bearing races that slope. These are really comination bearings, and they serve both functions in this design. As the bolt in pink has a few millimeters of clearance to the holes, the bearing serves as the axis locator for the azimuth axis.<\/p>\n\n\n\n<p>I realized that we need two bearings for this to work in order for the bolt to not loosen under rotary movement of the base. This would result in loss of preload on the bearings, and ultimately lead to the base falling apart.<br>As this is important does not happen, i added a bearing between the stationary base and the nut, so that the whole bolt may turn with the rotary joint.<\/p>\n\n\n\n<p>For clarification; the large upper bearing is responsible for allowing a single rotary degree of freedom in the base of the arm, and the smaller lower bearing is there to allow the nut to rotate with the upper portion of the base in order to maintain preload on the larger bearing.<\/p>\n\n\n\n<p>The rolling elements are intended to be Airsoft BB pellets as they are sufficiently round, and hard enough for this application.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"479\" height=\"281\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/section-of-base.png\" alt=\"\" class=\"wp-image-11494\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/section-of-base.png 479w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/section-of-base-300x176.png 300w\" sizes=\"auto, (max-width: 479px) 100vw, 479px\" \/><\/figure>\n\n\n\n<p>At the same time, the hydraulic system development continues. We have recieved the valves that we ordered. Now the focus for the hydraulic system is getting all the miscellaneous part that we need in order to make the whole system work. That means that we need more PVC tube to fit our water pump, push to connect fittings and distribution manifolds for the valves. I plan to purchase the needed lenght of tube in the coming week. The push to connect fittings are another such item that will cost us more than 500kr if we were to purchase them, so we are looking into making our own solution for the project. more on that either in Fredrik&#8217;s part, or in the next blog post.<\/p>\n\n\n\n<p>I have made a model of a simple distribution manifold that uses the same pipe that Fredrik uses to build the pistons from, with 3D printed endcaps that allow the flow that we want. the caps can be glued on using 2part epoxy glue that has already been purchased, and the rest should be producable by us.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"956\" height=\"644\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Man-I-Fold.png\" alt=\"\" class=\"wp-image-11495\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Man-I-Fold.png 956w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Man-I-Fold-300x202.png 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/Man-I-Fold-768x517.png 768w\" sizes=\"auto, (max-width: 956px) 100vw, 956px\" \/><\/figure>\n\n\n\n<p>The image below shows the assembly as lasercut and assembled. This was a dry fit, so we hadn&#8217;t glues all the plates to each other yet. In this picture the BB pellets are also missing in the bearings.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_5264-1024x768.jpg\" alt=\"\" class=\"wp-image-11496\" srcset=\"https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_5264-1024x768.jpg 1024w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_5264-300x225.jpg 300w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_5264-768x576.jpg 768w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_5264-1536x1152.jpg 1536w, https:\/\/dronesonen.usn.no\/wp-content\/uploads\/2025\/10\/IMG_5264-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\" \/>\n\n\n\n<p class=\"has-text-align-center\">That\u2019s all for now, see you next week!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello and welcome back!\ud83d\udc4b This week marked another milestone for the Hydrawlics team. We completed our midterm presentation, and it went really well! With Sprint 3 now behind us, we\u2019re starting to see more and more of the arm come to life; both physically and digitally. Here\u2019s what the team has been working on this [&hellip;]<\/p>\n","protected":false},"author":116,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11492","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/11492","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\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11492"}],"version-history":[{"count":19,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/11492\/revisions"}],"predecessor-version":[{"id":11551,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=\/wp\/v2\/posts\/11492\/revisions\/11551"}],"wp:attachment":[{"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dronesonen.usn.no\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}