Browse Source

and changed ultipanel to have the mm/sec and not mm/min

Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into Marlin_v1

Conflicts:
	Marlin/Marlin.pde
	Marlin/ultralcd.h
Bernhard Kubicek 13 years ago
parent
commit
a9c7da06e3
9 changed files with 2284 additions and 2125 deletions
  1. 36
    14
      Marlin/Configuration.h
  2. 30
    25
      Marlin/Marlin.pde
  3. 747
    629
      Marlin/planner.cpp
  4. 98
    95
      Marlin/planner.h
  5. 669
    664
      Marlin/stepper.cpp
  6. 580
    577
      Marlin/temperature.cpp
  7. 9
    7
      Marlin/thermistortables.h
  8. 103
    102
      Marlin/ultralcd.h
  9. 12
    12
      Marlin/ultralcd.pde

+ 36
- 14
Marlin/Configuration.h View File

@@ -9,6 +9,19 @@
9 9
 //#define BAUDRATE 230400
10 10
 
11 11
 
12
+// Frequency limit
13
+// See nophead's blog for more info
14
+// Not working OK
15
+//#define XY_FREQUENCY_LIMIT  15
16
+
17
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
18
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
19
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
20
+#define MINIMUM_PLANNER_SPEED 2.0 // (mm/sec)
21
+
22
+// If defined the movements slow down when the look ahead buffer is only half full
23
+#define SLOWDOWN
24
+
12 25
 // BASIC SETTINGS: select your board type, thermistor type, axis scaling, and endstop configuration
13 26
 
14 27
 //// The following define selects which electronics board you have. Please choose the one that matches your setup
@@ -45,7 +58,6 @@
45 58
 //#define BED_USES_THERMISTOR
46 59
 //#define BED_USES_AD595
47 60
 
48
-#define HEATER_CHECK_INTERVAL 50 //ms
49 61
 #define BED_CHECK_INTERVAL 5000 //ms
50 62
 
51 63
 //// Experimental watchdog and minimal temp
@@ -103,11 +115,15 @@
103 115
 
104 116
   #ifdef PID_PID
105 117
     //PID according to Ziegler-Nichols method
106
-    #define  DEFAULT_Kp  (0.6*PID_CRITIAL_GAIN)
107
-    #define  DEFAULT_Ki (2*Kp/PID_SWING_AT_CRITIAL*PID_dT)  
108
-    #define  DEFAULT_Kd (PID_SWING_AT_CRITIAL/8./PID_dT)  
118
+//    #define  DEFAULT_Kp  (0.6*PID_CRITIAL_GAIN)
119
+//    #define  DEFAULT_Ki (2*Kp/PID_SWING_AT_CRITIAL*PID_dT)  
120
+//    #define  DEFAULT_Kd (PID_SWING_AT_CRITIAL/8./PID_dT)  
121
+
122
+    #define  DEFAULT_Kp  22.2
123
+    #define  DEFAULT_Ki (1.25*PID_dT)  
124
+    #define  DEFAULT_Kd (99/PID_dT)  
109 125
   #endif
110
- 
126
+   
111 127
   #ifdef PID_PI
112 128
     //PI according to Ziegler-Nichols method
113 129
     #define  DEFAULT_Kp (PID_CRITIAL_GAIN/2.2) 
@@ -156,6 +172,11 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
156 172
 #define DISABLE_E false
157 173
 
158 174
 // Inverting axis direction
175
+//#define INVERT_X_DIR false    // for Mendel set to false, for Orca set to true
176
+//#define INVERT_Y_DIR true   // for Mendel set to true, for Orca set to false
177
+//#define INVERT_Z_DIR false    // for Mendel set to false, for Orca set to true
178
+//#define INVERT_E_DIR true   // for direct drive extruder v9 set to true, for geared extruder set to false
179
+
159 180
 #define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
160 181
 #define INVERT_Y_DIR false   // for Mendel set to true, for Orca set to false
161 182
 #define INVERT_Z_DIR true    // for Mendel set to false, for Orca set to true
@@ -176,7 +197,7 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
176 197
 //// MOVEMENT SETTINGS
177 198
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
178 199
 //note: on bernhards ultimaker 200 200 12 are working well.
179
-#define HOMING_FEEDRATE {50*60, 50*60, 12*60, 0}  // set the homing speeds
200
+#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
180 201
 
181 202
 #define AXIS_RELATIVE_MODES {false, false, false, false}
182 203
 
