{"id":3446,"date":"2023-05-27T06:21:19","date_gmt":"2023-05-27T13:21:19","guid":{"rendered":"https:\/\/www.donluc.com\/?p=3446"},"modified":"2023-05-27T06:21:19","modified_gmt":"2023-05-27T13:21:19","slug":"project-12-robotics-multi-motor-control-mk25","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=3446","title":{"rendered":"Project #12: Robotics &#8211; Multi-Motor Control &#8211; Mk25"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-3446-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Robotics #MultiMotorControl #AdafruitMETROM0Express #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01a.png\" alt=\"Multi-Motor Control\" width=\"720\" height=\"407\" class=\"alignnone size-full wp-image-3448\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01a-300x170.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01b.png\" alt=\"Multi-Motor Control\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3449\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01b-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01c.png\" alt=\"Multi-Motor Control\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-3450\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2023\/05\/DL2305Mk01c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Multi-Motor Control<\/strong><\/p>\n<p>In order to synchronize the multi-motor system, a novel method for this system based on embedded control terminal. A controller of the strategy with the function of synchronous control is also completed. According to the requirements of this system, a distributed control structure which based on Hierarchical Approach is chosen. The hardware platform of this structure is composed of embedded control terminal motor could be driven independently. The experiment results verified that the multi-motor system is reliable, the control strategy is rational applied this multi-motor system has better dynamic response and higher reliability.<\/p>\n<p><strong>DL2305Mk01<\/strong><\/p>\n<p>1 x Adafruit METRO M0 Express<br \/>\n1 x ProtoScrewShield<br \/>\n1 x Thumb Joystick<br \/>\n1 x SparkFun Thumb Joystick Breakout<br \/>\n2 x Pololu DRV8834 Low-Voltage Stepper Motor Driver Carrier<br \/>\n2 x Electrolytic Decoupling Capacitors &#8211; 100uF\/25V<br \/>\n2 x Pololu Stepper Motor Bipolar, 2.8V, 1.7 A\/Phase<br \/>\n2 x Pololu Universal Aluminum Mounting Hub for 5mm Shaft, M3 Holes<br \/>\n1 x SparkFun Solderable Breadboard &#8211; Large<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Adafruit METRO M0 Express<\/strong><\/p>\n<p>JH &#8211; Analog A0<br \/>\nJV &#8211; Analog A1<br \/>\nJS &#8211; Digital 2<br \/>\nDIR &#8211; Digital 7<br \/>\nSPR &#8211; Digital 8<br \/>\nDIL &#8211; Digital 9<br \/>\nSPL &#8211; Digital 10<br \/>\nLED &#8211; Digital 13<br \/>\nVIN &#8211; +3.3V<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>DL2305Mk01p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* ***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #12: Robotics - Multi-Motor Control - Mk25\r\n12-25\r\nDL2305Mk01p.ino\r\n1 x Adafruit METRO M0 Express\r\n1 x ProtoScrewShield\r\n1 x Thumb Joystick\r\n1 x SparkFun Thumb Joystick Breakout\r\n2 x Pololu DRV8834 Low-Voltage Stepper Motor Driver Carrier\r\n2 x Electrolytic Decoupling Capacitors - 100uF\/25V\r\n2 x Pololu Stepper Motor Bipolar, 2.8V, 1.7 A\/Phase\r\n2 x Pololu Universal Aluminum Mounting Hub for 5mm Shaft, M3 Holes\r\n1 x SparkFun Solderable Breadboard - Large\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Arduino\r\n#include &lt;Arduino.h&gt;\r\n\/\/ DRV8834 Stepper Motor Driver\r\n#include &lt;BasicStepperDriver.h&gt;\r\n#include &lt;MultiDriver.h&gt;\r\n\r\n\/\/ DRV8834 Stepper Motor Driver\r\n\/\/ Stepper motor steps per revolution.\r\n\/\/ Most steppers are 200 steps or 1.8 degrees\/step\r\n#define MOTOR_STEPS 200\r\n\/\/ Target RPM for X axis stepper motor\r\n#define MOTOR_X_RPM 800\r\n\/\/ Target RPM for Y axis stepper motor\r\n#define MOTOR_Y_RPM 800\r\n\/\/ Since microstepping is set externally,\r\n\/\/ make sure this matches the selected mode\r\n\/\/ If it doesn&#039;t, the motor will move at a\r\n\/\/ different RPM than chosen\r\n\/\/ 1=full step, 2=half step etc.\r\n#define MICROSTEPS 1\r\n\/\/ X Stepper motor\r\n#define DIR_X 7\r\n#define STEP_X 8\r\n\/\/ Y Stepper motor\r\n#define DIR_Y 9\r\n#define STEP_Y 10\r\n\/\/ BasicStepperDriver\r\nBasicStepperDriver stepperX(MOTOR_STEPS, DIR_X, STEP_X);\r\nBasicStepperDriver stepperY(MOTOR_STEPS, DIR_Y, STEP_Y);\r\n\/\/ Pick one of the two controllers below\r\n\/\/ each motor moves independently\r\nMultiDriver controller(stepperX, stepperY);\r\n\r\n\/\/ Joystick\r\n#define JH A0\r\n#define JV A1\r\n#define JS 2\r\n\r\n\/\/ Variable for reading the button\r\nint JSState = 0;\r\n\/\/ Adjusted Value\r\nint adjustedValue = 0;\r\nint adjustedValue2 = 0;\r\n\r\n\/\/ LED Yellow\r\nint iLED = 13;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;12-25&quot;;\r\n\r\nvoid loop() {\r\n  \r\n  \/\/ Button\r\n  isButton();\r\n\r\n  \/\/ Joystick\r\n  isThumbJoystick();\r\n  \r\n  \/\/ Stepper\r\n  isStepper();\r\n \r\n}\r\n<\/pre>\n<p><strong>getButton.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Button\r\n\/\/ Button Setup\r\nvoid isButtonSetup() {\r\n  \r\n  \/\/ Make the button line an input\r\n  pinMode(JS, INPUT_PULLUP);\r\n  \/\/ Initialize digital pin iLED as an output\r\n  pinMode(iLED, OUTPUT);\r\n  \r\n}\r\n\r\n\/\/ Button\r\nvoid isButton(){\r\n\r\n  \/\/ Read the state of the button\r\n  JSState = digitalRead(JS);\r\n\r\n  \/\/ Check if the button is pressed.\r\n  \/\/ If it is, the JSState is HIGH:\r\n  if (JSState == HIGH) {\r\n    \r\n    \/\/ Button\r\n    \/\/ Turn the LED on HIGH \r\n    digitalWrite(iLED, HIGH);\r\n    \r\n  } else {\r\n    \r\n    \/\/ Button\r\n    \/\/ Turn the LED on LOW \r\n    digitalWrite(iLED, LOW);\r\n    \r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>getStepper.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Stepper\r\n\/\/ isStepperSetup\r\nvoid isStepperSetup() {    \r\n  \r\n  \/\/ Set stepper target motors RPM.\r\n  stepperX.begin(MOTOR_X_RPM, MICROSTEPS);\r\n  stepperY.begin(MOTOR_Y_RPM, MICROSTEPS);\r\n\r\n}\r\n\/\/ Stepper\r\nvoid isStepper() {\r\n\r\n  \/\/ Stepper =&gt; Controller rotate\r\n  controller.rotate(adjustedValue, adjustedValue2);\r\n  \r\n}\r\n<\/pre>\n<p><strong>getThumbJoystick.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Thumb Joystick\r\nvoid isThumbJoystick() {\r\n\r\n  \/\/ Joystick JH\r\n  \/\/ Horizontal\r\n  \/\/ Joystick Pot Values JH\r\n  int potValue = analogRead(JH);\r\n  int potValues = 0;\r\n  \/\/ Adjusted Value\r\n  potValues = map(potValue, 0, 1023, 1000, -1000);\r\n  if (potValues &gt; 300) {\r\n\r\n    adjustedValue = potValues;\r\n\r\n  } else if (potValues &lt; -300) {\r\n\r\n    adjustedValue = potValues;\r\n\r\n  } else {\r\n\r\n    adjustedValue = 0;\r\n\r\n  }\r\n\r\n  \/\/ Joystick JV\r\n  \/\/ Vertical\r\n  \/\/ Joystick Pot Values JV\r\n  int potValue2 = analogRead(JV);\r\n  int potValues2 = 0;\r\n  \/\/ Adjusted Value2\r\n  potValues2 = map(potValue2, 0, 1023, 1000, -1000);\r\n  if (potValues2 &gt; 300) {\r\n\r\n    adjustedValue2 = potValues2;\r\n\r\n  } else if (potValues2 &lt; -300) {\r\n\r\n    adjustedValue2 = potValues2;\r\n\r\n  } else {\r\n\r\n    adjustedValue2 = 0;\r\n\r\n  }\r\n\r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n\r\n  \/\/ Button Setup\r\n  isButtonSetup();\r\n  \r\n  \/\/ DRV8834 Stepper Motor Driver\r\n  isStepperSetup();\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Technology Experience<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/li>\n<li>Machine Learning<\/li>\n<li>RTOS<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<\/ul>\n<p><strong>Instructor, E-Mentor, STEAM, and Arts-Based Training<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>IoT<\/li>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2023<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #Robotics #MultiMotorControl #AdafruitMETROM0Express #Arduino #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Multi-Motor Control In order to synchronize the multi-motor system, a novel method for this system based on embedded control terminal. A controller of the strategy with the function of synchronous control is also completed. According to the requirements &#8230; <a title=\"Project #12: Robotics &#8211; Multi-Motor Control &#8211; Mk25\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=3446\" aria-label=\"Read more about Project #12: Robotics &#8211; Multi-Motor Control &#8211; Mk25\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94,47,50,49,38,59,5,46,58,10,43],"tags":[86,6,102,4,19,85,24,283,103,27,95,109,33,34],"class_list":["post-3446","post","type-post","status-publish","format-standard","hentry","category-robotics-projerts","category-adafruit","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-pololu","category-arduino-programming","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-components","tag-consultant","tag-electronics","tag-fritzing","tag-microcontroller","tag-multi-motor-control","tag-pololu","tag-projects-2","tag-robotic","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3446","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3446"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3446\/revisions"}],"predecessor-version":[{"id":4179,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/3446\/revisions\/4179"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3446"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3446"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3446"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}