Skip to content

Commit 65934ee

Browse files
committed
A lot of changes in the planner code
1 parent 72ace55 commit 65934ee

7 files changed

Lines changed: 2019 additions & 1877 deletions

File tree

Marlin/Configuration.h

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
#define MM_PER_ARC_SEGMENT 1
77
#define N_ARC_CORRECTION 25
88

9+
// Frequency limit
10+
// See nophead's blog for more info
11+
#define XY_FREQUENCY_LIMIT 15
12+
13+
// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
14+
// of the buffer and all stops. This should not be much greater than zero and should only be changed
15+
// if unwanted behavior is observed on a user's machine when running at very slow speeds.
16+
#define MINIMUM_PLANNER_SPEED 2.0 // (mm/sec)
17+
918
// BASIC SETTINGS: select your board type, thermistor type, axis scaling, and endstop configuration
1019

1120
//// The following define selects which electronics board you have. Please choose the one that matches your setup
@@ -97,6 +106,11 @@ const int dropsegments=5; //everything with this number of steps will be ignore
97106
#define DISABLE_E false
98107

99108
// Inverting axis direction
109+
//#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true
110+
//#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false
111+
//#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true
112+
//#define INVERT_E_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
113+
100114
#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true
101115
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
102116
#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true
@@ -117,7 +131,7 @@ const int dropsegments=5; //everything with this number of steps will be ignore
117131
//// MOVEMENT SETTINGS
118132
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
119133
//note: on bernhards ultimaker 200 200 12 are working well.
120-
#define HOMING_FEEDRATE {50*60, 50*60, 12*60, 0} // set the homing speeds
134+
#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0} // set the homing speeds (mm/min)
121135

122136
#define AXIS_RELATIVE_MODES {false, false, false, false}
123137

@@ -126,19 +140,20 @@ const int dropsegments=5; //everything with this number of steps will be ignore
126140
// default settings
127141

128142
#define DEFAULT_AXIS_STEPS_PER_UNIT {79.87220447,79.87220447,200*8/3,14} // default steps per unit for ultimaker
129-
#define DEFAULT_MAX_FEEDRATE {160*60, 160*60, 10*60, 500000}
130-
#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.
143+
//#define DEFAULT_AXIS_STEPS_PER_UNIT {40, 40, 3333.92, 67}
144+
#define DEFAULT_MAX_FEEDRATE {500, 500, 10, 500000} // (mm/min)
145+
#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.
131146

132147
#define DEFAULT_ACCELERATION 3000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
133148
#define DEFAULT_RETRACT_ACCELERATION 7000 // X, Y, Z and E max acceleration in mm/s^2 for r retracts
134149

135-
#define DEFAULT_MINIMUMFEEDRATE 10 // minimum feedrate
136-
#define DEFAULT_MINTRAVELFEEDRATE 10
150+
#define DEFAULT_MINIMUMFEEDRATE 0 // minimum feedrate
151+
#define DEFAULT_MINTRAVELFEEDRATE 0
137152

138153
// 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.
139154
#define DEFAULT_MINSEGMENTTIME 20000
140-
#define DEFAULT_XYJERK 30.0*60
141-
#define DEFAULT_ZJERK 10.0*60
155+
#define DEFAULT_XYJERK 30.0 // (mm/sec)
156+
#define DEFAULT_ZJERK 0.4 // (mm/sec)
142157

143158

144159
// The watchdog waits for the watchperiod in milliseconds whenever an M104 or M109 increases the target temperature
@@ -162,15 +177,15 @@ const int dropsegments=5; //everything with this number of steps will be ignore
162177
//#define TEMP_HYSTERESIS 5 // (C°) range of +/- temperatures considered "close" to the target one
163178

164179
//// The minimal temperature defines the temperature below which the heater will not be enabled
165-
#define HEATER_0_MINTEMP 5
180+
//#define HEATER_0_MINTEMP 5
166181
//#define HEATER_1_MINTEMP 5
167182
//#define BED_MINTEMP 5
168183

169184

170185
// When temperature exceeds max temp, your heater will be switched off.
171186
// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
172187
// You should use MINTEMP for thermistor short/failure protection.
173-
#define HEATER_0_MAXTEMP 275
188+
//#define HEATER_0_MAXTEMP 275
174189
//#define_HEATER_1_MAXTEMP 275
175190
//#define BED_MAXTEMP 150
176191

@@ -246,9 +261,9 @@ const int dropsegments=5; //everything with this number of steps will be ignore
246261
// The number of linear motions that can be in the plan at any give time.
247262
// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ringbuffering.
248263
#if defined SDSUPPORT
249-
#define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
264+
#define BLOCK_BUFFER_SIZE 8 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
250265
#else
251-
#define BLOCK_BUFFER_SIZE 16 // maximize block buffer
266+
#define BLOCK_BUFFER_SIZE 8 // maximize block buffer
252267
#endif
253268

254269
//The ASCII buffer for recieving from the serial:

Marlin/Marlin.pde

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ extern float HeaterPower;
114114
//===========================================================================
115115
//=============================public variables=============================
116116
//===========================================================================
117+
#ifdef SDSUPPORT
117118
CardReader card;
119+
#endif
118120
float homing_feedrate[] = HOMING_FEEDRATE;
119121
bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
120122
volatile int feedmultiply=100; //100->1 200->2
@@ -215,7 +217,9 @@ void loop()
215217
{
216218
if(buflen<3)
217219
get_command();
220+
#ifdef SDSUPPORT
218221
card.checkautostart(false);
222+
#endif
219223
if(buflen)
220224
{
221225
#ifdef SDSUPPORT
@@ -933,7 +937,7 @@ inline void get_arc_coordinates()
933937

934938
void prepare_move()
935939
{
936-
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60.0/100.0);
940+
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate*feedmultiply/60/100.0);
937941
for(int8_t i=0; i < NUM_AXIS; i++) {
938942
current_position[i] = destination[i];
939943
}
@@ -943,7 +947,7 @@ void prepare_arc_move(char isclockwise) {
943947
float r = hypot(offset[X_AXIS], offset[Y_AXIS]); // Compute arc radius for mc_arc
944948

945949
// Trace the arc
946-
mc_arc(current_position, destination, offset, X_AXIS, Y_AXIS, Z_AXIS, feedrate*feedmultiply/60.0/100.0, r, isclockwise);
950+
mc_arc(current_position, destination, offset, X_AXIS, Y_AXIS, Z_AXIS, feedrate*feedmultiply/60/100.0, r, isclockwise);
947951

948952
// As far as the parser is concerned, the position is now == target. In reality the
949953
// motion control system might still be processing the action and the real tool position

0 commit comments

Comments
 (0)