{"action":"created","issue":{"url":"https://api.github.com/repos/KevinOConnor/klipper/issues/57","repository_url":"https://api.github.com/repos/KevinOConnor/klipper","labels_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/57/comments","events_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/57/events","html_url":"https://github.com/KevinOConnor/klipper/issues/57","id":282194929,"number":57,"title":"S-Curve acceleration? ","user":{"login":"dragonnn","id":1771469,"avatar_url":"https://avatars2.githubusercontent.com/u/1771469?v=4","gravatar_id":"","url":"https://api.github.com/users/dragonnn","html_url":"https://github.com/dragonnn","followers_url":"https://api.github.com/users/dragonnn/followers","following_url":"https://api.github.com/users/dragonnn/following{/other_user}","gists_url":"https://api.github.com/users/dragonnn/gists{/gist_id}","starred_url":"https://api.github.com/users/dragonnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dragonnn/subscriptions","organizations_url":"https://api.github.com/users/dragonnn/orgs","repos_url":"https://api.github.com/users/dragonnn/repos","events_url":"https://api.github.com/users/dragonnn/events{/privacy}","received_events_url":"https://api.github.com/users/dragonnn/received_events","type":"User","site_admin":false},"labels":[{"id":382382583,"url":"https://api.github.com/repos/KevinOConnor/klipper/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":66,"created_at":"2017-12-14T18:22:54Z","updated_at":"2018-04-14T19:56:03Z","closed_at":null,"author_association":"NONE","body":"klipper uses standard trapezoid acceleration as far I know. I never seen a firmware with s-curve like acceleration and I think it would work better for printers\r\nSome video from https://www.youtube.com/watch?v=qYJpl7SNoww \r\n\r\nSince klipper has enough processing power and the code is well organized I think it should be easy to implement.  "},"comment":{"url":"https://api.github.com/repos/KevinOConnor/klipper/issues/comments/381355998","html_url":"https://github.com/KevinOConnor/klipper/issues/57#issuecomment-381355998","issue_url":"https://api.github.com/repos/KevinOConnor/klipper/issues/57","id":381355998,"user":{"login":"ejtagle","id":831601,"avatar_url":"https://avatars2.githubusercontent.com/u/831601?v=4","gravatar_id":"","url":"https://api.github.com/users/ejtagle","html_url":"https://github.com/ejtagle","followers_url":"https://api.github.com/users/ejtagle/followers","following_url":"https://api.github.com/users/ejtagle/following{/other_user}","gists_url":"https://api.github.com/users/ejtagle/gists{/gist_id}","starred_url":"https://api.github.com/users/ejtagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejtagle/subscriptions","organizations_url":"https://api.github.com/users/ejtagle/orgs","repos_url":"https://api.github.com/users/ejtagle/repos","events_url":"https://api.github.com/users/ejtagle/events{/privacy}","received_events_url":"https://api.github.com/users/ejtagle/received_events","type":"User","site_admin":false},"created_at":"2018-04-14T19:56:03Z","updated_at":"2018-04-14T19:56:03Z","author_association":"NONE","body":"Hey! ... Please remember: One thing is theory, a very different one is reality!! ... Arbitrary precision calculation is pointless and a waste of resources, if at some point you are limited by the implementation. In your case, i assume there is a resolution limit in time (because, you must use a CPU timer to implement the delays between step pulses that are sent to a motor driver!!)\r\nAnd ALSO, a given motor has finite steps per turn. So, you must take that into consideration. \r\nAs a control systems professor of mine told me a lot of years ago: Perfect theory means nothing (unless you are planning to never implement it) if you can't convert it into reality and can't use it to modify and control that reality. And if a model requires perfect and infinitely precise measurements to work, then you are wrong, and will never get it to work in practice.\r\nBoth arbitrary mathematical precision and perfect modeling when, due to mechanical wear/slash/friction , the system itself can´t be considered a time invariant system when you try to model it at such level of detail, means you are just plainly wasting your time.\r\nSorry to be rude, but is the plain truth, You should try your ideas at some point in reality, to make sure you are in the right path and you are not wasting your time pursuing an impossible result.\r\n\r\nThe marlin implementation is quite simple:\r\n1) Fit a 5th order bezier curve to each CHANGE of speed (So, for each trapezoid there are 2 bezier curves, one for the starting acceleration phase, and another one for the ending deceleration phase. The trapezoidal cruising part is not handled by a bezier curve\r\nThe restrictions of that bezier curve are that acceleration is 0 at the start and at the end of the curve. Also, jerk is 0 at the start and at the end of the bezier, ONLY at the start and end points!. The remaining of the bezier curve can have acceleration and jerk .\r\nThe bezier curve models SPEED versus TIME. We normalize time to the range 0 to 1, that makes computations easier.\r\nWith that information you should be able to follow what is going on in the code. The newton-raphson iterations are not used to compute the curve. Just to compute distance/time, because on AVR that quotient takes too much time otherwise.\r\nProbably there are better approaches to this, but ensuring acceleration is 0 at the start and end of a movement, and that acceleration changes are smooth over time means applied forces do not change suddenly in magnitude or direction, and that means no vibrations and excitations of mechanical resonances of the machine.\r\nThat was the ONLY PURPOSE of that bezier interpolator, and it works amazinly well, compared to the previous trapezoidal implementation!"}}
{"actor":{"display_login":"ejtagle"}}