Skip to content

Commit

Permalink
Merge branch 'Marlin_v1' of github.com:ErikZalm/Marlin into Marlin_v1
Browse files Browse the repository at this point in the history
  • Loading branch information
daid committed May 1, 2014
2 parents 8b4c4aa + ce76843 commit 2acd379
Show file tree
Hide file tree
Showing 13 changed files with 2,330 additions and 162 deletions.
14 changes: 13 additions & 1 deletion Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
// 91 = Final OMCA board
// 301= Rambo
// 21 = Elefu Ra Board (v3)
// 88 = 5DPrint D8 Driver Board

#ifndef MOTHERBOARD
#define MOTHERBOARD 7
Expand Down Expand Up @@ -115,8 +116,10 @@
// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
// 10 is 100k RS thermistor 198-961 (4.7k pullup)
// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
//
// 1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
// (but gives greater accuracy and more stable PID)
Expand Down Expand Up @@ -459,6 +462,15 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//=============================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


// EEPROM
// The microcontroller can store settings in the EEPROM, e.g. max velocity...
// M500 - stores parameters in EEPROM
Expand Down
8 changes: 4 additions & 4 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
//The maximum buffered steps/sec of the extruder motor are called "se".
//You enter the autotemp mode by a M109 S<mintemp> T<maxtemp> F<factor>
//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
// you exit the value by any M109 without F*
// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
Expand Down Expand Up @@ -215,7 +215,7 @@
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
#define X_HOME_RETRACT_MM 5
#define Y_HOME_RETRACT_MM 5
#define Z_HOME_RETRACT_MM 1
#define Z_HOME_RETRACT_MM 2
//#define QUICK_HOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.

#define AXIS_RELATIVE_MODES {false, false, false, false}
Expand Down Expand Up @@ -410,10 +410,10 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#ifdef FWRETRACT
#define MIN_RETRACT 0.1 //minimum extruded mm to accept a automatic gcode retraction attempt
#define RETRACT_LENGTH 3 //default retract length (positive mm)
#define RETRACT_FEEDRATE 80*60 //default feedrate for retracting
#define RETRACT_FEEDRATE 45 //default feedrate for retracting (mm/s)
#define RETRACT_ZLIFT 0 //default retract Z-lift
#define RETRACT_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
#define RETRACT_RECOVER_FEEDRATE 8*60 //default feedrate for recovering from retraction
#define RETRACT_RECOVER_FEEDRATE 8 //default feedrate for recovering from retraction (mm/s)
#endif

//adds support for experimental filament exchange support M600; requires display
Expand Down
68 changes: 59 additions & 9 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
// M107 - Fan off
// M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
// Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
// IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
// M114 - Output current position to serial port
// M115 - Capabilities string
// M117 - display message
Expand Down Expand Up @@ -1119,7 +1120,7 @@ void refresh_cmd_timeout(void)
current_position[E_AXIS]+=retract_length/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate;
feedrate=retract_feedrate;
feedrate=retract_feedrate*60;
retracted=true;
prepare_move();
current_position[Z_AXIS]-=retract_zlift;
Expand All @@ -1137,7 +1138,7 @@ void refresh_cmd_timeout(void)
current_position[E_AXIS]-=(retract_length+retract_recover_length)/volumetric_multiplier[active_extruder];
plan_set_e_position(current_position[E_AXIS]);
float oldFeedrate = feedrate;
feedrate=retract_recover_feedrate;
feedrate=retract_recover_feedrate*60;
retracted=false;
prepare_move();
feedrate = oldFeedrate;
Expand Down Expand Up @@ -1286,7 +1287,12 @@ void process_commands()
destination[X_AXIS] = 1.5 * max_length(X_AXIS) * x_axis_home_dir;destination[Y_AXIS] = 1.5 * max_length(Y_AXIS) * home_dir(Y_AXIS);
feedrate = homing_feedrate[X_AXIS];
if(homing_feedrate[Y_AXIS]<feedrate)
feedrate =homing_feedrate[Y_AXIS];
feedrate = homing_feedrate[Y_AXIS];
if (max_length(X_AXIS) > max_length(Y_AXIS)) {
feedrate *= sqrt(pow(max_length(Y_AXIS) / max_length(X_AXIS), 2) + 1);
} else {
feedrate *= sqrt(pow(max_length(X_AXIS) / max_length(Y_AXIS), 2) + 1);
}
plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feedrate/60, active_extruder);
st_synchronize();

