{"id":160,"date":"2021-11-15T18:48:34","date_gmt":"2021-11-15T18:48:34","guid":{"rendered":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/?p=160"},"modified":"2022-05-05T20:31:33","modified_gmt":"2022-05-05T20:31:33","slug":"design-brainstorming","status":"publish","type":"post","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/design-brainstorming\/","title":{"rendered":"Design Brainstorming"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">PCB Design<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"691\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-1024x691.png\" alt=\"\" class=\"wp-image-634\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-1024x691.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-300x202.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-768x518.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-1536x1036.png 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-2048x1381.png 2048w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MotorControllerBrainstorming-400x270.png 400w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>High-level Diagram Showing General Layout of PCB for Powering and Controlling Motor<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">End-Effector Design<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"456\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/End_Effector_Evolution-1024x456.png\" alt=\"\" class=\"wp-image-648\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/End_Effector_Evolution-1024x456.png 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/End_Effector_Evolution-300x134.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/End_Effector_Evolution-768x342.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/End_Effector_Evolution.png 1260w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Evolution of End-Effector<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Perception Subsystem<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/IMG_20220413_181601-1024x768.jpg\" alt=\"\" class=\"wp-image-649\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/IMG_20220413_181601-1024x768.jpg 1024w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/IMG_20220413_181601-300x225.jpg 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/IMG_20220413_181601-768x576.jpg 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/IMG_20220413_181601-1536x1152.jpg 1536w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/05\/IMG_20220413_181601-2048x1536.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Brainstorming for Perception Software Subsystem<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Planning Subsystem<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"1024\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3-783x1024.png\" alt=\"\" class=\"wp-image-651\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3-783x1024.png 783w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3-229x300.png 229w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3-768x1005.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3-1174x1536.png 1174w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3-1565x2048.png 1565w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-3.png 1911w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><figcaption>Some Ideas for Building the Planning Subsystem<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Controls Subsystem<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"1024\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4-783x1024.png\" alt=\"\" class=\"wp-image-650\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4-783x1024.png 783w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4-229x300.png 229w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4-768x1005.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4-1174x1536.png 1174w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4-1565x2048.png 1565w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-4.png 1911w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><figcaption>MPC ROS Node Layout Brainstorming<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Miscellaneous<\/h2>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1911\" height=\"2500\" data-id=\"653\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1.png\" alt=\"\" class=\"wp-image-653\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1.png 1911w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1-229x300.png 229w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1-783x1024.png 783w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1-768x1005.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1-1174x1536.png 1174w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1-1565x2048.png 1565w\" sizes=\"auto, (max-width: 1911px) 100vw, 1911px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1911\" height=\"2500\" data-id=\"652\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2.png\" alt=\"\" class=\"wp-image-652\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2.png 1911w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2-229x300.png 229w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2-783x1024.png 783w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2-768x1005.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2-1174x1536.png 1174w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-2-1565x2048.png 1565w\" sizes=\"auto, (max-width: 1911px) 100vw, 1911px\" \/><\/figure>\n<figcaption class=\"blocks-gallery-caption\">Website Wireframe Brainstorming<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"1024\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-783x1024.png\" alt=\"\" class=\"wp-image-654\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-783x1024.png 783w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-229x300.png 229w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-768x1005.png 768w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1174x1536.png 1174w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS-1565x2048.png 1565w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2021\/11\/Image-from-iOS.png 1911w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><figcaption>Use Case Flowchart<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">MPC Brainstorming<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Deciding the Controller and Formulating the Optimal Control Problem<\/h3>\n\n\n\n<p>After surveying the possible controls algorithms that could be used for this system, a Model Predictive Controller (MPC) was decided as the best controller because of our system constraints and goals, changing system dynamics, and that MPC can take multiple inputs. Using classic manipulator dynamics, the system dynamics were determined. Constraints were determined based on literature research and system requirements. For the objective function, a tracking objective was chosen, minimizing the error along a desired trajectory while meeting constraints. Figure 16 shows the Optimal Control Problem.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"290\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/OptimalControlProblem.png\" alt=\"\" class=\"wp-image-618\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/OptimalControlProblem.png 547w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/OptimalControlProblem-300x159.png 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><figcaption>Figure 16. Optimal Control Problem<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Implementing the Dynamics Modeling of the Kinova Gen3 Arm<\/h3>\n\n\n\n<p>The dynamics function of the Kinova Gen3 Arm was implemented using the Julia Language and the RigidBodyDynamics.jl library. This library parses the URDF of our model and builds a joint-linkage tree, storing the mass and inertias. Given the joint positions, joint velocities, external wrenches, and input torques, the library has dynamics functions that can calculate the joint accelerations. Figure 17 shows the currently implemented dynamics function.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"913\" height=\"220\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/Dynamics.png\" alt=\"\" class=\"wp-image-617\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/Dynamics.png 913w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/Dynamics-300x72.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/Dynamics-768x185.png 768w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><figcaption>Figure 17. Implementation of System Dynamics Using RigidBodyDynamics.jl<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Implementing the MPC<\/h3>\n\n\n\n<p>Using the RobotDynamics.jl, TrajectoryOptimization.jl, and Altro.jl, the MPC was implemented, organizing a trajectory of desired states and desired inputs over time, setting up the Tracking Objective function, and setting up the System Constraints defined above in Figure 16. The most challenging part of setting the MPC up was providing a good initial guess for input torques for the solver to converge. The best initial guess was providing gravity compensation torques for the initial position of the manipulator in the trajectory. Figure 18 shows the implementation of the objective function and joint position and velocity constraints. Figure 19 shows an offline simulation of the MPC output, which had a very low tracking error (less than 0.001 mm and less than 0.5 degrees error of end-effector pose).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"395\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/MPC_process_compressed.gif\" alt=\"\" class=\"wp-image-620\" \/><figcaption>Figure 18. Implementation of Objective Function and Constraints<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"296\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/PR3_MPC.gif\" alt=\"\" class=\"wp-image-619\" \/><figcaption>Figure 19. Offline Simulation of MPC Output Following a Trajectory<\/figcaption><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Integrating the MPC into ROS<\/h3>\n\n\n\n<p>RobotOS.jl was used to integrate the MPC into ROS within the Julia Language, and is a wrapper for PyROS, allowing for the node to subscribe and publish messages within ROS. Two nodes were written as part of the controller: an MPC node to solve the optimal control problem given the current state, desired trajectory and system constraints, and a Controller node which sends the appropriate torques to the effort controllers in simulation or hardware.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Integrating the Motion Planner and Simulating in Gazebo<\/h3>\n\n\n\n<p>After writing the ROS nodes, the MPC was integrated with the Motion Planner subsystem and with the Gazebo simulation and joint effort controllers at a rate of 20 Hz (will increase later). This enabled real-time simulation and testing of the MPC, which revealed challenges with getting the MPC to converge on time.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Implementing the PD Impedance Tracking Controller<\/h3>\n\n\n\n<p>Since there were issues with getting the MPC to converge, a PD Impedance Tracking Controller was developed in parallel. Using the RobotDynamics.jl, the error in desired joint positions and velocities were given to the controller to determine the desired joint accelerations. Using the desired accelerations, the desired torques were calculated using inverse dynamics within the library, which uses the Recursive Newton Euler Algorithm. These torques are then provided to the effort controllers. Figure 20 shows the real-time simulation of the PD Impedance Tracking Controller following a straight-line trajectory in Gazebo.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"418\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-content\/uploads\/sites\/56\/2022\/04\/PDController.gif\" alt=\"\" class=\"wp-image-621\" \/><figcaption>Figure 20. PD Impedance Tracking Controller Simulated in Gazebo<\/figcaption><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>PCB Design End-Effector Design Perception Subsystem Planning Subsystem Controls Subsystem Miscellaneous MPC Brainstorming Deciding the Controller and Formulating the Optimal Control Problem After surveying the possible controls algorithms that could be used for this system, a Model Predictive Controller (MPC) was decided as the best controller because of our system constraints and goals, changing system<br \/><a class=\"moretag\" href=\"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/design-brainstorming\/\">+ Read More<\/a><\/p>\n","protected":false},"author":260,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-160","post","type-post","status-publish","format-standard","hentry","category-documents"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/posts\/160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/users\/260"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/comments?post=160"}],"version-history":[{"count":4,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/posts\/160\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/posts\/160\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/media?parent=160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/categories?post=160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2022teamc\/wp-json\/wp\/v2\/tags?post=160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}