]> git.gag.com Git - hw/altusmetrum/commitdiff
Add tiny servo.
authorKeith Packard <keithp@keithp.com>
Tue, 1 Mar 2016 23:13:58 +0000 (17:13 -0600)
committerKeith Packard <keithp@keithp.com>
Tue, 1 Mar 2016 23:14:44 +0000 (17:14 -0600)
This splits the servo itself from the motor contacts so they can be
placed independently.

Signed-off-by: Keith Packard <keithp@keithp.com>
packages/Makefile
packages/servo-motor.5c [new file with mode: 0644]
packages/servo.5c [new file with mode: 0644]
symbols/servo/servo-contacts.sym [new file with mode: 0644]
symbols/servo/servo-motor.sym [new file with mode: 0644]

index 6e6c3fb845038f1ab2753d3f5da2bc1a2f66e2ff..486d9513875187401890efa4389b70e1aed2141c 100644 (file)
@@ -96,7 +96,9 @@ FOOTPRINTS= \
        v-bite.fp \
        qfn16-3x3.fp \
        1051330011.fp \
-       2013499-1.fp
+       2013499-1.fp \
+       servo.fp \
+       servo-motor.fp
 
 .5c.fp:
        nickle $*.5c > $@
diff --git a/packages/servo-motor.5c b/packages/servo-motor.5c
new file mode 100644 (file)
index 0000000..f1f12b9
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright © 2016 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+load "footprint.5c"
+import Footprint;
+
+element_start("servo_motor");
+
+real   hole_size = 0.75;
+real   hole_space = 1.5;
+
+pin_mm(-hole_space/2, 0, hole_size, 0.25, "1", "1");
+pin_mm( hole_space/2, 0, hole_size, 0.25, "2", "2");
+
+element_end();
diff --git a/packages/servo.5c b/packages/servo.5c
new file mode 100644 (file)
index 0000000..15720c8
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright © 2016 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+load "footprint.5c"
+import Footprint;
+
+real dpi = 4800;
+
+real pixtomm(real pix) = pix / dpi * 25.4;
+
+typedef struct {
+       real    x;
+       real    y;
+} pos_t;
+
+real   origin_x = 423;
+real   origin_y = 213;
+
+real xmm(real xpix) = pixtomm(xpix - origin_x);
+real ymm(real ypix) = pixtomm(ypix - origin_y);
+
+pos_t pos(real xpix, real ypix) = (pos_t) { .x = xmm(xpix), .y = ymm(ypix) };
+
+pos_t ul = pos(543, 213);
+pos_t ur = pos(2912, 213);
+pos_t mll = pos(423, 1036);
+pos_t mlr = pos(543, 1036);
+pos_t mrl = pos(2912, 1036);
+pos_t mrr = pos(3980, 1036);
+pos_t ll = pos(423, 1955);
+pos_t lr = pos(3980, 1955);
+
+pos_t mount_ul = pos(781, 208);
+pos_t mount_ur = pos(2102, 208);
+
+pos_t mount_ll = pos(652, 1999);
+pos_t mount_lr = pos(3561, 1999);
+
+real mounting_hole = pixtomm(142);
+
+void linepos(pos_t a, pos_t b) { line(a.x, a.y, b.x, b.y); }
+
+void outline() {
+       linepos(ul, ur);
+       linepos(ur, mrl);
+       linepos(mrl, mrr);
+       linepos(mrr, lr);
+       linepos(lr, ll);
+       linepos(ll, mll);
+       linepos(mll, mlr);
+       linepos(mlr, ul);
+}
+
+void drill(pos_t a) {
+       pin_mm_clear(a.x, a.y, mounting_hole, 0.22, 0.32, "mount", "mount");
+}
+
+void mount() {
+       drill(mount_ul);
+       drill(mount_ur);
+       drill(mount_ll);
+       drill(mount_lr);
+}
+
+real ysplit = ymm(1500);
+real ygap = pixtomm(1536 - 1442);
+
+void contact(pos_t ul, pos_t lr, string name, string num) {
+       pad_mm((ul.x + lr.x) / 2,
+              (ul.y + lr.y) / 2,
+              (lr.x - ul.x),
+              (lr.y - ul.y),
+              name, num);
+}
+
+void top_contact(real x, real width, string name, string num) {
+       contact((pos_t) { .x = x, .y = mll.y },
+               (pos_t) { .x = x + width, .y = ysplit - ygap / 2 },
+               name, num);
+}
+
+real contact_left = xmm(563 + 2909 - 2667);
+real contact_right = xmm(2922);
+real contact_width = pixtomm(3267 - 2901);
+
+void bottom_contact(real x, real width, string name, string num) {
+       contact((pos_t) { .x = x, .y = ysplit + ygap / 2 },
+               (pos_t) { .x = x + width, .y = ll.y },
+               name, num);
+}
+
+element_start("servo");
+
+outline();
+mount();
+
+bottom_contact(contact_left, contact_width, "1", "1");
+bottom_contact(contact_right, contact_width, "2", "2");
+
+top_contact(contact_left, contact_width, "3", "3");
+top_contact(contact_right, contact_width, "4", "4");
+
+element_end();
diff --git a/symbols/servo/servo-contacts.sym b/symbols/servo/servo-contacts.sym
new file mode 100644 (file)
index 0000000..0ed3a32
--- /dev/null
@@ -0,0 +1,49 @@
+v 20130925 2
+T 100 100 0 1 0 0 0 0 1
+gedasymbols::url=http://www.gedasymbols.org/user/levente_kovacs/symbols/switch-dpdt-2.sym
+T 410 1650 8 10 0 0 0 0 1
+device=Dual_Two_Way_Switch
+L 310 200 660 350 3 0 0 0 -1 -1
+L 310 1000 660 1150 3 0 0 0 -1 -1
+T 410 1400 8 10 1 1 0 0 1
+refdes=S?
+V 660 1200 50 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
+V 660 400 50 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
+T 410 1900 8 10 0 0 0 0 1
+footprint=SWITCH2
+P 0 1000 300 1000 1 0 0
+{
+T 0 1100 5 10 1 1 0 0 1
+pinnumber=1
+T 0 1000 5 10 0 0 0 0 1
+pinseq=1
+}
+P 1000 1200 700 1200 1 0 0
+{
+T 1000 1300 5 10 1 1 0 6 1
+pinnumber=3
+T 1000 1200 5 10 0 0 0 0 1
+pinseq=3
+}
+P 0 200 300 200 1 0 0
+{
+T 0 300 5 10 1 1 0 0 1
+pinnumber=2
+T 0 200 5 10 0 0 0 0 1
+pinseq=2
+}
+P 1000 400 700 400 1 0 0
+{
+T 1000 500 5 10 1 1 0 6 1
+pinnumber=4
+T 1000 400 5 10 0 0 0 0 1
+pinseq=4
+}
+T 400 2500 5 10 0 0 0 0 1
+author=Levente Kovacs
+T 400 2300 5 10 0 0 0 0 1
+email=levente.kovacs@interware.hu
+T 400 2700 5 10 0 0 0 0 1
+dist-license=GPL
+T 400 2100 5 10 0 0 0 0 1
+use-license=unlimited
diff --git a/symbols/servo/servo-motor.sym b/symbols/servo/servo-motor.sym
new file mode 100644 (file)
index 0000000..ff0a0b6
--- /dev/null
@@ -0,0 +1,26 @@
+v 20041228 1
+P 200 1000 200 800 1 0 0
+{
+T 250 900 5 8 0 1 270 0 1
+pinnumber=1
+T 250 900 5 8 0 0 270 0 1
+pinseq=1
+}
+P 200 0 200 200 1 0 0
+{
+T 250 200 5 8 0 1 270 0 1
+pinnumber=2
+T 250 200 5 8 0 0 270 0 1
+pinseq=2
+}
+T 400 1000 8 10 0 0 0 0 1
+device=DC_MOTOR
+T 500 600 8 10 1 1 0 0 1
+refdes=M?
+V 200 500 200 3 0 0 0 -1 -1 0 -1 -1 -1 -1 -1
+L 100 673 100 800 3 0 0 0 -1 -1
+L 100 800 300 800 3 0 0 0 -1 -1
+L 300 800 300 673 3 0 0 0 -1 -1
+L 100 326 100 200 3 0 0 0 -1 -1
+L 100 200 300 200 3 0 0 0 -1 -1
+L 300 200 300 327 3 0 0 0 -1 -1