@@ -184,20 +205,21 @@ const bool ENDSTOPS_INVERTING = true; // set to true to invert the logic of the
184 205
 
185 206
 // default settings 
186 207
 
187
-#define DEFAULT_AXIS_STEPS_PER_UNIT   {79.87220447,79.87220447,200*8/3,14}                    // default steps per unit for ultimaker 
188
-#define DEFAULT_MAX_FEEDRATE          {160*60, 160*60, 10*60, 500000}        
189
-#define DEFAULT_MAX_ACCELERATION      {9000,9000,150,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
208
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {79.87220447,79.87220447,200*8/3,760*1.1}                    // default steps per unit for ultimaker 
209
+//#define DEFAULT_AXIS_STEPS_PER_UNIT   {40, 40, 3333.92, 67} 
210
+#define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 200000}    // (mm/sec)    
211
+#define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
190 212
 
191 213
 #define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves 
192 214
 #define DEFAULT_RETRACT_ACCELERATION  7000   // X, Y, Z and E max acceleration in mm/s^2 for r retracts
193 215
 
194
-#define DEFAULT_MINIMUMFEEDRATE       10     // minimum feedrate
195
-#define DEFAULT_MINTRAVELFEEDRATE     10
216
+#define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
217
+#define DEFAULT_MINTRAVELFEEDRATE     0.0
196 218
 
197 219
 // minimum time in microseconds that a movement needs to take if the buffer is emptied.   Increase this number if you see blobs while printing high speed & high detail.  It will slowdown on the detailed stuff.
198
-#define DEFAULT_MINSEGMENTTIME        20000
199
-#define DEFAULT_XYJERK                30.0*60    
200
-#define DEFAULT_ZJERK                 10.0*60
220
+#define DEFAULT_MINSEGMENTTIME        20000   // Obsolete delete this
221
+#define DEFAULT_XYJERK                30.0    // (mm/sec)
222
+#define DEFAULT_ZJERK                 0.4     // (mm/sec)
201 223
 
202 224
 
203 225
 

+ 30
- 25
Marlin/Marlin.pde View File

@@ -116,7 +116,9 @@ extern float HeaterPower;
116 116
 //===========================================================================
117 117
 //=============================public variables=============================
118 118
 //===========================================================================
119
+#ifdef SDSUPPORT
119 120
 CardReader card;
121
+#endif
120 122
 float homing_feedrate[] = HOMING_FEEDRATE;
121 123
 bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
122 124
 volatile int feedmultiply=100; //100->1 200->2
