{"id":349,"date":"2015-10-23T09:48:32","date_gmt":"2015-10-23T13:48:32","guid":{"rendered":"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/?page_id=349"},"modified":"2016-05-06T18:32:19","modified_gmt":"2016-05-06T22:32:19","slug":"software","status":"publish","type":"page","link":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/implementation\/software\/","title":{"rendered":"SOFTWARE"},"content":{"rendered":"<h2>Software\u00a0Subsystem<\/h2>\n<h3>1. Framework<\/h3>\n<p>The software framework was built to be robust by employing OOPS concepts that allowed smooth handling of data. The subsystem employs the use of three Classes: ADDIN, PrinterState and COTSItem<\/p>\n<h4>PrinterState<\/h4>\n<p>The class PrinterState binds all the state variables related to one G-Code command together. These include the XYZR positions of the motors, temperature of the extruder and bed, speed, extrusion rate, etc. With the help of this class, we are able to read G-Code line by line, translate all the state variables into an object of class PrinterState and hence create a table as shown below. Once all the G-code has been read and converted to an array of states, we are free to process the data without having to deal with the .gcode file.<\/p>\n<p style=\"text-align: center\">Table 4: G-Code represented in tabular format<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"78\"><strong>Index<\/strong><\/td>\n<td width=\"116\"><strong>GCommand<\/strong><\/td>\n<td width=\"73\"><strong>X<\/strong><\/td>\n<td width=\"73\"><strong>Y<\/strong><\/td>\n<td width=\"69\"><strong>Z<\/strong><\/td>\n<td width=\"68\"><strong>R<\/strong><\/td>\n<td width=\"68\"><strong>E<\/strong><\/td>\n<td width=\"72\"><strong>F<\/strong><\/td>\n<td width=\"77\"><strong>Tbed<\/strong><\/td>\n<td width=\"85\"><strong>TNozzle<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"78\"><strong>Obj 1<\/strong><\/td>\n<td width=\"116\">\u2018G01\u2019<\/td>\n<td width=\"73\">2.434<\/td>\n<td width=\"73\">1.876<\/td>\n<td width=\"69\">1.5<\/td>\n<td width=\"68\">30<\/td>\n<td width=\"68\">10<\/td>\n<td width=\"72\">1800<\/td>\n<td width=\"77\">60<\/td>\n<td width=\"85\">215<\/td>\n<\/tr>\n<tr>\n<td width=\"78\"><strong>Obj 2<\/strong><\/td>\n<td width=\"116\">\u2018G01\u2019<\/td>\n<td width=\"73\">4.234<\/td>\n<td width=\"73\">4.764<\/td>\n<td width=\"69\">1.5<\/td>\n<td width=\"68\">30<\/td>\n<td width=\"68\">15<\/td>\n<td width=\"72\">1800<\/td>\n<td width=\"77\">60<\/td>\n<td width=\"85\">215<\/td>\n<\/tr>\n<tr>\n<td width=\"78\"><strong>Obj 3<\/strong><\/td>\n<td width=\"116\">\u2018G01\u2019<\/td>\n<td width=\"73\">5.876<\/td>\n<td width=\"73\">8.764<\/td>\n<td width=\"69\">1.5<\/td>\n<td width=\"68\">30<\/td>\n<td width=\"68\">20<\/td>\n<td width=\"72\">1800<\/td>\n<td width=\"77\">60<\/td>\n<td width=\"85\">215<\/td>\n<\/tr>\n<tr>\n<td width=\"78\"><strong>\u2026<\/strong><\/td>\n<td width=\"116\"><\/td>\n<td width=\"73\"><\/td>\n<td width=\"73\"><\/td>\n<td width=\"69\"><\/td>\n<td width=\"68\"><\/td>\n<td width=\"68\"><\/td>\n<td width=\"72\"><\/td>\n<td width=\"77\"><\/td>\n<td width=\"85\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4>ADDIN<\/h4>\n<p>The ADDIN class contains all the data and functions pertaining to one particular 3D part. Some of the functions it includes are:<\/p>\n<ul>\n<li>Read G-Code file into array of PrinterStates<\/li>\n<li>Compute R axis commands<\/li>\n<li>Plot the 3D part<\/li>\n<li>Write PrinterStates back into a .gcode file<\/li>\n<\/ul>\n<h4>COTSItem<\/h4>\n<p>An object of this class represents all the data related to one COTS item, which includes its dimensions, minimum and minimum z heights, etc.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>2. Path Planning Algorithm<\/h3>\n<h4>Description:<\/h4>\n<p>The path planning algorithm essentially computes the angles that the stepper must rotate by during the execution of each G-Code command in order to stay clear of collisions with the COTS part.<\/p>\n<p>The basic steps for the algorithm are as follows:<\/p>\n<ol>\n<li>Orient the printer nozzle to be normal (or at some specified angle) to the velocity trajectory of the nozzle at all times (this yields two possible solutions for nozzle orientation).<\/li>\n<li>Always orient the nozzle to be pointing towards the nearest COTS item (this selects between the two solutions in (1)).<\/li>\n<\/ol>\n<p>In this design the path planning algorithm simplifies each COTS item to a \u2018keep out\u2019 zone centered at a specific point location and with a specified height. The assumption is made that the G-Code file for the printed part is designed to accurately represent the exterior profile of the COTS item, and thus no other information is needed about the COTS item\u2019s external geometry. Not relying on additional geometry information implies that the part designer avoided creating a design which violate the geometry constraints of the printer (i.e. parts are too close together, or have concave profiles that the nozzle cannot access), since these potential collisions will not be detected by the path planning algorithm.<\/p>\n<p>The path planning algorithm was implemented in MATLAB and is applied to a given G-Code file. The inputs to the algorithm are a G-Code file produced by Slic3r which encodes the XYZ locations the print nozzle must move to, and a list of COTS item locations and heights. Using this information, the algorithm computes the necessary angle of the rotation axis for each G-Code movement command, and produces a modified G-Code file. It was discovered that Skeinforge only produces straight line commands (G00 and G01) which greatly simplifies the implementation algorithm because rotation along an arc doesn\u2019t need to be considered.<\/p>\n<p>An example of the modified G-Code is shown\u00a0below:<\/p>\n<p>g1 x119.200 y133.151 e1238.61271 r18.4349<\/p>\n<p>g1 x118.973 y133.665 e1238.63294 r90<\/p>\n<p>The figures below\u00a0show the R-Axis commands generated for a cylinder with a rod placed inside it as a COTS item. As we can see, the arrows are all pointing towards the center, thus orienting the nozzle to not collide with the COTS item.\u00a0 The results clearly indicate that the algorithm is successfully controlling the nozzle orientation to avoid collision with the COTS item.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-738\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/1.png\" alt=\"1\" width=\"524\" height=\"593\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/1.png 812w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/1-265x300.png 265w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/1-768x869.png 768w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-739 alignright\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/2.png\" alt=\"2\" width=\"438\" height=\"496\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/2.png 812w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/2-265x300.png 265w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/2-768x869.png 768w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3><\/h3>\n<h3>3. Graphic User Interface<\/h3>\n<p>The GUI ties together all the functions written in the software and provides the user with an easy to interpret application that takes care of the special G-Code generation from start to end.<\/p>\n<p>The process can be understood by the following images:<\/p>\n<p>&nbsp;<\/p>\n<table width=\"847\">\n<tbody>\n<tr>\n<td width=\"442\">\n<p style=\"text-align: center\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-740\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/3.png\" alt=\"3\" width=\"507\" height=\"363\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/3.png 855w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/3-300x215.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/3-768x550.png 768w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/p>\n<p style=\"text-align: center\">Visualization of STL file in GUI<\/p>\n<\/td>\n<td width=\"405\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-741 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/4.png\" alt=\"4\" width=\"354\" height=\"350\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/4.png 450w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/4-300x297.png 300w\" sizes=\"auto, (max-width: 354px) 100vw, 354px\" \/><\/p>\n<p style=\"text-align: center\">Addition of COTS item (with options to vary orientation)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-742 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/5.png\" alt=\"5\" width=\"642\" height=\"459\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/5.png 856w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/5-300x214.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/5-768x549.png 768w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center\">Positioning of COTS item within 3D part<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-743 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/6.png\" alt=\"6\" width=\"707\" height=\"507\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/6.png 855w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/6-300x215.png 300w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/6-768x551.png 768w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/p>\n<p style=\"text-align: center\">Visualization of R-Axis commands per G-Code<\/p>\n<p><a name=\"_Toc450255135\"><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>4. Settings Window<\/h3>\n<p>The settings window is an extremely useful functionality of the GUI that allows the user to define the commands used to invoke the slicing software locally.\u00a0 This makes the software completely portable and also eases the process to save settings.<\/p>\n<p>As shown in the figure below, the Settings Window lets the user specify the following settings:<\/p>\n<ol>\n<li>The location of their slicing software on their system locally<\/li>\n<li>Slice Settings which vary from print to print<\/li>\n<li>Command to invoke the slicing software from command line<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-744 aligncenter\" src=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/7.png\" alt=\"7\" width=\"563\" height=\"493\" srcset=\"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/7.png 563w, https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/7-300x263.png 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/p>\n<p style=\"text-align: center\">Settings Window<\/p>\n<p>The settings window came in handy when the project required us to shift between slicing software in the last minute. When the previously employed \u2019Slic3r\u2019 started causing problems, we switched to \u2018Skeinforge\u2019 which allowed us to tune many more setting, giving us more room to obtain high quality prints. The three settings mentioned above were all we had to change in order to make this transition from Slic3r to Skeinforge.<\/p>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><a href=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/7.png\"><br \/>\n<\/a> <a href=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/6.png\"><br \/>\n<\/a> <a href=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/5.png\"><br \/>\n<\/a> <a href=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/4.png\"><br \/>\n<\/a> <a href=\"http:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-content\/uploads\/sites\/7\/2016\/05\/2.png\"><br \/>\n<\/a><\/h2>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Software\u00a0Subsystem 1. Framework The software framework was built to be robust by employing OOPS concepts that allowed smooth handling of data. The subsystem employs the use of three Classes: ADDIN, PrinterState and COTSItem PrinterState The class PrinterState binds all the state variables related to one G-Code command together. These include the XYZR positions of the&hellip;&nbsp;<\/p>\n","protected":false},"author":30,"featured_media":0,"parent":103,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"template-fullwidth.php","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"class_list":["post-349","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/pages\/349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":15,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/pages\/349\/revisions"}],"predecessor-version":[{"id":383,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/pages\/349\/revisions\/383"}],"up":[{"embeddable":true,"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/pages\/103"}],"wp:attachment":[{"href":"https:\/\/mrsdprojects.ri.cmu.edu\/2015teamf\/wp-json\/wp\/v2\/media?parent=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}