{"id":135,"date":"2011-09-15T21:15:52","date_gmt":"2011-09-15T21:15:52","guid":{"rendered":"https:\/\/peterklemperer.com\/blog\/?p=135"},"modified":"2011-09-15T21:15:52","modified_gmt":"2011-09-15T21:15:52","slug":"rat-plotter","status":"publish","type":"post","link":"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/","title":{"rendered":"Rat Plotter"},"content":{"rendered":"<p>Last year Jeri Ellsworth did a neat radar demo where she attached a radar sensor to a mouse and then scanned what was under a cloth by moving around the mouse and recording the radar response as she measured different positions with the mouse.<\/p>\n<p><a href=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030081\/\" rel=\"attachment wp-att-140\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"140\" data-permalink=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030081\/\" data-orig-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030081.jpg\" data-orig-size=\"450,600\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"P1030081\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030081-225x300.jpg\" data-large-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030081.jpg\" class=\"aligncenter size-full wp-image-140\" title=\"P1030081\" src=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030081.jpg\" alt=\"\" width=\"450\" height=\"600\" srcset=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030081.jpg 450w, https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030081-225x300.jpg 225w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><\/p>\n<p>I wondered if you could turn that idea around and attach a pen-plotting mechanism to a mouse and reproduce an image from the screen. \u00a0I call that work in progress the &#8220;Rat Plotter.&#8221;<\/p>\n<p><!--more-->The basic principle behind the Rat Plotter project is to attach a pen to a mouse. \u00a0If the mouse cursor on the screen is over a dark pixel in an image the pen is lowered and if the mouse cursor on the screen is over a light pixel in an image the pen is raised. \u00a0In this way dragging the cursor over an image on the screen will reproduce that image on a piece of paper underneath the mouse. \u00a0I implemented the project in three parts: the software GUI which runs on my laptop, the Arduino software which controls the servo, and the physical pen raising mechanism attached to the mouse.<\/p>\n<p>The software GUI is written in Processing. \u00a0The interface allows a simple 16-square image to be generated on the screen and then monitors the cursor position to determine whether the pen should be raised or lowered. \u00a0The pen position is then displayed on the screen and communicated to the Arduino over the serial connection using Firmata.<\/p>\n<div id=\"attachment_136\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/screenshot\/\" rel=\"attachment wp-att-136\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-136\" data-attachment-id=\"136\" data-permalink=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/screenshot\/\" data-orig-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/screenshot.jpg\" data-orig-size=\"600,470\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Rat Plotter software interface\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/screenshot-300x235.jpg\" data-large-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/screenshot.jpg\" class=\"size-full wp-image-136\" src=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/screenshot.jpg\" alt=\"\" width=\"600\" height=\"470\" srcset=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/screenshot.jpg 600w, https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/screenshot-300x235.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-136\" class=\"wp-caption-text\">Rat Plotter software interface showing the two bar test image demonstrated in the video.  The pen status is currently up.<\/p><\/div>\n<p>The Arduino software is relatively simple. \u00a0Firmata monitors for pen position changes transmitted from the GUI software over serial. \u00a0The Arduino servo library then controls the servo arm position to raise or lower the pen.<\/p>\n<p>The mechanical section of this project was more ambitious than I have attempted in the past. \u00a0I had recently bought a jar of Instamorph brand prototyping plastic that can be molded like clay when heated in boiling water but cools hard. \u00a0It&#8217;s relatively cheap and can be re-heated as many times as you want. \u00a0I built a small mechanical mount to attach the servo to the mouse and then a flexible pen holder that attached to the servo mount. \u00a0The long arm mounted to the servo can then displace the pen-holder.<\/p>\n<div id=\"attachment_141\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030075\/\" rel=\"attachment wp-att-141\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-141\" data-attachment-id=\"141\" data-permalink=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030075\/\" data-orig-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030075.jpg\" data-orig-size=\"600,450\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"P1030075\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Rat plotter mechanical close-up.&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030075-300x225.jpg\" data-large-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030075.jpg\" class=\"size-full wp-image-141\" title=\"P1030075\" src=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030075.jpg\" alt=\"\" width=\"600\" height=\"450\" srcset=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030075.jpg 600w, https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030075-300x225.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-141\" class=\"wp-caption-text\">Rat plotter mechanical close-up.<\/p><\/div>\n<p>I was basically trying to reproduce the beautiful laser-cut mechanism from the Eggbot using boiling-hot playdough. \u00a0It worked out ok. \u00a0See the following video to see how well.<\/p>\n<p><iframe loading=\"lazy\" title=\"Rat Plot Demo\" src=\"https:\/\/player.vimeo.com\/video\/29114436?dnt=1&amp;app_id=122963\" width=\"640\" height=\"360\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write\"><\/iframe><\/p>\n<p>These are some images of the resulting prints. They are not great. I think the pen holding mechanism bends badly under torque from the mouse moving. Also, the mouse sensor readings &#8220;slip&#8221; where the mouse moved but the computer did not record the movement. \u00a0Furthermore rotational movements are not accounted for so the mouse had to be held with a uniform orientation to minimize distortion.<\/p>\n<div id=\"attachment_139\" style=\"width: 460px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030082\/\" rel=\"attachment wp-att-139\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-139\" data-attachment-id=\"139\" data-permalink=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030082\/\" data-orig-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030082.jpg\" data-orig-size=\"450,600\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"P1030082\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030082-225x300.jpg\" data-large-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030082.jpg\" class=\"size-full wp-image-139\" title=\"P1030082\" src=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030082.jpg\" alt=\"\" width=\"450\" height=\"600\" srcset=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030082.jpg 450w, https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030082-225x300.jpg 225w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><p id=\"caption-attachment-139\" class=\"wp-caption-text\">Test plots one, two and three.<\/p><\/div>\n<p style=\"text-align: left;\">My first three test prints. These were produced from the test image shown in the GUI screenshot and would ideally show two vertically aligned sets of identically long blue marks. They do not. \u00a0Alignment issues and problems with the mechanical plotting setup are revealed. \u00a0The green pen marks are notes.<\/p>\n<div id=\"attachment_138\" style=\"width: 460px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030085\/\" rel=\"attachment wp-att-138\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-138\" data-attachment-id=\"138\" data-permalink=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/p1030085\/\" data-orig-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030085.jpg\" data-orig-size=\"450,600\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"P1030085\" data-image-description=\"&lt;p&gt;Test plots four and five.&lt;\/p&gt;\n\" data-image-caption=\"\" data-medium-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030085-225x300.jpg\" data-large-file=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030085.jpg\" class=\"size-full wp-image-138\" title=\"P1030085\" src=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030085.jpg\" alt=\"\" width=\"450\" height=\"600\" srcset=\"https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030085.jpg 450w, https:\/\/peterklemperer.com\/blog\/wp-content\/uploads\/2011\/09\/P1030085-225x300.jpg 225w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/a><p id=\"caption-attachment-138\" class=\"wp-caption-text\">Test plots four and five.<\/p><\/div>\n<p style=\"text-align: left;\">In conclusion, I used a super-crappy mouse that I found laying around under my desk. I&#8217;m going to try replacing it with my 2800 dpi Evoluent Vertical Mouse 3 and see if the distortion due to the mouse can be reduced. \u00a0I will also firm up the mechanical mechanism a bit.<\/p>\n<p style=\"text-align: left;\">Wish me luck!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last year Jeri Ellsworth did a neat radar demo where she attached a radar sensor to a mouse and then scanned what was under a cloth by moving around the mouse and recording the radar response as she measured different &hellip; <a href=\"https:\/\/peterklemperer.com\/blog\/2011\/09\/15\/rat-plotter\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,10],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-projects","category-toys"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1VqWo-2b","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":0,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"wp:attachment":[{"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peterklemperer.com\/blog\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}