@@ -193,32 +195,8 @@ extern "C"{
193 195
 
194 196
 
195 197
 
196
-inline void get_coordinates()
197
-{
198
-  for(int8_t i=0; i < NUM_AXIS; i++) {
199
-    if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
200
-    else destination[i] = current_position[i]; //Are these else lines really needed?
201
-  }
202
-  if(code_seen('F')) {
203
-    next_feedrate = code_value();
204
-    if(next_feedrate > 0.0) feedrate = next_feedrate;
205
-  }
206
-}
207 198
 
208
-inline void get_arc_coordinates()
209
-{
210
-   get_coordinates();
211
-   if(code_seen('I')) offset[0] = code_value();
212
-   if(code_seen('J')) offset[1] = code_value();
213
-}
214 199
 
215
-void prepare_move()
216
-{
217
-  plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
218
-  for(int8_t i=0; i < NUM_AXIS; i++) {
219
-    current_position[i] = destination[i];
220
-  }
221
-}
222 200
 
223 201
 
224 202
 
@@ -273,7 +251,9 @@ void loop()
273 251
 {
274 252
   if(buflen<3)
275 253
     get_command();
254
+  #ifdef SDSUPPORT
276 255
   card.checkautostart(false);
256
+  #endif
277 257
   if(buflen)
278 258
   {
279 259
     #ifdef SDSUPPORT
@@ -1008,13 +988,38 @@ void ClearToSend()
1008 988
   SERIAL_PROTOCOLLNPGM("ok"); 
1009 989
 }
1010 990
 
991
+inline void get_coordinates()
992
+{
993
+  for(int8_t i=0; i < NUM_AXIS; i++) {
994
+    if(code_seen(axis_codes[i])) destination[i] = (float)code_value() + (axis_relative_modes[i] || relative_mode)*current_position[i];
995
+    else destination[i] = current_position[i]; //Are these else lines really needed?
996
+  }
997
+  if(code_seen('F')) {
998
+    next_feedrate = code_value();
999
+    if(next_feedrate > 0.0) feedrate = next_feedrate;
1000
+  }
1001
+}
1002
+
1003
+inline void get_arc_coordinates()
1004
+{
1005
+   get_coordinates();
1006
+   if(code_seen('I')) offset[0] = code_value();
1007
+   if(code_seen('J')) offset[1] = code_value();
1008
+}
1011 1009
 
1010
+void prepare_move()
1011
+{
1012
+  plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0);
1013
+  for(int8_t i=0; i < NUM_AXIS; i++) {
1014
+    current_position[i] = destination[i];
1015
+  }
1016
+}
1012 1017
 
1013 1018
 void prepare_arc_move(char isclockwise) {
1014 1019
   float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc
1015 1020
 
1016 1021
   // Trace the arc
1017
-  mc_arc(current_position, destination, offset, X_AXIS, Y_AXIS, Z_AXIS, feedrate*feedmultiply/60.0/100.0, r, isclockwise);
1022
+  mc_arc(current_position, destination, offset, X_AXIS, Y_AXIS, Z_AXIS, feedrate*feedmultiply/60/100.0, r, isclockwise);
1018 1023
   
1019 1024
   // As far as the parser is concerned, the position is now == target. In reality the
1020 1025
   // motion control system might still be processing the action and the real tool position

+ 747
- 629
Marlin/planner.cpp
File diff suppressed because it is too large
View File


+ 98
- 95
Marlin/planner.h View File

@@ -1,95 +1,98 @@
1
-/*
2
-  planner.h - buffers movement commands and manages the acceleration profile plan
3
-  Part of Grbl
4
-
5
-  Copyright (c) 2009-2011 Simen Svale Skogsrud
6
-
7
-  Grbl is free software: you can redistribute it and/or modify
8
-  it under the terms of the GNU General Public License as published by
9
-  the Free Software Foundation, either version 3 of the License, or
10
-  (at your option) any later version.
11
-
12
-  Grbl is distributed in the hope that it will be useful,
13
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
-  GNU General Public License for more details.
16
-
17
-  You should have received a copy of the GNU General Public License
18
-  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
19
-*/
20
-
21
-// This module is to be considered a sub-module of stepper.c. Please don't include 
22
-// this file from any other module.
23
-
24
-#ifndef planner_h
25
-#define planner_h
26
-
27
-#include "Configuration.h"
28
-
29
-// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in 
30
-// the source g-code and may never actually be reached if acceleration management is active.
31
-typedef struct {
32
-  // Fields used by the bresenham algorithm for tracing the line
33
-  long steps_x, steps_y, steps_z, steps_e;  // Step count along each axis
34
-  long step_event_count;                    // The number of step events required to complete this block
35
-  volatile long accelerate_until;           // The index of the step event on which to stop acceleration
36
-  volatile long decelerate_after;           // The index of the step event on which to start decelerating
37
-  volatile long acceleration_rate;          // The acceleration rate used for acceleration calculation
38
-  unsigned char direction_bits;             // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
39
-  #ifdef ADVANCE
40
-    long advance_rate;
41
-    volatile long initial_advance;
42
-    volatile long final_advance;
43
-    float advance;
44
-  #endif
45
-
46
-  // Fields used by the motion planner to manage acceleration
47
-  float speed_x, speed_y, speed_z, speed_e;          // Nominal mm/minute for each axis
48
-  float nominal_speed;                               // The nominal speed for this block in mm/min  
49
-  float millimeters;                                 // The total travel of this block in mm
50
-  float entry_speed;
51
-  float acceleration;                                // acceleration mm/sec^2
52
-
53
-  // Settings for the trapezoid generator
54
-  long nominal_rate;                                 // The nominal step rate for this block in step_events/sec 
55
-  volatile long initial_rate;                        // The jerk-adjusted step rate at start of block  
56
-  volatile long final_rate;                          // The minimal rate at exit
57
-  long acceleration_st;                              // acceleration steps/sec^2
58
-  volatile char busy;
59
-} block_t;
60
-
61
-// Initialize the motion plan subsystem      
62
-void plan_init();
63
-
64
-// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in 
65
-// millimaters. Feed rate specifies the speed of the motion.
66
-void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate);
67
-
68
-// Set position. Used for G92 instructions.
69
-void plan_set_position(const float &x, const float &y, const float &z, const float &e);
70
-
71
-
72
-// Called when the current block is no longer needed. Discards the block and makes the memory
73
-// availible for new blocks.
74
-void plan_discard_current_block();
75
-
76
-// Gets the current block. Returns NULL if buffer empty
77
-block_t *plan_get_current_block();
78
-
79
-void check_axes_activity();
80
-
81
-extern unsigned long minsegmenttime;
82
-extern float max_feedrate[4]; // set the max speeds
83
-extern float axis_steps_per_unit[4];
84
-extern long max_acceleration_units_per_sq_second[4]; // Use M201 to override by software
85
-extern float minimumfeedrate;
86
-extern float acceleration;         // Normal acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
87
-extern float retract_acceleration; //  mm/s^2   filament pull-pack and push-forward  while standing still in the other axis M204 TXXXX
88
-extern float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
89
-extern float max_z_jerk;
90
-extern float mintravelfeedrate;
91
-extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];
92
-#ifdef AUTOTEMP
93
-extern float high_e_speed;
94
-#endif
95
-#endif
1
+/*
2
+  planner.h - buffers movement commands and manages the acceleration profile plan
3
+  Part of Grbl
4
+
5
+  Copyright (c) 2009-2011 Simen Svale Skogsrud
6
+
7
+  Grbl is free software: you can redistribute it and/or modify
8
+  it under the terms of the GNU General Public License as published by
9
+  the Free Software Foundation, either version 3 of the License, or
10
+  (at your option) any later version.
11
+
12
+  Grbl is distributed in the hope that it will be useful,
13
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
+  GNU General Public License for more details.
16
+
17
+  You should have received a copy of the GNU General Public License
18
+  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
19
+*/
20
+
21
+// This module is to be considered a sub-module of stepper.c. Please don't include 
22
+// this file from any other module.
23
+
24
+#ifndef planner_h
25
+#define planner_h
26
+
27
+#include "Configuration.h"
28
+
29
+// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in 
30
+// the source g-code and may never actually be reached if acceleration management is active.
31
+typedef struct {
32
+  // Fields used by the bresenham algorithm for tracing the line
33
+  long steps_x, steps_y, steps_z, steps_e;  // Step count along each axis
34
+  long step_event_count;                    // The number of step events required to complete this block
35
+  long accelerate_until;                    // The index of the step event on which to stop acceleration
36
+  long decelerate_after;                    // The index of the step event on which to start decelerating
37
+  long acceleration_rate;                   // The acceleration rate used for acceleration calculation
38
+  unsigned char direction_bits;             // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
39
+  #ifdef ADVANCE
40
+//    long advance_rate;
41
+//    volatile long initial_advance;
42
+//    volatile long final_advance;
43
+//    float advance;
44
+  #endif
45
+
46
+  // Fields used by the motion planner to manage acceleration
47
+//  float speed_x, speed_y, speed_z, speed_e;        // Nominal mm/minute for each axis
48
+  float nominal_speed;                               // The nominal speed for this block in mm/min  
49
+  float entry_speed;                                 // Entry speed at previous-current junction in mm/min
50
+  float max_entry_speed;                             // Maximum allowable junction entry speed in mm/min
51
+  float millimeters;                                 // The total travel of this block in mm
52
+  float acceleration;                                // acceleration mm/sec^2
53
+  unsigned char recalculate_flag;                    // Planner flag to recalculate trapezoids on entry junction
54
+  unsigned char nominal_length_flag;                 // Planner flag for nominal speed always reached
55
+
56
+  // Settings for the trapezoid generator
57
+  unsigned long nominal_rate;                        // The nominal step rate for this block in step_events/sec 
58
+  unsigned long initial_rate;                        // The jerk-adjusted step rate at start of block  
59
+  unsigned long final_rate;                          // The minimal rate at exit
60
+  unsigned long acceleration_st;                     // acceleration steps/sec^2
61
+  volatile char busy;
62
+} block_t;
63
+
64
+// Initialize the motion plan subsystem      
65
+void plan_init();
66
+
67
+// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in 
68
+// millimaters. Feed rate specifies the speed of the motion.
69
+void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate);
70
+
71
+// Set position. Used for G92 instructions.
72
+void plan_set_position(const float &x, const float &y, const float &z, const float &e);
73
+
74
+
75
+// Called when the current block is no longer needed. Discards the block and makes the memory
76
+// availible for new blocks.
77
+void plan_discard_current_block();
78
+
79
+// Gets the current block. Returns NULL if buffer empty
80
+block_t *plan_get_current_block();
81
+
82
+void check_axes_activity();
83
+
84
+extern unsigned long minsegmenttime;
85
+extern float max_feedrate[4]; // set the max speeds
86
+extern float axis_steps_per_unit[4];
87
+extern unsigned long max_acceleration_units_per_sq_second[4]; // Use M201 to override by software
88
+extern float minimumfeedrate;
89
+extern float acceleration;         // Normal acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
90
+extern float retract_acceleration; //  mm/s^2   filament pull-pack and push-forward  while standing still in the other axis M204 TXXXX
91
+extern float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
92
+extern float max_z_jerk;
93
+extern float mintravelfeedrate;
94
+extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];
95
+#ifdef AUTOTEMP
96
+extern float high_e_speed;
97
+#endif
98
+#endif

