diff options
author | Emanuele Caruso <emanuele.caruso@gmail.com> | 2011-05-04 21:05:22 +0200 |
---|---|---|
committer | Emanuele Caruso <emanuele.caruso@gmail.com> | 2011-05-04 21:05:22 +0200 |
commit | 93529ad632ca9f4949004f7a350b3bbc48f9deac (patch) | |
tree | 9a31dda7b10bfa1484cbc440f92013b41208968d | |
parent | 5a5818c10999d55050c6d8af79d606bdd6cf8669 (diff) |
Added max z feedrate configuration value, default to 120 mm/min. Solution suggested by cakeller98
-rw-r--r-- | Tonokip_Firmware/Tonokip_Firmware.pde | 7 | ||||
-rw-r--r-- | Tonokip_Firmware/configuration.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde index a9924d9..f7874aa 100644 --- a/Tonokip_Firmware/Tonokip_Firmware.pde +++ b/Tonokip_Firmware/Tonokip_Firmware.pde @@ -104,7 +104,7 @@ unsigned long interval; float destination_x =0.0, destination_y = 0.0, destination_z = 0.0, destination_e = 0.0; float current_x = 0.0, current_y = 0.0, current_z = 0.0, current_e = 0.0; long x_interval, y_interval, z_interval, e_interval; // for speed delay -float feedrate = 1500, next_feedrate; +float feedrate = 1500, next_feedrate, z_feedrate; float time_for_move; long gcode_N, gcode_LastN; bool relative_mode = false; //Determines Absolute or Relative Coordinates @@ -503,7 +503,7 @@ inline void process_commands() */ #define X_TIME_FOR_MOVE ((float)x_steps_to_take / (x_steps_per_unit*feedrate/60000000)) #define Y_TIME_FOR_MOVE ((float)y_steps_to_take / (y_steps_per_unit*feedrate/60000000)) - #define Z_TIME_FOR_MOVE ((float)z_steps_to_take / (z_steps_per_unit*feedrate/60000000)) + #define Z_TIME_FOR_MOVE ((float)z_steps_to_take / (z_steps_per_unit*z_feedrate/60000000)) #define E_TIME_FOR_MOVE ((float)e_steps_to_take / (e_steps_per_unit*feedrate/60000000)) time_for_move = max(X_TIME_FOR_MOVE,Y_TIME_FOR_MOVE); @@ -873,6 +873,9 @@ inline void get_coordinates() } if(feedrate > max_feedrate) feedrate = max_feedrate; + + if(feedrate > max_z_feedrate) z_feedrate = max_z_feedrate; + else z_feedrate=feedrate; } void linear_move(unsigned long x_steps_remaining, unsigned long y_steps_remaining, unsigned long z_steps_remaining, unsigned long e_steps_remaining) // make linear move with preset speeds and destinations, see G0 and G1 diff --git a/Tonokip_Firmware/configuration.h b/Tonokip_Firmware/configuration.h index e176ea4..1d3a1c8 100644 --- a/Tonokip_Firmware/configuration.h +++ b/Tonokip_Firmware/configuration.h @@ -74,6 +74,7 @@ float y_steps_per_unit = 80.376; float z_steps_per_unit = 3200/1.25; float e_steps_per_unit = 16; float max_feedrate = 200000; //mmm, acceleration! +float max_z_feedrate = 120; //float x_steps_per_unit = 10.047; //float y_steps_per_unit = 10.047; |