Skip to content

Commit

Permalink
All parts now built by Makefile
Browse files Browse the repository at this point in the history
The autogenerated makefile now produces STLs of *everything* required by all standard versions of the microscope.  There should be no further need for the stl folder (!)

I've updated the readmes to reflect this.
  • Loading branch information
rwb27 committed Nov 21, 2017
1 parent 6f773f1 commit 515bc15
Show file tree
Hide file tree
Showing 53 changed files with 1,376,136 additions and 684,814 deletions.
86 changes: 57 additions & 29 deletions Makefile
Expand Up @@ -8,13 +8,17 @@ OUTPUT = builds
body_versions = SS40 SS40-M LS65 LS65-M LS75 LS75-M
optics_versions = picamera_2_pilens_SS40 logitech_c270_c270_lens_SS40 picamera_2_rms_f40d16_LS65 picamera_2_rms_f50d13_LS65 logitech_c270_rms_f40d16_LS65 logitech_c270_rms_f50d13_LS65 m12_rms_f40d16_LS65 m12_rms_f50d13_LS65 m12_m12_lens_LS65
illumination_versions = SS40 SS40_tall SS40_condenser SS40_condenser_tall LS65 LS65_tall LS65_condenser LS65_condenser_tall LS75 LS75_tall LS75_condenser LS75_condenser_tall
sample_riser_versions = LS10 LS5 SS5
slide_riser_versions = LS10

TOOLS := actuator_assembly_tools condenser_lens_tool tube_lens_tool
COMMONPARTS := feet feet_tall gears sample_clips
TOOLS := $(TOOLS) picamera_2_cover picamera_2_gripper picamera_2_lens_gripper
ACCESSORIES := picamera_2_cover $(sample_riser_versions:%=sample_riser_%) $(slide_riser_versions:%=slide_riser_%)
COMMONPARTS := feet feet_tall gears sample_clips small_gears
BODIES := $(body_versions:%=main_body_%)
OPTICS := $(optics_versions:%=optics_%)
ILLUMINATIONS := $(illumination_versions:%=illumination_and_rear_foot_%)
ALLPARTS := $(COMMONPARTS) $(TOOLS) $(BODIES) $(ILLUMINATIONS)
ALLPARTS := $(COMMONPARTS) $(TOOLS) $(BODIES) $(ILLUMINATIONS) $(OPTICS) $(ACCESSORIES)
ALLSTLFILES := $(ALLPARTS:%=$(OUTPUT)/%.stl)

