{"id":311,"date":"2017-02-15T18:57:55","date_gmt":"2017-02-15T18:57:55","guid":{"rendered":"http:\/\/www.emtronics.co.uk\/wp_blog\/?p=311"},"modified":"2017-10-23T17:17:54","modified_gmt":"2017-10-23T17:17:54","slug":"quadservo-control-4-dc-servo-motors-8-rc-servos","status":"publish","type":"post","link":"http:\/\/www.emtronics.co.uk\/wp_blog\/?p=311","title":{"rendered":"QuadServo &#8211; Control 4 DC servo motors + 8 RC servos"},"content":{"rendered":"<p><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-321\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo.png\" alt=\"quad_servo\" width=\"737\" height=\"445\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo.png 911w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo-300x181.png 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo-768x464.png 768w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"QuadServo boards being using for a robot\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/0Av_HPY9YJk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p style=\"text-align: center;\">One QuadServo board being used to control 3 custom servo motors<\/p>\n<p>&nbsp;<\/p>\n<h1>Hardware<\/h1>\n<p>For a robotics project I needed a way of controlling at least 12 motors with analogue feedback to turn then in to servo-motors. I needed a separate board for each of the 4 &#8216;legs&#8217; of the robot which have 3 motors each.<\/p>\n<p>I designed a small PCB (36mm x 33mm) around the Atmel ATXMega32 and 2 x TB6612FNG dual motor drivers. This allows each board to fully control 4 x DC motors and with analogue feedback turn then into servo motors. I added access to the spare pins which were later used to control 8 x RC servos using the standard PWM servo protocol (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Servo_control\">https:\/\/en.wikipedia.org\/wiki\/Servo_control<\/a>).<\/p>\n<p>I had 8 PCB&#8217;s manufactured with PCB-POOL (<a href=\"https:\/\/www.pcb-pool.com\/\">https:\/\/www.pcb-pool.com\/<\/a>), it cost \u20ac93. They are certainly not the cheapest but the quality is excellent and I got the boards in a week.<\/p>\n<h2>Hardware features<\/h2>\n<ul>\n<li>ATXMega32 @ 32MHZ<\/li>\n<li>USB for programming or debug UART<\/li>\n<li>ISP connector for programming and debugging<\/li>\n<li>2 x dual DC motor drivers<\/li>\n<li>2.5v reference for analogue feed back<\/li>\n<li><\/li>\n<\/ul>\n<h2><\/h2>\n<h1>Design<\/h1>\n<p>PCB was designed in Eagle, it fits with the free version limitation.<\/p>\n<figure id=\"attachment_313\" aria-describedby=\"caption-attachment-313\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/schematic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-313 size-large\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/schematic-1024x584.png\" alt=\"schematic\" width=\"640\" height=\"365\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/schematic-1024x584.png 1024w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/schematic-300x171.png 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/schematic-768x438.png 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-313\" class=\"wp-caption-text\">Schematic<\/figcaption><\/figure>\n<figure id=\"attachment_312\" aria-describedby=\"caption-attachment-312\" style=\"width: 412px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/layout.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-312\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/layout.png\" alt=\"Board layout\" width=\"412\" height=\"452\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/layout.png 412w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/layout-273x300.png 273w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/a><figcaption id=\"caption-attachment-312\" class=\"wp-caption-text\">Board layout<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_315\" aria-describedby=\"caption-attachment-315\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/front.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-315\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/front.jpg\" alt=\"OLYMPUS DIGITAL CAMERA\" width=\"640\" height=\"584\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/front.jpg 1000w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/front-300x274.jpg 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/front-768x701.jpg 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-315\" class=\"wp-caption-text\">Front of PCB, half populated<\/figcaption><\/figure>\n<figure id=\"attachment_314\" aria-describedby=\"caption-attachment-314\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/back.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-314\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/back.jpg\" alt=\"Back of board\" width=\"640\" height=\"591\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/back.jpg 1000w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/back-300x277.jpg 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/back-768x709.jpg 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-314\" class=\"wp-caption-text\">Back of board<\/figcaption><\/figure>\n<figure id=\"attachment_316\" aria-describedby=\"caption-attachment-316\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/populated.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-316\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/populated.jpg\" alt=\"Populated board\" width=\"640\" height=\"584\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/populated.jpg 1000w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/populated-300x274.jpg 300w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/populated-768x701.jpg 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-316\" class=\"wp-caption-text\">Populated board<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h1>Software<\/h1>\n<p><a href=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-334\" src=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo1.png\" alt=\"quad_servo1\" width=\"674\" height=\"400\" srcset=\"http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo1.png 674w, http:\/\/www.emtronics.co.uk\/wp_blog\/wp-content\/uploads\/2017\/10\/quad_servo1-300x178.png 300w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/a><\/p>\n<p>The software is written in C using Atmel Studio. The diagram above shows a simple representation: Commands come in through the UART and are buffered in a fifo, the main loop just looks into the fifo and decodes the commands as they come in. The DC servo motor control is done in a timer interrupt, it reads the ADC and performs a PID control of the 4 motors. Another timer is used to generate the RC servo outputs.<\/p>\n<h2>Software features<\/h2>\n<ul>\n<li>PID control of 4 x DC motors with analogue feedback<\/li>\n<li>Control of 8 x RC servos on the spare 8 output<\/li>\n<li>..or use spare I\/O for GPIO control<\/li>\n<li>Use USB as debug or comms serial port<\/li>\n<li><\/li>\n<\/ul>\n<h2><\/h2>\n<h1>Files<\/h1>\n<p>Hardware and software files are here:<\/p>\n<p><a href=\"https:\/\/github.com\/emileb\/QuadServo\">https:\/\/github.com\/emileb\/QuadServo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; One QuadServo board being used to control 3 custom servo motors &nbsp; Hardware For a robotics project<\/p>\n","protected":false},"author":1,"featured_media":318,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects"],"_links":{"self":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311"}],"version-history":[{"count":17,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts\/311\/revisions"}],"predecessor-version":[{"id":336,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/posts\/311\/revisions\/336"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=\/wp\/v2\/media\/318"}],"wp:attachment":[{"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.emtronics.co.uk\/wp_blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}