Skip to content
This repository has been archived by the owner on Oct 25, 2020. It is now read-only.

Commit

Permalink
Merge branch 'Marlin_phoenix' into Marlin_phoenix_z_probe
Browse files Browse the repository at this point in the history
* Marlin_phoenix: (22 commits)
  Report changes from previous PR from old code base including : I've updated the minimum values from the LCD. It has been a while that i want to at least fix this. I have an inductive probe and often i need to set my zOffset to something lower than 0.5. With the current implementation, the default LCD value is set to 0.5 for some reason. On my case i need to be able to set it down to 0.0 as my inductive probe can be lower than 0.5. Before with the LCD we couldn't change this value below 0.5. We had to flash the firmware every time which was painful. Now we are able to change this value down to 0.0 if needed. I've also changed the minimum value for Z min acceleration. In the default configuration it's set to 25 but on the LCD the minimum was 100 which is not coherent. I've changes the minimum to 10. On this axis, depending on the mechanics/motor drivers we might require very low acceleration, so i guess 10 is somehow realistic.
  fix bad insertion config again
  Fix bad insert in configuration
  Fix mangled probe_pt calls
  Corrected Z_PROBE_ALLEN_KEY behaviour.
  Clean up Z_RAISE_AFTER_PROBING to work the same in all code paths except Z_PROBE_SLED.
  Blind fix for MarlinFirmware#1507
  Removed malplaced comment.
  Fix compile error with `*_DUAL_STEPPER_DRIVERS`
  Refactor SCARA calibration. Save some lines of code and possibly ROM.
  Don't add home offsets in G29
  Fix temperature min/max test
  Added G29 command
  Fix shrinked menucode
  Added comment for the EEPROM storage
  Shortened mesh_plan_buffer_line()
  EEPROM saving of z_values. Tried to make it a little intelligent.
  Remove of mesh_plan_buffer_line parameter reference (e)
  Disable option. Enable for use/test.
  Added comment about MESH_NUM axis points.
  ...

Resolved conflicts:
	Marlin/Configuration.h
  • Loading branch information
avluis committed Mar 23, 2015
2 parents 0c5a17f + f008806 commit 66585c3
Show file tree
Hide file tree
Showing 21 changed files with 662 additions and 303 deletions.
17 changes: 17 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,23 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
//const bool FIL_RUNOUT_INVERTING = true; // Should be uncommented and true or false should assigned
//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.

//===========================================================================
//============================ Manual Bed Leveling ==========================
//===========================================================================

// #define MANUAL_BED_LEVELING // Add display menu option for bed leveling
// #define MESH_BED_LEVELING // Enable mesh bed leveling

#if defined(MESH_BED_LEVELING)
#define MESH_MIN_X 10
#define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
#define MESH_MIN_Y 10
#define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
#define MESH_NUM_X_POINTS 3 // Don't use more than 7 points per axis, implementation limited
#define MESH_NUM_Y_POINTS 3
#define MESH_HOME_SEARCH_Z 4 // Z after Home, bed somewhere below but above 0.0
#endif // MESH_BED_LEVELING

//===========================================================================
//============================= Bed Auto Leveling ===========================
//===========================================================================
Expand Down
79 changes: 70 additions & 9 deletions Marlin/ConfigurationStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
* max_xy_jerk
* max_z_jerk
* max_e_jerk
* add_homing (x3)
* home_offset (x3)
*
* Mesh bed leveling:
* active
* mesh_num_x
* mesh_num_y
* z_values[][]
*
* DELTA:
* endstop_adj (x3)
Expand Down Expand Up @@ -69,6 +75,10 @@
#include "ultralcd.h"
#include "ConfigurationStore.h"

#if defined(MESH_BED_LEVELING)
#include "mesh_bed_leveling.h"
#endif // MESH_BED_LEVELING