Expand Down Expand Up @@ -2268,8 +2274,6 @@ void process_commands()
SERIAL_ECHO_START;
SERIAL_ECHO(MSG_M200_INVALID_EXTRUDER);
}
SERIAL_ECHOLN(tmp_extruder);
break;
}
volumetric_multiplier[tmp_extruder] = 1 / area;
}
Expand Down Expand Up @@ -2341,30 +2345,30 @@ void process_commands()
break;
#endif
#ifdef FWRETRACT
case 207: //M207 - set retract length S[positive mm] F[feedrate mm/sec] Z[additional zlift/hop]
case 207: //M207 - set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop]
{
if(code_seen('S'))
{
retract_length = code_value() ;
}
if(code_seen('F'))
{
retract_feedrate = code_value() ;
retract_feedrate = code_value()/60 ;
}
if(code_seen('Z'))
{
retract_zlift = code_value() ;
}
}break;
case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/sec]
case 208: // M208 - set retract recover length S[positive mm surplus to the M207 S*] F[feedrate mm/min]
{
if(code_seen('S'))
{
retract_recover_length = code_value() ;
}
if(code_seen('F'))
{
retract_recover_feedrate = code_value() ;
retract_recover_feedrate = code_value()/60 ;
}
}break;
case 209: // M209 - S<1=true/0=false> enable automatic retract detect if the slicer did not support G10/11: every normal extrude-only move will be classified as retract depending on the direction.
Expand Down Expand Up @@ -2721,6 +2725,43 @@ void process_commands()
}
break;
#endif

#ifdef CUSTOM_M_CODE_SET_Z_PROBE_OFFSET
case CUSTOM_M_CODE_SET_Z_PROBE_OFFSET:
{
float value;
if (code_seen('Z'))
{
value = code_value();
if ((Z_PROBE_OFFSET_RANGE_MIN <= value) && (value <= Z_PROBE_OFFSET_RANGE_MAX))
{
zprobe_zoffset = -value; // compare w/ line 278 of ConfigurationStore.cpp
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " " MSG_OK);
SERIAL_PROTOCOLLN("");
}
else
{
SERIAL_ECHO_START;
SERIAL_ECHOPGM(MSG_ZPROBE_ZOFFSET);
SERIAL_ECHOPGM(MSG_Z_MIN);
SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MIN);
SERIAL_ECHOPGM(MSG_Z_MAX);
SERIAL_ECHO(Z_PROBE_OFFSET_RANGE_MAX);
SERIAL_PROTOCOLLN("");
}
}
else
{
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM(MSG_ZPROBE_ZOFFSET " : ");
SERIAL_ECHO(-zprobe_zoffset);
SERIAL_PROTOCOLLN("");
}
break;
}
#endif // CUSTOM_M_CODE_SET_Z_PROBE_OFFSET

#ifdef FILAMENTCHANGEENABLE
case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
{
Expand Down Expand Up @@ -3051,7 +3092,16 @@ void process_commands()
// Set the new active extruder and position
active_extruder = tmp_extruder;
#endif //else DUAL_X_CARRIAGE
#ifdef DELTA

calculate_delta(current_position); // change cartesian kinematic to delta kinematic;
//sent position to plan_set_position();
plan_set_position(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS],current_position[E_AXIS]);

#else
plan_set_position(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]);

#endif
// Move to the old position if 'F' was in the parameters
if(make_move && Stopped == false) {
prepare_move();
Expand Down
5 changes: 5 additions & 0 deletions Marlin/digipot_mcp4451.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
#include "Wire.h"

// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
#if MOTHERBOARD == 88
#define DIGIPOT_I2C_FACTOR 117.96
#define DIGIPOT_I2C_MAX_CURRENT 1.736
#else
#define DIGIPOT_I2C_FACTOR 106.7
#define DIGIPOT_I2C_MAX_CURRENT 2.5
#endif

static byte current_to_wiper( float current ){
return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
Expand Down
Loading

0 comments on commit 2acd379

Please sign in to comment.