Which algorithm does Marlin use to create arcs?

6

1

I'm writing a paper about a plotter (I use a Prusa i3 with a custom "extruder" aka pen). And I'm supposed to write about the algorithms I/the plotter use(s). I tried reverse engineering, but since I'm not very experienced with this technique I wasn't successful. So I'm looking for the algorithm that Marlin uses for its G2/G3 commands.

Mattis

Posted 2016-04-01T23:18:49.420

Reputation: 101

3

Have you looked at Marlin_main.cpp, specifically t,e plan_arc function?

– Tom van der Zanden – 2016-04-02T09:21:18.300

Answers

4

The algorithm is based on the "Vector rotation by transformation matrix", and this solution is based on a solution from Jens Geisler. The formula for clockwise rotation is:

Vector rotation

More information about the vector rotation can be found on Wikipedia.

Mattis

Posted 2016-04-01T23:18:49.420

Reputation: 101