Skip to content

Commit

Permalink
time to save, acceleration seems to be temporarily broken, will have …
Browse files Browse the repository at this point in the history
…to debug later
  • Loading branch information
triffid committed Feb 2, 2010
1 parent 5e0f5a6 commit 6002e10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
9 changes: 3 additions & 6 deletions mendel/dda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
if (current == target)
return 0;

if (dir) {
// forwards/positive
if (max)
return 0;
if (current > target)
if ((current - target) >= 0)
return 0;
}
else {
// backwards/negative
if (min)
return 0;
if (target > current)
if ((target - current) >= 0)
return 0;
}

Expand Down Expand Up @@ -487,7 +484,7 @@ void dda_step(DDA *dda) {
if (step_option & F_REAL_STEP)
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;
// if (
// (current_position.X == dda->endpoint.X) &&
Expand Down
2 changes: 1 addition & 1 deletion mendel/dda.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct {
int32_t X;
int32_t Y;
int32_t Z;
uint32_t E;
int32_t E;
uint32_t F;
} TARGET;

Expand Down
9 changes: 4 additions & 5 deletions mendel/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#define Y_STEPS_PER_REV X_STEPS_PER_REV
// we need more speed than precision on Z, turn off microstepping
#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 Y_COG_CIRCUMFERENCE X_COG_CIRCUMFERENCE
Expand All @@ -26,7 +24,8 @@
// #define XY_COG_CIRCUMFERENCE (XY_COG_RADIUS * PI * 2)
#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_INLET_DIAMETER 3.0
#define EXTRUDER_NOZZLE_DIAMETER 0.8
Expand All @@ -37,8 +36,8 @@

// 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
// does this refer to filament or extrudate? extrudate depends on layer thickness.. hm
#define STEPS_PER_MM_E ((uint32_t) ((EXTRUDER_STEPS_PER_REV / (EXTRUDER_SHAFT_RADIUS * PI * EXTRUDER_INLET_DIAMETER / EXTRUDER_NOZZLE_DIAMETER)) + 0.5))
// 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) ((E_STEPS_PER_REV / (EXTRUDER_SHAFT_RADIUS * PI * EXTRUDER_INLET_DIAMETER)) + 0.5))

#define FEEDRATE_FAST_XY 6000
#define FEEDRATE_SLOW_XY 300
Expand Down
4 changes: 2 additions & 2 deletions mendel/mendel.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ int main (void)
serial_writechar(',');
serwrite_int32(current_position.Z);
serial_writechar(',');
serwrite_uint32(current_position.E);
serwrite_int32(current_position.E);
serial_writechar(',');
serwrite_uint32(current_position.F);
serial_writechar('\n');
Expand All @@ -148,7 +148,7 @@ int main (void)
serial_writechar(',');
serwrite_int32(movebuffer[mb_tail].endpoint.Z);
serial_writechar(',');
serwrite_uint32(movebuffer[mb_tail].endpoint.E);
serwrite_int32(movebuffer[mb_tail].endpoint.E);
serial_writechar(',');
serwrite_uint32(movebuffer[mb_tail].endpoint.F);
serial_writechar('\n');
Expand Down

0 comments on commit 6002e10

Please sign in to comment.