{"id":571,"date":"2022-04-29T20:48:08","date_gmt":"2022-04-29T20:48:08","guid":{"rendered":"http:\/\/fenstar.co\/wp\/?p=571"},"modified":"2022-05-18T17:04:43","modified_gmt":"2022-05-18T17:04:43","slug":"robut","status":"publish","type":"post","link":"https:\/\/fenstar.co\/wp\/?p=571","title":{"rendered":"Robut"},"content":{"rendered":"<p>I wanted to make a simple robot chassis that could have things added to it as needed.<br \/>\nI decided to go with some pz22gr9120r gearmotors because they are cheap (~$3 each) and easy to find. The 1:84 gear ratio and 6-24V operating range means that they aren&#8217;t going to be going very fast on a 2s or 3s battery pack, but for just playing around I think that robustness is more important.<\/p>\n<div id=\"attachment_572\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/fenstar.co\/wp\/?attachment_id=572\" rel=\"attachment wp-att-572\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-572\" class=\"size-medium wp-image-572\" src=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/desertbod-300x169.jpg\" alt=\"The top shell shown upside down.\" width=\"300\" height=\"169\" srcset=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/desertbod-300x169.jpg 300w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/desertbod-150x84.jpg 150w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/desertbod-1024x576.jpg 1024w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/desertbod-500x281.jpg 500w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/desertbod.jpg 1920w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-572\" class=\"wp-caption-text\">The top of the shell shown upside down, tanning in the desert<\/p><\/div>\n<p>The body has a 20 mm grid for attaching components and takes about 12 hrs to print. The bottom takes another 3.<\/p>\n<p><!--more--><\/p>\n<div id=\"attachment_573\" style=\"width: 950px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/fenstar.co\/wp\/?attachment_id=573\" rel=\"attachment wp-att-573\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-573\" class=\"size-large wp-image-573\" src=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/BodyRend-1024x354.jpg\" alt=\"R: face mount screws for gearbox  G: 20x20mm grid W: Melt inserts for attaching bottom B: holes for wires in\/out of body\" width=\"940\" height=\"325\" srcset=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/BodyRend-1024x354.jpg 1024w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/BodyRend-150x52.jpg 150w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/BodyRend-300x104.jpg 300w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/BodyRend-500x173.jpg 500w\" sizes=\"(max-width: 940px) 100vw, 940px\" \/><\/a><p id=\"caption-attachment-573\" class=\"wp-caption-text\"><strong>R:<\/strong> face mount screws for gearbox\u00a0 \u00a0<strong>G:<\/strong> 20x20mm grid\u00a0 \u00a0<strong>W:<\/strong> Melt inserts for attaching bottom\u00a0 \u00a0<strong>B:<\/strong> holes for wires in\/out of body<\/p><\/div>\n<p>The body has four mounts for the motors, which is\u00a0going to be unnecessary for almost everything, but there isn&#8217;t much point in not putting them in. The motor diameter is 22mm, so popping a common skate bearing into the motor mount should be trivial. I&#8217;d probably just do a press fit and then melt it in. The motor mounts include (<strong>R<\/strong>) a face mount with screw holes and a notch for the face profile as well as (<strong>M<\/strong>) clamps mounting the body when the bottom is put on.<\/p>\n<p>There are also (<strong>B<\/strong>) numerous holes for wires to pass through. The bottom plate is intended to be attached to the top using (<strong>W<\/strong>) (up to) 12 mount points with hot melt insert nuts. Accessories are intended to be attached to the top using (G) a 20 mm x 20 mm grid of holes.<\/p>\n<div id=\"attachment_580\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/fenstar.co\/wp\/?attachment_id=580\" rel=\"attachment wp-att-580\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-580\" class=\"size-medium wp-image-580\" src=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/CarBot-300x225.png\" alt=\"Bottom plate\" width=\"300\" height=\"225\" srcset=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/CarBot-300x225.png 300w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/CarBot-150x113.png 150w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/CarBot.png 1024w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/CarBot-400x300.png 400w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-580\" class=\"wp-caption-text\">Pretty simple. I put some slits and screw holes on the bottom for sensors.<\/p><\/div>\n<p>The bottom is mostly just intended to clam down the motors and protect the guts, but I added holes and stuff for more sensors. I figured maybe someone might want line following\u00a0or something. Someone wanted help with a setup where they controlled\u00a0mecanum wheels using a RC controller* so I slapped it together and it worked fine for that purpose.<\/p>\n<div id=\"attachment_575\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/fenstar.co\/wp\/?attachment_id=575\" rel=\"attachment wp-att-575\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-575\" class=\"size-medium wp-image-575\" src=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/RC-Mech-300x281.jpg\" alt=\"I don't care for these wheels.\" width=\"300\" height=\"281\" srcset=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/RC-Mech-300x281.jpg 300w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/RC-Mech-150x140.jpg 150w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/RC-Mech-321x300.jpg 321w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/RC-Mech.jpg 467w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-575\" class=\"wp-caption-text\">I don&#8217;t care for these wheels.<\/p><\/div>\n<p>I am not a big fan of omni wheels so I went back to &#8220;normal&#8221; ones. I made a mount for an Uno and a distance sensor and tried it out.<\/p>\n<div id=\"attachment_579\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/fenstar.co\/wp\/?attachment_id=579\" rel=\"attachment wp-att-579\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-579\" class=\"size-medium wp-image-579\" src=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/UnoSetup-300x276.jpg\" alt=\"Image of carbot\" width=\"300\" height=\"276\" srcset=\"https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/UnoSetup-300x276.jpg 300w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/UnoSetup-150x138.jpg 150w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/UnoSetup-326x300.jpg 326w, https:\/\/fenstar.co\/wp\/wp-content\/uploads\/2022\/04\/UnoSetup.jpg 634w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-579\" class=\"wp-caption-text\">The lack of traction could be an issue.<\/p><\/div>\n<p>It is\u00a0a lot more fun to put my hand in front of it and make it move forward and backward. The code I used is at the bottom of this post. It is pretty simple, but it does what I wanted it to do, which is to act as a prototyping bed that I can add stuff to and try out. The motors have enough torque that I can put a bit of weight on it and not worry about it stalling, and mounting more sensors is super easy.<\/p>\n<p>&nbsp;<\/p>\n<p>*is RC controller redundant? I feel like in this context in communicates what I mean so I&#8217;ll leave it.<\/p>\n<p><a href=\"https:\/\/fenstar.co\/wp\/?attachment_id=581\" rel=\"attachment wp-att-581\">CarPartsAPR2022<\/a>\u00a0(STL files used to print the car thing)<\/p>\n<pre>\/\/Simple arduno code to maintain a set distance to the object in front of it.\r\n\/\/Note that you may need to reset the arduno after plugging in the power\r\n\/\/to the motors so that the ESCs initialize correctly.\r\n#include &lt;Servo.h&gt;\r\n\r\nServo FRmotor;\r\nServo FLmotor;\r\nServo BRmotor;\r\nServo BLmotor;\r\n\r\n#define FRpin 6 \/\/rev\r\n#define FLpin 5 \/\/rev\r\n#define BRpin 9\r\n#define BLpin 10\r\n\r\n\/\/Trims for ESC\r\n#define TrimFR 5\r\n#define TrimFL 25\r\n#define TrimBR 0\r\n#define TrimBL 0\r\n\r\n\/\/Scale factors for conversion from % to \u00b5s\r\n#define MultiFR -5\r\n#define MultiFL -5\r\n#define MultiBR 5\r\n#define MultiBL 5\r\n\r\nvoid setup() \r\n{\r\n \/\/init motors -assign to pins\r\n FRmotor.attach(FRpin);\r\n FLmotor.attach(FLpin);\r\n BRmotor.attach(BRpin);\r\n BLmotor.attach(BLpin);\r\n delay(100);\r\n Serial.begin(9600);\r\n delay(100);\r\n}\r\n\r\nvoid loop() \r\n{\r\n delay(500);\r\n int dst = analogRead(A0); \/\/TOF IR used in analog mode\r\n Serial.println(dst); \/\/ for debug\r\n \/\/if (dst &gt; 400) {dst = 400;} \/\/If I wasn't sloppy\r\n allMotors( 100 - dst\/2); \/\/Maintiain set distance (value range is ~0-400)\r\n}\r\n\r\nvoid stopMotors() \r\n{\r\n MotFR(0);\r\n MotFL(0);\r\n MotBR(0);\r\n MotBL(0);\r\n}\r\n\r\nvoid maxMotors() \r\n{\r\n MotFR(100);\r\n MotFL(100);\r\n MotBR(100);\r\n MotBL(100);\r\n}\r\n\r\nvoid allMotors(int Spd) \r\n{\r\n MotFR(Spd);\r\n MotFL(Spd);\r\n MotBR(Spd);\r\n MotBL(Spd);\r\n}\r\n\r\nvoid MotFR(int Speed)\r\n{\r\n FRmotor.writeMicroseconds(TrimFR + 1500 + MultiFR * Speed);\r\n}\r\n\r\nvoid MotFL(int Speed)\r\n{\r\n FLmotor.writeMicroseconds(TrimFL + 1500 + MultiFL * Speed);\r\n}\r\n\r\nvoid MotBR(int Speed)\r\n{\r\n BRmotor.writeMicroseconds(TrimBR + 1500 + MultiBR * Speed);\r\n}\r\n\r\nvoid MotBL(int Speed)\r\n{\r\n BLmotor.writeMicroseconds(TrimBL + 1500 + MultiBL * Speed);\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I wanted to make a simple robot chassis that could have things added to it as needed. I decided to go with some pz22gr9120r gearmotors because they are cheap (~$3 each) and easy to find. The 1:84 gear ratio and &hellip; <a class=\"more-link\" href=\"https:\/\/fenstar.co\/wp\/?p=571\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6,8,10,22],"_links":{"self":[{"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=\/wp\/v2\/posts\/571"}],"collection":[{"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=571"}],"version-history":[{"count":10,"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=\/wp\/v2\/posts\/571\/revisions"}],"predecessor-version":[{"id":604,"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=\/wp\/v2\/posts\/571\/revisions\/604"}],"wp:attachment":[{"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fenstar.co\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}