Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #1

Open
wants to merge 34 commits into
base: Stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
cb12161
Add Filament menu and add Filament/Retract settings to config store.
wgm4321 Dec 29, 2014
d60efc3
Fix syntax error caused by previous changes.
wgm4321 Dec 29, 2014
2701dd8
Due to the fix for #1248, X and Y probe offsets must not be floats.
vandarin Dec 31, 2014
a18b625
Merge pull request #1261 from wgm4321/Development
boelle Jan 2, 2015
63da690
Merge pull request #1282 from vandarin/Development
boelle Jan 2, 2015
1d5d853
temperature.cpp: Fix typo of MAX_BED_PID to MAX_BED_POWER.
drf5n Jan 2, 2015
f3e503e
temperature.cpp: Fix typo of PID_MAX to MAX_BED_POWER for the bed.
drf5n Jan 2, 2015
ecda6cd
Fix typo, PID_BED_POWER -> MAX_BED_POWER
alhirzel Jan 2, 2015
edac64e
Add Filament menu and add Filament/Retract settings to config store.
wgm4321 Dec 29, 2014
b32be2d
Fix syntax error caused by previous changes.
wgm4321 Dec 29, 2014
1f520a5
Due to the fix for #1248, X and Y probe offsets must not be floats.
vandarin Dec 31, 2014
f3209bb
Merge branch 'Development' of https://github.com/alhirzel/Marlin into…
alhirzel Jan 2, 2015
eed451e
rework analogInputToDigitalPin definition
alhirzel Jan 2, 2015
b5e50cd
Move scripts and documentation to subfolders
thinkyhead Jan 2, 2015
912ed15
Merge pull request #1292 from thinkyhead/docs_and_scripts
alexborro Jan 2, 2015
f36fd3d
Merge branch 'Development' of https://github.com/ErikZalm/Marlin into…
alhirzel Jan 2, 2015
3f9707a
Added .gitignore back into repo
monkeydave Jan 3, 2015
86cc22d
Readd .travis.yml, change build enviroment to use ino instead of gcc
monkeydave Jan 3, 2015
21cc188
Updated .travis.yml for ErikZalm branch pull request
monkeydave Jan 3, 2015
9d9a2d7
Merge pull request #1295 from monkeydave/Re-add_gitignore
boelle Jan 3, 2015
206b7f4
Update .gitignore
boelle Jan 3, 2015
b5c6f11
Merge pull request #1297 from monkeydave/Readd-Travis-CI
boelle Jan 3, 2015
be81dfa
Updated .travis.yml so others forks will also compile
monkeydave Jan 3, 2015
07b85f8
Added compile checks for lots of defines in Configuration.h
monkeydave Jan 3, 2015
f8aa5ff
Fix for cant compile when REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLL…
wgm4321 Jan 3, 2015
04fb34c
Add English defines for filament menu to non-English to prevent compi…
wgm4321 Jan 3, 2015
9d57c37
Commented out configs that are failing with no easy fixes for the moment
monkeydave Jan 3, 2015
3d9f4ac
Merge pull request #1303 from wgm4321/Development
boelle Jan 4, 2015
efca4af
Merge pull request #1304 from monkeydave/Travis-CI
boelle Jan 4, 2015
c5f138e
Merge pull request #1291 from alhirzel/Development
boelle Jan 4, 2015
3024821
temp runaway: proper cast to prevent any overflow.
Jan 3, 2015
d2b6e62
Merge pull request #1309 from philfifi/fix_temp_runaway
alexborro Jan 4, 2015
9472bbe
issue 968 for dev branch
i-make-robots Jan 4, 2015
0978619
issue 1318
i-make-robots Jan 6, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.o
applet/
*~
*.orig
*.rej
*.bak
*.DS_Store
*.idea
160 changes: 160 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
language: c

before_install:
- pwd
- wget https://bootstrap.pypa.io/get-pip.py
- wget https://bintray.com/artifact/download/olikraus/u8glib/u8glib_arduino_v1.17.zip
install:
- sudo python get-pip.py
- sudo pip install ino
# add ppa for newer version of Arduino than available in ubuntu 12.04
- sudo add-apt-repository ppa:michael-gruz/elektronik -y
- sudo apt-get update -q
- sudo apt-get install arduino
before_script:
# add U8glib, LiquidCrystal_I2C & LiquidTWI2 libraries
- sudo unzip u8glib_arduino_v1.17.zip -d /usr/share/arduino/libraries/
- cd /usr/share/arduino/libraries/
- sudo git clone https://github.com/kiyoshigawa/LiquidCrystal_I2C.git
- ls -la
- ls -la LiquidCrystal_I2C/
- sudo git clone https://github.com/lincomatic/LiquidTWI2.git
# remove Robot_Control library to stop compile error!
- sudo rm -rf /usr/share/arduino/libraries/Robot_Control
# change back to home directory for compiling
- cd $TRAVIS_BUILD_DIR
# ino needs files in src directory
- ln -s Marlin src
# remove Marlin.pde as it confuses ino after it finds Marlin.ino
- rm Marlin/Marlin.pde
script:
# build default config
- ino build -m mega2560
# backup configuration.h
- cp Marlin/Configuration.h Marlin/Configuration.h.backup
- cp Marlin/Configuration_adv.h Marlin/Configuration_adv.h.backup
# change extruder numbers from 1 to 2
# commented out for the moment fails build but compiles fine in Arduino
#- sed -i 's/#define EXTRUDERS 1/#define EXTRUDERS 2/g' Marlin/Configuration.h
#- rm -rf .build/
#- ino build -m mega2560
# change extruder numbers from 2 to 3, needs to be a board with 3 extruders defined in pins.h
#- sed -i 's/#define MOTHERBOARD BOARD_ULTIMAKER/#define MOTHERBOARD BOARD_AZTEEG_X3_PRO/g' Marlin/Configuration.h
#- sed -i 's/#define EXTRUDERS 2/#define EXTRUDERS 3/g' Marlin/Configuration.h
#- rm -rf .build/
#- ino build -m mega2560
# enable PIDTEMPBED
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define PIDTEMPBED/#define PIDTEMPBED/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# enable THERMAL RUNAWAY PROTECTION for extruders & bed
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define THERMAL_RUNAWAY_PROTECTION_PERIOD/#define THERMAL_RUNAWAY_PROTECTION_PERIOD/g' Marlin/Configuration.h
- sed -i 's/\/\/#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS/#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS/g' Marlin/Configuration.h
- sed -i 's/\/\/#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD/#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD/g' Marlin/Configuration.h
- sed -i 's/\/\/#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS/#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# enable AUTO_BED_LEVELING
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define ENABLE_AUTO_BED_LEVELING/#define ENABLE_AUTO_BED_LEVELING/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# enable EEPROM_SETTINGS & EEPROM_CHITCHAT
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define EEPROM_SETTINGS/#define EEPROM_SETTINGS/g' Marlin/Configuration.h
- sed -i 's/\/\/#define EEPROM_CHITCHAT/#define EEPROM_CHITCHAT/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
### LCDS ###
# ULTIMAKERCONTROLLER
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define ULTIMAKERCONTROLLER/#define ULTIMAKERCONTROLLER/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# MAKRPANEL
# Needs to use melzi and sanguino hardware
#- cp Marlin/Configuration.h.backup Marlin/Configuration.h
#- sed -i 's/\/\/#define MAKRPANEL/#define MAKRPANEL/g' Marlin/Configuration.h
#- rm -rf .build/
#- ino build -m mega2560
# REPRAP_DISCOUNT_SMART_CONTROLLER
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define REPRAP_DISCOUNT_SMART_CONTROLLER/#define REPRAP_DISCOUNT_SMART_CONTROLLER/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# G3D_PANE
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define G3D_PANEL/#define G3D_PANEL/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER/#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# REPRAPWORLD_KEYPAD
# Cant find configuration details to get it to compile
#- cp Marlin/Configuration.h.backup Marlin/Configuration.h
#- sed -i 's/\/\/#define ULTRA_LCD/#define ULTRA_LCD/g' Marlin/Configuration.h
#- sed -i 's/\/\/#define REPRAPWORLD_KEYPAD/#define REPRAPWORLD_KEYPAD/g' Marlin/Configuration.h
#- sed -i 's/\/\/#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0/#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0/g' Marlin/Configuration.h
#- rm -rf .build/
#- ino build -m mega2560
# RA_CONTROL_PANEL
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define RA_CONTROL_PANEL/#define RA_CONTROL_PANEL/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
### I2C PANELS ###
# LCD_I2C_SAINSMART_YWROBOT
# Failing at the moment needs different library
#- cp Marlin/Configuration.h.backup Marlin/Configuration.h
#- sed -i 's/\/\/#define LCD_I2C_SAINSMART_YWROBOT/#define LCD_I2C_SAINSMART_YWROBOT/g' Marlin/Configuration.h
#- rm -rf .build/
#- ino build -m mega2560
# LCD_I2C_PANELOLU2
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define LCD_I2C_PANELOLU2/#define LCD_I2C_PANELOLU2/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# LCD_I2C_VIKI
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define LCD_I2C_VIKI/#define LCD_I2C_VIKI/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# Enable filament sensor
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define FILAMENT_SENSOR/#define FILAMENT_SENSOR/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
# Enable filament sensor with LCD display
- cp Marlin/Configuration.h.backup Marlin/Configuration.h
- sed -i 's/\/\/#define ULTIMAKERCONTROLLER/#define ULTIMAKERCONTROLLER/g' Marlin/Configuration.h
- sed -i 's/\/\/#define FILAMENT_SENSOR/#define FILAMENT_SENSOR/g' Marlin/Configuration.h
- sed -i 's/\/\/#define FILAMENT_LCD_DISPLAY/#define FILAMENT_LCD_DISPLAY/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m mega2560
######## Example Configurations ##############
# Delta Config
- cp Marlin/example_configurations/delta/Configuration* Marlin/
- rm -rf .build/
- ino build -m mega2560
# Makibox Config need to check board type for Teensy++ 2.0
#- cp Marlin/example_configurations/makibox/Configuration* Marlin/
#- rm -rf .build/
#- ino build -m mega2560
# SCARA Config
- cp Marlin/example_configurations/SCARA/Configuration* Marlin/
- rm -rf .build/
- ino build -m mega2560
# tvrrug Config need to check board type for sanguino atmega644p
#- cp Marlin/example_configurations/tvrrug/Round2/Configuration* Marlin/
#- rm -rf .build/
#- ino build -m mega2560
######## Board Types #############
- sed -i 's/#define MOTHERBOARD BOARD_RAMPS_13_EFB/#define MOTHERBOARD BOARD_DUEMILANOVE_328P/g' Marlin/Configuration.h
- rm -rf .build/
- ino build -m atmega328
3 changes: 3 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of


// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
// X and Y offsets must be integers
#define X_PROBE_OFFSET_FROM_EXTRUDER -25
#define Y_PROBE_OFFSET_FROM_EXTRUDER -29
#define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
Expand Down Expand Up @@ -780,6 +781,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of



// Send OK to PC, then wait OK_TIMEOUT ms before sending another 'OK', in case the first one was garbled.
#define OK_TIMEOUT 250



Expand Down
126 changes: 113 additions & 13 deletions Marlin/ConfigurationStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,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 "V10"
#ifdef DELTA
#undef EEPROM_VERSION
#define EEPROM_VERSION "V11"
#endif
#ifdef SCARA
#undef EEPROM_VERSION
#define EEPROM_VERSION "V12"
#endif
#define EEPROM_VERSION "V13"

#ifdef EEPROM_SETTINGS
void Config_StoreSettings()
Expand Down Expand Up @@ -101,6 +93,31 @@ void Config_StoreSettings()
#ifdef SCARA
EEPROM_WRITE_VAR(i,axis_scaling); // Add scaling for SCARA
#endif
#ifdef FWRETRACT
EEPROM_WRITE_VAR(i,autoretract_enabled);
EEPROM_WRITE_VAR(i,retract_length);
#if EXTRUDERS > 1
EEPROM_WRITE_VAR(i,retract_length_swap);
#endif
EEPROM_WRITE_VAR(i,retract_feedrate);
EEPROM_WRITE_VAR(i,retract_zlift);
EEPROM_WRITE_VAR(i,retract_recover_length);
#if EXTRUDERS > 1
EEPROM_WRITE_VAR(i,retract_recover_length_swap);
#endif
EEPROM_WRITE_VAR(i,retract_recover_feedrate);
#endif

// Save filament sizes
EEPROM_WRITE_VAR(i, volumetric_enabled);
EEPROM_WRITE_VAR(i, filament_size[0]);
#if EXTRUDERS > 1
EEPROM_WRITE_VAR(i, filament_size[1]);
#if EXTRUDERS > 2
EEPROM_WRITE_VAR(i, filament_size[2]);
#endif
#endif

char ver2[4]=EEPROM_VERSION;
i=EEPROM_OFFSET;
EEPROM_WRITE_VAR(i,ver2); // validate data
Expand Down Expand Up @@ -210,11 +227,45 @@ SERIAL_ECHOLNPGM("Scaling factors:");
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Recover: S=Extra length (mm) F:Speed (mm/m)");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M208 S",retract_recover_length);
SERIAL_ECHOPAIR(" F" ,retract_recover_feedrate*60);
SERIAL_ECHOLN("");
SERIAL_ECHOPAIR(" M208 S",retract_recover_length);
SERIAL_ECHOPAIR(" F", retract_recover_feedrate*60);
SERIAL_ECHOLN("");
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Auto-Retract: S=0 to disable, 1 to interpret extrude-only moves as retracts or recoveries");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M209 S", (unsigned long)(autoretract_enabled ? 1 : 0));
SERIAL_ECHOLN("");
#if EXTRUDERS > 1
SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Multi-extruder settings:");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" Swap retract length (mm): ", retract_length_swap);
SERIAL_ECHOLN("");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" Swap rec. addl. length (mm): ", retract_recover_length_swap);
SERIAL_ECHOLN("");
#endif
}
SERIAL_ECHO_START;
if (volumetric_enabled) {
SERIAL_ECHOLNPGM("Filament settings:");
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 D", filament_size[0]);
SERIAL_ECHOLN("");
#if EXTRUDERS > 1
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 T1 D", filament_size[1]);
SERIAL_ECHOLN("");
#if EXTRUDERS > 2
SERIAL_ECHO_START;
SERIAL_ECHOPAIR(" M200 T2 D", filament_size[2]);
SERIAL_ECHOLN("");
#endif
#endif
} else {
SERIAL_ECHOLNPGM("Filament settings: Disabled");
}
#endif
}
#endif


