{"id":1111,"date":"2017-06-19T11:21:56","date_gmt":"2017-06-19T10:21:56","guid":{"rendered":"http:\/\/ofalcao.pt\/blog\/?p=1111"},"modified":"2017-06-19T11:28:17","modified_gmt":"2017-06-19T10:28:17","slug":"triplex-v0-4","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2017\/triplex-v0-4","title":{"rendered":"Triplex v0.4"},"content":{"rendered":"<div class=\"seriesmeta\">This post is part 2 of 3 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/triplex\" class=\"series-303\" title=\"Triplex\">Triplex<\/a><\/div><p>Triplex v0.3 was demoed at S\u00e3o Jo\u00e3o da Madeira&#8217;s BRInCKa 2017, just using remote control from my laptop through a ssh session. As expected, some people find it similar to a lobster and a few visitors noticed the omniwheels and asked for further details.<\/p>\n<p>The best moment was after the exhibition being closed &#8211; a private test drive session just for &#8216;Pocas&#8217;, our LUG mosaic expert:<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"April 30, 2017\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/OK8Cm7dyN5k?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>One of these days I do have to complete my wifi-to-IR gateway so Pocas can drive Technic Power Functions models like the 42065 RC Tracked Racer.<\/p>\n<p>Now one of the lessons learned at BRINcKa 2017 was that Triplex was bending with is own weight. So last weeked I redesigned it to be more solid. Version 0.4 &#8220;legs&#8221; are now a little longer and overall I think it looks more elegant:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large\" src=\"https:\/\/lh3.googleusercontent.com\/W_di0i_SBKm-8FDY0zeMKzaxxVBzRjtF7KkBjv5XBM5POFty74lQwh7i4_SsI3dKIAfWfhKqZRLn9IBx-jZuoHHka91GZgc7BD3tmm3M2xPEqPKH5P6nW8Yo6Q6aBkEdE_LsdVn3nCTOvzZs7KK-xbI4nN5AKGcKs7Ju0ZQDGS5EyBorCTzhcD5_z2ZPntfqzJ9ynmXxO9TTC-FW8MxE-5oKSmtq_1PPlwYqde-01PggS8sQwaYRNUpXuD3_bf8AT1g5aOlUWjd0VYTy2vx0E2lKBhHL1tB_K4w6-omgXa8Zu-g_3_nDSdtPcj3Qq9M3MYmK4rnOMBq2HiZoy0A16f1f7Bkwr11tAH5gKRqnwbQ757zM-Yl7ch55k6Sou2n8R3FWzc1RtkOa9qkLvIg1Kzs__qJ-8-gMfWQXNPNgmUyFGkq75b14zlHy223ZyJH6_EVXUWgPlpWLr987iIfNjWvzuNBb7dfkMRPlx42OocmtAOW_PfihQWXm72XWgFFEj4aAgeSz4qHNFTkNT-P-u8aXC4tTOhEylFRUOaaL4QU1dJvKy3B2KsdjBlK4R4BZ_LSSXpl1zBvhAVsU8-XxjO4XryEkodaerXbgnW7tCJGpchBTbYKywRH56lkCzhlPdLw0JGjg3ua2F22GR2oPt9FBfMue5m317maeT2EVJw=w1457-h819-no\" width=\"1457\" height=\"818\" \/><\/p>\n<p>Also managed to make the math working and tested my matrix in python:<\/p>\n<pre> 0.667\u00a0\u00a0\u00a0   0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0.333\r\n-0.333\u00a0   -0.575     0.333 \r\n-0.333     0.575\u00a0\u00a0   0.333<\/pre>\n<p>To test moving it in 24 different directions (multiples of 15\u00ba) I used this python script (with some simplifications &#8211; since I don&#8217;t want it to rotate)<\/p>\n<pre>#!\/usr\/bin\/env python3\r\nfrom math import cos,sin\r\nfrom time import sleep\r\nimport ev3dev.ev3 as ev3\r\n\r\nM11 = 0.667\r\nM12 = 0\r\nM13 = 0.333\r\nM21 = -0.333\r\nM22 = -0.575\r\nM23 = 0.333 \r\nM31 = -0.333\r\nM32 = 0.575\r\nM33 = 0.333\r\n\r\nSPEED = 1000\r\nTIME = 1200\r\nPAUSE = 0.8\r\nPI = 3.14159\r\n\r\nm1 = ev3.MediumMotor('outA')\r\nm2 = ev3.MediumMotor('outB')\r\nm3 = ev3.MediumMotor('outC')\r\n\r\n# select an angle a in PI\/12 radians = 15\u00ba\r\n\r\nfor x in range(0, 24):\r\n\r\n# move\r\n    a = x*PI\/12\r\n    ax = cos(a)\r\n    ay = sin(a)\r\n\r\n    f1 = M11 * ax + M12 * ay\r\n    f2 = M21 * ax + M22 * ay\r\n    f3 = M31 * ax + M32 * ay\r\n\r\n    s1 = f1 * SPEED\r\n    s2 = f2 * SPEED\r\n    s3 = f3 * SPEED\r\n\r\n    m1.run_timed(time_sp=TIME, speed_sp=s1)\r\n    m2.run_timed(time_sp=TIME, speed_sp=s2)\r\n    m3.run_timed(time_sp=TIME, speed_sp=s3)\r\n\r\n    sleep(TIME\/1000)\r\n    sleep(PAUSE)\r\n\r\n# move back\r\n    a = PI + x*PI\/12\r\n    ax = cos(a)\r\n    ay = sin(a)\r\n\r\n    f1 = M11 * ax + M12 * ay\r\n    f2 = M21 * ax + M22 * ay\r\n    f3 = M31 * ax + M32 * ay\r\n\r\n    s1 = f1 * SPEED\r\n    s2 = f2 * SPEED\r\n    s3 = f3 * SPEED\r\n\r\n    m1.run_timed(time_sp=TIME, speed_sp=s1)\r\n    m2.run_timed(time_sp=TIME, speed_sp=s2)\r\n    m3.run_timed(time_sp=TIME, speed_sp=s3)\r\n\r\n    sleep(TIME\/1000)\r\n    sleep(PAUSE)<\/pre>\n<p>The result can be seen in this video:<\/p>\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"Triplex v0.4\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/4jVzCBV0OSk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<p>The robot drifts a lot after the 48 moves and also rotates a bit. Will have to compensante it with a gyro (and probably better wheels, I&#8217;m considering mecanum wheels).\u00a0 But the directions are quite as expected.<\/p>\n<p>I uploaded a couple of photos to the <a href=\"https:\/\/goo.gl\/photos\/fPLcX85WjdcjLCKD7\">Triplex Project Album<\/a>. Will try to add a few more later on.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"seriesmeta\">This post is part 2  of 3 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/triplex\" class=\"series-303\" title=\"Triplex\">Triplex<\/a><\/div><p>Triplex v0.3 was demoed at S\u00e3o Jo\u00e3o da Madeira&#8217;s BRInCKa 2017, just using remote control from my laptop through a ssh session. As expected, some people find it similar to a lobster and a few visitors noticed the omniwheels and asked for further details. The best moment was after the exhibition being closed &#8211; a &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2017\/triplex-v0-4\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;Triplex v0.4&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[294],"series":[303],"class_list":["post-1111","post","type-post","status-publish","format-standard","hentry","category-sem-categoria","tag-holonomic","series-triplex"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-hV","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1111"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1111\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1111"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}