void _EEPROM_writeData(int &pos, uint8_t* value, uint8_t size) {
uint8_t c;
while(size--) {
Expand Down Expand Up @@ -105,7 +115,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
// wrong data being written to the variables.
// ALSO: always make sure the variables in the Store and retrieve sections are in the same order.

#define EEPROM_VERSION "V16"
#define EEPROM_VERSION "V17"

#ifdef EEPROM_SETTINGS

Expand All @@ -126,7 +136,29 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, max_xy_jerk);
EEPROM_WRITE_VAR(i, max_z_jerk);
EEPROM_WRITE_VAR(i, max_e_jerk);
EEPROM_WRITE_VAR(i, add_homing);
EEPROM_WRITE_VAR(i, home_offset);

uint8_t mesh_num_x = 3;
uint8_t mesh_num_y = 3;
#if defined(MESH_BED_LEVELING)
// Compile time test that sizeof(mbl.z_values) is as expected
typedef char c_assert[(sizeof(mbl.z_values) == MESH_NUM_X_POINTS*MESH_NUM_Y_POINTS*sizeof(dummy)) ? 1 : -1];
mesh_num_x = MESH_NUM_X_POINTS;
mesh_num_y = MESH_NUM_Y_POINTS;
EEPROM_WRITE_VAR(i, mbl.active);
EEPROM_WRITE_VAR(i, mesh_num_x);
EEPROM_WRITE_VAR(i, mesh_num_y);
EEPROM_WRITE_VAR(i, mbl.z_values);
#else
uint8_t dummy_uint8 = 0;
EEPROM_WRITE_VAR(i, dummy_uint8);
EEPROM_WRITE_VAR(i, mesh_num_x);
EEPROM_WRITE_VAR(i, mesh_num_y);
dummy = 0.0f;
for (int q=0; q<mesh_num_x*mesh_num_y; q++) {
EEPROM_WRITE_VAR(i, dummy);
}
#endif // MESH_BED_LEVELING

#ifdef DELTA
EEPROM_WRITE_VAR(i, endstop_adj); // 3 floats
Expand Down Expand Up @@ -250,7 +282,7 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, max_feedrate);
EEPROM_READ_VAR(i, max_acceleration_units_per_sq_second);

// steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
// steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
reset_acceleration_rates();

EEPROM_READ_VAR(i, acceleration);
Expand All @@ -262,7 +294,32 @@ void Config_RetrieveSettings() {
EEPROM_READ_VAR(i, max_xy_jerk);
EEPROM_READ_VAR(i, max_z_jerk);
EEPROM_READ_VAR(i, max_e_jerk);
EEPROM_READ_VAR(i, add_homing);
EEPROM_READ_VAR(i, home_offset);

uint8_t mesh_num_x = 0;
uint8_t mesh_num_y = 0;
#if defined(MESH_BED_LEVELING)
EEPROM_READ_VAR(i, mbl.active);
EEPROM_READ_VAR(i, mesh_num_x);
EEPROM_READ_VAR(i, mesh_num_y);
if (mesh_num_x != MESH_NUM_X_POINTS ||
mesh_num_y != MESH_NUM_Y_POINTS) {
mbl.reset();
for (int q=0; q<mesh_num_x*mesh_num_y; q++) {
EEPROM_READ_VAR(i, dummy);
}
} else {
EEPROM_READ_VAR(i, mbl.z_values);
}
#else
uint8_t dummy_uint8 = 0;
EEPROM_READ_VAR(i, dummy_uint8);
EEPROM_READ_VAR(i, mesh_num_x);
EEPROM_READ_VAR(i, mesh_num_y);
for (int q=0; q<mesh_num_x*mesh_num_y; q++) {
EEPROM_READ_VAR(i, dummy);
}
#endif // MESH_BED_LEVELING

#ifdef DELTA
EEPROM_READ_VAR(i, endstop_adj); // 3 floats
Expand Down Expand Up @@ -390,7 +447,11 @@ void Config_ResetDefault() {
max_xy_jerk = DEFAULT_XYJERK;
max_z_jerk = DEFAULT_ZJERK;
max_e_jerk = DEFAULT_EJERK;
add_homing[X_AXIS] = add_homing[Y_AXIS] = add_homing[Z_AXIS] = 0;
home_offset[X_AXIS] = home_offset[Y_AXIS] = home_offset[Z_AXIS] = 0;

#if defined(MESH_BED_LEVELING)
mbl.active = 0;
#endif // MESH_BED_LEVELING

#ifdef DELTA
endstop_adj[X_AXIS] = endstop_adj[Y_AXIS] = endstop_adj[Z_AXIS] = 0;
Expand Down Expand Up @@ -546,9 +607,9 @@ void Config_PrintSettings(bool forReplay) {
SERIAL_ECHOLNPGM("Home offset (mm):");
SERIAL_ECHO_START;
}
SERIAL_ECHOPAIR(" M206 X", add_homing[X_AXIS] );
SERIAL_ECHOPAIR(" Y", add_homing[Y_AXIS] );
SERIAL_ECHOPAIR(" Z", add_homing[Z_AXIS] );
SERIAL_ECHOPAIR(" M206 X", home_offset[X_AXIS] );
SERIAL_ECHOPAIR(" Y", home_offset[Y_AXIS] );
SERIAL_ECHOPAIR(" Z", home_offset[Z_AXIS] );
SERIAL_EOL;

#ifdef DELTA
Expand Down
2 changes: 1 addition & 1 deletion Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in per
extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
extern float current_position[NUM_AXIS] ;
extern float add_homing[3];
extern float home_offset[3];
#ifdef DELTA
extern float endstop_adj[3];
extern float delta_radius;
Expand Down
Loading

0 comments on commit 66585c3

Please sign in to comment.