Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
920a6718
Commit
920a6718
authored
Dec 21, 2014
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change AUTO_BED_LEVELING with AUTO_BED_COMPENSATION
parent
a06a7f4d
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
169 additions
and
157 deletions
+169
-157
ConfigurationStore.cpp
MarlinKimbra/ConfigurationStore.cpp
+6
-6
Configuration_Cartesian.h
MarlinKimbra/Configuration_Cartesian.h
+11
-11
Configuration_Corexy.h
MarlinKimbra/Configuration_Corexy.h
+12
-12
Configuration_Scara.h
MarlinKimbra/Configuration_Scara.h
+49
-37
Marlin_main.cpp
MarlinKimbra/Marlin_main.cpp
+54
-54
Servo.cpp
MarlinKimbra/Servo.cpp
+1
-1
Servo.h
MarlinKimbra/Servo.h
+1
-1
planner.cpp
MarlinKimbra/planner.cpp
+15
-15
planner.h
MarlinKimbra/planner.h
+9
-9
qr_solve.cpp
MarlinKimbra/qr_solve.cpp
+1
-1
qr_solve.h
MarlinKimbra/qr_solve.h
+1
-1
stepper.cpp
MarlinKimbra/stepper.cpp
+2
-2
stepper.h
MarlinKimbra/stepper.h
+2
-2
ultralcd.cpp
MarlinKimbra/ultralcd.cpp
+1
-1
vector_3.cpp
MarlinKimbra/vector_3.cpp
+2
-2
vector_3.h
MarlinKimbra/vector_3.h
+2
-2
No files found.
MarlinKimbra/ConfigurationStore.cpp
View file @
920a6718
...
...
@@ -74,7 +74,7 @@ void Config_StoreSettings()
EEPROM_WRITE_VAR
(
i
,
tower_adj
);
EEPROM_WRITE_VAR
(
i
,
z_probe_offset
);
#endif
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
EEPROM_WRITE_VAR
(
i
,
zprobe_zoffset
);
#endif
#ifndef ULTIPANEL
...
...
@@ -239,11 +239,11 @@ void Config_PrintSettings()
*/
#endif // DELTA
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
SERIAL_ECHO_START
;
SERIAL_ECHOPAIR
(
"Z Probe offset (mm):"
,
zprobe_zoffset
);
SERIAL_ECHOLN
(
""
);
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
#ifdef PIDTEMP
SERIAL_ECHO_START
;
...
...
@@ -297,7 +297,7 @@ void Config_RetrieveSettings()
// Update delta constants for updated delta_radius & tower_adj values
set_delta_constants
();
#endif
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
EEPROM_READ_VAR
(
i
,
zprobe_zoffset
);
#endif
#ifndef ULTIPANEL
...
...
@@ -357,7 +357,7 @@ void Config_ResetDefault()
float
tmp6
[]
=
DEFAULT_Ki
;
float
tmp7
[]
=
DEFAULT_Kd
;
for
(
short
i
=
0
;
i
<
7
;
i
++
)
for
(
short
i
=
0
;
i
<
NUM_AXIS
;
i
++
)
{
axis_steps_per_unit
[
i
]
=
tmp1
[
i
];
max_feedrate
[
i
]
=
tmp2
[
i
];
...
...
@@ -404,7 +404,7 @@ void Config_ResetDefault()
gumPreheatHPBTemp
=
GUM_PREHEAT_HPB_TEMP
;
gumPreheatFanSpeed
=
GUM_PREHEAT_FAN_SPEED
;
#endif
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
zprobe_zoffset
=
-
Z_PROBE_OFFSET_FROM_EXTRUDER
;
#endif
#ifdef DOGLCD
...
...
MarlinKimbra/Configuration_Cartesian.h
View file @
920a6718
...
...
@@ -89,9 +89,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= Bed
Leveling
===========================
//============================= Bed
Auto Compensation
===========================
//#define ENABLE_AUTO_BED_
LEVELING
// Delete the comment to enable
//#define ENABLE_AUTO_BED_
COMPENSATION
// Delete the comment to enable
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
// set the rectangle in which to probe in manual or automatic
...
...
@@ -102,7 +102,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
// There are 2 different ways to pick the X and Y locations to probe:
...
...
@@ -116,17 +116,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_
LEVELING
_GRID
// with AUTO_BED_
LEVELING
_GRID, the bed is sampled in a
// AUTO_BED_
LEVELING_GRID_POINTSxAUTO_BED_LEVELING
_GRID_POINTS grid
#define AUTO_BED_
COMPENSATION
_GRID
// with AUTO_BED_
COMPENSATION
_GRID, the bed is sampled in a
// AUTO_BED_
COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION
_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_
LEVELING
_GRID
#ifdef AUTO_BED_
COMPENSATION
_GRID
// set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_
LEVELING
_GRID_POINTS 2
#define AUTO_BED_
COMPENSATION
_GRID_POINTS 2
#else // not AUTO_BED_
LEVELING
_GRID
#else // not AUTO_BED_
COMPENSATION
_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed
...
...
@@ -137,7 +137,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_
LEVELING
_GRID
#endif // AUTO_BED_
COMPENSATION
_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
...
...
@@ -178,7 +178,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#endif
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
// The position of the homing switches
...
...
MarlinKimbra/Configuration_Corexy.h
View file @
920a6718
...
...
@@ -94,9 +94,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= Bed
Leveling
===========================
//============================= Bed
Auto Compensation
===========================
//#define ENABLE_AUTO_BED_
LEVELING
// Delete the comment to enable
//#define ENABLE_AUTO_BED_
COMPENSATION
// Delete the comment to enable
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
// set the rectangle in which to probe in manual or automatic
...
...
@@ -107,7 +107,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
// There are 2 different ways to pick the X and Y locations to probe:
...
...
@@ -121,17 +121,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_
LEVELING
_GRID
// with AUTO_BED_
LEVELING
_GRID, the bed is sampled in a
// AUTO_BED_
LEVELING_GRID_POINTSxAUTO_BED_LEVELING
_GRID_POINTS grid
#define AUTO_BED_
COMPENSATION
_GRID
// with AUTO_BED_
COMPENSATION
_GRID, the bed is sampled in a
// AUTO_BED_
COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION
_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_
LEVELING
_GRID
#ifdef AUTO_BED_
COMPENSATION
_GRID
// set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_
LEVELING
_GRID_POINTS 2
#define AUTO_BED_
COMPENSATION
_GRID_POINTS 2
#else // not AUTO_BED_
LEVELING
_GRID
#else // not AUTO_BED_
COMPENSATION
_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed
...
...
@@ -142,7 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_
LEVELING
_GRID
#endif // AUTO_BED_
COMPENSATION
_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
...
...
@@ -183,7 +183,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the lo
#endif
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
// The position of the homing switches
...
...
MarlinKimbra/Configuration_Scara.h
View file @
920a6718
...
...
@@ -54,23 +54,20 @@
#define ENDSTOPPULLUP_XMIN
#define ENDSTOPPULLUP_YMIN
#define ENDSTOPPULLUP_ZMIN
#define ENDSTOPPULLUP_EMIN
#endif
// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const
bool
X_MIN_ENDSTOP_INVERTING
=
true
;
// set to true to invert the logic of the endstop.
const
bool
Y_MIN_ENDSTOP_INVERTING
=
true
;
// set to true to invert the logic of the endstop.
const
bool
Z_MIN_ENDSTOP_INVERTING
=
true
;
// set to true to invert the logic of the endstop.
const
bool
E_MIN_ENDSTOP_INVERTING
=
false
;
// set to true to invert the logic of the endstop.
const
bool
X_MAX_ENDSTOP_INVERTING
=
true
;
// set to true to invert the logic of the endstop.
const
bool
Y_MAX_ENDSTOP_INVERTING
=
true
;
// set to true to invert the logic of the endstop.
const
bool
Z_MAX_ENDSTOP_INVERTING
=
true
;
// set to true to invert the logic of the endstop.
//#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS
// Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
#define DISABLE_MAX_ENDSTOPS
#endif
// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
...
...
@@ -82,7 +79,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DISABLE_Y false
#define DISABLE_Z false
#define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER
tru
e //disable only inactive extruders and keep active extruder enabled
#define DISABLE_INACTIVE_EXTRUDER
fals
e //disable only inactive extruders and keep active extruder enabled
#define INVERT_X_DIR false // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
...
...
@@ -92,10 +89,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS:
// Sets direction of endstop
s when homing; 1=MAX, -1=MIN
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#define X_HOME_DIR 1
#define Y_HOME_DIR 1
#define Z_HOME_DIR -1
#define E_HOME_DIR -1
#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops true // If true, axis won't move to coordinates greater than the defined lengths below.
...
...
@@ -107,15 +105,27 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define Y_MIN_POS 0
#define Z_MAX_POS 225
#define Z_MIN_POS MANUAL_Z_HOME_POS
#define E_MIN_POS 0
#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
//============================= Bed Auto Leveling ===========================
//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
#ifdef ENABLE_AUTO_BED_LEVELING
//============================= Bed Auto Compensation ===========================
//#define ENABLE_AUTO_BED_COMPENSATION // Delete the comment to enable
//#define Z_PROBE_REPEATABILITY_TEST // Delete the comment to enable
// set the rectangle in which to probe in manual or automatic
#define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 180
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#ifdef ENABLE_AUTO_BED_COMPENSATION
// There are 2 different ways to pick the X and Y locations to probe:
...
...
@@ -129,25 +139,17 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
// Probe 3 arbitrary points on the bed (that aren't colinear)
// You must specify the X & Y coordinates of all 3 points
#define AUTO_BED_
LEVELING
_GRID
// with AUTO_BED_
LEVELING
_GRID, the bed is sampled in a
// AUTO_BED_
LEVELING_GRID_POINTSxAUTO_BED_LEVELING
_GRID_POINTS grid
#define AUTO_BED_
COMPENSATION
_GRID
// with AUTO_BED_
COMPENSATION
_GRID, the bed is sampled in a
// AUTO_BED_
COMPENSATION_GRID_POINTSxAUTO_BED_COMPENSATION
_GRID_POINTS grid
// and least squares solution is calculated
// Note: this feature occupies 10'206 byte
#ifdef AUTO_BED_LEVELING_GRID
// set the rectangle in which to probe
#define LEFT_PROBE_BED_POSITION 15
#define RIGHT_PROBE_BED_POSITION 170
#define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 20
#ifdef AUTO_BED_COMPENSATION_GRID
// set the number of grid points per dimension
// I wouldn't see a reason to go above 3 (=9 probing points on the bed)
#define AUTO_BED_LEVELING_GRID_POINTS 2
#define AUTO_BED_COMPENSATION_GRID_POINTS 2
#else // not AUTO_BED_
LEVELING
_GRID
#else // not AUTO_BED_
COMPENSATION
_GRID
// with no grid, just probe 3 arbitrary points. A simple cross-product
// is used to esimate the plane of the print bed
...
...
@@ -158,7 +160,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define ABL_PROBE_PT_3_X 170
#define ABL_PROBE_PT_3_Y 20
#endif // AUTO_BED_
LEVELING
_GRID
#endif // AUTO_BED_
COMPENSATION
_GRID
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
...
...
@@ -169,8 +171,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#define Z_RAISE_BEFORE_PROBING 15 //How much the extruder will be raised before traveling to the first probing point.
#define Z_RAISE_BETWEEN_PROBINGS 5 //How much the extruder will be raised when traveling from between next probing points
...
...
@@ -185,12 +185,12 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
//
#define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
// When defined, it will:
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled
// - If stepper drivers timeout, it will need X and Y homing again before Z homing
// - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
// - Block Z homing only when the probe is outside bed area.
#define Z_SAFE_HOMING // This feature is meant to avoid Z homing with probe outside the bed area.
// When defined, it will:
// - Allow Z homing only after X and Y homing AND stepper drivers still enabled
// - If stepper drivers timeout, it will need X and Y homing again before Z homing
// - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
// - Block Z homing only when the probe is outside bed area.
#ifdef Z_SAFE_HOMING
...
...
@@ -199,7 +199,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#endif
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
// The position of the homing switches
...
...
@@ -238,3 +238,15 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#define DEFAULT_XYJERK 5 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 3 // (mm/sec)
//===========================================================================
//=============================Additional Features===========================
//===========================================================================
// Custom M code points
//#define CUSTOM_M_CODES
#ifdef CUSTOM_M_CODES
#define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
#define Z_PROBE_OFFSET_RANGE_MIN -15
#define Z_PROBE_OFFSET_RANGE_MAX -5
#endif
MarlinKimbra/Marlin_main.cpp
View file @
920a6718
This diff is collapsed.
Click to expand it.
MarlinKimbra/Servo.cpp
View file @
920a6718
...
...
@@ -262,7 +262,7 @@ uint8_t Servo::attach(int pin)
uint8_t
Servo
::
attach
(
int
pin
,
int
min
,
int
max
)
{
if
(
this
->
servoIndex
<
MAX_SERVOS
)
{
#if defined (ENABLE_AUTO_BED_
LEVELING
) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
#if defined (ENABLE_AUTO_BED_
COMPENSATION
) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
if
(
pin
>
0
)
this
->
pin
=
pin
;
else
pin
=
this
->
pin
;
#endif
pinMode
(
pin
,
OUTPUT
)
;
// set servo pin to output
...
...
MarlinKimbra/Servo.h
View file @
920a6718
...
...
@@ -123,7 +123,7 @@ public:
int
read
();
// returns current pulse width as an angle between 0 and 180 degrees
int
readMicroseconds
();
// returns current pulse width in microseconds for this servo (was read_us() in first release)
bool
attached
();
// return true if this servo is attached, otherwise false
#if defined (ENABLE_AUTO_BED_
LEVELING
) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
#if defined (ENABLE_AUTO_BED_
COMPENSATION
) && (PROBE_SERVO_DEACTIVATION_DELAY > 0)
int
pin
;
// store the hardware pin of the servo
#endif
private
:
...
...
MarlinKimbra/planner.cpp
View file @
920a6718
...
...
@@ -76,14 +76,14 @@ float max_e_jerk;
float
mintravelfeedrate
;
unsigned
long
axis_steps_per_sqr_second
[
NUM_AXIS
];
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
// this holds the required transform to compensate for bed level
matrix_3x3
plan_bed_
level
_matrix
=
{
matrix_3x3
plan_bed_
compensation
_matrix
=
{
1.0
,
0.0
,
0.0
,
0.0
,
1.0
,
0.0
,
0.0
,
0.0
,
1.0
,
};
#endif // #ifdef ENABLE_AUTO_BED_
LEVELING
#endif // #ifdef ENABLE_AUTO_BED_
COMPENSATION
// The current position of the tool in absolute steps
long
position
[
4
];
//rescaled from extern when axis_steps_per_unit are changed by gcode
...
...
@@ -543,11 +543,11 @@ float junction_deviation = 0.1;
// Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in
// mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
// calculation the caller must also provide the physical length of the line in millimeters.
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
void
plan_buffer_line
(
float
x
,
float
y
,
float
z
,
const
float
&
e
,
float
feed_rate
,
const
uint8_t
&
extruder
,
const
uint8_t
&
driver
)
#else
void
plan_buffer_line
(
const
float
&
x
,
const
float
&
y
,
const
float
&
z
,
const
float
&
e
,
float
feed_rate
,
const
uint8_t
&
extruder
,
const
uint8_t
&
driver
)
#endif //ENABLE_AUTO_BED_
LEVELING
#endif //ENABLE_AUTO_BED_
COMPENSATION
{
// Calculate the buffer head after we push this byte
int
next_buffer_head
=
next_block_index
(
block_buffer_head
);
...
...
@@ -561,9 +561,9 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
lcd_update
();
}
#ifdef ENABLE_AUTO_BED_
LEVELING
apply_rotation_xyz
(
plan_bed_
level
_matrix
,
x
,
y
,
z
);
#endif // ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
apply_rotation_xyz
(
plan_bed_
compensation
_matrix
,
x
,
y
,
z
);
#endif // ENABLE_AUTO_BED_
COMPENSATION
// The target position of the tool in absolute steps
// Calculate target position in absolute steps
...
...
@@ -1082,29 +1082,29 @@ block->steps_y = labs((target[X_AXIS]-position[X_AXIS]) - (target[Y_AXIS]-positi
st_wake_up
();
}
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
vector_3
plan_get_position
()
{
vector_3
position
=
vector_3
(
st_get_position_mm
(
X_AXIS
),
st_get_position_mm
(
Y_AXIS
),
st_get_position_mm
(
Z_AXIS
));
//position.debug("in plan_get position");
//plan_bed_
level
_matrix.debug("in plan_get bed_level");
matrix_3x3
inverse
=
matrix_3x3
::
transpose
(
plan_bed_
level
_matrix
);
//plan_bed_
compensation
_matrix.debug("in plan_get bed_level");
matrix_3x3
inverse
=
matrix_3x3
::
transpose
(
plan_bed_
compensation
_matrix
);
//inverse.debug("in plan_get inverse");
position
.
apply_rotation
(
inverse
);
//position.debug("after rotation");
return
position
;
}
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
void
plan_set_position
(
float
x
,
float
y
,
float
z
,
const
float
&
e
)
{
apply_rotation_xyz
(
plan_bed_
level
_matrix
,
x
,
y
,
z
);
apply_rotation_xyz
(
plan_bed_
compensation
_matrix
,
x
,
y
,
z
);
#else
void
plan_set_position
(
const
float
&
x
,
const
float
&
y
,
const
float
&
z
,
const
float
&
e
)
{
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
position
[
X_AXIS
]
=
lround
(
x
*
axis_steps_per_unit
[
X_AXIS
]);
position
[
Y_AXIS
]
=
lround
(
y
*
axis_steps_per_unit
[
Y_AXIS
]);
...
...
MarlinKimbra/planner.h
View file @
920a6718
...
...
@@ -26,9 +26,9 @@
#include "Marlin.h"
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
#include "vector_3.h"
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
// This struct is used when buffering the setup for each linear movement "nominal" values are as specified in
// the source g-code and may never actually be reached if acceleration management is active.
...
...
@@ -75,10 +75,10 @@ typedef struct {
}
block_t
;
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
// this holds the required transform to compensate for bed level
extern
matrix_3x3
plan_bed_
level
_matrix
;
#endif // #ifdef ENABLE_AUTO_BED_
LEVELING
extern
matrix_3x3
plan_bed_
compensation
_matrix
;
#endif // #ifdef ENABLE_AUTO_BED_
COMPENSATION
// Initialize the motion plan subsystem
void
plan_init
();
...
...
@@ -86,21 +86,21 @@ void plan_init();
// Add a new linear movement to the buffer. x, y and z is the signed, absolute target position in
// millimaters. Feed rate specifies the speed of the motion.
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
void
plan_buffer_line
(
float
x
,
float
y
,
float
z
,
const
float
&
e
,
float
feed_rate
,
const
uint8_t
&
extruder
,
const
uint8_t
&
driver
);
// Get the position applying the bed level matrix if enabled
vector_3
plan_get_position
();
#else
void
plan_buffer_line
(
const
float
&
x
,
const
float
&
y
,
const
float
&
z
,
const
float
&
e
,
float
feed_rate
,
const
uint8_t
&
extruder
,
const
uint8_t
&
driver
);
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
// Set position. Used for G92 instructions.
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
void
plan_set_position
(
float
x
,
float
y
,
float
z
,
const
float
&
e
);
#else
void
plan_set_position
(
const
float
&
x
,
const
float
&
y
,
const
float
&
z
,
const
float
&
e
);
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
void
plan_set_e_position
(
const
float
&
e
);
...
...
MarlinKimbra/qr_solve.cpp
View file @
920a6718
#include "qr_solve.h"
#ifdef AUTO_BED_
LEVELING
_GRID
#ifdef AUTO_BED_
COMPENSATION
_GRID
#include <stdlib.h>
#include <math.h>
...
...
MarlinKimbra/qr_solve.h
View file @
920a6718
#include "Configuration.h"
#ifdef AUTO_BED_
LEVELING
_GRID
#ifdef AUTO_BED_
COMPENSATION
_GRID
void
daxpy
(
int
n
,
double
da
,
double
dx
[],
int
incx
,
double
dy
[],
int
incy
);
double
ddot
(
int
n
,
double
dx
[],
int
incx
,
double
dy
[],
int
incy
);
...
...
MarlinKimbra/stepper.cpp
View file @
920a6718
...
...
@@ -1180,13 +1180,13 @@ long st_get_position(uint8_t axis)
return
count_pos
;
}
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
float
st_get_position_mm
(
uint8_t
axis
)
{
float
steper_position_in_steps
=
st_get_position
(
axis
);
return
steper_position_in_steps
/
axis_steps_per_unit
[
axis
];
}
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
void
finishAndDisableSteppers
()
{
...
...
MarlinKimbra/stepper.h
View file @
920a6718
...
...
@@ -65,10 +65,10 @@ void st_set_e_position(const long &e);
// Get current position in steps
long
st_get_position
(
uint8_t
axis
);
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
// Get current position in mm
float
st_get_position_mm
(
uint8_t
axis
);
#endif //ENABLE_AUTO_BED_
LEVELING
#endif //ENABLE_AUTO_BED_
COMPENSATION
// The stepper subsystem goes to sleep when it runs out of things to execute. Call this
// to notify the subsystem that it is time to go to work.
...
...
MarlinKimbra/ultralcd.cpp
View file @
920a6718
...
...
@@ -1107,7 +1107,7 @@ static void lcd_control_motion_menu()
{
START_MENU
();
MENU_ITEM
(
back
,
MSG_CONTROL
,
lcd_control_menu
);
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
MENU_ITEM_EDIT
(
float32
,
MSG_ZPROBE_ZOFFSET
,
&
zprobe_zoffset
,
0.5
,
50
);
#endif
MENU_ITEM_EDIT
(
float5
,
MSG_ACC
,
&
acceleration
,
500
,
99000
);
...
...
MarlinKimbra/vector_3.cpp
View file @
920a6718
...
...
@@ -19,7 +19,7 @@
#include <math.h>
#include "Marlin.h"
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
#include "vector_3.h"
vector_3
::
vector_3
()
:
x
(
0
),
y
(
0
),
z
(
0
)
{
}
...
...
@@ -163,5 +163,5 @@ void matrix_3x3::debug(char* title)
}
}
#endif // #ifdef ENABLE_AUTO_BED_
LEVELING
#endif // #ifdef ENABLE_AUTO_BED_
COMPENSATION
MarlinKimbra/vector_3.h
View file @
920a6718
...
...
@@ -19,7 +19,7 @@
#ifndef VECTOR_3_H
#define VECTOR_3_H
#ifdef ENABLE_AUTO_BED_
LEVELING
#ifdef ENABLE_AUTO_BED_
COMPENSATION
class
matrix_3x3
;
struct
vector_3
...
...
@@ -57,6 +57,6 @@ struct matrix_3x3
void
apply_rotation_xyz
(
matrix_3x3
rotationMatrix
,
float
&
x
,
float
&
y
,
float
&
z
);
#endif // ENABLE_AUTO_BED_
LEVELING
#endif // ENABLE_AUTO_BED_
COMPENSATION
#endif // VECTOR_3_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment