Date:2015-07-23 01:15:45 (8 years 2 months ago)
Author:Werner Almesberger
Commit:4153e6b4e2c14bcb4f0cbcb46ac3d5f5393bf718
Message:gp2rml/gp2rml.c (output_paths): use PA when possible; correct speed calculation

The mill uses the Z speed for the entire !ZZ movement, whether there
is a Z component or not. We now issue PA instead of !ZZ when moving
horizontally.

Also adapted the speed calculating accordingly.
Files: gp2rml/gp2rml.c (2 diffs)

Change Details

gp2rml/gp2rml.c
133133    const struct segment *seg;
134134    double x = 0, y = 0, z = 0;
135135    double d, s = 0, t = 0;
136    double txy, tz;
136    double speed;
137137
138138    printf("IN;!MC1;PA\n");
139139    printf("!ZO%d;!PZ0,%d;PU\n", units(z_max), units(z_clear));
...... 
156156        z = seg->z;
157157        seg = seg->next;
158158        while (seg) {
159            printf("!ZZ%d,%d,%d\n", units(seg->x), units(seg->y),
160                units((seg->z - z_max) * z_scale));
159            if (path->segments->z == z && z == seg->z) {
160                printf("PA%d,%d\n",
161                    units(seg->x), units(seg->y));
162                speed = xy_speed;
163            } else {
164                printf("!ZZ%d,%d,%d\n",
165                    units(seg->x), units(seg->y),
166                    units((seg->z - z_max) * z_scale));
167                speed = z_speed;
168            }
161169            d = hypot(x - seg->x, y - seg->y);
162            txy = d / xy_speed;
163            tz = fabs(z - seg->z) / z_speed;
164            t += txy > tz ? txy : tz;
165170            d = hypot(d, z - seg->z);
171            t += d / speed;
166172            s += d;
167173            x = seg->x;
168174            y = seg->y;

Archive Download the corresponding diff file

Branches:
master



interactive