From c429a4b3ec9b80e7927b6e75e8b6f1241cf369d0 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Wed, 3 Dec 2014 14:37:16 +0100 Subject: [PATCH 1/2] Toshiba Stepper Driver support Tosh stepper drivers need to be driven slower, so the stepper code was interleaved to separate the pin HIGH from the pin LOW. This adds enough instructions to make it work, without needing nops. --- Marlin/Configuration_adv.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 6398f4161..bce45851d 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -219,9 +219,11 @@ //#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially. #define AXIS_RELATIVE_MODES {false, false, false, false} - +#ifdef CONFIG_STEPPERS_TOSHIBA +#define MAX_STEP_FREQUENCY 10000 // Max step frequency for Toshiba Stepper Controllers +#else #define MAX_STEP_FREQUENCY 40000 // Max step frequency for Ultimaker (5000 pps / half step) - +#endif //By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step. #define INVERT_X_STEP_PIN false #define INVERT_Y_STEP_PIN false From edfcf3b52778456e109b9728b1a89d1ba62c33c6 Mon Sep 17 00:00:00 2001 From: Bo Herrmannsen Date: Wed, 3 Dec 2014 15:01:52 +0100 Subject: [PATCH 2/2] Toshiba Stepper Driver support Tosh stepper drivers need to be driven slower, so the stepper code was interleaved to separate the pin HIGH from the pin LOW. This adds enough instructions to make it work, without needing nops. --- Marlin/stepper.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 9e22eb198..b2e7d1208 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -559,6 +559,58 @@ ISR(TIMER1_COMPA_vect) #endif //ADVANCE counter_x += current_block->steps_x; + #ifdef CONFIG_STEPPERS_TOSHIBA + /* The toshiba stepper controller require much longer pulses + * tjerfore we 'stage' decompose the pulses between high, and + * low instead of doing each in turn. The extra tests add enough + * lag to allow it work with without needing NOPs */ + if (counter_x > 0) { + WRITE(X_STEP_PIN, HIGH); + } + + counter_y += current_block->steps_y; + if (counter_y > 0) { + WRITE(Y_STEP_PIN, HIGH); + } + + counter_z += current_block->steps_z; + if (counter_z > 0) { + WRITE(Z_STEP_PIN, HIGH); + } + + #ifndef ADVANCE + counter_e += current_block->steps_e; + if (counter_e > 0) { + WRITE_E_STEP(HIGH); + } + #endif //!ADVANCE + + if (counter_x > 0) { + counter_x -= current_block->step_event_count; + count_position[X_AXIS]+=count_direction[X_AXIS]; + WRITE(X_STEP_PIN, LOW); + } + + if (counter_y > 0) { + counter_y -= current_block->step_event_count; + count_position[Y_AXIS]+=count_direction[Y_AXIS]; + WRITE(Y_STEP_PIN, LOW); + } + + if (counter_z > 0) { + counter_z -= current_block->step_event_count; + count_position[Z_AXIS]+=count_direction[Z_AXIS]; + WRITE(Z_STEP_PIN, LOW); + } + + #ifndef ADVANCE + if (counter_e > 0) { + counter_e -= current_block->step_event_count; + count_position[E_AXIS]+=count_direction[E_AXIS]; + WRITE_E_STEP(LOW); + } + #endif //!ADVANCE +#else if (counter_x > 0) { #ifdef DUAL_X_CARRIAGE if (extruder_duplication_enabled){ @@ -635,6 +687,7 @@ ISR(TIMER1_COMPA_vect) WRITE_E_STEP(INVERT_E_STEP_PIN); } #endif //!ADVANCE + #endif step_events_completed += 1; if(step_events_completed >= current_block->step_event_count) break; }