From fe67763884ff3d60b1c5a067f05b6ec91d255605 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Tue, 24 Oct 2023 14:13:23 +0200 Subject: [PATCH] added servo Signed-off-by: Stephan Richter --- .gitmodules | 3 +++ cadmodel-sg90 | 1 + katzenklappe.scad | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .gitmodules create mode 160000 cadmodel-sg90 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..665979e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cadmodel-sg90"] + path = cadmodel-sg90 + url = https://github.com/ledalert/cadmodel-sg90.git diff --git a/cadmodel-sg90 b/cadmodel-sg90 new file mode 160000 index 0000000..2aba157 --- /dev/null +++ b/cadmodel-sg90 @@ -0,0 +1 @@ +Subproject commit 2aba157f6aa121d7a08217885196b563c99a30ab diff --git a/katzenklappe.scad b/katzenklappe.scad index 8c785fd..ecf8518 100644 --- a/katzenklappe.scad +++ b/katzenklappe.scad @@ -1,7 +1,12 @@ -angle = 20; +use ; +use ; + +flap_angle = 0; +servo_angle = -10; axle_dia = 4; axle_len = 40; raise = 0; + tunnel_w = 160; tunnel_h = 160; tunnel_t = 10; // tunnel thickness @@ -130,7 +135,7 @@ module axles(){ } module flap(){ - translate(z*(sheet_h-rad)/2) rotate(x*angle) { + translate(z*(sheet_h-rad)/2) rotate(x*flap_angle) { difference(){ rotate(y*90) cylinder(d=2*rad,h=tunnel_w-2*seal,center=true); sheets(); @@ -155,7 +160,17 @@ module flap(){ } } -*door(); +module servo(){ + translate(-[5.5,0,28.5]) sg90(); + rotate(servo_angle*z) sg90_f1(); +} + +module servo_in_place(){ + translate([-11,0,-tunnel_h/2 -10])rotate(90*x)servo(); +} + +door(); tunnel(); flap(); axles(); +servo_in_place();