Parameterisation of the camera platform height for lens spacers
Coming from things noticed in !309, the parameterisation of the lens spacer and camera platform dimensions is not clear.
Notes copied from there, and corrected/tidied up:
There remains a question about the way the platform height is generated in relation to both the "parfocal_distance"
dictionary item and also the shift
translate_z(-4){
objective_fitting_cutout(params, y_stop=true);
}
The position of the bottom of the lens spacer is defined as
function lens_spacer_z(params, optics_config) = let(
sample_z = key_lookup("sample_z", params),
parfocal_distance = key_lookup("parfocal_distance", optics_config),
lens_spacing = key_lookup("lens_spacing", optics_config)
) sample_z - (parfocal_distance + camera_sensor_height(optics_config) + lens_spacing);
so starting from the sample we go down the par-focal distance, then the lens spacing, then the camera sensor height (above the PCB) (6 , 17, 2 for the PiCamera = 25mm)
The distance that we actually want is: front focal distance + lens real thickness + lens spacing + camera sensor height + board thickness (1 + 3 (checked on a Pi Camera V2 lens) + 17 + 2 (Checked on a Pi camera V2) + 1 (Checked on a Pi camera V2) = 24mm) which is 1mm less.
The -4mm in the mounting nut position is not about the platform height, but about allowing the camera to move up a long way in the microscope body, which would allow slide risers.
With the Arducam B0196 focused (same sensor and lens module as the Pi Camera V2.1), the base of the camera platform is 1 to 1.2mm higher than the base of the microscope. This means that the camera platform height is close to correct, if anything a little short. This matches the calculation that we are placing the camera 25mm below the sample when it should be about 24mm below the sample.
The -4mm shift does not affect this, it is about where the clamping screw and nut are in the z-axis dovetail. The screw is indeed quite far below the nominal position - which is the very top of the slot for V7.0.0-Beta1. The platform can indeed move a further 4mm higher up the body to the highest place on the slot where the Allen key can be used.
With the Arducam B0196 focussed the distance from the lens face to the sample is hard to measure, but it does appear to be about 1mm. Not less than 1mm, possibly as much as 1.5mm.
So the suggestion would be:
- Remove the
translate_z(-4)
or maybe make it-2
- Re-parameterise the bottom of the lens spacer as
sample_z - (parfocal_distance + camera_sensor_height(optics_config) + lens_spacing + camera_board_thickness)
. Also make a note in the dictionaries thatparfocal_distance
is front working distance plus lens thickness, so for the Pi Camera V2.1 it is 4mm not 6mm