{"action":"created","issue":{"url":"https://api.github.com/repos/Traumflug/Teacup_Firmware/issues/117","labels_url":"https://api.github.com/repos/Traumflug/Teacup_Firmware/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/Traumflug/Teacup_Firmware/issues/117/comments","events_url":"https://api.github.com/repos/Traumflug/Teacup_Firmware/issues/117/events","html_url":"https://github.com/Traumflug/Teacup_Firmware/issues/117","id":57037151,"number":117,"title":"Delta Printer Support","user":{"login":"NickE37","id":10699387,"avatar_url":"https://avatars.githubusercontent.com/u/10699387?v=3","gravatar_id":"","url":"https://api.github.com/users/NickE37","html_url":"https://github.com/NickE37","followers_url":"https://api.github.com/users/NickE37/followers","following_url":"https://api.github.com/users/NickE37/following{/other_user}","gists_url":"https://api.github.com/users/NickE37/gists{/gist_id}","starred_url":"https://api.github.com/users/NickE37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickE37/subscriptions","organizations_url":"https://api.github.com/users/NickE37/orgs","repos_url":"https://api.github.com/users/NickE37/repos","events_url":"https://api.github.com/users/NickE37/events{/privacy}","received_events_url":"https://api.github.com/users/NickE37/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-02-09T14:28:32Z","updated_at":"2015-02-15T15:54:23Z","closed_at":null,"body":"I have been familiarizing myself with the source code so that I can add Delta Printer support to Teacup.  \r\n\r\nThe biggest issue I see is with micrometer scales and 32 bit integers.  The conversion of cartesian coordinates to tower movement is (for each tower):\r\n\r\ndelta_tow_a_pos=sqrt(arm_len^2 - (tow_a_loc_x - cart_x)^2 -(tow_a_loc_y - cart_y)^2) + cart_z\r\ndelta_tow_b_pos=sqrt(arm_len^2 - (tow_a_loc_b - cart_x)^2 -(tow_a_loc_b - cart_y)^2) + cart_z\r\ndelta_tow_c_pos=sqrt(arm_len^2 - (tow_a_loc_c - cart_x)^2 -(tow_a_loc_c - cart_y)^2) + cart_z\r\n\r\nTypical values for delta printers overflow 32 bit integers when squared.\r\n\r\nFor example, a typical arm_len is between 170mm to 300mm (170000um to 300000um).  Squared that is 28,900,000,000 to 90,000,000,000, where 2^32 is 4,294,967,296.  [I apologize for being pedantic, I am trying to document the problem here, not insult you.]\r\n\r\nFor Teacup, what is the best way to handle this problem?  \r\n- 64 bit integers for the calculations then back to 32 bit? \r\n- Floats for the calculations then back to 32 bit? \r\n- Scaling the numbers down for the calculation (a factor of 10?), then back to um to return the results?\r\n- Something else?\r\n\r\nThis problem is also being massively compounded by having the typical cartestian move chopped into small segments.\r\n\r\nYour guidance would be appreciated.\r\n\r\nNickE"},"comment":{"url":"https://api.github.com/repos/Traumflug/Teacup_Firmware/issues/comments/74422798","html_url":"https://github.com/Traumflug/Teacup_Firmware/issues/117#issuecomment-74422798","issue_url":"https://api.github.com/repos/Traumflug/Teacup_Firmware/issues/117","id":74422798,"user":{"login":"NickE37","id":10699387,"avatar_url":"https://avatars.githubusercontent.com/u/10699387?v=3","gravatar_id":"","url":"https://api.github.com/users/NickE37","html_url":"https://github.com/NickE37","followers_url":"https://api.github.com/users/NickE37/followers","following_url":"https://api.github.com/users/NickE37/following{/other_user}","gists_url":"https://api.github.com/users/NickE37/gists{/gist_id}","starred_url":"https://api.github.com/users/NickE37/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickE37/subscriptions","organizations_url":"https://api.github.com/users/NickE37/orgs","repos_url":"https://api.github.com/users/NickE37/repos","events_url":"https://api.github.com/users/NickE37/events{/privacy}","received_events_url":"https://api.github.com/users/NickE37/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T15:54:23Z","updated_at":"2015-02-15T15:54:23Z","body":"I am interested in the approach that dc42 and ambrop7 have taken, but I do not think it will ever be feasible in Teacup without 32 bit hardware.  It might not be necessary...\r\n\r\nI have been doing a deep review of the mathematics of cartesian to delta and delta to cartesian coordinate space.  Marlin and Repetier do segmentation and dc42 and ambrop7 calculate step-accurate timing because if you simply transform a cartesian move to delta coordinates and then move linearly (constant timing between steps from delta start to delta end) in delta space, you will have positional errors in cartesian space along the path.  In other words, the transformation of cartesian to delta space is not linear.  \r\n\r\nIt turns out the error function looks remarkably similar to a ballastics with drag trajectory.  If I can match the parameters of the error function to known quantities, I should be able to write a \"correction\" function that is very similar to an acceleration function, completely removing the need for segmentation or per step calculations.  Anyway, slogging through the math now."}}