{"id":2515,"date":"2014-10-31T20:10:54","date_gmt":"2014-11-01T00:10:54","guid":{"rendered":"http:\/\/www.paleotechnologist.net\/?p=2515"},"modified":"2014-10-31T17:28:27","modified_gmt":"2014-10-31T21:28:27","slug":"components-servos","status":"publish","type":"post","link":"https:\/\/www.paleotechnologist.net\/?p=2515","title":{"rendered":"Components: Servos"},"content":{"rendered":"<p>Do you speak Servo?<\/p>\n<div id=\"attachment_3728\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2014\/10\/2014-10-31-16.51.15_lg.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3728\" class=\"wp-image-3728 size-full\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2014\/10\/2014-10-31-16.51.15_sm.jpg\" alt=\"2014-10-31 16.51.15_sm\" width=\"600\" height=\"338\" \/><\/a><p id=\"caption-attachment-3728\" class=\"wp-caption-text\">Various standard servo motors (about 180 degrees movement each). Click for larger.<\/p><\/div>\n<p>Servo motors (both positional and continuous-rotation) are useful devices. Provide power, ground, and a relatively simple control signal, and the servo&#8217;s onboard circuitry handles all of the motor-control tasks, including a closed-loop feedback system to ensure the servo maintains the correct position or speed.<\/p>\n<p>One nice thing about servo motors is that they are easily controlled by a microcontroller with no additional control or current amplification circuitry needed. Constant DC power (typically, 5V-6V) is applied to the servo, and a control signal is provided to the (high-impedance) control line. One microcontroller, depending on application specifics and processor speed, can control as many as a couple dozen servos.<\/p>\n<p>In addition to traditional servos and continuous-rotation servos, small, efficient, and powerful DC brushless &#8220;outrunner&#8221; motors have recently become popular in many applications such as electric RC aircraft and quadrotor flying drones. Outrunner motors are essentially three-phase AC motors, driven by a custom controller. Conveniently enough, these controllers usually use the standard servo protocol, as well.<\/p>\n<div id=\"attachment_3731\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2014\/10\/2014-10-31-16.52.06_lg.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3731\" class=\"wp-image-3731 size-full\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2014\/10\/2014-10-31-16.52.06_sm.jpg\" alt=\"2014-10-31 16.52.06_sm\" width=\"600\" height=\"338\" \/><\/a><p id=\"caption-attachment-3731\" class=\"wp-caption-text\">A brushless DC motor and its electronic controller. The controller receives control commands as if it were a servo motor, allowing existing servo motor microcontroller libraries to be easily adapted to control these motors. (Click for larger.)<\/p><\/div>\n<p>In a nutshell, servos and similar devices are controlled by the following signal type:<\/p>\n<ul>\n<li>5V TTL (5VDC high, 0VDC low);<\/li>\n<li>High impedance input, easily driven directly by logic;<\/li>\n<li>20ms (50Hz) period pulsed input;<\/li>\n<li>~0.5ms &#8212; ~2.0ms pulse width (varying the pulse width provides the control variable.)<\/li>\n<\/ul>\n<div id=\"attachment_3725\" style=\"width: 919px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2012\/04\/servo_waveform.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3725\" class=\"size-full wp-image-3725\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2012\/04\/servo_waveform.png\" alt=\"Pulses to control a servo. Five 0.5ms pulses command full movement in one direction; five 1.5ms pulses command movement to the center; and five 2.5ms pulses command movement in the other direction.\" width=\"909\" height=\"623\" \/><\/a><p id=\"caption-attachment-3725\" class=\"wp-caption-text\">Pulses to control a servo. Five 0.5ms pulses command full movement in one direction; five 1.5ms pulses command movement to the center; and five 2.5ms pulses command movement in the other direction.<\/p><\/div>\n<p>One pitfall when working with servos is to think of this signal as a PWM cycle, and calculate servo position based on the duty cycle of the pulse. While technically correct, the &#8220;duty cycle&#8221; only varies from roughly 1% to 4% when ranging over the entire valid control input range of the servo. A duty cycle of 25%, for example, does not correspond to 25% power, as it would for a motor driven directly by a PWM signal. Rather, a 25% duty cycle pulse train would probably not be understood by the servo controller as a valid signal at all. It&#8217;s best to think in terms of pulse width, since changes in pulse width (within a small range) correspond to changes in servo behavior. Even the long 2.5ms pulses are still only 12.5% &#8220;duty cycle.&#8221;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Servo motors are useful devices. Here&#8217;s how to drive them using a microcontroller or similar device. <a href=\"https:\/\/www.paleotechnologist.net\/?p=2515\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[265,210,238,226,213],"tags":[],"class_list":["post-2515","post","type-post","status-publish","format-standard","hentry","category-components-electronics","category-digital","category-electronics","category-how-to","category-robotics"],"_links":{"self":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/2515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2515"}],"version-history":[{"count":8,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/2515\/revisions"}],"predecessor-version":[{"id":3732,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/2515\/revisions\/3732"}],"wp:attachment":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}