time to save, acceleration seems to be temporarily broken, will have to debug later

This commit is contained in:
Michael Moon 2010-02-02 23:51:08 +11:00
parent 5e0f5a6c87
commit 6002e10dd7
4 changed files with 10 additions and 14 deletions

View File

@ -321,21 +321,18 @@ void dda_start(DDA *dda) {
*/ */
uint8_t can_step(uint8_t min, uint8_t max, int32_t current, int32_t target, uint8_t dir) { uint8_t can_step(uint8_t min, uint8_t max, int32_t current, int32_t target, uint8_t dir) {
if (current == target)
return 0;
if (dir) { if (dir) {
// forwards/positive // forwards/positive
if (max) if (max)
return 0; return 0;
if (current > target) if ((current - target) >= 0)
return 0; return 0;
} }
else { else {
// backwards/negative // backwards/negative
if (min) if (min)
return 0; return 0;
if (target > current) if ((target - current) >= 0)
return 0; return 0;
} }
@ -487,7 +484,7 @@ void dda_step(DDA *dda) {
if (step_option & F_REAL_STEP) if (step_option & F_REAL_STEP)
setTimer(dda->move_duration / current_position.F); setTimer(dda->move_duration / current_position.F);
// if we could step, we're still running // if we could do anything at all, we're still running
dda->live = (step_option != 0)?1:0; dda->live = (step_option != 0)?1:0;
// if ( // if (
// (current_position.X == dda->endpoint.X) && // (current_position.X == dda->endpoint.X) &&

View File

@ -10,7 +10,7 @@ typedef struct {
int32_t X; int32_t X;
int32_t Y; int32_t Y;
int32_t Z; int32_t Z;
uint32_t E; int32_t E;
uint32_t F; uint32_t F;
} TARGET; } TARGET;

View File

@ -16,8 +16,6 @@
#define Y_STEPS_PER_REV X_STEPS_PER_REV #define Y_STEPS_PER_REV X_STEPS_PER_REV
// we need more speed than precision on Z, turn off microstepping // we need more speed than precision on Z, turn off microstepping
#define Z_STEPS_PER_REV 200.0 #define Z_STEPS_PER_REV 200.0
// we need more torque and smoothness at very low speeds on E, maximum microstepping
#define E_STEPS_PER_REV 3200.0
#define X_COG_CIRCUMFERENCE (4.77 * 16.0) #define X_COG_CIRCUMFERENCE (4.77 * 16.0)
#define Y_COG_CIRCUMFERENCE X_COG_CIRCUMFERENCE #define Y_COG_CIRCUMFERENCE X_COG_CIRCUMFERENCE
@ -26,7 +24,8 @@
// #define XY_COG_CIRCUMFERENCE (XY_COG_RADIUS * PI * 2) // #define XY_COG_CIRCUMFERENCE (XY_COG_RADIUS * PI * 2)
#define Z_GEAR_RATIO 1.0 #define Z_GEAR_RATIO 1.0
#define EXTRUDER_STEPS_PER_REV E_STEPS_PER_REV // we need more torque and smoothness at very low speeds on E, maximum microstepping
#define E_STEPS_PER_REV 3200.0
#define EXTRUDER_SHAFT_RADIUS 5.0 #define EXTRUDER_SHAFT_RADIUS 5.0
#define EXTRUDER_INLET_DIAMETER 3.0 #define EXTRUDER_INLET_DIAMETER 3.0
#define EXTRUDER_NOZZLE_DIAMETER 0.8 #define EXTRUDER_NOZZLE_DIAMETER 0.8
@ -37,8 +36,8 @@
// http://blog.arcol.hu/?p=157 may help with this next one // http://blog.arcol.hu/?p=157 may help with this next one
// I haven't tuned this at all- it's just a placeholder until I read the above carefully enough // I haven't tuned this at all- it's just a placeholder until I read the above carefully enough
// does this refer to filament or extrudate? extrudate depends on layer thickness.. hm // does this refer to filament or extrudate? extrudate depends on XY distance vs E distance.. hm lets go with filament
#define STEPS_PER_MM_E ((uint32_t) ((EXTRUDER_STEPS_PER_REV / (EXTRUDER_SHAFT_RADIUS * PI * EXTRUDER_INLET_DIAMETER / EXTRUDER_NOZZLE_DIAMETER)) + 0.5)) #define STEPS_PER_MM_E ((uint32_t) ((E_STEPS_PER_REV / (EXTRUDER_SHAFT_RADIUS * PI * EXTRUDER_INLET_DIAMETER)) + 0.5))
#define FEEDRATE_FAST_XY 6000 #define FEEDRATE_FAST_XY 6000
#define FEEDRATE_SLOW_XY 300 #define FEEDRATE_SLOW_XY 300

View File

@ -135,7 +135,7 @@ int main (void)
serial_writechar(','); serial_writechar(',');
serwrite_int32(current_position.Z); serwrite_int32(current_position.Z);
serial_writechar(','); serial_writechar(',');
serwrite_uint32(current_position.E); serwrite_int32(current_position.E);
serial_writechar(','); serial_writechar(',');
serwrite_uint32(current_position.F); serwrite_uint32(current_position.F);
serial_writechar('\n'); serial_writechar('\n');
@ -148,7 +148,7 @@ int main (void)
serial_writechar(','); serial_writechar(',');
serwrite_int32(movebuffer[mb_tail].endpoint.Z); serwrite_int32(movebuffer[mb_tail].endpoint.Z);
serial_writechar(','); serial_writechar(',');
serwrite_uint32(movebuffer[mb_tail].endpoint.E); serwrite_int32(movebuffer[mb_tail].endpoint.E);
serial_writechar(','); serial_writechar(',');
serwrite_uint32(movebuffer[mb_tail].endpoint.F); serwrite_uint32(movebuffer[mb_tail].endpoint.F);
serial_writechar('\n'); serial_writechar('\n');