{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9379","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9379/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9379/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9379/events","html_url":"https://github.com/MarlinFirmware/Marlin/pull/9379","id":292218349,"number":9379,"title":"[Don't merge!] LIN_ADVANCE v1.5 for testers","user":{"login":"Sebastianv650","id":10776877,"avatar_url":"https://avatars3.githubusercontent.com/u/10776877?v=4","gravatar_id":"","url":"https://api.github.com/users/Sebastianv650","html_url":"https://github.com/Sebastianv650","followers_url":"https://api.github.com/users/Sebastianv650/followers","following_url":"https://api.github.com/users/Sebastianv650/following{/other_user}","gists_url":"https://api.github.com/users/Sebastianv650/gists{/gist_id}","starred_url":"https://api.github.com/users/Sebastianv650/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sebastianv650/subscriptions","organizations_url":"https://api.github.com/users/Sebastianv650/orgs","repos_url":"https://api.github.com/users/Sebastianv650/repos","events_url":"https://api.github.com/users/Sebastianv650/events{/privacy}","received_events_url":"https://api.github.com/users/Sebastianv650/received_events","type":"User","site_admin":false},"labels":[{"id":196934261,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/PR:%20Bugfix","name":"PR: Bugfix","color":"bfe5bf","default":false},{"id":281783768,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Status:%20Don't%20Merge","name":"Status: Don't Merge","color":"b60205","default":false},{"id":342950962,"url":"https://api.github.com/repos/MarlinFirmware/Marlin/labels/Status:%20Experimental","name":"Status: Experimental","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":115,"created_at":"2018-01-28T16:39:00Z","updated_at":"2018-02-12T13:38:04Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/pulls/9379","html_url":"https://github.com/MarlinFirmware/Marlin/pull/9379","diff_url":"https://github.com/MarlinFirmware/Marlin/pull/9379.diff","patch_url":"https://github.com/MarlinFirmware/Marlin/pull/9379.patch"},"body":"This is a most likely working, but unifinished version of a `LIN_ADVANCE` \"v1.5\".\r\n\r\nAfter all my tries failed where I tried to improve LIN_ADVANCE with the existing method used, I decided to go with another approach. The final result is the same, but instead of calculating advance steps inside the stepper ISR and execute them in a horrible inconsistent time interval with all sorts of spikes, this one offsets the extruder speed during acceleration and deceleration.\r\nThis is done using a reference speed offset which is defined as speed offset needed at an extruder acceleration of 10mm/s². Inside the planner, the extruder acceleration is calculated and based on this and the speed offset for the block.\r\nThe extruder ISR is now running at the fixed speed offset calculated for the block during acceleration and deceleration. Each ISR run will execute an advance step together with all other extruder steps (where the extruder steps can only be 0 or step_loop value).\r\nThis way, there is absolutely no calculation needed within the stepper ISR, which saves memory and processing time. Also the extruder speed has no spikes any more, which results in smooth running. Another benefit is that we can now check for extruder jerk violations inside the planner easily and limit the speed if necessary.\r\n\r\nAll this means LIN_ADVANCE is no longer using a spring constant K for tuning but a V value as speed (or **V**elocity) offset.\r\n\r\nThis method has a possible disadvantage as well (of course):\r\nIt's only precise as long as Marlin is using a true linear acceleration and final speed is always start speed of the next block. As we know, this is only true in an approximation. Might be good enough in reality, has to be tested.\r\nUp to now it's also using the same extrusion length to line length ratio for its calculation as v1.0 did. This means it's also using the float raw values from gcode, but if further tests are fine I would test using the step-based values already available in the planner. Maybe the precission is good enough for this version.\r\nThis also means it's most likely also not delta-compatible. For this, I have to understand where the delta transformations are calculated first, and how to calculate the extruder acceleration for deltas. Maybe someone has a good approach?\r\n\r\nAs you might see, the implementation is not very polished up to now. It's ment to be functional for testing, as long as it's running on a cartesian printer with only a single extruder stepper (no mixing extruder or other fancy stuff).\r\nMy first test prints (fast cylinders and parts where I know the v1.0 makes problems) are looking very promising, that's why I decided to creates this PR so others can have a look at it.\r\n\r\nFeel free to comment, test it, give advises how to code it better!\r\n\r\nKnown issues / things todo or check:\r\n- [x] Enable the eISR to also handle others than only extruder 0\r\n- [x] Zero `current_adv_steps` when the extruder has changed\r\n- [x] `current_block` is set to `Null `as soon as the last `step_loops` is done, but the time until the next block is called is still belonging to the old block. This prevents LIN_ADVANCE from executing the last advance steps.\r\n- [x] Detect retracts which got joined with a short segment by a unusual e/D ratio instead of checking for the leading axis.\r\n- [ ] Check handling of variable width moves, where no acceleration is present at all\r\n- [ ] On variable width path it's possible that we need to deplete pressure during acceleration, therefore LIN_ADVANCE would need to check for the actual direction needed. In this case, the calculated extruder speed will not be the optimum for correction but still good enough.\r\n- [ ] Check if set extruder speed is suitable to execute normal + advance esteps. Might be necessary on low K factors for example."},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/364924469","html_url":"https://github.com/MarlinFirmware/Marlin/pull/9379#issuecomment-364924469","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/9379","id":364924469,"user":{"login":"Sebastianv650","id":10776877,"avatar_url":"https://avatars3.githubusercontent.com/u/10776877?v=4","gravatar_id":"","url":"https://api.github.com/users/Sebastianv650","html_url":"https://github.com/Sebastianv650","followers_url":"https://api.github.com/users/Sebastianv650/followers","following_url":"https://api.github.com/users/Sebastianv650/following{/other_user}","gists_url":"https://api.github.com/users/Sebastianv650/gists{/gist_id}","starred_url":"https://api.github.com/users/Sebastianv650/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sebastianv650/subscriptions","organizations_url":"https://api.github.com/users/Sebastianv650/orgs","repos_url":"https://api.github.com/users/Sebastianv650/repos","events_url":"https://api.github.com/users/Sebastianv650/events{/privacy}","received_events_url":"https://api.github.com/users/Sebastianv650/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T13:38:04Z","updated_at":"2018-02-12T13:38:04Z","author_association":"NONE","body":"The v1.5 is the right one. No, no lag at all. As soon as i push the commit, you can also download it.\r\nThere is no version number related to my changes, but you can search for one specific thing that was changed by the last commit on your downloaded code. "}}
{"actor":{"display_login":"Sebastianv650"}}