{"id":7371,"date":"2018-06-06T08:44:00","date_gmt":"2018-06-06T06:44:00","guid":{"rendered":"https:\/\/aceautomation.eu\/rc-servo-control-how-to-control-the-angle-of-a-rc-servo-using-a-pwm-output\/"},"modified":"2018-07-27T13:57:03","modified_gmt":"2018-07-27T11:57:03","slug":"rc-servo-control-how-to-control-the-angle-of-a-rc-servo-using-a-pwm-output","status":"publish","type":"page","link":"https:\/\/aceautomation.eu\/de\/rc-servo-control-how-to-control-the-angle-of-a-rc-servo-using-a-pwm-output\/","title":{"rendered":"RC Servo Control \u2013 How to control the angle of a RC servo using a PWM output."},"content":{"rendered":"<p>[et_pb_section bb_built=&#8221;1&#8243;][et_pb_row][et_pb_column type=&#8221;4_4&#8243;][et_pb_text _builder_version=&#8221;3.9&#8243;]<\/p>\n<h2>RC Servo Control \u2013 How to control the angle of a RC servo using a PWM output<\/h2>\n<p>RC Servo Motors are typically small motors limited in movement to 180 degrees. \u00a0They have 3 wires: ground, power and control.<\/p>\n<p>To control the position, you send a Pulse Width Modulated (PWM)\u00a0signal to the control line. \u00a0The percentage of On Time determines the angle the servo will move to.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-17745\" src=\"https:\/\/aceautomation.eu\/wp-content\/uploads\/PWM-page11.png\" alt=\"\" width=\"425\" height=\"125\" srcset=\"https:\/\/aceautomation.eu\/wp-content\/uploads\/PWM-page11.png 425w, https:\/\/aceautomation.eu\/wp-content\/uploads\/PWM-page11-300x88.png 300w\" sizes=\"(max-width: 425px) 100vw, 425px\" \/><\/p>\n<p><strong>Period:<\/strong> for most RC Servos is 20,000 microseconds (50Hz).<br class=\"blank\" \/><strong>On Time:<\/strong> Velocio PLCs have sinking transistor type outputs. \u00a0That means that when they are \u201cON\u201d a ground connection is made. \u00a0The documentation for most RC Servo motors will talk about ON time in terms of high voltage time. \u00a0Thus you\u2019ll invert the time mentioned in most documentation. \u00a0 Because of this, ON time will typically be values between 19,000 and 18,000 microseconds, where 18,500 microseconds represents center position.<\/p>\n<h3>Wiring PLC to RC Servo<\/h3>\n<p>You can directly control your RC servos using your Velocio PLC\u2019s outputs.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-17750\" src=\"https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Motor-Wiring11.png\" alt=\"\" width=\"684\" height=\"410\" srcset=\"https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Motor-Wiring11.png 684w, https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Motor-Wiring11-300x180.png 300w, https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Motor-Wiring11-600x360.png 600w\" sizes=\"(max-width: 684px) 100vw, 684px\" \/><\/p>\n<h3>RC Servo Example All Wired Up<\/h3>\n<p>[\/et_pb_text][et_pb_code _builder_version=&#8221;3.5.1&#8243;]&lt;iframe width=&#8221;560&#8243; height=&#8221;315&#8243; src=&#8221;https:\/\/www.youtube.com\/embed\/hnejBN3LyGk?rel=0&amp;amp;showinfo=0&#8243; frameborder=&#8221;0&#8243; allow=&#8221;autoplay; encrypted-media&#8221; allowfullscreen&gt;&lt;\/iframe&gt;[\/et_pb_code][et_pb_text _builder_version=&#8221;3.9&#8243;]<\/p>\n<p>ACE PLCs allow you to control as many RC Servos as you have digital outputs.\u00a0 So, if your PLC has 18 digital outputs, you\u00a0 can control up to 18 servos.\u00a0 They will all use the same Period, but may use their own ON Time.<\/p>\n<h3>RC Servo Programming Example<\/h3>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-17755\" src=\"https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Programming-Example1.png\" alt=\"\" width=\"909\" height=\"481\" srcset=\"https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Programming-Example1.png 909w, https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Programming-Example1-300x159.png 300w, https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Programming-Example1-768x406.png 768w, https:\/\/aceautomation.eu\/wp-content\/uploads\/RC-Programming-Example1-600x317.png 600w\" sizes=\"(max-width: 909px) 100vw, 909px\" \/><\/p>\n<p>Here are the files: \u00a0<a href=\"http:\/\/velocio.net\/wp-content\/uploads\/2015\/12\/RC-Servo.zip\">RC-Servo.zip<\/a>\u00a0(Click to download. \u00a0Then unzip and open using vBuilder.)<\/p>\n<p>In State=1 we set the period to 20000 microseconds.<\/p>\n<p>In State=2 we take an analog input and scale it so that the analog min corresponds to the RC\u2019s min and the analog max corresponds to the RC\u2019s max value. \u00a0We then Start the PWM, telling it to use this newly scaled value as the ON Time.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p><div class=\"et_pb_row et_pb_row_0 et_pb_row_empty\">\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div> RC Servo Control \u2013 How to control the angle of a RC servo using a PWM output RC Servo Motors are typically small motors limited in movement to 180 degrees. \u00a0They have 3 wires: ground, power and control. To control the position, you send a Pulse Width Modulated (PWM)\u00a0signal to the control line. \u00a0The [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-7371","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/pages\/7371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/comments?post=7371"}],"version-history":[{"count":4,"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/pages\/7371\/revisions"}],"predecessor-version":[{"id":17764,"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/pages\/7371\/revisions\/17764"}],"wp:attachment":[{"href":"https:\/\/aceautomation.eu\/de\/wp-json\/wp\/v2\/media?parent=7371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}