r5750 - in developers/werner/cncmap: . spool

werner at docs.openmoko.org werner at docs.openmoko.org
Thu Dec 3 13:47:23 CET 2009


Author: werner
Date: 2009-12-03 13:47:22 +0100 (Thu, 03 Dec 2009)
New Revision: 5750

Added:
   developers/werner/cncmap/spool/
   developers/werner/cncmap/spool/Makefile
   developers/werner/cncmap/spool/spool.c
   developers/werner/cncmap/workflow.fig
Modified:
   developers/werner/cncmap/README
Log:
Added basic spooler and some more description of how things work.

- README, spool/: new utility "spool" to send a file to the mill
- workflow.fig: show how the various utilities interact



Modified: developers/werner/cncmap/README
===================================================================
--- developers/werner/cncmap/README	2009-12-02 21:02:58 UTC (rev 5749)
+++ developers/werner/cncmap/README	2009-12-03 12:47:22 UTC (rev 5750)
@@ -1,3 +1,9 @@
+cncmap - Collection of utilities for milling uneven 2D surfaces
+===============================================================
+
+Overview
+--------
+
 When milling a surface, we have the following parameters that depend on
 machine configuration and the piece:
 
@@ -24,4 +30,38 @@
 the third point "left".
 
 zscan: scan the surface of a rectangular area with the contact sensor and
-generate a z map.
+generate a Z map.
+
+zmap: project points or lines onto the surface defined by a Z map.
+If using a file (read from standard input), that file is in 2D or 3D
+gnuplot format, see below.
+
+align: map the model (in gnuplot format) to the workspace coordinates
+obtained from "rect". This  [...]
+
+spool: send a file to a Roland MDX-15/20 mill. (To do: progress
+reporting, halt and resume, maybe manual mode a la millp.)
+
+
+Formats
+-------
+
+We call the gnuplot-compatible 2D/3D format simply "gnuplot". In gnuplot
+format, each line of the file contains two (X, Y) or three (X, Y, Z)
+coordinates specifying a point.
+
+A polyline is defined by two or more points, followed by at least one
+empty line or any number of empty lines followed by the end of file.
+
+All polylines describe a milling operation. To move the head quickly
+to a new position, end the polygon and start a new polygon at the
+new location.
+
+The gnuplot format does not carry additional information, such as the
+maximum speed of head movements. It may contain comments intended for
+human readers, which consist of a line beginning with an exclamation
+mark. Such lines are ignored and not considered polyline separators.
+
+RML is Roland's proprietary extension of HP-GL. A more or less
+accurate description can be found here:
+http://www.cs.uml.edu/~fredm/lab/egx300/RML1_Command_GuideENVer100.pdf

Added: developers/werner/cncmap/spool/Makefile
===================================================================
--- developers/werner/cncmap/spool/Makefile	                        (rev 0)
+++ developers/werner/cncmap/spool/Makefile	2009-12-03 12:47:22 UTC (rev 5750)
@@ -0,0 +1,28 @@
+#
+# spool/Makefile - Build the job spooler
+#
+# Written 2008, 2009 by Werner Almesberger
+# Copyright 2008, 2009 Werner Almesberger
+#
+# 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; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+
+MAIN = spool
+OBJS = spool.o serial.o
+
+CFLAGS = -Wall -Wshadow -iquote ../millp
+
+all:		$(MAIN)
+
+$(MAIN):	$(OBJS)
+		$(CC) $(LDFLAGS) -o $(MAIN) $(OBJS)
+
+serial.o:	../millp/serial.c
+		$(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+		rm -f $(OBJS)

Added: developers/werner/cncmap/spool/spool.c
===================================================================
--- developers/werner/cncmap/spool/spool.c	                        (rev 0)
+++ developers/werner/cncmap/spool/spool.c	2009-12-03 12:47:22 UTC (rev 5750)
@@ -0,0 +1,59 @@
+/*
+ * spool.c - Send a file to a Roland MDX series CNC mill
+ *
+ * Written 2009 by Werner Almesberger
+ * Copyright 2009 Werner Almesberger
+ *
+ * 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; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "serial.h"
+
+
+#define BUF_SIZE	8192
+
+
+static void usage(const char *name)
+{
+	fprintf(stderr, "usage: %s [file]\n", name);
+	exit(1);
+}
+
+
+int main(int argc, const char **argv)
+{
+	FILE *file;
+	char buf[BUF_SIZE];
+	size_t n;
+
+	switch (argc) {
+	case 1:
+		file = stdin;
+		break;
+	case 2:
+		file = fopen(argv[1], "r");
+		if (!file) {
+			perror(argv[1]);
+			exit(1);
+		}
+		break;
+	default:
+		usage(*argv);
+	}
+	serial_open("/dev/ttyS0");
+	while (1) {
+		n = fread(buf, 1, BUF_SIZE, file);
+		if (!n)
+			break;
+		serial_printf("%s", buf);
+	}
+	serial_close();
+	return 0;
+}

Added: developers/werner/cncmap/workflow.fig
===================================================================
--- developers/werner/cncmap/workflow.fig	                        (rev 0)
+++ developers/werner/cncmap/workflow.fig	2009-12-03 12:47:22 UTC (rev 5750)
@@ -0,0 +1,88 @@
+#FIG 3.2  Produced by xfig version 3.2.5a
+Landscape
+Center
+Metric
+A4      
+100.00
+Single
+-2
+1200 2
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 2925 2475 2925 2925
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 2925 3825 2925 4275
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 2925 5220 2925 5625
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 3420 6435 5445 6435
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 5850 2475 5850 2925
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 5850 3825 5850 4275
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 5850 5175 5850 6300
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 4
+	1 1 2.00 60.00 60.00
+	 5355 3735 4500 3735 4500 5760 3330 5760
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 5850 7245 5850 7650
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 2925 1800 2925 2250
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 2925 3150 2925 3600
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 5850 1800 5850 2250
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 5850 3150 5850 3600
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 5850 4500 5850 4950
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 5850 6525 5850 6975
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 2925 5850 2925 6300
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 2925 4500 2925 4950
+2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 6345 1620 6480 1620 6480 1755 6345 1755 6345 1620
+2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 6345 4320 6480 4320 6480 4455 6345 4455 6345 4320
+2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 2295 8820 2430 8820 2430 8955 2295 8955 2295 8820
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
+	 5850 7875 5850 8280
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 4
+	 2250 4725 2025 4725 2025 3375 2250 3375
+2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
+	1 1 2.00 60.00 60.00
+	 5850 8550 5850 9000
+2 2 0 2 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
+	 6345 9045 6480 9045 6480 9180 6345 9180 6345 9045
+4 1 0 50 -1 14 12 0.0000 4 195 675 5850 1755 millp\001
+4 1 0 50 -1 19 12 0.0000 4 165 885 5850 2430 9 coords\001
+4 1 0 50 -1 14 12 0.0000 4 135 540 5850 3105 rect\001
+4 1 0 50 -1 19 12 0.0000 4 165 885 5850 3780 9 coords\001
+4 1 0 50 -1 14 12 0.0000 4 105 675 5850 4455 zscan\001
+4 1 0 50 -1 19 12 0.0000 4 165 525 5850 5130 zmap\001
+4 1 0 50 -1 14 12 0.0000 4 195 810 2925 1755 pcbnew\001
+4 1 0 50 -1 19 12 0.0000 4 165 720 2925 2430 Gerber\001
+4 1 0 50 -1 14 12 0.0000 4 150 810 2925 3105 cam.py\001
+4 1 0 50 -1 19 12 0.0000 4 165 720 2925 3780 Gerber\001
+4 1 0 50 -1 19 12 0.0000 4 210 795 2925 5130 gnuplot\001
+4 1 0 50 -1 14 12 0.0000 4 195 675 2925 5805 align\001
+4 1 0 50 -1 19 12 0.0000 4 210 795 2925 6480 gnuplot\001
+4 1 0 50 -1 14 12 0.0000 4 150 540 5850 6480 zmap\001
+4 1 0 50 -1 19 12 0.0000 4 210 795 5850 7155 gnuplot\001
+4 1 0 50 -1 14 12 0.0000 4 195 810 5850 7830 gp2rml\001
+4 1 0 50 -1 19 12 0.0000 4 165 465 5850 8505 RML\001
+4 1 0 50 -1 14 12 0.0000 4 195 675 5850 9180 spool\001
+4 1 0 50 -1 14 12 0.0000 4 195 1215 2925 4455 gerber2gp\001
+4 1 0 50 -1 0 12 1.5708 4 150 1110 1935 4050 Formar TBD\001
+4 0 0 50 -1 0 12 0.0000 4 195 1095 2700 8955 operates mill\001




More information about the commitlog mailing list