Expand Down Expand Up @@ -277,6 +328,30 @@ void Config_RetrieveSettings()
EEPROM_READ_VAR(i,axis_scaling);
#endif

#ifdef FWRETRACT
EEPROM_READ_VAR(i,autoretract_enabled);
EEPROM_READ_VAR(i,retract_length);
#if EXTRUDERS > 1
EEPROM_READ_VAR(i,retract_length_swap);
#endif
EEPROM_READ_VAR(i,retract_feedrate);
EEPROM_READ_VAR(i,retract_zlift);
EEPROM_READ_VAR(i,retract_recover_length);
#if EXTRUDERS > 1
EEPROM_READ_VAR(i,retract_recover_length_swap);
#endif
EEPROM_READ_VAR(i,retract_recover_feedrate);
#endif

EEPROM_READ_VAR(i, volumetric_enabled);
EEPROM_READ_VAR(i, filament_size[0]);
#if EXTRUDERS > 1
EEPROM_READ_VAR(i, filament_size[1]);
#if EXTRUDERS > 2
EEPROM_READ_VAR(i, filament_size[2]);
#endif
#endif
calculate_volumetric_multipliers();
// Call updatePID (similar to when we have processed M301)
updatePID();
SERIAL_ECHO_START;
Expand Down Expand Up @@ -353,6 +428,31 @@ void Config_ResetDefault()
#endif//PID_ADD_EXTRUSION_RATE
#endif//PIDTEMP

#ifdef FWRETRACT
autoretract_enabled = false;
retract_length = RETRACT_LENGTH;
#if EXTRUDERS > 1
retract_length_swap = RETRACT_LENGTH_SWAP;
#endif
retract_feedrate = RETRACT_FEEDRATE;
retract_zlift = RETRACT_ZLIFT;
retract_recover_length = RETRACT_RECOVER_LENGTH;
#if EXTRUDERS > 1
retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
#endif
retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
#endif

volumetric_enabled = false;
filament_size[0] = DEFAULT_NOMINAL_FILAMENT_DIA;
#if EXTRUDERS > 1
filament_size[1] = DEFAULT_NOMINAL_FILAMENT_DIA;
#if EXTRUDERS > 2
filament_size[2] = DEFAULT_NOMINAL_FILAMENT_DIA;
#endif
#endif
calculate_volumetric_multipliers();

SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");

Expand Down
16 changes: 12 additions & 4 deletions Marlin/Marlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
# include "Arduino.h"
#else
# include "WProgram.h"
//Arduino < 1.0.0 does not define this, so we need to do it ourselves
#endif

// Arduino < 1.0.0 does not define this, so we need to do it ourselves
#ifndef analogInputToDigitalPin
# define analogInputToDigitalPin(p) ((p) + A0)
#endif

Expand Down Expand Up @@ -209,7 +212,9 @@ extern float homing_feedrate[];
extern bool axis_relative_modes[];
extern int feedmultiply;
extern int extrudemultiply; // Sets extrude multiply factor (in percent) for all extruders
extern bool volumetric_enabled;
extern int extruder_multiply[EXTRUDERS]; // sets extrude multiply factor (in percent) for each extruder individually
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];
Expand Down Expand Up @@ -238,9 +243,9 @@ extern unsigned char fanSpeedSoftPwm;
#endif

#ifdef FILAMENT_SENSOR
extern float filament_width_nominal; //holds the theoretical filament diameter ie., 3.00 or 1.75
extern bool filament_sensor; //indicates that filament sensor readings should control extrusion
extern float filament_width_meas; //holds the filament diameter as accurately measured
extern float filament_width_nominal; //holds the theoretical filament diameter ie., 3.00 or 1.75
extern bool filament_sensor; //indicates that filament sensor readings should control extrusion
extern float filament_width_meas; //holds the filament diameter as accurately measured
extern signed char measurement_delay[]; //ring buffer to delay measurement
extern int delay_index1, delay_index2; //index into ring buffer
extern float delay_dist; //delay distance counter
Expand All @@ -266,3 +271,6 @@ extern void digipot_i2c_init();
#endif

#endif

extern void calculate_volumetric_multipliers();

Loading