From ea2c19f978e59ba0cbc6ee5b2e7975949b099802 Mon Sep 17 00:00:00 2001 From: Erik van der Zalm Date: Sat, 14 Jul 2012 14:21:53 +0200 Subject: [PATCH] Added CoreXY support (Thanks Ilan Moyer) --- Marlin/Configuration.h | 11 ++++++----- Marlin/stepper.cpp | 18 +++++++++--------- README.md | 1 + 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index b9bf13e..2da2478 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -35,9 +35,7 @@ #define MOTHERBOARD 7 #endif -/// Comment out the following line to enable normal kinematics -#define COREXY //=========================================================================== //=============================Thermal Settings ============================ @@ -131,6 +129,9 @@ //=============================Mechanical Settings=========================== //=========================================================================== +// Uncomment the following line to enable CoreXY kinematics +// #define COREXY + // corse Endstop Settings #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors @@ -172,7 +173,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th #define DISABLE_E false // For all extruders #define INVERT_X_DIR true // for Mendel set to false, for Orca set to true -#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false +#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false #define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true #define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false #define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false @@ -184,8 +185,8 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th #define Y_HOME_DIR -1 #define Z_HOME_DIR -1 -#define min_software_endstops false //If true, axis won't move to coordinates less than HOME_POS. -#define max_software_endstops false //If true, axis won't move to coordinates greater than the defined lengths below. +#define min_software_endstops true //If true, axis won't move to coordinates less than HOME_POS. +#define max_software_endstops true //If true, axis won't move to coordinates greater than the defined lengths below. #define X_MAX_LENGTH 205 #define Y_MAX_LENGTH 205 #define Z_MAX_LENGTH 200 diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 592e930..5a24ac4 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -488,16 +488,16 @@ ISR(TIMER1_COMPA_vect) if (counter_x > 0) { WRITE(X_STEP_PIN, HIGH); counter_x -= current_block->step_event_count; - WRITE(X_STEP_PIN, LOW); count_position[X_AXIS]+=count_direction[X_AXIS]; + WRITE(X_STEP_PIN, LOW); } counter_y += current_block->steps_y; if (counter_y > 0) { WRITE(Y_STEP_PIN, HIGH); - + counter_y -= current_block->step_event_count; + count_position[Y_AXIS]+=count_direction[Y_AXIS]; WRITE(Y_STEP_PIN, LOW); - } #endif @@ -508,19 +508,19 @@ ISR(TIMER1_COMPA_vect) if ((counter_x > 0)&&!(counter_y>0)){ //X step only WRITE(X_STEP_PIN, HIGH); WRITE(Y_STEP_PIN, HIGH); - counter_x -= current_block->step_event_count; + counter_x -= current_block->step_event_count; + count_position[X_AXIS]+=count_direction[X_AXIS]; WRITE(X_STEP_PIN, LOW); WRITE(Y_STEP_PIN, LOW); - count_position[X_AXIS]+=count_direction[X_AXIS]; } if (!(counter_x > 0)&&(counter_y>0)){ //Y step only WRITE(X_STEP_PIN, HIGH); WRITE(Y_STEP_PIN, HIGH); - counter_y -= current_block->step_event_count; + counter_y -= current_block->step_event_count; + count_position[Y_AXIS]+=count_direction[Y_AXIS]; WRITE(X_STEP_PIN, LOW); WRITE(Y_STEP_PIN, LOW); - count_position[Y_AXIS]+=count_direction[Y_AXIS]; } if ((counter_x > 0)&&(counter_y>0)){ //step in both axes @@ -553,8 +553,8 @@ ISR(TIMER1_COMPA_vect) if (counter_z > 0) { WRITE(Z_STEP_PIN, HIGH); counter_z -= current_block->step_event_count; - WRITE(Z_STEP_PIN, LOW); count_position[Z_AXIS]+=count_direction[Z_AXIS]; + WRITE(Z_STEP_PIN, LOW); } #ifndef ADVANCE @@ -562,8 +562,8 @@ ISR(TIMER1_COMPA_vect) if (counter_e > 0) { WRITE_E_STEP(HIGH); counter_e -= current_block->step_event_count; - WRITE_E_STEP(LOW); count_position[E_AXIS]+=count_direction[E_AXIS]; + WRITE_E_STEP(LOW); } #endif //!ADVANCE step_events_completed += 1; diff --git a/README.md b/README.md index c6befba..86dd93d 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Features: * Updated sdcardlib * Heater power reporting. Useful for PID monitoring. * PID tuning +* CoreXY kinematics (www.corexy.com/theory.html) The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments. -- 2.30.2