Skip to content

Commit

Permalink
Merge pull request Ultimaker#3 from filipmu/Marlin_v1
Browse files Browse the repository at this point in the history
Sync up from my Marlin_v1 to Filament-sensor
  • Loading branch information
filipmu committed Nov 9, 2014
2 parents 9bc7aec + b014fd1 commit df7c803
Show file tree
Hide file tree
Showing 20 changed files with 2,684 additions and 1,194 deletions.
15 changes: 13 additions & 2 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
// example_configurations/delta directory.
//

//===========================================================================
//============================= SCARA Printer ===============================
//===========================================================================
// For a Delta printer replace the configuration files with the files in the
// example_configurations/SCARA directory.
//

// User-specified version info of this build 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
// build by the user have been successfully uploaded into firmware.
Expand All @@ -23,7 +30,6 @@
// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
#define SERIAL_PORT 0

// This determines the communication speed of the printer
// This determines the communication speed of the printer
#define BAUDRATE 250000

Expand All @@ -42,6 +48,7 @@
// 33 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Bed)
// 34 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
// 35 = RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
// 36 = RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
// 4 = Duemilanove w/ ATMega328P pin assignment
// 5 = Gen6
// 51 = Gen6 deluxe
Expand Down Expand Up @@ -72,6 +79,7 @@
// 301= Rambo
// 21 = Elefu Ra Board (v3)
// 88 = 5DPrint D8 Driver Board
// 999 = Leapfrog

#ifndef MOTHERBOARD
#define MOTHERBOARD 7
Expand Down Expand Up @@ -119,6 +127,7 @@
// 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)
// 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
//
Expand All @@ -132,7 +141,6 @@
// 1010 is Pt1000 with 1k pullup (non standard)
// 147 is Pt100 with 4k7 pullup
// 110 is Pt100 with 1k pullup (non standard)
// 70 is 500C thermistor for Pico hot end

#define TEMP_SENSOR_0 -1
#define TEMP_SENSOR_1 -1
Expand Down Expand Up @@ -376,6 +384,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
//============================= Bed Auto Leveling ===========================

//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
#define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.

#ifdef ENABLE_AUTO_BED_LEVELING

Expand Down Expand Up @@ -436,6 +445,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
#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

//#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
//#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
//The value is the delay to turn the servo off after powered on - depends on the servo speed; 300ms is good value, but you can try lower it.
Expand Down
46 changes: 35 additions & 11 deletions Marlin/ConfigurationStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
// the default values are used whenever there is a change to the data, to prevent
// wrong data being written to the variables.
// ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
#ifdef DELTA
#define EEPROM_VERSION "V11"
#else

#define EEPROM_VERSION "V10"
#ifdef DELTA
#undef EEPROM_VERSION
#define EEPROM_VERSION "V11"
#endif
#ifdef SCARA
#undef EEPROM_VERSION
#define EEPROM_VERSION "V12"
#endif

#ifdef EEPROM_SETTINGS
Expand All @@ -49,7 +54,7 @@ void Config_StoreSettings()
char ver[4]= "000";
int i=EEPROM_OFFSET;
EEPROM_WRITE_VAR(i,ver); // invalidate data first
EEPROM_WRITE_VAR(i,axis_steps_per_unit);
EEPROM_WRITE_VAR(i,axis_steps_per_unit);
EEPROM_WRITE_VAR(i,max_feedrate);
EEPROM_WRITE_VAR(i,max_acceleration_units_per_sq_second);
EEPROM_WRITE_VAR(i,acceleration);
Expand All @@ -60,7 +65,7 @@ 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_homeing);
EEPROM_WRITE_VAR(i,add_homing);
#ifdef DELTA
EEPROM_WRITE_VAR(i,endstop_adj);
EEPROM_WRITE_VAR(i,delta_radius);
Expand Down Expand Up @@ -93,6 +98,9 @@ void Config_StoreSettings()
int lcd_contrast = 32;
#endif
EEPROM_WRITE_VAR(i,lcd_contrast);
#ifdef SCARA
EEPROM_WRITE_VAR(i,axis_scaling); // Add scaling for SCARA
#endif
char ver2[4]=EEPROM_VERSION;
i=EEPROM_OFFSET;
EEPROM_WRITE_VAR(i,ver2); // validate data
Expand All @@ -115,6 +123,16 @@ void Config_PrintSettings()
SERIAL_ECHOLN("");

