{"id":636,"date":"2017-02-01T12:48:12","date_gmt":"2017-02-01T12:48:12","guid":{"rendered":"http:\/\/pthat.com\/?page_id=636"},"modified":"2017-03-19T17:05:40","modified_gmt":"2017-03-19T17:05:40","slug":"stepper-drivers-2-2-2-2","status":"publish","type":"page","link":"https:\/\/pthat.com\/index.php\/stepper-drivers-2-2-2-2\/","title":{"rendered":"Linear Interpolation"},"content":{"rendered":"<p>[et_pb_section admin_label=&#8221;section&#8221; background_color=&#8221;#2ea3f2&#8243; inner_shadow=&#8221;off&#8221; parallax=&#8221;on&#8221;][et_pb_row admin_label=&#8221;row&#8221;][et_pb_column type=&#8221;4_4&#8243;][et_pb_text admin_label=&#8221;Text&#8221; background_layout=&#8221;dark&#8221; text_orientation=&#8221;center&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h1 style=\"font-size: 72px; font-weight: 300;\">Linear Interpolation<\/h1>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section admin_label=&#8221;section&#8221; fullwidth=&#8221;off&#8221; specialty=&#8221;off&#8221; inner_shadow=&#8221;off&#8221; parallax=&#8221;off&#8221;][et_pb_row admin_label=&#8221;Row&#8221;][et_pb_column type=&#8221;4_4&#8243;][et_pb_text admin_label=&#8221;Text&#8221; background_layout=&#8221;light&#8221; text_orientation=&#8221;left&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h2>Inter who? I hear you shout !<\/h2>\n<p><span style=\"font-size: 14pt;\">Interpolation with motors is to have all motors start and stop at the same time, no matter what the distance is, and even if the distance is different for each Axis.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">Simple I hear you shout again!, if we have one motor that needs to have 1000 pulses sent to it and the other motor needs 2000 pulses sent to it and we want them to start and stop at the same time. We simply send 1 pulse to motor1 and 2 pulses to motor2. Yep that will work but what if we need to send 1000 pulses to motor1 and 2222 pulses to motor2, can we really send 1 pulse to motor1 and 2.222 pulses to motor2?. No we cannot as we cannot sent 0.222 of a pulse and also saving up the\u00a00.222 pulses, till we get a full pulse and then sending it, also throws the motors out of sync at so many steps and it gets very complicated.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">So this is where again the PTHAT comes in handy as it will allow high resolution frequency pulse trains be produced via the on board DDS processors.<\/span><\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section admin_label=&#8221;section&#8221; fullwidth=&#8221;off&#8221; specialty=&#8221;off&#8221; inner_shadow=&#8221;off&#8221; parallax=&#8221;off&#8221; transparent_background=&#8221;off&#8221; background_color=&#8221;#f9f9f9&#8243; allow_player_pause=&#8221;off&#8221; parallax_method=&#8221;off&#8221; padding_mobile=&#8221;off&#8221; make_fullwidth=&#8221;off&#8221; use_custom_width=&#8221;off&#8221; width_unit=&#8221;on&#8221; make_equal=&#8221;off&#8221; use_custom_gutter=&#8221;off&#8221;][et_pb_row admin_label=&#8221;Row&#8221;][et_pb_column type=&#8221;4_4&#8243;][et_pb_text admin_label=&#8221;Text&#8221; background_layout=&#8221;light&#8221; text_orientation=&#8221;left&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h2>Calculating Interpolation<\/h2>\n<p><span style=\"font-size: 14pt;\">Lets say we have motor1 that needs 1000 pulses and motor2 that needs 2222 pulses to reach the\u00a0target travel distance.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">As in other examples above we have ballscrews with a 5mm pitch and motor drivers set to 1600 Pulses Per Rev.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">We want to go at 100 RPM, so lets do the calculations on the biggest amount of pulses first\u00a0motor2.<br \/>\nWe take our Pulses Per Rev of 1600*0.01666666666=26.666666656 and\u00a0multiply the result by the RPM required 100*26.666666656=2666.66Hz.<\/span><br \/>\n<span style=\"font-size: 14pt;\"> That is motor2\u00a0frequency calculated to 2666.66Hz, so it runs at 100 RPM.<\/span><br \/>\n<span style=\"font-size: 14pt;\"><br \/>\nNow for motor1 we first divide motor2 pulse by motor1 pulses\u00a02222\/1000=2.222 and\u00a0divide the\u00a0frequency of motor2 by the result\u00a02666.66\/2.222=1200.11Hz<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">The final result being, is that we:<br \/>\nRun motor2 at 2666.66Hz (100RPM)<br \/>\nRun motor1 at 1200.11Hz (45.45RPM)<br \/>\nNow motor1 and motor2 will start and stop at the same time and both would of done the target pulses.<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">There are other ways of calculating these numbers and expressions to be used, but I want to try and break it down into easy steps for people to understand.<\/span><\/p>\n<p>[\/et_pb_text][et_pb_divider admin_label=&#8221;Divider&#8221; color=&#8221;#ffffff&#8221; show_divider=&#8221;off&#8221; height=&#8221;10&#8243; divider_style=&#8221;solid&#8221; divider_position=&#8221;top&#8221; hide_on_mobile=&#8221;on&#8221;] [\/et_pb_divider][et_pb_text admin_label=&#8221;Text&#8221; background_layout=&#8221;light&#8221; text_orientation=&#8221;left&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h2>Here is a scope shot of the PTHAT loaded with the values above and sent to the X and Y Axis motors.<\/h2>\n<p>[\/et_pb_text][et_pb_image admin_label=&#8221;Image&#8221; src=&#8221;https:\/\/pthat.com\/wp-content\/uploads\/2017\/01\/scope-interpolation3.jpg&#8221; show_in_lightbox=&#8221;off&#8221; url_new_window=&#8221;off&#8221; use_overlay=&#8221;off&#8221; animation=&#8221;fade_in&#8221; sticky=&#8221;off&#8221; align=&#8221;center&#8221; force_fullwidth=&#8221;off&#8221; always_center_on_mobile=&#8221;on&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;] [\/et_pb_image][et_pb_divider admin_label=&#8221;Divider&#8221; color=&#8221;#ffffff&#8221; show_divider=&#8221;off&#8221; height=&#8221;60&#8243; divider_style=&#8221;solid&#8221; divider_position=&#8221;top&#8221; hide_on_mobile=&#8221;on&#8221;] [\/et_pb_divider][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linear Interpolation Inter who? I hear you shout ! Interpolation with motors is to have all motors start and stop at the same time, no matter what the distance is, and even if the distance is different for each Axis. Simple I hear you shout again!, if we have one motor that needs to have [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-636","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/pages\/636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/comments?post=636"}],"version-history":[{"count":3,"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/pages\/636\/revisions"}],"predecessor-version":[{"id":4196,"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/pages\/636\/revisions\/4196"}],"wp:attachment":[{"href":"https:\/\/pthat.com\/index.php\/wp-json\/wp\/v2\/media?parent=636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}