Commit 521d08d1 authored by MagoKimbra's avatar MagoKimbra

Update!!!

parent bb233423
// Define this to set a custom name for your generic Mendel,
#define CUSTOM_MENDEL_NAME "Prusa"
// Displayed in the LCD "Ready" message
#define CUSTOM_MACHINE_NAME "Prusa"
//===========================================================================
//=============================Mechanical Settings===========================
......
// Define this to set a custom name for your generic Mendel,
#define CUSTOM_MENDEL_NAME "Core XY"
// Displayed in the LCD "Ready" message
#define CUSTOM_MACHINE_NAME "Core XY"
//===========================================================================
//=============================Mechanical Settings===========================
......
// Define this to set a custom name for your generic Delta
#define CUSTOM_MENDEL_NAME "Delta"
// Displayed in the LCD "Ready" message
#define CUSTOM_MACHINE_NAME "Delta"
//===========================================================================
//============================== Delta Settings =============================
......
// Define this to set a custom name for your generic Mendel,
#define CUSTOM_MENDEL_NAME "Scara"
// Displayed in the LCD "Ready" message
#define CUSTOM_MACHINE_NAME "Scara"
// SCARA-mode for Marlin has been developed by QHARLEY in ZA in 2012/2013. Implemented
// and slightly reworked by JCERNY in 06/2014 with the goal to bring it into Master-Branch
......
......@@ -138,7 +138,7 @@
* IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
* M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h.
* M112 - Emergency stop
* M114 - Output current position to serial port
* M114 - Output current position to serial port, (V)erbose for user
* M115 - Capabilities string
* M117 - display message
* M119 - Output Endstop status to serial port
......@@ -149,6 +149,7 @@
* M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
* M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
* M140 - Set bed target temp
* M145 - Set the heatup state H<hotend> B<bed> F<fan speed> for S<material> (0=PLA, 1=ABS)
* M150 - Set BlinkM Color Output R: Red<0-255> U(!): Green<0-255> B: Blue<0-255> over i2c, G for green does not work.
* M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
* Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
......@@ -334,7 +335,7 @@ millis_t config_last_update = 0;
#endif
#ifdef DELTA
float endstop_adj[3] = { 0, 0, 0 };
float delta[3] = { 0.0 };
float tower_adj[6] = { 0, 0, 0, 0, 0, 0 };
float delta_radius; // = DEFAULT_delta_radius;
float delta_diagonal_rod; // = DEFAULT_DELTA_DIAGONAL_ROD;
......@@ -357,7 +358,6 @@ millis_t config_last_update = 0;
{ 0, 0, 0 },
{ 0, 0, 0 },
};
float delta[3] = { 0.0, 0.0, 0.0 };
float delta_tmp[3] = { 0.0, 0.0, 0.0 };
float probing_feedrate = PROBING_FEEDRATE;
float default_z_probe_offset[] = Z_PROBE_OFFSET;
......@@ -368,6 +368,7 @@ millis_t config_last_update = 0;
float z_probe_retract_end_location[] = Z_PROBE_RETRACT_END_LOCATION;
#define SIN_60 0.8660254037844386
#define COS_60 0.5
float endstop_adj[3] = { 0 };
static float bed_level[7][7] = {
{ 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0 },
......@@ -1048,54 +1049,7 @@ XYZ_CONSTS_FROM_CONFIG(signed char, home_dir, HOME_DIR);
#endif //DUAL_X_CARRIAGE
/**
* Some planner shorthand inline functions
*/
inline void set_homing_bump_feedrate(AxisEnum axis) {
#ifdef DELTA
const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
if (homing_bump_divisor[X_AXIS] >= 1)
feedrate = homing_feedrate[axis] / homing_bump_divisor[X_AXIS];
else {
feedrate = homing_feedrate[axis] / 10;
ECHO_LM(ER, MSG_ERR_HOMING_DIV);
}
#else // No DELTA
const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
if (homing_bump_divisor[axis] >= 1)
feedrate = homing_feedrate[axis] / homing_bump_divisor[axis];
else {
feedrate = homing_feedrate[axis] / 10;
ECHO_LM(ER, MSG_ERR_HOMING_DIV);
}
#endif // No DELTA
}
inline void line_to_current_position() {
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
}
inline void line_to_z(float zPosition) {
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
}
inline void line_to_destination(float mm_m) {
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m/60, active_extruder, active_driver);
}
inline void line_to_destination() {
line_to_destination(feedrate);
}
inline void sync_plan_position() {
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
}
#if defined(DELTA) || defined(SCARA)
inline void sync_plan_position_delta() {
calculate_delta(current_position);
plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
}
#endif
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA)
static void axis_is_at_home(int axis) {
static void axis_is_at_home(int axis) {
#ifdef DUAL_X_CARRIAGE
if (axis == X_AXIS) {
......@@ -1150,14 +1104,73 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
min_pos[axis] = base_min_pos(axis); // + (delta[axis] - base_home_pos(axis));
max_pos[axis] = base_max_pos(axis); // + (delta[axis] - base_home_pos(axis));
}
else
#endif
{
else {
current_position[axis] = base_home_pos(axis) + home_offset[axis];
min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos(axis) + home_offset[axis];
}
#elif defined(DELTA)
current_position[axis] = base_home_pos[axis] + home_offset[axis];
min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos[axis] + home_offset[axis];
#else
current_position[axis] = base_home_pos(axis) + home_offset[axis];
min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos(axis) + home_offset[axis];
#endif
#if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
if (axis == Z_AXIS) current_position[Z_AXIS] += zprobe_zoffset;
#endif
}
/**
* Some planner shorthand inline functions
*/
inline void set_homing_bump_feedrate(AxisEnum axis) {
#ifdef DELTA
const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
if (homing_bump_divisor[X_AXIS] >= 1)
feedrate = homing_feedrate[axis] / homing_bump_divisor[X_AXIS];
else {
feedrate = homing_feedrate[axis] / 10;
ECHO_LM(ER, MSG_ERR_HOMING_DIV);
}
#else // No DELTA
const int homing_bump_divisor[] = HOMING_BUMP_DIVISOR;
if (homing_bump_divisor[axis] >= 1)
feedrate = homing_feedrate[axis] / homing_bump_divisor[axis];
else {
feedrate = homing_feedrate[axis] / 10;
ECHO_LM(ER, MSG_ERR_HOMING_DIV);
}
#endif // No DELTA
}
inline void line_to_current_position() {
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
}
inline void line_to_z(float zPosition) {
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], zPosition, current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
}
inline void line_to_destination(float mm_m) {
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], mm_m/60, active_extruder, active_driver);
}
inline void line_to_destination() {
line_to_destination(feedrate);
}
inline void sync_plan_position() {
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);
}
#if defined(DELTA) || defined(SCARA)
inline void sync_plan_position_delta() {
calculate_delta(current_position);
plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS]);
}
#endif
inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA)
static void do_blocking_move_to(float x, float y, float z) {
float oldFeedRate = feedrate;
......@@ -1467,11 +1480,6 @@ inline void set_destination_to_current() { memcpy(destination, current_position,
#endif // Cartesian || CoreXY || Scara
#ifdef DELTA
static void axis_is_at_home(int axis) {
current_position[axis] = base_home_pos[axis] + home_offset[axis];
min_pos[axis] = base_min_pos(axis) + home_offset[axis];
max_pos[axis] = base_max_pos[axis] + home_offset[axis];
}
static void homeaxis(AxisEnum axis) {
#define HOMEAXIS_DO(LETTER) \
......@@ -2511,11 +2519,11 @@ inline void wait_bed() {
refresh_cmd_timeout();
}
/******************************************************************************
***************************** G-Code Functions ********************************
*******************************************************************************/
/**
* G0, G1: Coordinated movement of X Y Z E axes
*/
......@@ -2542,6 +2550,7 @@ inline void gcode_G0_G1() {
}
}
#endif //FWRETRACT
prepare_move();
//ClearToSend();
}
......@@ -2740,6 +2749,11 @@ inline void gcode_G28(boolean home_x = false, boolean home_y = false) {
#endif // QUICK_HOME
#ifdef HOME_Y_BEFORE_X
// Home Y
if (home_all_axis || homeY) HOMEAXIS(Y);
#endif
// Home X
if (home_all_axis || homeX) {
#ifdef DUAL_X_CARRIAGE
......@@ -2759,20 +2773,10 @@ inline void gcode_G28(boolean home_x = false, boolean home_y = false) {
#endif
}
#ifndef HOME_Y_BEFORE_X
// Home Y
if (home_all_axis || homeY) HOMEAXIS(Y);
// Set the X position, if included
if (code_seen(axis_codes[X_AXIS]) && code_has_value()) {
if (code_value_long() != 0) // filter 0
current_position[X_AXIS] = code_value();
}
// Set the Y position, if included
if (code_seen(axis_codes[Y_AXIS]) && code_has_value()) {
if (code_value_long() != 0) // filter 0
current_position[Y_AXIS] = code_value();
}
#endif
// Home Z last if homing towards the bed
#if Z_HOME_DIR < 0
......@@ -2969,16 +2973,6 @@ inline void gcode_G28(boolean home_x = false, boolean home_y = false) {
#endif //Z_SAFE_HOMING
#endif //Z_HOME_DIR < 0
// Set the Z position, if included
if (code_seen(axis_codes[Z_AXIS]) && code_has_value()) {
if (code_value_long() != 0) // filter 0
current_position[Z_AXIS] = code_value();
}
#if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset; // Add Z_Probe offset (the distance is negative)
#endif
sync_plan_position();
#endif // else DELTA
......@@ -3922,13 +3916,13 @@ inline void gcode_M42() {
if (radius < 0.0) radius = -radius;
X_current = X_probe_location + cos(theta) * radius;
X_current = constrain(X_current, X_MIN_POS, X_MAX_POS);
X_current = constrain(X_current, X_MIN_POS + 10, X_MAX_POS - 10);
Y_current = Y_probe_location + sin(theta) * radius;
Y_current = constrain(Y_current, Y_MIN_POS, Y_MAX_POS);
Y_current = constrain(Y_current, Y_MIN_POS + 10, Y_MAX_POS - 10);
if (verbose_level > 3) {
ECHO_SMV(DB, "x: ", X_current);
ECHO_EMV("y: ", Y_current);
ECHO_EMV(" y: ", Y_current);
}
do_blocking_move_to(X_current, Y_current, Z_current); // this also updates current_position
......@@ -3969,9 +3963,10 @@ inline void gcode_M42() {
sigma = sqrt(sum / (n + 1));
if (verbose_level > 1) {
ECHO_V(n+1);
ECHO_SV(DB, n + 1);
ECHO_MV(" of ", n_samples);
ECHO_MV(" z: ", current_position[Z_AXIS], 6);
ECHO_EM(" samples");
ECHO_SMV(DB, "z: ", current_position[Z_AXIS], 6);
if (verbose_level > 2) {
ECHO_MV(" mean: ", mean,6);
ECHO_MV(" sigma: ", sigma,6);
......@@ -4104,25 +4099,24 @@ inline void gcode_M85() {
}
/**
* M92: Set axis_steps_per_unit - same syntax as G92
* M92: Set axis_steps_per_unit
*/
inline void gcode_M92() {
for(int8_t i = 0; i < NUM_AXIS; i++) {
if (code_seen(axis_codes[i])) {
if (i == E_AXIS) {
float value = code_value();
for(int8_t i = 0; i <= Z_AXIS; i++) {
if (code_seen(axis_codes[i])) axis_steps_per_unit[i] = code_value();
}
if (code_seen('E')) {
int tmp_extruder = 0;
tmp_extruder = code_value();
float value = code_seen('S') ? code_value() : axis_steps_per_unit[E_AXIS + tmp_extruder];
if (value < 20.0) {
float factor = axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
float factor = axis_steps_per_unit[E_AXIS + tmp_extruder] / value; // increase e constants if M92 E14 is given for netfab.
max_e_jerk *= factor;
max_feedrate[i] *= factor;
axis_steps_per_sqr_second[i] *= factor;
}
axis_steps_per_unit[i] = value;
}
else {
axis_steps_per_unit[i] = code_value();
}
max_feedrate[E_AXIS + tmp_extruder] *= factor;
axis_steps_per_sqr_second[E_AXIS + tmp_extruder] *= factor;
}
axis_steps_per_unit[E_AXIS + tmp_extruder] = value;
}
}
......@@ -4270,6 +4264,30 @@ inline void gcode_M112() {
* M114: Output current position to serial port
*/
inline void gcode_M114() {
//MESSAGE for Host
ECHO_SMV(OK, "X:", current_position[X_AXIS]);
ECHO_MV(" Y:", current_position[Y_AXIS]);
ECHO_MV(" Z:", current_position[Z_AXIS]);
ECHO_MV(" E:", current_position[E_AXIS]);
ECHO_MV(MSG_COUNT_X, float(st_get_position(X_AXIS))/axis_steps_per_unit[X_AXIS]);
ECHO_MV(" Y:", float(st_get_position(Y_AXIS))/axis_steps_per_unit[Y_AXIS]);
ECHO_EMV(" Z:", float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]);
#ifdef SCARA
//MESSAGE for Host
ECHO_SMV(OK, "SCARA Theta:", delta[X_AXIS]);
ECHO_EMV(" Psi+Theta:", delta[Y_AXIS]);
ECHO_SMV(DB, "SCARA Cal - Theta:", delta[X_AXIS]+home_offset[X_AXIS]);
ECHO_EMV(" Psi+Theta (90):", delta[Y_AXIS]-delta[X_AXIS]-90+home_offset[Y_AXIS]);
ECHO_SMV(DB, "SCARA step Cal - Theta:", delta[X_AXIS]/90*axis_steps_per_unit[X_AXIS]);
ECHO_EMV(" Psi+Theta:", (delta[Y_AXIS]-delta[X_AXIS])/90*axis_steps_per_unit[Y_AXIS]);
#endif
if (code_seen('V')) {
//MESSAGE for user
ECHO_SMV(DB, "X:", current_position[X_AXIS]);
ECHO_MV(" Y:", current_position[Y_AXIS]);
ECHO_MV(" Z:", current_position[Z_AXIS]);
......@@ -4280,7 +4298,8 @@ inline void gcode_M114() {
ECHO_EMV(" Z:", float(st_get_position(Z_AXIS))/axis_steps_per_unit[Z_AXIS]);
#ifdef SCARA
ECHO_SMV(DB, "SCARA Theta:", delta[X_AXIS]);
//MESSAGE for User
ECHO_SMV(OK, "SCARA Theta:", delta[X_AXIS]);
ECHO_EMV(" Psi+Theta:", delta[Y_AXIS]);
ECHO_SMV(DB, "SCARA Cal - Theta:", delta[X_AXIS]+home_offset[X_AXIS]);
......@@ -4289,6 +4308,7 @@ inline void gcode_M114() {
ECHO_SMV(DB, "SCARA step Cal - Theta:", delta[X_AXIS]/90*axis_steps_per_unit[X_AXIS]);
ECHO_EMV(" Psi+Theta:", (delta[Y_AXIS]-delta[X_AXIS])/90*axis_steps_per_unit[Y_AXIS]);
#endif
}
}
/**
......@@ -4389,6 +4409,77 @@ inline void gcode_M140() {
if (code_seen('S')) setTargetBed(code_value());
}
#ifdef ULTIPANEL
/**
* M145: Set the heatup state for a material in the LCD menu
* S<material> (0=PLA, 1=ABS, 2=GUM)
* H<hotend temp>
* B<bed temp>
* F<fan speed>
*/
inline void gcode_M145() {
uint8_t material = code_seen('S') ? code_value_short() : 0;
if (material < 0 || material > 2) {
ECHO_SM(DB, MSG_ERR_MATERIAL_INDEX);
}
else {
int v;
switch (material) {
case 0:
if (code_seen('H')) {
v = code_value_short();
plaPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
}
if (code_seen('F')) {
v = code_value_short();
plaPreheatFanSpeed = constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0
if (code_seen('B')) {
v = code_value_short();
plaPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
}
#endif
break;
case 1:
if (code_seen('H')) {
v = code_value_short();
absPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
}
if (code_seen('F')) {
v = code_value_short();
absPreheatFanSpeed = constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0
if (code_seen('B')) {
v = code_value_short();
absPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
}
#endif
break;
case 2:
if (code_seen('H')) {
v = code_value_short();
gumPreheatHotendTemp = constrain(v, EXTRUDE_MINTEMP, HEATER_0_MAXTEMP - 15);
}
if (code_seen('F')) {
v = code_value_short();
gumPreheatFanSpeed = constrain(v, 0, 255);
}
#if TEMP_SENSOR_BED != 0
if (code_seen('B')) {
v = code_value_short();
gumPreheatHPBTemp = constrain(v, BED_MINTEMP, BED_MAXTEMP - 15);
}
#endif
break;
}
}
}
#endif
#ifdef BLINKM
/**
* M150: Set Status LED Color - Use R-U-B for R-G-B
......@@ -4480,10 +4571,15 @@ inline void gcode_M201() {
* M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
*/
inline void gcode_M203() {
for (int8_t i=0; i < NUM_AXIS; i++) {
if (code_seen(axis_codes[i])) {
max_feedrate[i] = code_value();
for(int8_t i = 0; i <= Z_AXIS; i++) {
if (code_seen(axis_codes[i])) max_feedrate[i] = code_value();
}
if (code_seen('E')) {
int tmp_extruder = 0;
tmp_extruder = code_value();
float value = code_seen('S') ? code_value() : max_feedrate[E_AXIS + tmp_extruder];
max_feedrate[E_AXIS + tmp_extruder] = value;
}
}
......@@ -5745,11 +5841,11 @@ void process_commands() {
#endif //FWRETRACT
case 28: //G28: Home all axes, one at a time
gcode_G28(); break;
gcode_G28(); gcode_M114(); break;
#ifdef ENABLE_AUTO_BED_LEVELING
case 29: // G29 Detailed Z-Probe, probes the bed at 3 or more points.
gcode_G29(); break;
gcode_G29(); gcode_M114(); break;
#ifndef Z_PROBE_SLED
case 30: // G30 Single Z Probe
gcode_G30(); break;
......
......@@ -20,77 +20,77 @@
* V21 EEPROM Layout:
*
* ver
* axis_steps_per_unit (x7)
* max_feedrate (x7)
* retraction_feedrate (x4)
* max_acceleration_units_per_sq_second (x7)
* acceleration
* retract_acceleration
* travel_acceleration
* minimumfeedrate
* mintravelfeedrate
* minsegmenttime
* max_xy_jerk
* max_z_jerk
* max_e_jerk
* home_offset (x3)
* zprobe_zoffset
* M92 XYZ E0 E1 E2 E3 axis_steps_per_unit (x7)
* M203 XYZ E0 E1 E2 E3 max_feedrate (x7)
* M??? E0 E1 E2 E3 retraction_feedrate (x4)
* M201 XYZ E0 E1 E2 E3 max_acceleration_units_per_sq_second (x7)
* M204 P acceleration
* M204 R retract_acceleration
* M204 T travel_acceleration
* M205 S minimumfeedrate
* M205 T mintravelfeedrate
* M205 B minsegmenttime
* M205 X max_xy_jerk
* M205 Z max_z_jerk
* M205 E max_e_jerk
* M206 XYZ home_offset (x3)
* M666 P zprobe_zoffset
*
* HOTEND OFFSET:
* hotend_offset (x4)
* M218 T XY hotend_offset (x4) (T0..3)
*
* DELTA:
* endstop_adj (x3)
* delta_radius
* delta_diagonal_rod
* max_pos
* tower_adj (x3)
* z_probe_offset
* M666 XYZ endstop_adj (x3)
* M666 ABCDEFG tower_adj (x6)
* M666 R delta_radius
* M666 D delta_diagonal_rod
* M666 H Z max_pos
* M666 P z_probe_offset
*
* Z_DUAL_ENDSTOPS
* z_endstop_adj
* M666 Z z_endstop_adj
*
* ULTIPANEL:
* plaPreheatHotendTemp
* plaPreheatHPBTemp
* plaPreheatFanSpeed
* absPreheatHotendTemp
* absPreheatHPBTemp
* absPreheatFanSpeed
* gumPreheatHotendTemp
* gumPreheatHPBTemp
* gumPreheatFanSpeed
* M145 S0 H plaPreheatHotendTemp
* M145 S0 B plaPreheatHPBTemp
* M145 S0 F plaPreheatFanSpeed
* M145 S1 H absPreheatHotendTemp
* M145 S1 B absPreheatHPBTemp
* M145 S1 F absPreheatFanSpeed
* M145 S2 H gumPreheatHotendTemp
* M145 S2 B gumPreheatHPBTemp
* M145 S2 F gumPreheatFanSpeed
*
* PIDTEMP:
* Kp[0], Ki[0], Kd[0]
* Kp[1], Ki[1], Kd[1]
* Kp[2], Ki[2], Kd[2]
* Kp[3], Ki[3], Kd[3]
* M301 E0 PID Kp[0], Ki[0], Kd[0]
* M301 E1 PID Kp[1], Ki[1], Kd[1]
* M301 E2 PID Kp[2], Ki[2], Kd[2]
* M301 E3 PID Kp[3], Ki[3], Kd[3]
*
* PIDTEMPBED:
* bedKp, bedKi, bedKd
* M304 PID bedKp, bedKi, bedKd
*
* DOGLCD:
* lcd_contrast
* M250 C lcd_contrast
*
* SCARA:
* axis_scaling (x3)
* M365 XYZ axis_scaling (x3)
*
* FWRETRACT:
* autoretract_enabled
* retract_length
* retract_length_swap
* retract_feedrate
* retract_zlift
* retract_recover_length
* retract_recover_length_swap
* retract_recover_feedrate
* M209 S autoretract_enabled
* M207 S retract_length
* M207 W retract_length_swap
* M207 F retract_feedrate
* M207 Z retract_zlift
* M208 S retract_recover_length
* M208 W retract_recover_length_swap
* M208 F retract_recover_feedrate
*
* volumetric_enabled
* M200 D volumetric_enabled (D>0 makes this enabled)
*
* filament_size (x4)
* M200 T D filament_size (x4) (T0..3)
*
* idleoozing_enabled
* M??? S idleoozing_enabled
*
*
*
......@@ -127,8 +127,6 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
#define EEPROM_WRITE_VAR(pos, value) _EEPROM_writeData(pos, (uint8_t*)&value, sizeof(value))
#define EEPROM_READ_VAR(pos, value) _EEPROM_readData(pos, (uint8_t*)&value, sizeof(value))
//======================================================================================
#define DUMMY_PID_VALUE 3000.0f
#define EEPROM_OFFSET 100
......@@ -137,6 +135,9 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
#ifdef EEPROM_SETTINGS
/**
* Store Configuration Settings - M500
*/
void Config_StoreSettings() {
float dummy = 0.0f;
char ver[4] = "000";
......@@ -272,12 +273,16 @@ void Config_StoreSettings() {
ECHO_EM(" bytes)");
}
/**
* Retrieve Configuration Settings - M501
*/
void Config_RetrieveSettings() {
int i = EEPROM_OFFSET;
char stored_ver[4];
char ver[4] = EEPROM_VERSION;
EEPROM_READ_VAR(i, stored_ver); //read stored version
// ECHO_EM("Version: [" << ver << "] Stored version: [" << stored_ver << "]");
if (strncmp(ver, stored_ver, 3) != 0) {
Config_ResetDefault();
......@@ -432,6 +437,9 @@ void Config_RetrieveSettings() {
#endif // EEPROM_SETTINGS
/**
* Reset Configuration Settings - M502
*/
void Config_ResetDefault() {
float tmp1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
......@@ -564,6 +572,9 @@ void Config_ResetDefault() {
#ifndef DISABLE_M503
/**
* Print Configuration Settings - M502
*/
void Config_PrintSettings(bool forReplay) {
// Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
......@@ -724,6 +735,24 @@ void Config_PrintSettings(bool forReplay) {
ECHO_LMV(DB, " M666 P", zprobe_zoffset);
#endif // DELTA
#ifdef ULTIPANEL
if (!forReplay) {
ECHO_LM(DB, "Material heatup parameters:");
}
ECHO_SMV(DB, " M145 M0 H", plaPreheatHotendTemp);
ECHO_MV(" B", plaPreheatHPBTemp);
ECHO_MV(" F", plaPreheatFanSpeed);
ECHO_EM(" (Material PLA)");
ECHO_SMV(DB, " M145 M1 H", absPreheatHotendTemp);
ECHO_MV(" B", absPreheatHPBTemp);
ECHO_MV(" F", absPreheatFanSpeed);
ECHO_EM(" (Material ABS)");
ECHO_SMV(DB, " M145 M2 H", gumPreheatHotendTemp);
ECHO_MV(" B", gumPreheatHPBTemp);
ECHO_MV(" F", gumPreheatFanSpeed);
ECHO_EM(" (Material GUM)");
#endif // ULTIPANEL
#if defined(PIDTEMP) || defined(PIDTEMPBED)
if (!forReplay) {
ECHO_LM(DB, "PID settings:");
......
......@@ -9,10 +9,8 @@ void save_lifetime_stats();
#ifndef DISABLE_M503
void Config_PrintSettings(bool forReplay=false);
void ConfigSD_PrintSettings(bool forReplay=false);
#else
FORCE_INLINE void Config_PrintSettings(bool forReplay=false) {}
FORCE_INLINE void ConfigSD_PrintSettings(bool forReplay=false) {}
#endif
#ifdef EEPROM_SETTINGS
......
......@@ -29,7 +29,7 @@
#endif
#include <U8glib.h>
#include "DOGMbitmaps.h"
#include "dogm_bitmaps.h"
#include "ultralcd.h"
#include "ultralcd_st7920_u8glib_rrd.h"
......@@ -64,6 +64,10 @@
#elif defined( DISPLAY_CHARSET_ISO10646_KANA )
#include "dogm_font_data_ISO10646_Kana.h"
#define FONT_MENU_NAME ISO10646_Kana_5x7
#elif defined( DISPLAY_CHARSET_ISO10646_CN )
#include "dogm_font_data_ISO10646_CN.h"
#define FONT_MENU_NAME ISO10646_CN
#define TALL_FONT_CORRECTION 1
#else // fall-back
#include "dogm_font_data_ISO10646_1.h"
#define FONT_MENU_NAME ISO10646_1_5x7
......@@ -106,6 +110,10 @@
#define LCD_WIDTH_EDIT 22
#endif
#ifndef TALL_FONT_CORRECTION
#define TALL_FONT_CORRECTION 0
#endif
#define START_ROW 0
// LCD selection
......@@ -123,6 +131,13 @@
U8GLIB_DOGM128 u8g(DOGLCD_CS, DOGLCD_A0); // HW-SPI Com: CS, A0
#endif
#ifndef LCD_PIXEL_WIDTH
#define LCD_PIXEL_WIDTH 128
#endif
#ifndef LCD_PIXEL_HEIGHT
#define LCD_PIXEL_HEIGHT 64
#endif
#include "utf_mapper.h"
int lcd_contrast;
......@@ -172,6 +187,7 @@ char lcd_printPGM(const char* str) {
static bool show_splashscreen = true;
/* Warning: This function is called from interrupt context */
static void lcd_implementation_init() {
#ifdef LCD_PIN_BL // Enable LCD backlight
......@@ -252,20 +268,21 @@ static void lcd_implementation_status_screen() {
#ifdef SDSUPPORT
// SD Card Symbol
u8g.drawBox(42,42,8,7);
u8g.drawBox(50,44,2,5);
u8g.drawFrame(42,49,10,4);
u8g.drawPixel(50,43);
u8g.drawBox(42, 42 - TALL_FONT_CORRECTION, 8, 7);
u8g.drawBox(50, 44 - TALL_FONT_CORRECTION, 2, 5);
u8g.drawFrame(42, 49 - TALL_FONT_CORRECTION, 10, 4);
u8g.drawPixel(50, 43 - TALL_FONT_CORRECTION);
// Progress bar frame
u8g.drawFrame(54,49,73,4);
u8g.drawFrame(54, 49, 73, 4 - TALL_FONT_CORRECTION);
// SD Card Progress bar and clock
lcd_setFont(FONT_STATUSMENU);
if (IS_SD_PRINTING) {
// Progress bar solid part
u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2);
u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - TALL_FONT_CORRECTION);
}
u8g.setPrintPos(80,48);
......@@ -319,9 +336,9 @@ static void lcd_implementation_status_screen() {
lcd_setFont(FONT_STATUSMENU);
#ifdef USE_SMALL_INFOFONT
u8g.drawBox(0,30,128,10);
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,10);
#else
u8g.drawBox(0,30,128,9);
u8g.drawBox(0,30,LCD_PIXEL_WIDTH,9);
#endif
u8g.setColorIndex(0); // white on black
u8g.setPrintPos(2,XYZ_BASELINE);
......@@ -396,7 +413,7 @@ static void lcd_implementation_status_screen() {
static void lcd_implementation_mark_as_selected(uint8_t row, bool isSelected) {
if (isSelected) {
u8g.setColorIndex(1); // black on white
u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3, 128, DOG_CHAR_HEIGHT);
u8g.drawBox(0, row * DOG_CHAR_HEIGHT + 3 - TALL_FONT_CORRECTION, LCD_PIXEL_WIDTH, DOG_CHAR_HEIGHT);
u8g.setColorIndex(0); // following text must be white on black
}
else {
......@@ -416,13 +433,15 @@ static void lcd_implementation_drawmenu_generic(bool isSelected, uint8_t row, co
pstr++;
}
while (n--) lcd_print(' ');
u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH, (row + 1) * DOG_CHAR_HEIGHT);
lcd_print(post_char);
lcd_print(' ');
}
static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const char* pstr, const char* data, bool pgm) {
char c;
uint8_t n = LCD_WIDTH - 2 - (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
uint8_t vallen = (pgm ? lcd_strlen_P(data) : (lcd_strlen((char*)data)));
uint8_t n = LCD_WIDTH - 2 - vallen;
lcd_implementation_mark_as_selected(row, isSelected);
......@@ -432,6 +451,7 @@ static void _drawmenu_setting_edit_generic(bool isSelected, uint8_t row, const c
}
lcd_print(':');
while (n--) lcd_print(' ');
u8g.setPrintPos(LCD_PIXEL_WIDTH - DOG_CHAR_WIDTH * vallen, (row + 1) * DOG_CHAR_HEIGHT);
if (pgm) { lcd_printPGM(data); } else { lcd_print((char *)data); }
}
......
......@@ -30,17 +30,14 @@
#endif
#define PROTOCOL_VERSION "1.0"
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#if MB(ULTIMAKER)|| MB(ULTIMAKER_OLD)|| MB(ULTIMAIN_2)
#undef FIRMWARE_URL
#define MACHINE_NAME "Ultimaker"
#define FIRMWARE_URL "http://firmware.ultimaker.com"
#elif MB(RUMBA)
#define MACHINE_NAME "Rumba"
#elif MB(3DRAG)
#define MACHINE_NAME "3Drag"
#undef FIRMWARE_URL
#define FIRMWARE_URL "http://3dprint.elettronicain.it/"
#elif MB(K8200)
#define MACHINE_NAME "K8200"
......@@ -48,15 +45,23 @@
#define MACHINE_NAME "Makibox"
#elif MB(SAV_MKI)
#define MACHINE_NAME "SAV MkI"
#undef FIRMWARE_URL
#define FIRMWARE_URL "https://github.com/fmalpartida/Marlin/tree/SAV-MkI-config"
#else // Default firmware set to Mendel
#define MACHINE_NAME "Mendel"
#endif
#ifdef CUSTOM_MENDEL_NAME
#error CUSTOM_MENDEL_NAME deprecated - use CUSTOM_MACHINE_NAME
#define CUSTOM_MACHINE_NAME CUSTOM_MENDEL_NAME
#endif
#ifdef CUSTOM_MACHINE_NAME
#undef MACHINE_NAME
#define MACHINE_NAME CUSTOM_MENDEL_NAME
#define MACHINE_NAME CUSTOM_MACHINE_NAME
#endif
#ifndef FIRMWARE_URL
#define FIRMWARE_URL "https://github.com/MagoKimbra/MarlinKimbra"
#endif
#ifndef BUILD_VERSION
......@@ -131,6 +136,7 @@
#define MSG_Z_MAX "z_max: "
#define MSG_Z2_MAX "z2_max: "
#define MSG_Z_PROBE "z_probe: "
#define MSG_ERR_MATERIAL_INDEX "M145 S<index> out of range (0-2)"
#define MSG_E_MIN "e_min: "
#define MSG_FILAMENT_RUNOUT_PIN "filament_runout_pin: "
#define MSG_M119_REPORT "Reporting endstop status"
......
......@@ -2231,8 +2231,8 @@
/****************************************************************************************
* 502
* Arduino Due pin assignment
* Alligator R2
* http://www.3dartists.org/
****************************************************************************************/
#if MB(ALLIGATOR)
#define KNOWN_BOARD 1
......@@ -2345,6 +2345,87 @@
//32Mb
#define SPI_FLASH_CS 23 //PA14
#ifdef ULTRA_LCD
#ifdef NEWPANEL
#ifdef PANEL_ONE
#define LCD_PINS_RS 40
#define LCD_PINS_ENABLE 42
#define LCD_PINS_D4 65
#define LCD_PINS_D5 66
#define LCD_PINS_D6 44
#define LCD_PINS_D7 64
#else
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
#endif //PANEL_ONE
#ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
#define BEEPER 37
#define BTN_EN1 31
#define BTN_EN2 33
#define BTN_ENC 35
#define SDCARDDETECT 49
#elif defined(LCD_I2C_PANELOLU2)
#define BTN_EN1 47 //reverse if the encoder turns the wrong way.
#define BTN_EN2 43
#define BTN_ENC 32
#define LCD_SDSS 53
#define SDCARDDETECT -1
#define KILL_PIN 41
#elif defined(LCD_I2C_VIKI)
#define BTN_EN1 22 //reverse if the encoder turns the wrong way.
#define BTN_EN2 7
#define BTN_ENC -1
#define LCD_SDSS 53
#define SDCARDDETECT 49
#else
//arduino pin which triggers an piezzo beeper
#define BEEPER 33 // Beeper on AUX-4
//buttons are directly attached using AUX-2
#ifdef REPRAPWORLD_KEYPAD
#define BTN_EN1 64 // encoder
#define BTN_EN2 59 // encoder
#define BTN_ENC 63 // enter button
#define SHIFT_OUT 40 // shift register
#define SHIFT_CLK 44 // shift register
#define SHIFT_LD 42 // shift register
#elif defined(PANEL_ONE)
#define BTN_EN1 59 // AUX2 PIN 3
#define BTN_EN2 63 // AUX2 PIN 4
#define BTN_ENC 49 // AUX3 PIN 7
#else
#define BTN_EN1 37
#define BTN_EN2 35
#define BTN_ENC 31 //the click
#endif
#endif
#else //old style panel with shift register
//arduino pin witch triggers an piezzo beeper
#define BEEPER 33 //No Beeper added
//buttons are attached to a shift register
// Not wired this yet
//#define SHIFT_CLK 38
//#define SHIFT_LD 42
//#define SHIFT_OUT 40
//#define SHIFT_EN 17
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27
#define LCD_PINS_D7 29
#endif //NEWPANEL
#endif //ULTRA_LCD
#endif //ALLIGATOR
/****************************************************************************************/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment