Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
310 stars 198 forks source link

Acceleration config for each axis separately #294

Open wsowa opened 6 years ago

wsowa commented 6 years ago

In most printers at least Z and E axis have different mechanics than X and Y. Often X and Y differs as well. Therefore it makes sense to control acceleration of every axis separately. Indeed many other firmwares allow for such config. This change adds ability to configure acceleration for X,Y,Z and E independently

Wurstnase commented 6 years ago

Thanks for your contribution.

Your approach will work excellent on single axis movements. But unfortunately not on multiple axis movements.

Movements are dependent on each other. The one axis with the most steps per second will win. On this axis the speed will calculated. So when this axis has high acceleration and a tiny slower axis has much lower acceleration values, the tiny slower axis will accelerate with the high acceleration from the tiny faster axis.

So you need to check the acceleration in dda_clock and calculate a new acceleration for the move and the fast axis. This will not be constant anymore.

Traumflug commented 6 years ago

True, a valuable contribution. The Configtool part looks good.

To get the remaining part working for multiaxis movements, one has to calculate acceleration duration for each participating axis and take the longest one. Then calculate acceleration on the fast axis using this longest duration.

wsowa commented 6 years ago

I had a feeling it was too easy. I’ll get back to you with more changes. Thanks for the hints where to start.

triffid commented 6 years ago

Yep the most important consideration with new motion profiles is that XYZE move in a straight line in 4d space (or XYZ in 3-space etc). Without this property, you'll get dog legs or s curves in your straight lines.

In the case of different constraints on each axis, one way to approach this is to determine the length of the acceleration segment using each axis' constraint and it's contribution to the total length of the movement, find the longest/slowest one, then recalculate the acceleration for all other involved axes. Same for deceleration and, if they don't intersect, the coast segment is whatever's left.

With 3d printers there's a unique issue that happens where the rate of extrusion lags behind the extruder's motor, and so any time you have sudden speed changes in 3-space there will be defects in the print. In this case it's best to simply limit the acceleration of both X and Y to the slower of the two and sacrifice potential travel speed in one direction to gain overall print quality. Z is not much of an issue here since it typically has rare and very small movements compared to XY.

Fwiw a dog leg in an XE movement would give you either a big blob or no plastic at all at the end of a segment.

On 14 Feb 2018 15:58, "Witold Sowa" notifications@github.com wrote:

I had a feeling it was too easy. I’ll get back to you with more changes. Thanks for the hints where to start.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Traumflug/Teacup_Firmware/pull/294#issuecomment-365524528, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKBGiABw8RSUMgolV124YbQLogmVyCHks5tUpIsgaJpZM4SC1g4 .