{"id":201,"date":"2018-04-07T09:00:39","date_gmt":"2018-04-07T09:00:39","guid":{"rendered":"http:\/\/www.hardwarehacker.co.uk\/blog\/?p=201"},"modified":"2021-04-07T08:33:12","modified_gmt":"2021-04-07T08:33:12","slug":"peripherals-servos","status":"publish","type":"post","link":"https:\/\/www.hardwarehacker.co.uk\/blog\/peripherals-servos\/","title":{"rendered":"Peripherals &#8211; Servos"},"content":{"rendered":"<p>So two of the PiWars 2018 events suggest using servos to operate something: duck-shoot and golf.<\/p>\n<p>Servos have been around for a long time and have a very simple interface.\u00a0 About every 20ms, you need to send them a pulse.\u00a0 That pulse needs to be between 1ms and 2ms long.\u00a0 A pulse length of 1.5ms will cause the servo to move to the centre position, 1ms and 2ms correspond to the two ends of travel.\u00a0 Note that some servos can move beyond these limits, and some can be damaged if you drive them beyond these limits!\u00a0 If you fail to send a pulse every 20ms, the servo will power down (stop actively driving the motor to a particular position).<\/p>\n<p>See https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?t=46771 for more details and Pi driven solutions.<\/p>\n<p>In Tigerbot, our servos are driven by the Propeller Hat.\u00a0 This is a microcontroller with 8 cores.\u00a0 It takes some of the load off the Pi and because it isn&#8217;t running an operating system, it is possible to *guarantee* pulse timings.\u00a0 Our controlling Pi then sends desired servo positions over to the Propeller using I2C, then the Propeller sends servo pulses.\u00a0 Here&#8217;s a demo:<\/p>\n<div style=\"width: 660px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-201-1\" width=\"660\" height=\"371\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2018\/03\/VID_20180328_213632.mp4?_=1\" \/><a href=\"http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2018\/03\/VID_20180328_213632.mp4\">http:\/\/www.hardwarehacker.co.uk\/blog\/wp-content\/uploads\/2018\/03\/VID_20180328_213632.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>So two of the PiWars 2018 events suggest using servos to operate something: duck-shoot and golf. Servos have been around for a long time and have a very simple interface.\u00a0 About every 20ms, you need to send them a pulse.\u00a0 That pulse needs to be between 1ms and 2ms long.\u00a0 A pulse length of 1.5ms &hellip; <a href=\"https:\/\/www.hardwarehacker.co.uk\/blog\/peripherals-servos\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Peripherals &#8211; Servos<\/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":[9,5,11],"tags":[2],"_links":{"self":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/201"}],"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=201"}],"version-history":[{"count":2,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":206,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/posts\/201\/revisions\/206"}],"wp:attachment":[{"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hardwarehacker.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}