summaryrefslogtreecommitdiff
path: root/Sprinter/Sprinter.h
diff options
context:
space:
mode:
authormidopple <mdoppler@gmx.at>2012-02-05 19:58:36 +0100
committermidopple <mdoppler@gmx.at>2012-02-05 19:58:36 +0100
commite74587a1b4fea9f90a54d3293bbd98a4d58a4913 (patch)
tree801945d7ee60850e55a674f3e45703b23d4ccd14 /Sprinter/Sprinter.h
parent0953453911833e1129ff240901d95821a05b8378 (diff)
- Implement Plannercode from Marlin V1 --> big thanks to Erik
- Stepper interrupt with Step loops - Stepperfrequenz 30 Khz - New Command * M202 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec * M204 - Set default acceleration: S normal moves T filament only moves (M204 S3000 T7000) im mm/sec^2 * M205 - advanced settings: minimum travel speed S=while printing T=travel only, X= maximum xy jerk, Z=maximum Z jerk - Remove unused Variables - Check Uart Puffer while circle processing (CMD: G2 / G3) - Fast Xfer Function --> move Text to Flash - Option to deaktivate ARC (G2/G3) function (save flash) - Removed modulo (%) operator, which uses an expensive divide
Diffstat (limited to 'Sprinter/Sprinter.h')
-rw-r--r--Sprinter/Sprinter.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/Sprinter/Sprinter.h b/Sprinter/Sprinter.h
index 844fc34..b70d1fd 100644
--- a/Sprinter/Sprinter.h
+++ b/Sprinter/Sprinter.h
@@ -1,10 +1,18 @@
// Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
// Licence: GPL
-#include <WProgram.h>
+
+//Check Version of Arduino and then include the right libraries
+#if defined(ARDUINO) && ARDUINO >= 100
+ #include "Arduino.h"
+#else
+ #include <WProgram.h>
+#endif
+
#include "fastio.h"
extern "C" void __cxa_pure_virtual();
+#define FORCE_INLINE __attribute__((always_inline)) inline
#if X_ENABLE_PIN > -1
#define enable_x() WRITE(X_ENABLE_PIN, X_ENABLE_ON)
@@ -47,10 +55,10 @@ typedef struct {
// Fields used by the bresenham algorithm for tracing the line
long steps_x, steps_y, steps_z, steps_e; // Step count along each axis
- long step_event_count; // The number of step events required to complete this block
- volatile long accelerate_until; // The index of the step event on which to stop acceleration
- volatile long decelerate_after; // The index of the step event on which to start decelerating
- volatile long acceleration_rate; // The acceleration rate used for acceleration calculation
+ unsigned long step_event_count; // The number of step events required to complete this block
+ long accelerate_until; // The index of the step event on which to stop acceleration
+ long decelerate_after; // The index of the step event on which to start decelerating
+ long acceleration_rate; // The acceleration rate used for acceleration calculation
unsigned char direction_bits; // The direction bit set for this block (refers to *_DIRECTION_BIT in config.h)
#ifdef ADVANCE
@@ -61,16 +69,20 @@ typedef struct {
#endif
// Fields used by the motion planner to manage acceleration
- float speed_x, speed_y, speed_z, speed_e; // Nominal mm/minute for each axis
+// float speed_x, speed_y, speed_z, speed_e; // Nominal mm/minute for each axis
float nominal_speed; // The nominal speed for this block in mm/min
+ float entry_speed; // Entry speed at previous-current junction in mm/min
+ float max_entry_speed; // Maximum allowable junction entry speed in mm/min
float millimeters; // The total travel of this block in mm
- float entry_speed;
float acceleration; // acceleration mm/sec^2
+ unsigned char recalculate_flag; // Planner flag to recalculate trapezoids on entry junction
+ unsigned char nominal_length_flag; // Planner flag for nominal speed always reached
+
// Settings for the trapezoid generator
long nominal_rate; // The nominal step rate for this block in step_events/sec
- volatile long initial_rate; // The jerk-adjusted step rate at start of block
- volatile long final_rate; // The minimal rate at exit
+ long initial_rate; // The jerk-adjusted step rate at start of block
+ long final_rate; // The minimal rate at exit
long acceleration_st; // acceleration steps/sec^2
volatile char busy;
} block_t;
@@ -87,7 +99,6 @@ void manage_inactivity(byte debug);
void get_coordinates();
void prepare_move();
void prepare_arc_move(char isclockwise);
-void plan_buffer_line(float x, float y, float z, float e, float feed_rate);
void kill(byte debug);