Greetings
I am trying to use a picaxe to control a stepper that does circle shapes. At each trace point, the engraver will move on the tangent of the circle for a short distance, then recalculate.
For instance
The first derivative of a circle is y' = +/- x/sqrt (25-x^2)
This is a circle x^2 + y^2 = 25
This circle has a radius of 5 and it's origin x = 0.
So, the 1st derivative is x divided by sqrt (25-x^2)
Thus, the slope at (-3, 4) - (the upper left convex quadrant of circle) is - (-3/sqrt(25-9)) or 3/4.
The stepper then 'knows' to proceed 4 in x and 3 in y. If the stepper is limited (arbitrarily) to
a distance of 2 per movement in the larger value, then x increments 2 and y increments 1.5.
In cases of rounding, it would be nice to avoid long term drift, but that may be avoided in a random rounding process.
Can a picaxe do a sqrt, and square a value? For this project, I don't need to be very accurate, maybe 1-2%.
Any stabs at this welcome.
I am trying to use a picaxe to control a stepper that does circle shapes. At each trace point, the engraver will move on the tangent of the circle for a short distance, then recalculate.
For instance
The first derivative of a circle is y' = +/- x/sqrt (25-x^2)
This is a circle x^2 + y^2 = 25
This circle has a radius of 5 and it's origin x = 0.
So, the 1st derivative is x divided by sqrt (25-x^2)
Thus, the slope at (-3, 4) - (the upper left convex quadrant of circle) is - (-3/sqrt(25-9)) or 3/4.
The stepper then 'knows' to proceed 4 in x and 3 in y. If the stepper is limited (arbitrarily) to
a distance of 2 per movement in the larger value, then x increments 2 and y increments 1.5.
In cases of rounding, it would be nice to avoid long term drift, but that may be avoided in a random rounding process.
Can a picaxe do a sqrt, and square a value? For this project, I don't need to be very accurate, maybe 1-2%.
Any stabs at this welcome.