Wallacoloo / printipi

3d printing directly through the Raspberry Pi's GPIO pins
MIT License
141 stars 43 forks source link

Add ability to round path joints to minimize deceleration #16

Open Wallacoloo opened 10 years ago

Wallacoloo commented 10 years ago

With linear paths, one must theoretically come to a complete stop at each joint in order to avoid straying from the path. If these joints are turned into curves (essentially an arc of a circle where the start is tangential to the first path and the end is tangential to the second path), then a more gradual acceleration can occur that joins the paths without stopping. This achieves a faster and less jerky print speed at the cost of a small amount of theoretical precision.

Example: According to uniform circular motion, the radial acceleration required to maintain a circular path is a=v^2/r. Rearranged, v=sqrt(a*r). If our maximum curve radius is set to 1mm (which translates to (1-sqrt(1/2))^2 = .086 mm maximal error when executing a 90-degree turn (maximum distance between a square and a circle inset in the square) and our maximal acceleration is 1000mm/s/s, then the maximum speed we can take that corner at is 31.6 mm/sec. This is far better than decelerating all the way to 0. And if we can tolerate a 0.34mm error at the joints with 1000mm/s/s acceleration, then we can maintain a velocity of 63.2 mm/sec.

As can be seen, the maximal error is proportional to the radius of the turn, which is proportional to the square of the desired velocity. A more sophisticated curve choice could reduce the maximal error.

One nice thing is that implementing this provides all the necessary behavior required to handle G2/G3 arc movements as well.

matthewSorensen commented 10 years ago

FYI, I'm interested in working on this, and the rest of a quality acceleration planning system.

Wallacoloo commented 10 years ago

I think that this would be a good project for you, especially considering the other projects you've recently contributed to.