summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmanuele Caruso <emanuele.caruso@gmail.com>2011-06-05 06:27:31 +0200
committerEmanuele Caruso <emanuele.caruso@gmail.com>2011-06-05 06:27:31 +0200
commita7ed8f90215ed948a5cba8e9f78b5d00c7b5c488 (patch)
treebea78bb6841bb1aec74c24311555e0b7ff2f9521
parent4689ab10ef12951a20efb1713478056d17332421 (diff)
Exponential acceleration discontinued. Deleted all related code
-rw-r--r--Tonokip_Firmware/Tonokip_Firmware.pde56
-rw-r--r--Tonokip_Firmware/configuration.h13
2 files changed, 0 insertions, 69 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde
index 535716e..933b6d2 100644
--- a/Tonokip_Firmware/Tonokip_Firmware.pde
+++ b/Tonokip_Firmware/Tonokip_Firmware.pde
@@ -78,16 +78,6 @@ unsigned long move_steps_to_take[NUM_AXIS];
max_travel_acceleration_units_per_sq_second[3] * axis_steps_per_unit[3]};
unsigned long steps_per_sqr_second, plateau_steps;
#endif
-#ifdef EXP_ACCELERATION
- unsigned long axis_virtual_full_velocity_steps[] = {full_velocity_units * axis_steps_per_unit[0], full_velocity_units * axis_steps_per_unit[1]};
- unsigned long axis_travel_virtual_full_velocity_steps[] = {travel_move_full_velocity_units * axis_steps_per_unit[0],
- travel_move_full_velocity_units * axis_steps_per_unit[1]};
- unsigned long axis_max_interval[] = {100000000.0 / (max_start_speed_units_per_second[0] * axis_steps_per_unit[0]),
- 100000000.0 / (max_start_speed_units_per_second[1] * axis_steps_per_unit[1])};
- unsigned long max_interval;
- unsigned long axis_min_constant_speed_steps[] = {min_constant_speed_units * axis_steps_per_unit[0], min_constant_speed_units * axis_steps_per_unit[1]};
- unsigned long min_constant_speed_steps;
-#endif
boolean acceleration_enabled = false, accelerating = false;
unsigned long interval;
float destination[NUM_AXIS] = {0.0, 0.0, 0.0, 0.0};
@@ -1011,15 +1001,6 @@ void linear_move(unsigned long axis_steps_remaining[]) // make linear move with
log_ulong_array("_RAMP_ACCELERATION - Actual step intervals at move start", new_axis_max_intervals, NUM_AXIS);
#endif
#endif
- #ifdef EXP_ACCELERATION
- unsigned long virtual_full_velocity_steps;
- unsigned long full_velocity_steps;
- if(move_steps_to_take[3] > 0) virtual_full_velocity_steps = axis_virtual_full_velocity_steps[primary_axis];
- else virtual_full_velocity_steps = axis_travel_virtual_full_velocity_steps[primary_axis];
- full_velocity_steps = min(virtual_full_velocity_steps, (delta[primary_axis] - axis_min_constant_speed_steps[primary_axis]) / 2);
- max_interval = axis_max_interval[primary_axis];
- min_constant_speed_steps = axis_min_constant_speed_steps[primary_axis];
- #endif
unsigned long steps_done = 0;
#ifdef RAMP_ACCELERATION
@@ -1029,20 +1010,6 @@ void linear_move(unsigned long axis_steps_remaining[]) // make linear move with
if(interval > max_interval) acceleration_enabled = false;
boolean decelerating = false;
#endif
- #ifdef EXP_ACCELERATION
- acceleration_enabled = true;
- if(full_velocity_steps == 0) full_velocity_steps++;
- if(interval > max_interval) acceleration_enabled = false;
- unsigned long full_interval = interval;
- if(min_constant_speed_steps >= steps_to_take) {
- acceleration_enabled = false;
- full_interval = max(max_interval, interval); // choose the min speed between feedrate and acceleration start speed
- }
- if(full_velocity_steps < virtual_full_velocity_steps && acceleration_enabled) full_interval = max(interval,
- max_interval - ((max_interval - full_interval) * full_velocity_steps / virtual_full_velocity_steps)); // choose the min speed between feedrate and speed at full steps
- unsigned int steps_acceleration_check = 1;
- accelerating = acceleration_enabled;
- #endif
unsigned long start_move_micros = micros();
for(int i = 0; i < NUM_AXIS; i++) {
@@ -1108,29 +1075,6 @@ void linear_move(unsigned long axis_steps_remaining[]) // make linear move with
accelerating = false;
}
#endif
- #ifdef EXP_ACCELERATION
- //If acceleration is enabled on this move and we are in the acceleration segment, calculate the current interval
- // TODO: is this any useful? -> steps_done % steps_acceleration_check == 0
- if (acceleration_enabled && steps_done < full_velocity_steps && steps_done / full_velocity_steps < 1 && (steps_done % steps_acceleration_check == 0)) {
- if(steps_done == 0) {
- interval = max_interval;
- } else {
- interval = max_interval - ((max_interval - full_interval) * steps_done / virtual_full_velocity_steps);
- }
- } else if (acceleration_enabled && steps_remaining < full_velocity_steps) {
- //Else, if acceleration is enabled on this move and we are in the deceleration segment, calculate the current interval
- if(steps_remaining == 0) {
- interval = max_interval;
- } else {
- interval = max_interval - ((max_interval - full_interval) * steps_remaining / virtual_full_velocity_steps);
- }
- accelerating = true;
- } else if (steps_done - full_velocity_steps >= 1 || !acceleration_enabled){
- //Else, we are just use the full speed interval as current interval
- interval = full_interval;
- accelerating = false;
- }
- #endif
//If there are x or y steps remaining, perform Bresenham algorithm
if(axis_steps_remaining[primary_axis]) {
diff --git a/Tonokip_Firmware/configuration.h b/Tonokip_Firmware/configuration.h
index 7710f82..5370977 100644
--- a/Tonokip_Firmware/configuration.h
+++ b/Tonokip_Firmware/configuration.h
@@ -19,11 +19,6 @@
//Comment this to disable ramp acceleration
#define RAMP_ACCELERATION 1
-//Uncomment this to enable exponential acceleration. WARNING!! This is not supported in the current version, and will be fixed before
-// merging it to the stable branch.
-// TODO: fix exp acceleration to correctly perform N bresenham.
-//#define EXP_ACCELERATION 1
-
//Acceleration settings
#ifdef RAMP_ACCELERATION
//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.
@@ -31,14 +26,6 @@ float max_start_speed_units_per_second[] = {25.0,25.0,0.2,10.0};
long max_acceleration_units_per_sq_second[] = {1000,1000,50,10000}; // X, Y, Z and E max acceleration in mm/s^2 for printing moves or retracts
long max_travel_acceleration_units_per_sq_second[] = {500,500,50}; // X, Y, Z max acceleration in mm/s^2 for travel moves
#endif
-#ifdef EXP_ACCELERATION
-float full_velocity_units = 10; // the units between minimum and G1 move feedrate
-float travel_move_full_velocity_units = 10; // used for travel moves
-float min_units_per_second = 35.0; // the minimum feedrate
-float min_constant_speed_units = 2; // the minimum units of an accelerated move that must be done at constant speed
- // Note that if the move is shorter than this value, acceleration won't be perfomed,
- // but will be done at the minimum between min_units_per_seconds and move feedrate speeds.
-#endif
// AD595 THERMOCOUPLE SUPPORT UNTESTED... USE WITH CAUTION!!!!