Microscope lug position is defined from stage height, not from stage width.
The function microscope_back_lug_x_pos()
is defined in microscope_parameters.scad
.
It is not only used to set the lug position, but also it is used to set the position of a nearly vertical edge on wall inside the legs (the one near the lug, where the cable tidies attach), and the base cut-out under the stage, and the body part of the optics fitting wedge.
The current code is:
/**
* Sets the position of the back lugs (These are the lugs by the legs)
* The front lugs are set by the position of the actuator housing.
* To get all holes see base_mounting_holes in microscope_structure.scad
*/
function back_lug_x_pos(params) = let(
leg_r = key_lookup("leg_r", params),
tenth_of_height = max(5,leg_dims(params).z*0.1)
) (leg_r-flex_dims().y-tenth_of_height)*sqrt(2);
So the horizontal position of this is defined by the vertical height of the legs!
This means that if you change the height of the stage the wall and the optics fitting wedge break.
The leg height is (I think exactly, possibly a flexure thickness different) the sample_z
minus stage_t
which in the default params is 75-15=60mm. The default leg_r
is 30mm.
So, by setting 'fifth of stage radius` instead of 'tenth of leg height' we should have exactly the same number by default, but it all still works for a taller stage.
function back_lug_x_pos(params) = let(
leg_r = key_lookup("leg_r", params),
fifth_of_radius = max(5,leg_r*0.2)
) (leg_r-flex_dims().y-fifth_of_radius)*sqrt(2);
Using echo()
the default back_lug_x_pos
is 31.7137 in the old version, and it becomes 31.8198 in this new version. The STLs look more similar than that.
Trying it out for a larger stage, leg_r=45
it also gives a better result than the old version.
not
.
Edit:
leg_dims
z-component is the height of the sample minus the thickness of the stage (in a round-about route via upper_xy_flex_z
and leg_height
) plus the flexure thickness flex_dims().z
. That is 0.75mm by default, so tenth_of_height
is 0.075 bigger than fifth_of_radius
. With the sqrt(2) that makes 0.1mm movement.