nedlecky / AutoGrind

Custom grinding project for Olympus-Controls and Tosoh Quartz
1 stars 0 forks source link

N points in a circle #238

Closed nedlecky closed 2 years ago

nedlecky commented 2 years ago

Are we calculating correctly?

Another way to look at it is 2 points per second, like we do in grind_movel.

This would be pi D / speed 2.

100mm diam circle is 314mm circumference. So at 20mm/s you'd want 15 points but we insist on 100 so we don't polygon. But at 2mm/s you'd want 157 and you'd want 314 points at 1mm/s

nedlecky commented 2 years ago

This is now 2 Hz for blend_radius==0 BUT we recommend blend_radius==2mm and then we do a new point every 1.5 blend radii

Circles and spirals are done with imover_realtime off so the blend actually works!

def recommend_npoints(diam_m):

2 points per second?

local circum_m = MATH_PI diam_m local t = circum_m / grind_speed_mps global grind_circle_n_sides = limiter(ceil(t 2), 2, 1000) return grind_circle_n_sides end

Grind along a circle with circle_diam_mm. Repeat n_cycles times. If stay_in_contact, stay_in_contact at end.

def grind_circle(circle_diam_mm, n_cycles, stay_in_contact): global grind_circle_n_sides = recommend_npoints(circle_diam_mm / 1000.0)

if grind_blend_radius_m > 0.0:

Try setting n_sides to 1.5 blend radii

local circum_m = MATH_PI * circle_diam_mm / 1000.
global grind_circle_n_sides = ceil(circum_m / (grind_blend_radius_m * 1.5))

end ...