{"id":78,"date":"2015-09-16T13:03:41","date_gmt":"2015-09-16T13:03:41","guid":{"rendered":"http:\/\/www.hardwarehacker.co.uk\/blog\/?p=78"},"modified":"2015-09-22T18:51:28","modified_gmt":"2015-09-22T18:51:28","slug":"straight-line-speed-test","status":"publish","type":"post","link":"https:\/\/www.hardwarehacker.co.uk\/blog\/straight-line-speed-test\/","title":{"rendered":"Straight line speed test"},"content":{"rendered":"<p>At first glance, the straight line speed test sounds like an easy event. But once you try\u00a0it, you start to notice problems:<\/p>\n<p>Robots don&#8217;t go straight naturally. \u00a0There&#8217;s always some difference in the wheels, motors, speed controllers, etc so that the robot starts turning. \u00a0And over the long, narrow\u00a0speed test course, you&#8217;ll probably hit the walls at some point. \u00a0So how can you deal with\u00a0this?<\/p>\n<p>Options:<\/p>\n<ul>\n<li>Drive under manual control\n<ul>\n<li>This is harder than it looks &#8211; most robots last year didn&#8217;t have fine direction control.<\/li>\n<\/ul>\n<\/li>\n<li>Detect the walls and avoid them\n<ul>\n<li>This is a good option &#8211; detect the walls somehow (e.g. with an IR or ultrasound sensor &#8211; much like the proximity alert sensors, but mounted facing sideways) and if you see one, either speed up the wheel on that side or slow down the one on the other side.<\/li>\n<\/ul>\n<\/li>\n<li>Mechanically follow the wall\n<ul>\n<li>This is what we did last year with metabot<\/li>\n<li>Place some sort of bumper (wood, teflon, bearings?) on the sides below the top of the wall\n<ul>\n<li>and optionally place the robot against the wall on the side it naturally turns towards<\/li>\n<\/ul>\n<\/li>\n<li>The downside of course is that this increases friction<\/li>\n<\/ul>\n<\/li>\n<li>Camera\n<ul>\n<li>Write code to process the image, spot the edges of the course and adjust the motors appropriately.<\/li>\n<li>Image processing code is hard&#8230; \u00a0People have used OpenCV with the RPi.<\/li>\n<\/ul>\n<\/li>\n<li>Compass\n<ul>\n<li>Add a compass sensor to the robot\n<ul>\n<li>something like the <a href=\"http:\/\/www.ebay.co.uk\/itm\/HMC5883L-Triple-3-Axis-Digital-Compass-Magnetometer-Sensor-Module-Arduino-PIC-Pi-\/191115760827\">HMC5883L<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Regularly read it and adjust the motor speeds if it detects that you&#8217;re turning<\/li>\n<li>BUT &#8211; I&#8217;ve never tried this myself and I don&#8217;t know for sure that the compass will be sensitive enough to detect the very small rotations you&#8217;ll need to spot, or will work well in the presence of the magnets in your motors!<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Finally &#8211; think about how you&#8217;re going to stop&#8230; \u00a0If your robot is capable of any decent speed, the stopping area is quite short. \u00a0We implemented a &#8220;dead mans handle&#8221; on Metabot last year &#8211; i.e. the robot ran at full speed while we held down the button and stopped immediately when the button was released. \u00a0The event judge ruled that this was a safety device and NOT manual control in case\u00a0that matters to you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At first glance, the straight line speed test sounds like an easy event. But once you try\u00a0it, you start to notice problems: Robots don&#8217;t go straight naturally. \u00a0There&#8217;s always some difference in the wheels, motors, speed controllers, etc so that the robot starts turning. \u00a0And over the long, narrow\u00a0speed test course, you&#8217;ll probably hit the &hellip; <a href=\"https:\/\/www.hardwarehacker.co.uk\/blog\/straight-line-speed-test\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Straight line speed test<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[2],"_links":{"self":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/78"}],"collection":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":2,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/78\/revisions\/81"}],"wp:attachment":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}