+ 669
- 664
Marlin/stepper.cpp
File diff suppressed because it is too large
View File


+ 580
- 577
Marlin/temperature.cpp
File diff suppressed because it is too large
View File


+ 9
- 7
Marlin/thermistortables.h View File

@@ -1,12 +1,14 @@
1 1
 #ifndef THERMISTORTABLES_H_
2 2
 #define THERMISTORTABLES_H_
3 3
 
4
+#include <avr/pgmspace.h>
5
+
4 6
 #define OVERSAMPLENR 16
5 7
 
6 8
 #if (THERMISTORHEATER_0 == 1) || (THERMISTORHEATER_1 == 1) || (THERMISTORBED == 1) //100k bed thermistor
7 9
 
8 10
 #define NUMTEMPS_1 61
9
-const short temptable_1[NUMTEMPS_1][2] = {
11
+const short temptable_1[NUMTEMPS_1][2] PROGMEM = {
10 12
 {       23*OVERSAMPLENR ,       300     },
11 13
 {       25*OVERSAMPLENR ,       295     },
12 14
 {       27*OVERSAMPLENR ,       290     },
@@ -72,7 +74,7 @@ const short temptable_1[NUMTEMPS_1][2] = {
72 74
 #endif
73 75
 #if (THERMISTORHEATER_0 == 2) || (THERMISTORHEATER_1 == 2) || (THERMISTORBED == 2) //200k bed thermistor
74 76
 #define NUMTEMPS_2 21
75
-const short temptable_2[NUMTEMPS_2][2] = {
77
+const short temptable_2[NUMTEMPS_2][2] PROGMEM = {
76 78
    {1*OVERSAMPLENR, 848},
77 79
    {54*OVERSAMPLENR, 275},
78 80
    {107*OVERSAMPLENR, 228},
@@ -99,7 +101,7 @@ const short temptable_2[NUMTEMPS_2][2] = {
99 101
 #endif
100 102
 #if (THERMISTORHEATER_0 == 3) || (THERMISTORHEATER_1 == 3) || (THERMISTORBED == 3) //mendel-parts
101 103
 #define NUMTEMPS_3 28
102
-const short temptable_3[NUMTEMPS_3][2] = {
104
+const short temptable_3[NUMTEMPS_3][2] PROGMEM = {
103 105
                 {1*OVERSAMPLENR,864},
104 106
                 {21*OVERSAMPLENR,300},
105 107
                 {25*OVERSAMPLENR,290},
@@ -134,7 +136,7 @@ const short temptable_3[NUMTEMPS_3][2] = {
134 136
 #if (THERMISTORHEATER_0 == 4) || (THERMISTORHEATER_1 == 4) || (THERMISTORBED == 4) //10k thermistor
135 137
 
136 138
 #define NUMTEMPS_4 20
137
-short temptable_4[NUMTEMPS_4][2] = {
139
+const short temptable_4[NUMTEMPS_4][2] PROGMEM = {
138 140
    {1*OVERSAMPLENR, 430},
139 141
    {54*OVERSAMPLENR, 137},
140 142
    {107*OVERSAMPLENR, 107},
@@ -161,7 +163,7 @@ short temptable_4[NUMTEMPS_4][2] = {
161 163
 #if (THERMISTORHEATER_0 == 5) || (THERMISTORHEATER_1 == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2)
162 164
 
163 165
 #define NUMTEMPS_5 61
164
-const short temptable_5[NUMTEMPS_5][2] = {
166
+const short temptable_5[NUMTEMPS_5][2] PROGMEM = {
165 167
 {1*OVERSAMPLENR, 713},
166 168
 {18*OVERSAMPLENR, 316},
167 169
 {35*OVERSAMPLENR, 266},
@@ -228,7 +230,7 @@ const short temptable_5[NUMTEMPS_5][2] = {
228 230
 
229 231
 #if (THERMISTORHEATER_0 == 6) || (THERMISTORHEATER_1 == 6) || (THERMISTORBED == 6) // 100k Epcos thermistor
230 232
 #define NUMTEMPS_6 36
231
-const short temptable_6[NUMTEMPS_6][2] = {
233
+const short temptable_6[NUMTEMPS_6][2] PROGMEM = {
232 234
    {28*OVERSAMPLENR, 250},
233 235
    {31*OVERSAMPLENR, 245},
234 236
    {35*OVERSAMPLENR, 240},
@@ -270,7 +272,7 @@ const short temptable_6[NUMTEMPS_6][2] = {
270 272
 
271 273
 #if (THERMISTORHEATER_0 == 7) || (THERMISTORHEATER_1 == 7) || (THERMISTORBED == 7) // 100k Honeywell 135-104LAG-J01
272 274
 #define NUMTEMPS_7 54
273
-const short temptable_7[NUMTEMPS_7][2] = {
275
+const short temptable_7[NUMTEMPS_7][2] PROGMEM = {
274 276
    {46*OVERSAMPLENR, 270},
275 277
    {50*OVERSAMPLENR, 265},
276 278
    {54*OVERSAMPLENR, 260},

+ 103
- 102
Marlin/ultralcd.h View File

@@ -1,102 +1,103 @@
1
-#ifndef __ULTRALCDH
2
-#define __ULTRALCDH
3
-#include "Configuration.h"
4
-
5
-#ifdef ULTRA_LCD
6
-
7
-  void lcd_status();
8
-  void lcd_init();
9
-  void lcd_status(const char* message);
10
-  void beep();
11
-  void buttons_check();
12
-
13
-
14
-  #define LCD_UPDATE_INTERVAL 100
15
-  #define STATUSTIMEOUT 15000
16
-
17
-
18
-  #include <LiquidCrystal.h>
19
-  extern LiquidCrystal lcd;
20
-
21
-
22
-  #ifdef NEWPANEL
23
-
24
-    
25
-    #define EN_C (1<<BLEN_C)
26
-    #define EN_B (1<<BLEN_B)
27
-    #define EN_A (1<<BLEN_A)
28
-    
29
-    #define CLICKED (buttons&EN_C)
30
-    #define BLOCK {blocking=millis()+blocktime;}
31
-    #define CARDINSERTED (READ(SDCARDDETECT)==0)
32
-    
33
-  #else
34
-
35
-    //atomatic, do not change
36
-    #define B_LE (1<<BL_LE)
37
-    #define B_UP (1<<BL_UP)
38
-    #define B_MI (1<<BL_MI)
39
-    #define B_DW (1<<BL_DW)
40
-    #define B_RI (1<<BL_RI)
41
-    #define B_ST (1<<BL_ST)
42
-    #define EN_B (1<<BLEN_B)
43
-    #define EN_A (1<<BLEN_A)
44
-    
45
-    #define CLICKED ((buttons&B_MI)||(buttons&B_ST))
46
-    #define BLOCK {blocking[BL_MI]=millis()+blocktime;blocking[BL_ST]=millis()+blocktime;}
47
-    
48
-  #endif
49
-    
50
-  // blocking time for recognizing a new keypress of one key, ms
51
-  #define blocktime 500
52
-  #define lcdslow 5
53
-    
54
-  enum MainStatus{Main_Status, Main_Menu, Main_Prepare, Main_Control, Main_SD};
55
-
56
-  class MainMenu{
57
-  public:
58
-    MainMenu();
59
-    void update();
60
-    uint8_t activeline;
61
-    MainStatus status;
62
-    uint8_t displayStartingRow;
63
-    
64
-    void showStatus();
65
-    void showMainMenu();
66
-    void showPrepare();
67
-    void showControl();
68
-    void showSD();
69
-    bool force_lcd_update;
70
-    int lastencoderpos;
71
-    int8_t lineoffset;
72
-    int8_t lastlineoffset;
73
-    
74
-    bool linechanging;
75
-  };
76
-
77
-  //conversion routines, could need some overworking
78
-  char *fillto(int8_t n,char *c);
79
-  char *ftostr51(const float &x);
80
-  char *ftostr31(const float &x);
81
-  char *ftostr3(const float &x);
82
-
83
-
84
-
85
-  #define LCD_MESSAGE(x) lcd_status(x);
86
-  #define LCD_MESSAGEPGM(x) lcd_statuspgm(PSTR(x));
87
-  #define LCD_STATUS lcd_status()
88
-#else //no lcd
89
-  #define LCD_STATUS
90
-  #define LCD_MESSAGE(x)
91
-  inline void lcd_status() {};
92
-#endif
93
-  
94
-#ifndef ULTIPANEL  
95
- #define CLICKED false
96
-  #define BLOCK ;
97
-#endif 
98
-  
99
-void lcd_statuspgm(const char* message);
100
-  
101
-#endif //ULTRALCD
102
-
1
+#ifndef __ULTRALCDH
2
+#define __ULTRALCDH
3
+#include "Configuration.h"
4
+
5
+#ifdef ULTRA_LCD
6
+
7
+  void lcd_status();
8
+  void lcd_init();
9
+  void lcd_status(const char* message);
10
+  void beep();
11
+  void buttons_check();
12
+
13
+
14
+  #define LCD_UPDATE_INTERVAL 100
15
+  #define STATUSTIMEOUT 15000
16
+
17
+
18
+  #include <LiquidCrystal.h>
19
+  extern LiquidCrystal lcd;
20
+
21
+
22
+  #ifdef NEWPANEL
23
+
24
+    
25
+    #define EN_C (1<<BLEN_C)
26
+    #define EN_B (1<<BLEN_B)
27
+    #define EN_A (1<<BLEN_A)
28
+    
29
+    #define CLICKED (buttons&EN_C)
30
+    #define BLOCK {blocking=millis()+blocktime;}
31
+    #define CARDINSERTED (READ(SDCARDDETECT)==0)
32
+    
33
+  #else
34
+
35
+    //atomatic, do not change
36
+    #define B_LE (1<<BL_LE)
37
+    #define B_UP (1<<BL_UP)
38
+    #define B_MI (1<<BL_MI)
39
+    #define B_DW (1<<BL_DW)
40
+    #define B_RI (1<<BL_RI)
41
+    #define B_ST (1<<BL_ST)
42
+    #define EN_B (1<<BLEN_B)
43
+    #define EN_A (1<<BLEN_A)
44
+    
45
+    #define CLICKED ((buttons&B_MI)||(buttons&B_ST))
46
+    #define BLOCK {blocking[BL_MI]=millis()+blocktime;blocking[BL_ST]=millis()+blocktime;}
47
+    
48
+  #endif
49
+    
50
+  // blocking time for recognizing a new keypress of one key, ms
51
+  #define blocktime 500
52
+  #define lcdslow 5
53
+    
54
+  enum MainStatus{Main_Status, Main_Menu, Main_Prepare, Main_Control, Main_SD};
55
+
56
+  class MainMenu{
57
+  public:
58
+    MainMenu();
59
+    void update();
60
+    uint8_t activeline;
61
+    MainStatus status;
62
+    uint8_t displayStartingRow;
63
+    
64
+    void showStatus();
65
+    void showMainMenu();
66
+    void showPrepare();
67
+    void showControl();
68
+    void showSD();
69
+    bool force_lcd_update;
70
+    int lastencoderpos;
71
+    int8_t lineoffset;
72
+    int8_t lastlineoffset;
73
+    
74
+    bool linechanging;
75
+  };
76
+
77
+  //conversion routines, could need some overworking
78
+  char *fillto(int8_t n,char *c);
79
+  char *ftostr51(const float &x);
80
+  char *ftostr31(const float &x);
81
+  char *ftostr3(const float &x);
82
+
83
+
84
+
85
+  #define LCD_MESSAGE(x) lcd_status(x);
86
+  #define LCD_MESSAGEPGM(x) lcd_statuspgm(PSTR(x));
87
+  #define LCD_STATUS lcd_status()
88
+#else //no lcd
89
+  #define LCD_STATUS
90
+  #define LCD_MESSAGE(x)
91
+  #define LCD_MESSAGEPGM(x)
92
+  inline void lcd_status() {};
93
+#endif
94
+  
95
+#ifndef ULTIPANEL  
96
+ #define CLICKED false
97
+  #define BLOCK ;
98
+#endif 
99
+  
100
+void lcd_statuspgm(const char* message);
101
+  
102
+#endif //ULTRALCD
103
+

+ 12
- 12
Marlin/ultralcd.pde View File

@@ -697,7 +697,7 @@ void MainMenu::showControl()
697 697
       if(force_lcd_update)
698 698
         {
699 699
           lcd.setCursor(0,line);lcdprintPGM(" Vxy-jerk: ");
700
-          lcd.setCursor(13,line);lcd.print(itostr3(max_xy_jerk/60));
700
+          lcd.setCursor(13,line);lcd.print(itostr3(max_xy_jerk));
701 701
         }
702 702
         
703 703
         if((activeline==line) )
@@ -707,11 +707,11 @@ void MainMenu::showControl()
707 707
             linechanging=!linechanging;
708 708
             if(linechanging)
709 709
             {
710
-               encoderpos=(int)max_xy_jerk/60;
710
+               encoderpos=(int)max_xy_jerk;
711 711
             }
712 712
             else
713 713
             {
714
-              max_xy_jerk= encoderpos*60;
714
+              max_xy_jerk= encoderpos;
715 715
               encoderpos=activeline*lcdslow;
716 716
                 
717 717
             }
@@ -877,7 +877,7 @@ void MainMenu::showControl()
877 877
           if(i==ItemC_vmaxy)lcdprintPGM("y:");
878 878
           if(i==ItemC_vmaxz)lcdprintPGM("z:");
879 879
           if(i==ItemC_vmaxe)lcdprintPGM("e:");
880
-          lcd.setCursor(13,line);lcd.print(itostr3(max_feedrate[i-ItemC_vmaxx]/60));
880
+          lcd.setCursor(13,line);lcd.print(itostr3(max_feedrate[i-ItemC_vmaxx]));
881 881
         }
882 882
         
883 883
         if((activeline==line) )
@@ -887,11 +887,11 @@ void MainMenu::showControl()
887 887
             linechanging=!linechanging;
888 888
             if(linechanging)
889 889
             {
890
-               encoderpos=(int)max_feedrate[i-ItemC_vmaxx]/60;
890
+               encoderpos=(int)max_feedrate[i-ItemC_vmaxx];
891 891
             }
892 892
             else
893 893
             {
894
-              max_feedrate[i-ItemC_vmaxx]= encoderpos*60;
894
+              max_feedrate[i-ItemC_vmaxx]= encoderpos;
895 895
               encoderpos=activeline*lcdslow;
896 896
                 
897 897
             }
@@ -912,7 +912,7 @@ void MainMenu::showControl()
912 912
       if(force_lcd_update)
913 913
         {
914 914
           lcd.setCursor(0,line);lcdprintPGM(" Vmin:");
915
-          lcd.setCursor(13,line);lcd.print(itostr3(minimumfeedrate/60));
915
+          lcd.setCursor(13,line);lcd.print(itostr3(minimumfeedrate));
916 916
         }
917 917
         
918 918
         if((activeline==line) )
@@ -922,11 +922,11 @@ void MainMenu::showControl()
922 922
             linechanging=!linechanging;
923 923
             if(linechanging)
924 924
             {
925
-               encoderpos=(int)(minimumfeedrate/60.);
925
+               encoderpos=(int)(minimumfeedrate);
926 926
             }
927 927
             else
928 928
             {
929
-              minimumfeedrate= encoderpos*60;
929
+              minimumfeedrate= encoderpos;
930 930
               encoderpos=activeline*lcdslow;
931 931
                 
932 932
             }
@@ -946,7 +946,7 @@ void MainMenu::showControl()
946 946
       if(force_lcd_update)
947 947
         {
948 948
           lcd.setCursor(0,line);lcdprintPGM(" VTrav min:");
949
-          lcd.setCursor(13,line);lcd.print(itostr3(mintravelfeedrate/60));
949
+          lcd.setCursor(13,line);lcd.print(itostr3(mintravelfeedrate));
950 950
         }
951 951
         
952 952
         if((activeline==line) )
@@ -956,11 +956,11 @@ void MainMenu::showControl()
956 956
             linechanging=!linechanging;
957 957
             if(linechanging)
958 958
             {
959
-               encoderpos=(int)mintravelfeedrate/60;
959
+               encoderpos=(int)mintravelfeedrate;
960 960
             }
961 961
             else
962 962
             {
963
-              mintravelfeedrate= encoderpos*60;
963
+              mintravelfeedrate= encoderpos;
964 964
               encoderpos=activeline*lcdslow;
965 965
                 
966 966
             }

Loading…
Cancel
Save