mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-23 01:05:32 +02:00
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.
This commit is contained in:
parent
d72d649c30
commit
4153e6b4e2
@ -133,7 +133,7 @@ static void output_paths(double z_clear, double xy_speed, double z_speed)
|
|||||||
const struct segment *seg;
|
const struct segment *seg;
|
||||||
double x = 0, y = 0, z = 0;
|
double x = 0, y = 0, z = 0;
|
||||||
double d, s = 0, t = 0;
|
double d, s = 0, t = 0;
|
||||||
double txy, tz;
|
double speed;
|
||||||
|
|
||||||
printf("IN;!MC1;PA\n");
|
printf("IN;!MC1;PA\n");
|
||||||
printf("!ZO%d;!PZ0,%d;PU\n", units(z_max), units(z_clear));
|
printf("!ZO%d;!PZ0,%d;PU\n", units(z_max), units(z_clear));
|
||||||
@ -156,13 +156,19 @@ static void output_paths(double z_clear, double xy_speed, double z_speed)
|
|||||||
z = seg->z;
|
z = seg->z;
|
||||||
seg = seg->next;
|
seg = seg->next;
|
||||||
while (seg) {
|
while (seg) {
|
||||||
printf("!ZZ%d,%d,%d\n", units(seg->x), units(seg->y),
|
if (path->segments->z == z && z == seg->z) {
|
||||||
units((seg->z - z_max) * z_scale));
|
printf("PA%d,%d\n",
|
||||||
|
units(seg->x), units(seg->y));
|
||||||
|
speed = xy_speed;
|
||||||
|
} else {
|
||||||
|
printf("!ZZ%d,%d,%d\n",
|
||||||
|
units(seg->x), units(seg->y),
|
||||||
|
units((seg->z - z_max) * z_scale));
|
||||||
|
speed = z_speed;
|
||||||
|
}
|
||||||
d = hypot(x - seg->x, y - seg->y);
|
d = hypot(x - seg->x, y - seg->y);
|
||||||
txy = d / xy_speed;
|
|
||||||
tz = fabs(z - seg->z) / z_speed;
|
|
||||||
t += txy > tz ? txy : tz;
|
|
||||||
d = hypot(d, z - seg->z);
|
d = hypot(d, z - seg->z);
|
||||||
|
t += d / speed;
|
||||||
s += d;
|
s += d;
|
||||||
x = seg->x;
|
x = seg->x;
|
||||||
y = seg->y;
|
y = seg->y;
|
||||||
|
Loading…
Reference in New Issue
Block a user