Fix absolute E positioning.
Now also works with M101/M103
This commit is contained in:
parent
1d556e0278
commit
4b7f8fba48
12
dda.c
12
dda.c
|
|
@ -379,8 +379,10 @@ void dda_create(DDA *dda, TARGET *target) {
|
||||||
|
|
||||||
// next dda starts where we finish
|
// next dda starts where we finish
|
||||||
memcpy(&startpoint, target, sizeof(TARGET));
|
memcpy(&startpoint, target, sizeof(TARGET));
|
||||||
// E is always relative, reset it here
|
// if E is relative, reset it here
|
||||||
startpoint.E = 0;
|
#ifndef E_ABSOLUTE
|
||||||
|
startpoint.E = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Start a prepared DDA
|
/*! Start a prepared DDA
|
||||||
|
|
@ -647,8 +649,10 @@ void dda_step(DDA *dda) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dda->live = 0;
|
dda->live = 0;
|
||||||
// reset E- always relative
|
// if E is relative reset it
|
||||||
current_position.E = 0;
|
#ifndef E_ABSOLUTE
|
||||||
|
current_position.E = 0;
|
||||||
|
#endif
|
||||||
// linear acceleration code doesn't alter F during a move, so we must update it here
|
// linear acceleration code doesn't alter F during a move, so we must update it here
|
||||||
// in theory, we *could* update F every step, but that would require a divide in interrupt context which should be avoided if at all possible
|
// in theory, we *could* update F every step, but that would require a divide in interrupt context which should be avoided if at all possible
|
||||||
current_position.F = dda->endpoint.F;
|
current_position.F = dda->endpoint.F;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ static void zero_z(void) {
|
||||||
/// move E by a certain amount at a certain speed
|
/// move E by a certain amount at a certain speed
|
||||||
static void SpecialMoveE(int32_t e, uint32_t f) {
|
static void SpecialMoveE(int32_t e, uint32_t f) {
|
||||||
TARGET t = startpoint;
|
TARGET t = startpoint;
|
||||||
t.E = e;
|
t.E += e;
|
||||||
t.F = f;
|
t.F = f;
|
||||||
enqueue(&t);
|
enqueue(&t);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue