M206 persistent.

This commit is contained in:
jeanmarc
2012-05-07 19:42:55 +01:00
parent a3915a5351
commit 0580997a99
6 changed files with 33 additions and 16 deletions
+13 -11
View File
@@ -8,7 +8,7 @@
//User specified version info of THIS file to display in [Pronterface, etc] terminal window during startup.
//Implementation of an idea by Prof Braino to inform user that any changes made
//to THIS file by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H "2012-03-26-1" //Personal revision number for changes to THIS file.
#define STRING_VERSION_CONFIG_H "2012-04-12-2" //Personal revision number for changes to THIS file.
#define STRING_CONFIG_H_AUTHOR "eMAKER" //Who made the changes.
// This determines the communication speed of the printer
@@ -48,11 +48,13 @@
// 7 is 100k Honeywell thermistor 135-104LAG-J01
// 100 is 100k GE Sensing AL03006-58.2K-97-G1
// 101 is 100k 0603 SMD Vishay NTCS0603E3104FXT
// 102 is 100k EPCOS G57540 Nozzle
// 103 is 100k EPCOS G57540 Bed
#define TEMP_SENSOR_0 102
#define TEMP_SENSOR_0 100
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
#define TEMP_SENSOR_BED 103
#define TEMP_SENSOR_BED 101
// Actual temperature must be close to target for this long before M109 returns success
#define TEMP_RESIDENCY_TIME 10 // (seconds)
@@ -139,11 +141,11 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
#define DISABLE_E false // For all extruders
#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR true // for Mendel set to true, for Orca set to false
#define INVERT_Y_DIR false // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR false // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E0_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR true // for direct drive extruder v9 set to true, for geared extruder set to false
// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
@@ -153,8 +155,8 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
#define min_software_endstops true //If true, axis won't move to coordinates less than zero.
#define max_software_endstops true //If true, axis won't move to coordinates greater than the defined lengths below.
#define X_MAX_LENGTH 145
#define Y_MAX_LENGTH 145
#define X_MAX_LENGTH 145 //155 for v2
#define Y_MAX_LENGTH 145 //150 for v2
#define Z_MAX_LENGTH 100
// The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
@@ -172,7 +174,7 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
#define DEFAULT_AXIS_STEPS_PER_UNIT {91.4286, 91.4286,4000,875} // default steps per unit for ultimaker
//#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,4571.429,850}
#define DEFAULT_MAX_FEEDRATE {500, 500, 5, 45} // (mm/sec)
#define DEFAULT_MAX_ACCELERATION {1000,1000,50,250} // 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.
#define DEFAULT_MAX_ACCELERATION {1000,1000,50,1000} // 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.
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for r retracts
@@ -180,7 +182,7 @@ const bool Z_ENDSTOPS_INVERTING = false; // set to true to invert the logic of t
//
#define DEFAULT_XYJERK 15.0 // (mm/sec)
#define DEFAULT_ZJERK 0.4 // (mm/sec)
#define DEFAULT_EJERK 5.0 // (mm/sec)
#define DEFAULT_EJERK 15.0 // (mm/sec)
//===========================================================================
//=============================Additional Features===========================
+7
View File
@@ -58,6 +58,7 @@ inline void EEPROM_StoreSettings()
EEPROM_writeAnything(i,max_xy_jerk);
EEPROM_writeAnything(i,max_z_jerk);
EEPROM_writeAnything(i,max_e_jerk);
EEPROM_writeAnything(i,add_homeing);
#ifdef PIDTEMP
EEPROM_writeAnything(i,Kp);
EEPROM_writeAnything(i,Ki);
@@ -124,6 +125,11 @@ inline void EEPROM_printSettings()
SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
SERIAL_ECHOPAIR(" E" ,max_e_jerk);
SERIAL_ECHOLN("");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M206 X",add_homeing[0]);
SERIAL_ECHOPAIR(" Y",add_homeing[1] );
SERIAL_ECHOPAIR(" Z", add_homeing[2] );
SERIAL_ECHOLN("");
#ifdef PIDTEMP
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("PID settings:");
@@ -163,6 +169,7 @@ inline void EEPROM_RetrieveSettings(bool def=false)
EEPROM_readAnything(i,max_xy_jerk);
EEPROM_readAnything(i,max_z_jerk);
EEPROM_readAnything(i,max_e_jerk);
EEPROM_readAnything(i,add_homeing);
#ifndef PIDTEMP
float Kp,Ki,Kd;
int Ki_Max;
Executable → Regular
View File
View File
+5 -5
View File
@@ -579,16 +579,16 @@
#define Z_STEP_PIN 3
#define Z_DIR_PIN 2
#define Z_MIN_PIN 11//20
#define Z_MIN_PIN 20 //for Melzi Z bed probe, 20 for standard Z endstop
#define Z_MAX_PIN -1
#define E0_STEP_PIN 1
#define E0_DIR_PIN 0
#define PROBE_PIN 11 //29 on Melzi1284p A2, 11 on SL1.3a
#define PROBE_PIN -1 //29 on Melzi1284p A2, 11 on SL1.3a
#define LED_PIN 27 //27 on Melzi1284p
#define FAN_PIN 4 //4 on Melzi1284p
#define LED_PIN -1//27 //27 on Melzi1284p
#define FAN_PIN 12 //4 on Melzi1284p
#define PS_ON_PIN -1
#define KILL_PIN -1
@@ -599,7 +599,7 @@
#ifdef SANGUINOLOLU_V_1_2
#define HEATER_BED_PIN 12 // (bed) - 10 for spare DIO pin and bed MOSFET, 12 for SL MOSFET
#define HEATER_BED_PIN 10 // (bed) - 10 for spare DIO pin and bed MOSFET, 12 for SL MOSFET
#define X_ENABLE_PIN 14
#define Y_ENABLE_PIN 14
#define Z_ENABLE_PIN 26
+8
View File
@@ -2,6 +2,7 @@
#if defined(PROBE_PIN) && (PROBE_PIN > -1)
#include "Marlin.h"
#include "stepper.h"
#include "temperature.h"
float Probe_Bed(float x_pos, float y_pos, int n)
{
@@ -9,6 +10,11 @@ float Probe_Bed(float x_pos, float y_pos, int n)
float ProbeDepth[n];
float ProbeDepthAvg=0;
//force bed heater off for probing
int save_bed_targ = target_raw_bed;
target_raw_bed = 0;
WRITE(HEATER_BED_PIN,LOW);
if (Z_HOME_DIR==-1)
{
//int probe_flag =1;
@@ -106,7 +112,9 @@ float Probe_Bed(float x_pos, float y_pos, int n)
SERIAL_ECHO("Probed Z="); SERIAL_ECHOLN(ProbeDepthAvg);
SERIAL_ECHO("RAW current_position[Z_AXIS]=");SERIAL_ECHOLN(current_position[Z_AXIS]);
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], Z_HOME_RETRACT_MM, current_position[E_AXIS]);
current_position[Z_AXIS] = Z_HOME_RETRACT_MM;
target_raw_bed = save_bed_targ;
return ProbeDepthAvg;
}