parameters_file := $(SOURCE)/microscope_parameters.scad
Expand All @@ -32,93 +36,117 @@ $(OUTPUT)/%.stl: $(all_deps)
main_body_dep_names := compact_nut_seat dovetail logo
main_body_deps := $(main_body_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/main_body_SS40.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D big_stage=false -D sample_z=40 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<

$(OUTPUT)/main_body_SS40-M.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D big_stage=false -D sample_z=40 -D motor_lugs=true $<
openscad -o $@ -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=true' $<

$(OUTPUT)/main_body_LS65.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/main_body_LS65-M.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D big_stage=true -D sample_z=65 -D motor_lugs=true $<
openscad -o $@ -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=true' $<

$(OUTPUT)/main_body_LS75.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D big_stage=true -D sample_z=75 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=true' -D 'sample_z=75' -D 'motor_lugs=false' $<

$(OUTPUT)/main_body_LS75-M.stl: $(SOURCE)/main_body.scad $(main_body_deps)
openscad -o $@ -D big_stage=true -D sample_z=75 -D motor_lugs=true $<
openscad -o $@ -D 'big_stage=true' -D 'sample_z=75' -D 'motor_lugs=true' $<


illumination_dep_names := dovetail optics
illumination_deps := $(illumination_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/illumination_and_rear_foot_SS40.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=false -D condenser=false -D sample_z=40 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=false' -D 'condenser=false' -D 'sample_z=40' -D 'motor_lugs=false' $<

$(OUTPUT)/illumination_and_rear_foot_SS40_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=false -D motor_lugs=false -D condenser=false -D sample_z=40 -D foot_height=26 $<
openscad -o $@ -D 'big_stage=false' -D 'motor_lugs=false' -D 'condenser=false' -D 'sample_z=40' -D 'foot_height=26' $<

$(OUTPUT)/illumination_and_rear_foot_SS40_condenser.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=false -D condenser=true -D sample_z=40 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=false' -D 'condenser=true' -D 'sample_z=40' -D 'motor_lugs=false' $<

$(OUTPUT)/illumination_and_rear_foot_SS40_condenser_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=false -D motor_lugs=false -D condenser=true -D sample_z=40 -D foot_height=26 $<
openscad -o $@ -D 'big_stage=false' -D 'motor_lugs=false' -D 'condenser=true' -D 'sample_z=40' -D 'foot_height=26' $<

$(OUTPUT)/illumination_and_rear_foot_LS65.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D condenser=false -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=true' -D 'condenser=false' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/illumination_and_rear_foot_LS65_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D motor_lugs=false -D condenser=false -D sample_z=65 -D foot_height=26 $<
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=false' -D 'sample_z=65' -D 'foot_height=26' $<

$(OUTPUT)/illumination_and_rear_foot_LS65_condenser.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D condenser=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=true' -D 'condenser=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/illumination_and_rear_foot_LS65_condenser_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D motor_lugs=false -D condenser=true -D sample_z=65 -D foot_height=26 $<
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=true' -D 'sample_z=65' -D 'foot_height=26' $<

$(OUTPUT)/illumination_and_rear_foot_LS75.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D condenser=false -D sample_z=75 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=true' -D 'condenser=false' -D 'sample_z=75' -D 'motor_lugs=false' $<

$(OUTPUT)/illumination_and_rear_foot_LS75_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D motor_lugs=false -D condenser=false -D sample_z=75 -D foot_height=26 $<
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=false' -D 'sample_z=75' -D 'foot_height=26' $<

$(OUTPUT)/illumination_and_rear_foot_LS75_condenser.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D condenser=true -D sample_z=75 -D motor_lugs=false $<
openscad -o $@ -D 'big_stage=true' -D 'condenser=true' -D 'sample_z=75' -D 'motor_lugs=false' $<

$(OUTPUT)/illumination_and_rear_foot_LS75_condenser_tall.stl: $(SOURCE)/illumination_and_rear_foot.scad $(illumination_deps)
openscad -o $@ -D big_stage=true -D motor_lugs=false -D condenser=true -D sample_z=75 -D foot_height=26 $<
openscad -o $@ -D 'big_stage=true' -D 'motor_lugs=false' -D 'condenser=true' -D 'sample_z=75' -D 'foot_height=26' $<


optics_dep_names := dovetail cameras/camera
optics_deps := $(optics_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/optics_picamera_2_pilens_SS40.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=pilens -D camera=picamera_2 -D big_stage=false -D sample_z=40 -D motor_lugs=false $<
openscad -o $@ -D 'optics="pilens"' -D 'camera="picamera_2"' -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_logitech_c270_c270_lens_SS40.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=c270_lens -D camera=logitech_c270 -D big_stage=false -D sample_z=40 -D motor_lugs=false $<
openscad -o $@ -D 'optics="c270_lens"' -D 'camera="logitech_c270"' -D 'big_stage=false' -D 'sample_z=40' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_picamera_2_rms_f40d16_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=rms_f40d16 -D camera=picamera_2 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="rms_f40d16"' -D 'camera="picamera_2"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_picamera_2_rms_f50d13_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=rms_f50d13 -D camera=picamera_2 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="rms_f50d13"' -D 'camera="picamera_2"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_logitech_c270_rms_f40d16_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=rms_f40d16 -D camera=logitech_c270 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="rms_f40d16"' -D 'camera="logitech_c270"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_logitech_c270_rms_f50d13_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=rms_f50d13 -D camera=logitech_c270 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="rms_f50d13"' -D 'camera="logitech_c270"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_m12_rms_f40d16_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=rms_f40d16 -D camera=m12 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="rms_f40d16"' -D 'camera="m12"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_m12_rms_f50d13_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=rms_f50d13 -D camera=m12 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="rms_f50d13"' -D 'camera="m12"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<

$(OUTPUT)/optics_m12_m12_lens_LS65.stl: $(SOURCE)/optics.scad $(optics_deps)
openscad -o $@ -D optics=m12_lens -D camera=m12 -D big_stage=true -D sample_z=65 -D motor_lugs=false $<
openscad -o $@ -D 'optics="m12_lens"' -D 'camera="m12"' -D 'big_stage=true' -D 'sample_z=65' -D 'motor_lugs=false' $<


riser_dep_names := main_body
riser_deps := $(optics_dep_names:%=$(SOURCE)/%.scad)
$(OUTPUT)/sample_riser_LS10.stl: $(SOURCE)/sample_riser.scad $(riser_deps)
openscad -o $@ -D 'h=10' -D 'big_stage=true' $<

$(OUTPUT)/sample_riser_LS5.stl: $(SOURCE)/sample_riser.scad $(riser_deps)
openscad -o $@ -D 'h=5' -D 'big_stage=true' $<

$(OUTPUT)/sample_riser_SS5.stl: $(SOURCE)/sample_riser.scad $(riser_deps)
openscad -o $@ -D 'h=5' -D 'big_stage=false' $<

$(OUTPUT)/slide_riser_LS10.stl: $(SOURCE)/slide_riser.scad $(riser_deps)
openscad -o $@ -D 'h=10' -D 'big_stage=true' $<


$(OUTPUT)/picamera_2_%.stl: $(SOURCE)/cameras/picamera_2_%.scad $(all_deps)
openscad -o $@ -D 'camera="picamera_2"' $<


$(OUTPUT)/feet_tall.stl: $(SOURCE)/feet.scad $(all_deps)
openscad -o $@ -D 'foot_height=26' $<


$(OUTPUT)/%.stl: $(SOURCE)/%.scad $(all_deps)
openscad -o $@ $<


2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -13,7 +13,7 @@ This project is open-source and is released under the CERN open hardware license
To build the microscope, go to [version 5.16 release](https://github.com/rwb27/openflexure_microscope/releases/tag/v5.16.10-beta) and
download the STL files and instructions. Don't just print everything from the STL folder,
as currently it contains some parts that must be printed multiple times, and other parts
that are redundant. The assembly instructions contain instructions on what parts to print - or you can consult the readme file in the [STL folder](https://github.com/rwb27/openflexure_microscope/tree/master/docs/stl). The top-level STL folder is a bit of a mixed bag of files generated during development; we've left it in the repository because it's helpful to share things with people, but there's no guarantee the files in there are up to date, or compatible with any particular version of the microscope.
that are redundant. The assembly instructions contain instructions on what parts to print - or you can consult the readme file in the [builds folder](https://github.com/rwb27/openflexure_microscope/tree/master/builds) if you want the latest version. The top-level STL folder is a bit of a mixed bag of files generated during development; we've left it in the repository because it's helpful to share things with people, but there's no guarantee the files in there are up to date, or compatible with any particular version of the microscope.

If you've built one, let us know - add yourself to the [wiki page of builds](https://github.com/rwb27/openflexure_microscope/wiki/Assembly-Logs) or submit a [build report issue](https://github.com/rwb27/openflexure_microscope/issues/new?labels=build%20report). This is a really helpful thing to do even if you don't suggest improvements or flag up problems.

Expand Down
39 changes: 27 additions & 12 deletions builds/README.md
Expand Up @@ -14,23 +14,38 @@ These files are all designed to print without support material or adhesion layer
To build a basic OpenFlexure microscope you need:

Plastic tools:
* actuator_assembly_tools.stl
* [optional] tool to insert the condenser lens: condenser_lens_tool.stl
* [optional] tool to insert the tube lens: tube_lens_tool.stl
* [optional] tools to remove the Raspberry Pi camera's lens: picam2_board_gripper.stl, picam2_lens_remover.stl (currently these are located in the ``docs/stl`` folder).
* band and nut insertion tools ``actuator_assembly_tools.stl``
* [optional] tool to insert the condenser lens: ``condenser_lens_tool.stl``
* [optional] tool to insert the tube lens: ``tube_lens_tool.stl``
* [optional] tools to remove the Raspberry Pi camera's lens: ``picamera_2_gripper.stl``, ``picamera_2_lens_gripper.stl``

Components:
* body of the microscope: body_<version>.stl (there are 6 versions).
* 3 feet: feet.stl or feet_tall.stl (contains all 3)
* 3 gears: gears.stl (contains 3)
* illumination arm: illumination <version>.stl (there are multiple versions).
* 2 sample clips: sample_clip.stl (need to print 2)
* optics module: optics_<version>.stl (there are 6 versions, and STL files for these are in the main ``stl`` folder)
* [optional] camera cover: picam_cover.stl (from the main ``stl`` folder)
* body of the microscope: ``body_<stage size><height>[-M].stl``.
* 3 feet: ``feet.stl`` or ``feet_tall.stl`` (contains all 3)
* 3 gears: ``gears.stl`` (contains all 3)
* illumination arm: ``illumination_<stage size><height>[_condenser][_tall].stl``
* 2 sample clips: ``sample_clips.stl`` (contains both)
* optics module: ``optics_<camera>_<lens>_<stage size><height>.stl
* [optional] camera cover: ``picamera_2_cover.stl``
* [optional] 3 small gears for motors: ``small_gears.stl`` (contains all 3)
* [optional] riser for the sample: ``sample_riser_<stage size><thickness>.stl``
* [optional] slide holder that works better if using immersion oil: ``slide_riser_LS10.stl``

In the filenames above, where there are multiple versions, parameters are included in angle brackets:
* ``<stage size>`` will be either ``SS`` for small stage or ``LS`` for large stage
* ``<height>`` is the height from the bottom of the main body to the top of the stage in mm, usually ``40`` or ``65`` (occasionally ``75`` if you are using a sample riser, or a larger body).
* Usually the above two parameters occur next to each other, so you will see "SS40" or "LS65".
* ``<camera>`` is the camera you are using, either ``picamera_2`` for the Raspberry Pi camera module v2, ``c270`` for the Logitech C270, or ``m12`` for a camera with a screw-on M12 lens mount.
* ``<lens>`` is the lens you are using, either ``pilens``, ``c270_lens``, or ``m12_lens`` if you are using the lens that came with your camera. To use a finite-conjugate objective lens, you should specify ``rms_f40d16`` (to use a Comar tube lens, focal length 40mm, diameter 16mm) or ``rms_f50d13`` (for a 50mm focal length ThorLabs ac127-050-a lens)
* ``<thickness>`` is the thickness of a stage riser - the amount it adds to the height. Usually a 10mm riser is used with a 65mm body to allow a taller objective to be used.
Optional bits of filenames are in square brackets above:
* ``-M`` in the body name means it has motor lugs to allow 28BYJ-48 stepper motors to be fitted
* ``_condenser`` in the illumination name means there is a mount for a plastic condenser lens
* ``_tall`` on the illumination or the feet means the body sits 26mm off the ground rather than 15mm, to give clearance for larger camera modules.

Which version of the body you need depends on two things: firstly, whether you want to use a large optics module (versions with LS65 or LS75 in the name) or a small one (versions with SS), and secondly whether you want attachment lugs for motors (files with -M in the name). All the files start with `body_`.You need the SS version if you're using a Raspberry Pi camera or a Logitech C270 camera, together with the lens that came on the camera. If you're using a microscope objective, or the USB camera with M12 lens, you need the LS65 version. The microscope body takes around 8 hours on a RepRapPro Ormerod (and many other low-end printers) or about 5 hours on Ultimaker, MakerBot, and the like.

The illumination arm is available in 4 versions: they all start with `illumination_and_back_foot_` and then you can choose either adjustable arm with a bare LED, or bare LED plus tape (`adj`) or one that uses a condenser lens (`condenser`). It's important to match the type of microscope you're using (LS65 or SS). If you are using a riser to make space for a larger objective (if you've got a 35mm parfocal length objective) you'll need the LS75 version.
The illumination arm is available in 4 versions: they all start with `illumination_and_rear_foot_` and then you can choose either adjustable arm with a bare LED, or bare LED plus tape or one that uses a condenser lens (`_condenser`). It's important to match the type of microscope you're using (LS65 or SS40). If you are using a riser to make space for a larger objective (if you've got a 35mm parfocal length objective) you'll need the LS75 version.

There are several versions of the optics module, depending on your camera (Raspberry Pi Camera v2, Logitech C270, or WaterScope USB camera) and on whether you will use the lens from the camera (pilens, M12, ownlens) or an RMS objective and 40mm tube lens. Make sure you pick the right STL file for your camera module! There is a cover that fits over the Raspberry Pi camera module, and holds it firmly onto the optics module. The following table shows compatibility:

Expand Down

0 comments on commit 515bc15

Please sign in to comment.