From fedb77789d8695de042aa14b291a29429ab56261 Mon Sep 17 00:00:00 2001 From: Sebastian Wendel Date: Mon, 18 Sep 2023 03:42:18 +0200 Subject: [PATCH] added OpenScad pump designs --- .vscode/extensions.json | 1 + README.md | 2 +- .../flowflex-peristaltic-pump.scad | 0 hardware/peristaltic-pump/libs/base.scad | 57 ++++++++++++++++++ hardware/peristaltic-pump/pump-body.scad | 45 ++++++++++++++ hardware/peristaltic-pump/pump-cover.scad | 20 +++++++ hardware/peristaltic-pump/pump-insert.scad | 58 +++++++++++++++++++ nix/checks.nix | 6 -- nix/shell.nix | 3 +- 9 files changed, 184 insertions(+), 8 deletions(-) delete mode 100644 hardware/peristaltic-pump/flowflex-peristaltic-pump.scad create mode 100644 hardware/peristaltic-pump/libs/base.scad create mode 100644 hardware/peristaltic-pump/pump-body.scad create mode 100644 hardware/peristaltic-pump/pump-cover.scad create mode 100644 hardware/peristaltic-pump/pump-insert.scad diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 74fd55b..60cc31d 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,5 +4,6 @@ "jnoortheen.nix-ide", "kamadorueda.alejandra", "antyos.openscad", + "juliangmp.openscad-formatter", ], } diff --git a/README.md b/README.md index 2541835..e4e8b04 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ This project follows the [REUSE Specification](https://reuse.software/spec/) and ## Acknowledgements -To all contributors to the following open-source community for their ongoing support: +To all the contributors to the following open source communities for their continued support: - [OpenFlexure Project](https://openflexure.org/) - [Planktoscope Project](https://www.planktoscope.org/) diff --git a/hardware/peristaltic-pump/flowflex-peristaltic-pump.scad b/hardware/peristaltic-pump/flowflex-peristaltic-pump.scad deleted file mode 100644 index e69de29..0000000 diff --git a/hardware/peristaltic-pump/libs/base.scad b/hardware/peristaltic-pump/libs/base.scad new file mode 100644 index 0000000..517f85f --- /dev/null +++ b/hardware/peristaltic-pump/libs/base.scad @@ -0,0 +1,57 @@ +$fn = 100; + +case_size = 31; +case_corner = 5; + +motor_screw_y = 8; +motor_screw_x = 17.5; + +screws_socket = 4.5; +screws_hole = 2; + +module base_layout() +{ + minkowski() + { + square(case_size - (case_corner * 2), center = true); + circle(r = case_corner); + } + + difference() + { + hull() + { + translate([ motor_screw_x, motor_screw_y, 0 ]) + { + circle(r = screws_socket); + } + + mirror([ 1, 0, 0 ]) + { + translate([ motor_screw_x, motor_screw_y, 0 ]) + { + difference() + { + circle(r = screws_socket); + } + } + } + } + + translate([ motor_screw_x, motor_screw_y, 0 ]) + { + circle(r = screws_hole); + } + + mirror([ 1, 0, 0 ]) + { + translate([ motor_screw_x, motor_screw_y, 0 ]) + { + difference() + { + circle(r = screws_hole); + } + } + } + } +} diff --git a/hardware/peristaltic-pump/pump-body.scad b/hardware/peristaltic-pump/pump-body.scad new file mode 100644 index 0000000..c57a2be --- /dev/null +++ b/hardware/peristaltic-pump/pump-body.scad @@ -0,0 +1,45 @@ + +use <./libs/base.scad> + +$fn = 100; + +// translate([ 0, 40, 0 ]) +// { +// rotate([ 180, 180, 0 ]) +// { +// import("../../../peristaltic-pump/old/body.stl"); +// } +// } + +body_thickness = 9; +motor_body_radius = 5; + +insert_radius = 12; +insert_height = 7; + +tubing_radius = 14; +tubing_height = 4; + +tube_radius = 2; + +module body() +{ + difference() + { + linear_extrude(body_thickness) + { + difference() + { + base_layout(); + circle(motor_body_radius); + } + } + translate([ 0, 0, body_thickness - insert_height ]) + cylinder(insert_height, insert_radius, insert_radius); + + translate([ 0, 0, body_thickness - tubing_height ]) + cylinder(tubing_height, tubing_radius, tubing_radius); + } +} + +body(); diff --git a/hardware/peristaltic-pump/pump-cover.scad b/hardware/peristaltic-pump/pump-cover.scad new file mode 100644 index 0000000..84642ea --- /dev/null +++ b/hardware/peristaltic-pump/pump-cover.scad @@ -0,0 +1,20 @@ +$fn = 100; + +use <./libs/base.scad> + +cover_thickness = 2; +motor_axis_cutout = 2.5; + +module cover() +{ + linear_extrude(cover_thickness) + { + difference() + { + base_layout(); + circle(motor_axis_cutout); + } + } +} + +cover(); diff --git a/hardware/peristaltic-pump/pump-insert.scad b/hardware/peristaltic-pump/pump-insert.scad new file mode 100644 index 0000000..ce67b99 --- /dev/null +++ b/hardware/peristaltic-pump/pump-insert.scad @@ -0,0 +1,58 @@ +$fn = 100; + +use <./libs/base.scad> + +insert_radius = 11; +insert_depth = 6; + +axis_diameter = 5; +axis_height = 3; + +bearing_radius = 5; +bearing_depth = 4.5; +bearing_axis = 1.5; +bearing_shift = 9; + +module bearing() +{ + difference() + { + linear_extrude(bearing_depth) + { + circle(bearing_radius); + } + + linear_extrude(bearing_depth - 1) + { + circle(bearing_axis); + } + } +} + +module insert() +{ + difference() + { + linear_extrude(insert_depth) + { + difference() + { + circle(insert_radius); + square([ axis_diameter, axis_height ], center = true); + } + } + + translate([ bearing_shift, 0, insert_depth - bearing_depth ]) + bearing(); + + rotate([ 0, 0, 120 ]) + translate([ bearing_shift, 0, insert_depth - bearing_depth ]) + bearing(); + + rotate([ 0, 0, 240 ]) + translate([ bearing_shift, 0, insert_depth - bearing_depth ]) + bearing(); + } +} + +insert(); diff --git a/nix/checks.nix b/nix/checks.nix index d12c63a..bdae7ed 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -1,7 +1,6 @@ { self, pre-commit, - nixpkgs, ... }: system: with self.pkgs.${system}; { @@ -14,11 +13,6 @@ with self.pkgs.${system}; { statix.enable = true; deadnix.enable = true; actionlint.enable = true; - shellcheck = { - enable = true; - types_or = lib.mkForce []; - }; - shfmt.enable = true; }; }; } diff --git a/nix/shell.nix b/nix/shell.nix index a766373..3cb9a9d 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -2,7 +2,7 @@ with self.pkgs.${system}; mkShell { name = "flowflexure-nix"; - nativeBuildInputs = [ + packages = [ alejandra deadnix git @@ -13,6 +13,7 @@ with self.pkgs.${system}; statix vscode-extensions.antyos.openscad vscodium-fhs + clang-tools ]; shellHook = ''