SERIAL_ECHO_START;
#ifdef SCARA
SERIAL_ECHOLNPGM("Scaling factors:");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M365 X",axis_scaling[0]);
SERIAL_ECHOPAIR(" Y",axis_scaling[1]);
SERIAL_ECHOPAIR(" Z",axis_scaling[2]);
SERIAL_ECHOLN("");

SERIAL_ECHO_START;
#endif
SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M203 X",max_feedrate[0]);
Expand Down Expand Up @@ -152,9 +170,9 @@ void Config_PrintSettings()
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Home offset (mm):");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M206 X",add_homeing[0] );
SERIAL_ECHOPAIR(" Y" ,add_homeing[1] );
SERIAL_ECHOPAIR(" Z" ,add_homeing[2] );
SERIAL_ECHOPAIR(" M206 X",add_homing[0] );
SERIAL_ECHOPAIR(" Y" ,add_homing[1] );
SERIAL_ECHOPAIR(" Z" ,add_homing[2] );
SERIAL_ECHOLN("");
#ifdef DELTA
SERIAL_ECHO_START;
Expand Down Expand Up @@ -196,7 +214,7 @@ void Config_RetrieveSettings()
if (strncmp(ver,stored_ver,3) == 0)
{
// version number match
EEPROM_READ_VAR(i,axis_steps_per_unit);
EEPROM_READ_VAR(i,axis_steps_per_unit);
EEPROM_READ_VAR(i,max_feedrate);
EEPROM_READ_VAR(i,max_acceleration_units_per_sq_second);

Expand All @@ -211,7 +229,7 @@ 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_homeing);
EEPROM_READ_VAR(i,add_homing);
#ifdef DELTA
EEPROM_READ_VAR(i,endstop_adj);
EEPROM_READ_VAR(i,delta_radius);
Expand Down Expand Up @@ -240,6 +258,9 @@ void Config_RetrieveSettings()
int lcd_contrast;
#endif
EEPROM_READ_VAR(i,lcd_contrast);
#ifdef SCARA
EEPROM_READ_VAR(i,axis_scaling);
#endif

// Call updatePID (similar to when we have processed M301)
updatePID();
Expand All @@ -266,6 +287,9 @@ void Config_ResetDefault()
axis_steps_per_unit[i]=tmp1[i];
max_feedrate[i]=tmp2[i];
max_acceleration_units_per_sq_second[i]=tmp3[i];
#ifdef SCARA
axis_scaling[i]=1;
#endif
}

// steps per sq second need to be updated to agree with the units per sq second
Expand All @@ -279,7 +303,7 @@ void Config_ResetDefault()
max_xy_jerk=DEFAULT_XYJERK;
max_z_jerk=DEFAULT_ZJERK;
max_e_jerk=DEFAULT_EJERK;
add_homeing[0] = add_homeing[1] = add_homeing[2] = 0;
add_homing[0] = add_homing[1] = add_homing[2] = 0;
#ifdef DELTA
endstop_adj[0] = endstop_adj[1] = endstop_adj[2] = 0;
delta_radius= DELTA_RADIUS;
Expand Down
9 changes: 8 additions & 1 deletion Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ void get_coordinates();
void calculate_delta(float cartesian[3]);
extern float delta[3];
#endif
#ifdef SCARA
void calculate_delta(float cartesian[3]);
void calculate_SCARA_forward_Transform(float f_scara[3]);
#endif
void prepare_move();
void kill();
void Stop();
Expand Down Expand Up @@ -207,14 +211,17 @@ extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all
extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
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_homeing[3];
extern float add_homing[3];
#ifdef DELTA
extern float endstop_adj[3];
extern float delta_radius;
extern float delta_diagonal_rod;
extern float delta_segments_per_second;
void recalc_delta_settings(float radius, float diagonal_rod);
#endif
#ifdef SCARA
extern float axis_scaling[3]; // Build size scaling
#endif
extern float min_pos[3];
extern float max_pos[3];
extern bool axis_known_position[3];
Expand Down
2 changes: 1 addition & 1 deletion Marlin/MarlinSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void MarlinSerial::begin(long baud)
bool useU2X = true;

#if F_CPU == 16000000UL && SERIAL_PORT == 0
// hard coded exception for compatibility with the bootloader shipped
// hard-coded exception for compatibility with the bootloader shipped
// with the Duemilanove and previous boards and the firmware on the 8U2
// on the Uno and Mega 2560.
if (baud == 57600) {
Expand Down
Loading

0 comments on commit df7c803

Please sign in to comment.