Ver código fonte

Merge branch 'Development' of https://github.com/MarlinFirmware/Marlin into Bulgarian

AnHardt 10 anos atrás
pai
commit
e353d27430
70 arquivos alterados com 4325 adições e 2388 exclusões
  1. 0
    105
      Documentation/BedLeveling.md
  2. 0
    16
      Documentation/Compilation.md
  3. 0
    10
      Documentation/Contributing.md
  4. 0
    112
      Documentation/Features.md
  5. 0
    9
      Documentation/FilamentSensor.md
  6. 0
    193
      Documentation/GCodes.md
  7. BIN
      Documentation/LCD Menu Tree.pdf
  8. BIN
      Documentation/Menu Plans.xlsx
  9. 0
    82
      Documentation/MeshBedLeveling.md
  10. 0
    9
      Documentation/RampsServoPower.md
  11. 0
    30
      Documentation/changelog.md
  12. 7
    0
      Marlin/Conditionals.h
  13. 25
    43
      Marlin/Configuration.h
  14. 40
    15
      Marlin/Configuration_adv.h
  15. 2
    2
      Marlin/Makefile
  16. 7
    3
      Marlin/Marlin.h
  17. 779
    517
      Marlin/Marlin_main.cpp
  18. 12
    0
      Marlin/SanityCheck.h
  19. 23
    34
      Marlin/SdBaseFile.cpp
  20. 2
    0
      Marlin/boards.h
  21. 49
    27
      Marlin/cardreader.cpp
  22. 3
    3
      Marlin/configuration_store.cpp
  23. 24
    41
      Marlin/configurator/config/Configuration.h
  24. 40
    7
      Marlin/configurator/config/Configuration_adv.h
  25. 11
    10
      Marlin/configurator/config/language.h
  26. 12
    4
      Marlin/dogm_lcd_implementation.h
  27. 24
    41
      Marlin/example_configurations/Felix/Configuration.h
  28. 24
    41
      Marlin/example_configurations/Felix/Configuration_DUAL.h
  29. 40
    7
      Marlin/example_configurations/Felix/Configuration_adv.h
  30. 24
    41
      Marlin/example_configurations/Hephestos/Configuration.h
  31. 41
    8
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  32. 23
    40
      Marlin/example_configurations/K8200/Configuration.h
  33. 40
    7
      Marlin/example_configurations/K8200/Configuration_adv.h
  34. 799
    0
      Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h
  35. 25
    42
      Marlin/example_configurations/SCARA/Configuration.h
  36. 40
    7
      Marlin/example_configurations/SCARA/Configuration_adv.h
  37. 24
    41
      Marlin/example_configurations/WITBOX/Configuration.h
  38. 41
    8
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  39. 803
    0
      Marlin/example_configurations/delta/biv2.5/Configuration.h
  40. 585
    0
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  41. 24
    41
      Marlin/example_configurations/delta/generic/Configuration.h
  42. 40
    7
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  43. 24
    41
      Marlin/example_configurations/delta/kossel_mini/Configuration.h
  44. 40
    7
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  45. 24
    41
      Marlin/example_configurations/makibox/Configuration.h
  46. 40
    7
      Marlin/example_configurations/makibox/Configuration_adv.h
  47. 23
    40
      Marlin/example_configurations/tvrrug/Round2/Configuration.h
  48. 40
    7
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  49. 11
    10
      Marlin/language.h
  50. 8
    7
      Marlin/language_fr.h
  51. 0
    145
      Marlin/motion_control.cpp
  52. 0
    32
      Marlin/motion_control.h
  53. 2
    1
      Marlin/pins.h
  54. 13
    8
      Marlin/pins_MEGATRONICS_3.h
  55. 11
    0
      Marlin/pins_MKS_BASE.h
  56. 13
    12
      Marlin/pins_OMCA.h
  57. 4
    0
      Marlin/pins_RAMBO.h
  58. 8
    3
      Marlin/pins_RAMPS_13.h
  59. 4
    0
      Marlin/pins_SANGUINOLOLU_11.h
  60. 8
    7
      Marlin/planner.cpp
  61. 1
    1
      Marlin/servo.cpp
  62. 0
    0
      Marlin/servo.h
  63. 139
    164
      Marlin/stepper.cpp
  64. 3
    3
      Marlin/stepper.h
  65. 56
    46
      Marlin/temperature.cpp
  66. 4
    1
      Marlin/temperature.h
  67. 50
    32
      Marlin/ultralcd.cpp
  68. 1
    1
      Marlin/ultralcd.h
  69. 150
    144
      Marlin/ultralcd_implementation_hitachi_HD44780.h
  70. 15
    25
      README.md

+ 0
- 105
Documentation/BedLeveling.md Ver arquivo

@@ -1,105 +0,0 @@
1
-===============================================
2
-Instructions for configuring Bed Auto Leveling
3
-===============================================
4
-There are two options for this feature. You may choose to use a servo mounted on the X carriage or you may use a sled that mounts on the X axis and can be docked when not in use.
5
-See the section for each option below for specifics about installation and configuration. Also included are instructions that apply to both options.
6
-
7
-Instructions for Both Options
8
------------------------------
9
-
10
-Uncomment the "ENABLE_AUTO_BED_LEVELING" define (commented by default)
11
-
12
-The following options define the probing positions. These are good starting values.
13
-I recommend to keep a better clearance from borders in the first run and then make the probes as close as possible to borders:
14
-
15
-* \#define LEFT_PROBE_BED_POSITION 30
16
-* \#define RIGHT_PROBE_BED_POSITION 140
17
-* \#define BACK_PROBE_BED_POSITION 140
18
-* \#define FRONT_PROBE_BED_POSITION 30
19
-
20
-A few more options:
21
-
22
-* \#define XY_TRAVEL_SPEED 6000
23
-
24
-X and Y axis travel speed between probes, in mm/min.
25
-Bear in mind that really fast moves may render step skipping. 6000 mm/min (100mm/s) is a good value.
26
-
27
-* \#define Z_RAISE_BEFORE_PROBING 10
28
-* \#define Z_RAISE_BETWEEN_PROBINGS 10
29
-
30
-The Z axis is lifted when traveling to the first probe point by Z_RAISE_BEFORE_PROBING value
31
-and then lifted when traveling from first to second and second to third point by Z_RAISE_BETWEEN_PROBINGS.
32
-All values are in mm as usual.
33
-
34
-Servo Option Notes
35
-------------------
36
-You will probably need a swivel Z-MIN endstop in the extruder. A rc servo do a great job.
37
-Check the system working here: http://www.youtube.com/watch?v=3IKMeOYz-1Q (Enable English subtitles)
38
-Teasing ;-) video: http://www.youtube.com/watch?v=x8eqSQNAyro
39
-
40
-In order to get the servo working, you need to enable:
41
-
42
-* \#define NUM_SERVOS 1 // Servo index starts with 0 for M280 command
43
-
44
-* \#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
45
-
46
-* \#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 165,60} // X,Y,Z Axis Extend and Retract angles
47
-
48
-The first define tells firmware how many servos you have.
49
-The second tells what axis this servo will be attached to. In the example above, we have a servo in Z axis.
50
-The third one tells the angle in 2 situations: Probing (165º) and resting (60º). Check this with command M280 P0 S{angle} (example: M280 P0 S60 moves the servo to 60º)
51
-
52
-Next you need to define the Z endstop (probe) offset from hotend.
53
-My preferred method:
54
-
55
-* a) Make a small mark in the bed with a marker/felt-tip pen.
56
-* b) Place the hotend tip as *exactly* as possible on the mark, touching the bed. Raise the hotend 0.1mm (a regular paper thickness) and zero all axis (G92 X0 Y0 Z0);
57
-* d) Raise the hotend 10mm (or more) for probe clearance, lower the Z probe (Z-Endstop) with M401 and place it just on that mark by moving X, Y and Z;
58
-* e) Lower the Z in 0.1mm steps, with the probe always touching the mark (it may be necessary to adjust X and Y as well) until you hear the "click" meaning the mechanical endstop was trigged. You can confirm with M119;
59
-* f) Now you have the probe in the same place as your hotend tip was before. Perform a M114 and write down the values, for example: X:24.3 Y:-31.4 Z:5.1;
60
-* g) You can raise the z probe with M402 command;
61
-* h) Fill the defines bellow multiplying the values by "-1" (just change the signal)
62
-
63
-* X and Y-Offset must be Integers!
64
-* \#define X_PROBE_OFFSET_FROM_EXTRUDER -24
65
-* \#define Y_PROBE_OFFSET_FROM_EXTRUDER 31
66
-* \#define Z_PROBE_OFFSET_FROM_EXTRUDER -5.1
67
-
68
-Sled Option Notes
69
------------------
70
-The sled option uses an electromagnet to attach and detach to/from the X carriage. See http://www.thingiverse.com/thing:396692 for more details on how to print and install this feature. It uses the same connections as the servo option.
71
-
72
-To use the sled option, you must define two additional things in Configuration.h:
73
-
74
-* \#define Z_PROBE_SLED
75
-* \#define SLED_DOCKING_OFFSET 5
76
-
77
-Uncomment the Z_PROBE_SLED to define to enable the sled (commented out by default).
78
-
79
-Uncomment the SLED_DOCKING_OFFSET to set the extra distance the X axis must travel to dock the sled. This value can be found by moving the X axis to its maximum position then measure the distance to the right X end and subtract the width of the sled (23mm if you printed the sled from Thingiverse).
80
-
81
-Next you need to define the Z endstop (probe) offset from hotend.
82
-My preferred method:
83
-
84
-* a) Home the X and Y axes.
85
-* b) Move the X axis to about the center of the print bed. Make a mark on the print bed.
86
-* c) Move the Y axis to the maximum position. Make another mark.
87
-* d) Home the X axis and use a straight edge to make a line between the two points.
88
-* e) Repeat (b)-(d) reversing the X and Y. When you are done you will have two lines on the print bed. We will use these to measure the offset for the Z probe endstop.
89
-* f) Move the nozzle so that it is positioned on the center point of the two lines. You can use fine movement of 0.1mm to get it as close as possible. Note the position of X and Y.
90
-* g) Zero the Z axis with the G92 Z0 command.
91
-* h) Raise the Z axis about 20mmm.
92
-* i) Use the G32 command to retrieve the sled.
93
-* j) Now more the X and Y axis to the position recorded in (f).
94
-* k) Lower the Z axis in 0.1mm steps until you hear the "click" meaning the mechanical endstop was trigged. You can confirm with the M119 command. Note the position of the Z axis.
95
-* l) Make a mark on the print bed where the endstop lever has touched the print bed. Raise the Z-axis about 30mm to give yourself some room.
96
-* m) Now measure the distance from the center point to the endstop impact site along the X and Y axis using the lines drawn previously.
97
-* n) Fill in the values below. If the endstop mark is in front of the line running left-to-right, use positive values. If it is behind, use negative values. For the Z axis use the value from (k) and subtract 0.1mm.
98
-
99
-For example, suppose you measured the endstop position and it was 20mm to the right of the line running front-to-back, 10mm toward the front of the line running left-to-right, and the value from (k) was 2.85. The values for the defines would be:
100
-
101
-* \#define X_PROBE_OFFSET_FROM_EXTRUDER 20
102
-* \#define Y_PROBE_OFFSET_FROM_EXTRUDER 10
103
-* \#define Z_PROBE_OFFSET_FROM_EXTRUDER 2.75
104
-
105
-That's it.. enjoy never having to calibrate your Z endstop neither leveling your bed by hand anymore ;-)

+ 0
- 16
Documentation/Compilation.md Ver arquivo

@@ -1,16 +0,0 @@
1
-# Configuring and compilation
2
-
3
-  1. Install the latest non-beta arduino software IDE/toolset: http://www.arduino.cc/en/Main/Software
4
-  2. Download the Marlin firmware
5
-    - [Latest developement version](https://github.com/MarlinFirmware/Marlin/tree/Development)
6
-    - [Stable version]()
7
-  3. In both cases use the "Download Zip" button on the right.
8
-  4. Some boards require special files and/or libraries from the ArduinoAddons directory. Take a look at the dedicated [README](/ArduinoAddons/README.md) for details.
9
-  5. Start the arduino IDE.
10
-  6. Select Tools -> Board -> Arduino Mega 2560 or your microcontroller
11
-  7. Select the correct serial port in Tools ->Serial Port
12
-  8. Open Marlin.pde or .ino
13
-  9. Click the Verify/Compile button
14
-  10. Click the Upload button. If all goes well the firmware is uploading
15
-
16
-That's ok.  Enjoy Silky Smooth Printing.

+ 0
- 10
Documentation/Contributing.md Ver arquivo

@@ -1,10 +0,0 @@
1
-Developer Notes
2
-===================
3
-
4
-- There are now 2 branches: The __development__ branch is where new features and code changes will be sorted out. This branch may have untested code in it, so please let us know if you find any bugs. When the __development__ branch has reached a state where it is stable, it will be moved to the __stable__ branch.
5
-
6
-- We are doing a kind of cleanup in the list of Issues and Pull Requests, the aim is to get to a state where we can certify the code as stable. To get the code tested as widely as possible we require several volunteers with a wide variety of hardware configurations willing to test the firmware and help us to certify it as stable. If you want to help out testing go to this issue and let us know: https://github.com/MarlinFirmware/Marlin/issues/1209
7
-
8
-- Before you submit any pull request, we ask that you _PLEASE_ test your code before submission, even if the change seems innocuous. When creating the pull request, please include the hardware you used for testing and a short synopsis of your testing procedure. Untested pull requests are less likely to be merged, as even slight changes create the risk of breaking the main branch.
9
-
10
-- If you have a fix don't open an issue telling about it, but test the code and submit a pull request. Use the __development__ branch when you submit.

+ 0
- 112
Documentation/Features.md Ver arquivo

@@ -1,112 +0,0 @@
1
-# Features
2
-
3
-*   Interrupt based movement with real linear acceleration
4
-*   High steprate
5
-*   Look ahead (Keep the speed high when possible. High cornering speed)
6
-*   Interrupt based temperature protection
7
-*   Preliminary support for [Matthew Roberts Advance Algorithm](http://reprap.org/pipermail/reprap-dev/2011-May/003323.html)
8
-*   Full endstop support
9
-*   SD Card support
10
-*   SD Card folders (works in pronterface)
11
-*   SD Card autostart support
12
-*   LCD support (ideally 20x4)
13
-*   LCD menu system for autonomous SD card printing, controlled by an click-encoder.
14
-*   EEPROM storage of e.g. max-velocity, max-acceleration, and similar variables
15
-*   many small but handy things originating from bkubicek's fork.
16
-*   Arc support
17
-*   Temperature oversampling
18
-*   Dynamic Temperature setpointing aka "AutoTemp"
19
-*   Support for [QTMarlin](https://github.com/bkubicek/QTMarlin), a very beta GUI for PID-tuning and velocity-acceleration testing. 
20
-*   Endstop trigger reporting to the host software.
21
-*   Updated sdcardlib
22
-*   Heater power reporting. Useful for PID monitoring.
23
-*   PID tuning
24
-*   [CoreXY kinematics](www.corexy.com/theory.html)
25
-*   Delta kinematics
26
-*   SCARA kinematics
27
-*   Dual X-carriage support for multiple extruder systems
28
-*   Configurable serial port to support connection of wireless adaptors.
29
-*   Automatic operation of extruder/cold-end cooling fans based on nozzle temperature
30
-*   RC Servo Support, specify angle or duration for continuous rotation servos.
31
-*   Bed Auto Leveling.
32
-*   Support for a filament diameter sensor, which adjusts extrusion volume
33
-
34
-The default baudrate is 250000. This baudrate has less jitter and hence errors than the usual 115200 baud, but is less supported by drivers and host-environments.
35
-
36
-## Differences and additions to the already good Sprinter firmware
37
-
38
-### Look-ahead
39
-
40
-Marlin has look-ahead. While sprinter has to break and re-accelerate at each corner,
41
-lookahead will only decelerate and accelerate to a velocity,
42
-so that the change in vectorial velocity magnitude is less than the xy_jerk_velocity.
43
-This is only possible, if some future moves are already processed, hence the name.
44
-It leads to less over-deposition at corners, especially at flat angles.
45
-
46
-### Arc support
47
-
48
-Slic3r can find curves that, although broken into segments, were ment to describe an arc.
49
-Marlin is able to print those arcs. The advantage is the firmware can choose the resolution,
50
-and can perform the arc with nearly constant velocity, resulting in a nice finish.
51
-Also, less serial communication is needed.
52
-
53
-### Temperature Oversampling
54
-
55
-To reduce noise and make the PID-differential term more useful, 16 ADC conversion results are averaged.
56
-
57
-### AutoTemp
58
-
59
-If your gcode contains a wide spread of extruder velocities, or you realtime change the building speed, the temperature should be changed accordingly.
60
-Usually, higher speed requires higher temperature.
61
-This can now be performed by the AutoTemp function
62
-By calling M109 S<mintemp> B<maxtemp> F<factor> you enter the autotemp mode.
63
-
64
-You can leave it by calling M109 without any F.
65
-If active, the maximal extruder stepper rate of all buffered moves will be calculated, and named "maxerate" [steps/sec].
66
-The wanted temperature then will be set to t=tempmin+factor*maxerate, while being limited between tempmin and tempmax.
67
-If the target temperature is set manually or by gcode to a value less then tempmin, it will be kept without change.
68
-Ideally, your gcode can be completely free of temperature controls, apart from a M109 S T F in the start.gcode, and a M109 S0 in the end.gcode.
69
-
70
-### EEPROM
71
-
72
-If you know your PID values, the acceleration and max-velocities of your unique machine, you can set them, and finally store them in the EEPROM.
73
-After each reboot, it will magically load them from EEPROM, independent what your Configuration.h says.
74
-
75
-### LCD Menu
76
-
77
-If your hardware supports it, you can build yourself a LCD-CardReader+Click+encoder combination. It will enable you to realtime tune temperatures,
78
-accelerations, velocities, flow rates, select and print files from the SD card, preheat, disable the steppers, and do other fancy stuff.
79
-One working hardware is documented here: http://www.thingiverse.com/thing:12663
80
-Also, with just a 20x4 or 16x2 display, useful data is shown.
81
-
82
-### SD card directories
83
-
84
-If you have an SD card reader attached to your controller, also folders work now. Listing the files in pronterface will show "/path/subpath/file.g".
85
-You can write to file in a subfolder by specifying a similar text using small letters in the path.
86
-Also, backup copies of various operating systems are hidden, as well as files not ending with ".g".
87
-
88
-### Autostart
89
-
90
-If you place a file auto[0-9].g into the root of the sd card, it will be automatically executed if you boot the printer. The same file will be executed by selecting "Autostart" from the menu.
91
-First *0 will be performed, than *1 and so on. That way, you can heat up or even print automatically without user interaction.
92
-
93
-### Endstop trigger reporting
94
-
95
-If an endstop is hit while moving towards the endstop, the location at which the firmware thinks that the endstop was triggered is outputed on the serial port.
96
-This is useful, because the user gets a warning message.
97
-However, also tools like QTMarlin can use this for finding acceptable combinations of velocity+acceleration.
98
-
99
-### Coding paradigm
100
-
101
-Not relevant from a user side, but Marlin was split into thematic junks, and has tried to partially enforced private variables.
102
-This is intended to make it clearer, what interacts which what, and leads to a higher level of modularization.
103
-We think that this is a useful prestep for porting this firmware to e.g. an ARM platform in the future.
104
-A lot of RAM (with enabled LCD ~2200 bytes) was saved by storing char []="some message" in Program memory.
105
-In the serial communication, a #define based level of abstraction was enforced, so that it is clear that
106
-some transfer is information (usually beginning with "echo:"), an error "error:", or just normal protocol,
107
-necessary for backwards compatibility.
108
-
109
-### Interrupt based temperature measurements
110
-
111
-An interrupt is used to manage ADC conversions, and enforce checking for critical temperatures.
112
-This leads to less blocking in the heater management routine.

+ 0
- 9
Documentation/FilamentSensor.md Ver arquivo

@@ -1,9 +0,0 @@
1
-Filament Sensor
2
----------------
3
-Supports the use of a real time filament diameter sensor that measures the diameter of the filament going into the extruder and then adjusts the extrusion rate to compensate for filament that does not match what is defined in the g-code.  The diameter can also be displayed on the LCD screen. This potentially eliminates the need to measure filament diameter when changing spools of filament. Gcode becomes independent of the filament diameter. Can also compensate for changing diameter.
4
-
5
-For examples of these sensors, see: http://www.thingiverse.com/thing:454584, https://www.youmagine.com/designs/filament-diameter-sensor, http://diy3dprinting.blogspot.com/2014/01/diy-filament-diameter-sensor.html. Any sensor which produces a voltage equivalent to the diameter in mm (i.e. 1v = 1mm) can be used. This provides a very simple interface and may encourage more innovation in this area.
6
-
7
-4 new Mcodes are defined to set relevant parameters: M404, M405, M406, M407 - see above.
8
-
9
- Implements a delay buffer to handle the transit delay between where the filament is measured and when it gets to the extruder.

+ 0
- 193
Documentation/GCodes.md Ver arquivo

@@ -1,193 +0,0 @@
1
-## Implemented G Codes
2
-
3
-### Movement G and M Codes
4
-```
5
-G0   -> G1
6
-G1   - Coordinated Movement X Y Z E
7
-G2   - CW ARC
8
-G3   - CCW ARC
9
-G4   - Dwell S[seconds] or P[milliseconds]
10
-G92  - Set the "current position" to coordinates: X<xpos> Y<ypos> Z<zpos> E<epos>
11
-M0   - Wait for user, with optional prompt message (requires LCD controller)
12
-       M0 Click When Ready ; show "Click When Ready" until the button is pressed.
13
-M1   - Same as M0
14
-M400 - Finish all moves
15
-M999 - Restart after being stopped by error
16
-```
17
-### SD Card M Codes
18
-```
19
-M20  - List SD card
20
-M21  - Init SD card
21
-M22  - Release SD card
22
-M23  - Select SD file (M23 filename.g)
23
-M24  - Start/resume SD print
24
-M25  - Pause SD print
25
-M26  - Set SD position in bytes (M26 S12345)
26
-M27  - Report SD print status
27
-M28  - Start SD write (M28 filename.g)
28
-M29  - Stop SD write
29
-M30  - Delete file from SD (M30 filename.g)
30
-M31  - Output time since last M109 or SD card start to serial
31
-M32  - Select file and start SD print (Can be used _while_ printing from SD card files):
32
-       syntax "M32 /path/filename#", or "M32 S<startpos bytes> !filename#"
33
-       Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include).
34
-       The '#' is necessary when calling from within sd files, as it stops buffer prereading
35
-M540 - Enable/Disable "Stop SD Print on Endstop Hit" (req. ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
36
-       M540 S<0|1>
37
-M928 - Start SD logging (M928 filename.g) - ended by M29
38
-```
39
-### Hardware Control
40
-```
41
-M42  - Change pin status via gcode: P<pin> S<value>. If P is omitted the onboard LED pin will be used.
42
-       M42 P9 S1 ; set PIN 9 to 1. 
43
-M80  - Turn on Power Supply
44
-M81  - Turn off Power Supply
45
-M84  - Disable steppers until next move,
46
-       or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
47
-M85  - Set inactivity shutdown timer with parameter S<seconds>. Disable with "M85" or "M85 S0".
48
-M112 - Emergency stop. Requires hardware reset!!
49
-M226 - Wait for a pin to be in some state: P<pin number> S<pin state>
50
-```
51
-### Temperature M Codes
52
-```
53
-M104 - Set extruder target temp
54
-M105 - Read current temp
55
-M106 - Fan on
56
-M107 - Fan off
57
-M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
58
-       Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
59
-       IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
60
-M140 - Set bed target temp
61
-M190 - Sxxx Wait for bed current temp to reach target temp. Waits only when heating
62
-       Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling
63
-M301 - Set PID parameters P I and D
64
-M302 - Allow cold extrudes, or set the minimum extrude S<temperature>.
65
-M303 - PID relay autotune S<temperature> sets the target temperature. (default target temperature = 150C)
66
-M304 - Set bed PID parameters P I and D
67
-```
68
-### Message M Codes
69
-```
70
-M114 - Output current position to serial port
71
-M115 - Capabilities string
72
-M117 - Display message text on the LCD
73
-M119 - Output Endstop status to serial port
74
-```
75
-### Endstops M Codes
76
-```
77
-M120 - Enable endstop detection
78
-M121 - Disable endstop detection
79
-```
80
-### Special Features M Codes
81
-```
82
-M126 - Solenoid Air Valve Open (BariCUDA support by jmil)
83
-M127 - Solenoid Air Valve Closed (BariCUDA vent to atmospheric pressure by jmil)
84
-M128 - EtoP Open (BariCUDA EtoP = electricity to air pressure transducer by jmil)
85
-M129 - EtoP Closed (BariCUDA EtoP = electricity to air pressure transducer by jmil)
86
-M150 - Set BlinkM Color: R<red> U<green> B<blue> via I2C. Range: 0-255
87
-M240 - Trigger a camera to take a photograph. (Add to your per-layer GCode.)
88
-M250 - Set LCD contrast: C<0-63>
89
-M280 - Set servo position absolute. P<servo index> S<angle or microseconds>
90
-M300 - Play beep sound S<frequency Hz> P<duration ms>
91
-M380 - Activate solenoid on active extruder
92
-M381 - Disable all solenoids
93
-M600 - Pause for filament change X<xpos> Y<ypos> Z<lift> E<initial retract> L<later retract for removal>
94
-```
95
-### Units and Measures G and M Codes
96
-```
97
-G90  - Use Absolute Coordinates
98
-G91  - Use Relative Coordinates
99
-M82  - Set E codes absolute (default)
100
-M83  - Set E codes relative while in Absolute Coordinates (G90) mode
101
-M92  - Set axis_steps_per_unit - same syntax as G92
102
-M200 - Set filament diameter and set E axis units to mm^3 (use S0 to set back to mm).: D<mm>
103
-M201 - Set max acceleration in units/s^2 for print moves (M201 X1000 Y1000)
104
-M202 - Set max acceleration in units/s^2 for travel moves (M202 X1000 Y1000) Unused in Marlin!!
105
-M203 - Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in mm/sec
106
-M204 - Set default acceleration: P for Printing moves, R for Retract only (no X, Y, Z) moves and T for Travel (non printing) moves (ex. M204 P800 T3000 R9000) in mm/sec^2
107
-M205 - Advanced settings: minimum travel speed S=while printing T=travel only, B=minimum segment time X=maximum xy jerk, Z=maximum Z jerk, E=maximum E jerk
108
-M206 - Set additional homing offset
109
-M218 - Set hotend offset (in mm): T<extruder_number> X<offset_on_X> Y<offset_on_Y>
110
-M220 - Set speed factor override percentage: S<factor in percent>
111
-M221 - Set extrude factor override percentage: S<factor in percent>
112
-```
113
-### Firmware Retraction G and M Codes
114
-```
115
-G10  - Retract filament according to settings of M207
116
-G11  - Retract recover filament according to settings of M208
117
-M207 - Set retract length S[positive mm] F[feedrate mm/min] Z[additional zlift/hop], stays in mm regardless of M200 setting
118
-M208 - Set recover=unretract length S[positive mm surplus to the M207 S*] F[feedrate mm/s]
119
-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
120
-```
121
-### Z Probe G and M Codes
122
-```
123
-G28  - Home all Axis
124
-G29  - Detailed Z-Probe, probes the bed at 3 or more points. The printer must be homed with G28 before G29.
125
-G30  - Single Z Probe, probes bed at current XY location.
126
-G31  - Dock Z Probe sled (if enabled)
127
-G32  - Undock Z Probe sled (if enabled)
128
-M48  - Measure Z_Probe repeatability: P<points> X<xpos> Y<ypos> V<verbosity> E=engage L<legs of travel>
129
-       As with G29, the E flag causes the probe to stow after each probe.
130
-M401 - Lower Z-probe (if present)
131
-M402 - Raise Z-probe (if present)
132
-```
133
-### Filament Diameter M Codes
134
-```
135
-M404 - Set (or display) Nominal Filament Diameter in mm: [N<diameter>] (e.g., 3mm or 1.75mm)
136
-M405 - Turn on Filament Sensor extrusion control: [D<distance>] to set distance (in cm) from sensor to extruder
137
-M406 - Turn off Filament Sensor extrusion control
138
-M407 - Display measured Filament Diameter
139
-```
140
-### EEPROM Settings M Codes
141
-```
142
-M500 - Store parameters in EEPROM
143
-M501 - Read parameters from EEPROM (if you need reset them after you changed them temporarily).
144
-M502 - Revert to the default "factory settings". You still need to store them in EEPROM afterwards if you want to.
145
-M503 - Print the current settings (from memory not from EEPROM). Use S0 to leave off headings.
146
-```
147
-### Delta M Codes
148
-```
149
-M665 - Set Delta configurations: L<diagonal rod> R<delta radius> S<segments/s>
150
-M666 - Set Delta endstop adjustment: X<x-adjustment> Y<y-adjustment> Z<z-adjustment>
151
-M605 - Set dual x-carriage movement mode: S<mode> [ X<duplication x-offset> R<duplication temp offset> ]
152
-```
153
-### Stepper Driver M Codes
154
-```
155
-M17  - Enable/Power all stepper motors
156
-M18  - Disable all stepper motors. (same as M84)
157
-M907 - Set digital trimpot motor current using axis codes.
158
-M908 - Control digital trimpot directly.
159
-M350 - Set microstepping mode.
160
-M351 - Toggle MS1 MS2 pins directly.
161
-```
162
-### SCARA M-Codes
163
-__May change to suit future G-code standards__
164
-```
165
-M360 - SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
166
-M361 - SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
167
-M362 - SCARA calibration: Move to cal-position PsiA (0 deg calibration)
168
-M363 - SCARA calibration: Move to cal-position PsiB (90 deg calibration - steps per degree)
169
-M364 - SCARA calibration: Move to cal-position PSIC (90 deg to Theta calibration position)
170
-M365 - SCARA calibration: Scaling factor, X, Y, Z axis
171
-```
172
-
173
-## Comments
174
-
175
-Comments start at a `;` (semicolon) and end with the end of the line:
176
-
177
-    N3 T0*57 ; This is a comment
178
-    N4 G92 E0*67
179
-    ; So is this
180
-    N5 G28*22
181
-
182
-(example taken from the [RepRap wiki](http://reprap.org/wiki/Gcode#Comments))
183
-
184
-If you need to use a literal `;` somewhere (for example within `M117`), you can escape semicolons with a `\`
185
-(backslash):
186
-
187
-     M117 Hello \;)
188
-
189
-`\` can also be used to escape `\` itself, if you need a literal `\` in front of a `;`:
190
-
191
-    M117 backslash: \\;and a comment
192
-
193
-Please note that hosts should strip any comments before sending GCODE to the printer in order to save bandwidth.

BIN
Documentation/LCD Menu Tree.pdf Ver arquivo


BIN
Documentation/Menu Plans.xlsx Ver arquivo


+ 0
- 82
Documentation/MeshBedLeveling.md Ver arquivo

@@ -1,82 +0,0 @@
1
-==============================================
2
-Instructions for configuring Mesh Bed Leveling
3
-==============================================
4
-
5
-Background
6
-----------
7
-
8
-This mesh based method of leveling/compensating can compensate for an non-flat bed. There are various opinions about doing this. It was primarily written to compensate a RigidBot BIG bed (40x30cm) that was somewhat bent.
9
-
10
-Currently there is no automatic way to probe the bed like the Auto Bed Leveling feature. So, you can not enable `ENABLE_AUTO_BED_LEVELING` at the same time. This might soon be implemented though, stay tuned.
11
-
12
-Theory
13
-------
14
-
15
-The bed is manually probed in a grid maner. During a print the Z axis compensation will be interpolated within each square using a bi-linear method. Because the grid squares can be tilting in different directions a printing move can be split on the borders of the grid squares. During fast travel moves one can sometimes notice a de-acceleration on these borders. 
16
-
17
-Mesh point probing can either be carried out from the display, or by issuing `G29` commands.
18
-
19
-The Z-endstop should be set slightly above the bed. An opto endstop is preferable but a switch with a metal arm that allow some travel though should also work.
20
-
21
-Configuration
22
--------------
23
-
24
-In `Configuration.h` there are two options that can be enabled.
25
-
26
-`MESH_BED_LEVELING` will enable mesh bed leveling.<br/>
27
-`MANUAL_BED_LEVELING` will add the menu option for bed leveling.
28
-
29
-There are also some values that can be set.
30
-
31
-The following will set the step distance used when manually turning the display encoder. Default is 0.025
32
-
33
-`MBL_Z_STEP` 
34
-
35
-Following four define the area to cover. Default 10mm from max bed size
36
-
37
-`MESH_MIN_X`<br/>
38
-`MESH_MAX_X`<br/>
39
-`MESH_MIN_Y`<br/>
40
-`MESH_MAX_Y`
41
-
42
-Following two define the number of points to probe, total number will be these two multiplied. Default is 3x3 points. Don't probe more than 7x7 points (software limited)
43
-
44
-`MESH_NUM_X_POINTS`<br/> 
45
-`MESH_NUM_Y_POINTS`<br/>
46
-
47
-The following will set the Z-endstop height during probing. When initiating a bed leveling probing, a homing will take place and the Z-endstop will be set to this height so lowering through the endstop can take place and the bed should be within this distance. Default is 4mm
48
-
49
-`MESH_HOME_SEARCH_Z`
50
-
51
-The probed points will also be saved in the EEPROM if it has been enables. Otherwise a new probe sequence needs to be made next time the printer has been turned on.
52
-
53
-Probing the bed with the display
54
---------------------------------
55
-
56
-If `MANUAL_BED_LEVELING` has been enabled then will a `Level bed` menu option be available in the `Prepare` menu.
57
-
58
-When selecting this option the printer will first do a homing, and then travel to the first probe point. There it will wait. By turning the encoder on the display the hotend can now be lowered until it touches the bed. Using a paper to feel the distance when it gets close. Pressing the encoder/button will store this point and then travel to the next point. Repeating this until all points have been probed.
59
-
60
-If the EEPROM has been enable it can be good to issue a `M500` to get these points saved.
61
-
62
-Issuing a `G29` will return the state of the mesh leveling and report the probed points.
63
-
64
-Probing the bed with G-codes
65
-----------------------------
66
-
67
-Probing the bed by G-codes follows the sequence much like doing it with the display.
68
-
69
-`G29` or `G29 S0` will return the state of the bed leveling and report the probed points. Where X=1 Y=1 is the top-left value and X=MESH_NUM_X_POINTS Y=MESH_NUM_Y_POINTS is bottom-right value. X per column and Y per row.
70
-
71
-`G29 S1` will initiate the bed leveling, homing and traveling to the first point to probe.
72
-
73
-Then use your preferred Printer controller program, i.e. Printrun, to lower the hotend until it touches the bed. Using a paper to feel the distance when it gets close.
74
-
75
-`G29 S2` will store the point and travel to the next point until last point has been probed.
76
-
77
-`G29 S3 Xn Yn Zn.nn` will modify a single probed point. This can be used to tweak a badly probed point. Specify probe point where `Xn` and `Yn`, where `n` in `Xn` is between 1 and `MESH_NUM_X_POINTS`. Likewise for `Yn`. `Zn.nn` is the new Z value in that probed point. 
78
-
79
-Note
80
-----
81
-
82
-Depending how firm feel you aim for on the paper you can use the `Z offset` option in Slic3r to compensate a slight height diff. (I like the paper loose so I needed to put `-0.05` in Slic3r)

+ 0
- 9
Documentation/RampsServoPower.md Ver arquivo

@@ -1,9 +0,0 @@
1
-
2
-
3
-__Note for RAMPS users:__
4
-----------------------
5
-
6
--By default, RAMPS have no power on servo bus (if you happen to have a multimeter, check the voltage on servo power pins).
7
--In order to get the servo working, you need to supply 5V to 5V pin.. You can do it using your power supply (if it has a 5V output) or jumping the "Vcc" from Arduino to the 5V RAMPS rail.
8
--These 2 pins are located just between the Reset Button and the yellow fuses... There are marks in the board showing 5V and VCC.. just connect them..
9
--If jumping the arduino Vcc do RAMPS 5V rail, take care to not use a power hungry servo, otherwise you will cause a blackout in the arduino board ;-)

+ 0
- 30
Documentation/changelog.md Ver arquivo

@@ -1,30 +0,0 @@
1
-### Version 1.0.3
2
-* Reduced code size, maybe a lot depending on your configuration.
3
-* Improved support for Delta, SCARA, and COREXY kinematics.
4
-* Move parts of Configuration files to `Conditionals.h` and `SanityCheck.h`.
5
-* Clean up of temperature code.
6
-* Enhanced `G29` with improved grid bed leveling based on Roxy code. See documentation.
7
-* Various bugs fixed from 1.0.2.
8
-* EEPROM layout updated to `V17`.
9
-* Added `M204` travel acceleration options.
10
-* `M204` "`P`" parameter replaces "`S`." "`S`" retained for backward compatibility.
11
-* Support for more RAMPS-based boards.
12
-* Configurator utility under development.
13
-* `M404` "`N`" parameter replaced with "`W`." ("`N`" is for line numbers only).
14
-* Much cleanup of the code.
15
-* Improved support for Cyrillic and accented languages.
16
-* LCD controller knob acceleration.
17
-* Improved compatibility with various sensors, MAX6675 thermocouple.
18
-* Filament runout sensor support.
19
-* Filament width measurement support.
20
-* Support for TMC and L6470 stepper drivers.
21
-* Better support of G-Code `;` comments, `\`, `N` line numbers, and `*` checksums.
22
-* Moved GCode handling code into individual functions per-code.
23
-
24
-### Version 1.0.2
25
-* Progress bar for character-based LCD displays.
26
-
27
-### Version 1.0.1
28
-
29
-### Version 1.0.0
30
-* Initial release

+ 7
- 0
Marlin/Conditionals.h Ver arquivo

@@ -276,6 +276,13 @@
276 276
     #define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
277 277
   #endif
278 278
 
279
+   /**
280
+    * Sled Options
281
+    */ 
282
+  #ifdef Z_PROBE_SLED
283
+    #define Z_SAFE_HOMING
284
+  #endif
285
+  
279 286
   /**
280 287
    * MAX_STEP_FREQUENCY differs for TOSHIBA
281 288
    */

+ 25
- 43
Marlin/Configuration.h Ver arquivo

@@ -270,44 +270,24 @@ Here are some standard links for getting your machine calibrated:
270 270
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
271 271
 
272 272
 //===========================================================================
273
-//============================= Thermal Runaway Protection ==================
273
+//======================== Thermal Runaway Protection =======================
274 274
 //===========================================================================
275
-/*
276
-This is a feature to protect your printer from burn up in flames if it has
277
-a thermistor coming off place (this happened to a friend of mine recently and
278
-motivated me writing this feature).
279
-
280
-The issue: If a thermistor come off, it will read a lower temperature than actual.
281
-The system will turn the heater on forever, burning up the filament and anything
282
-else around.
283
-
284
-After the temperature reaches the target for the first time, this feature will
285
-start measuring for how long the current temperature stays below the target
286
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
287
-
288
-If it stays longer than _PERIOD, it means the thermistor temperature
289
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
290
-safe side, the system will he halt.
291
-
292
-Bear in mind the count down will just start AFTER the first time the
293
-thermistor temperature is over the target, so you will have no problem if
294
-your extruder heater takes 2 minutes to hit the target on heating.
295
-
296
-*/
297
-// If you want to enable this feature for all your extruder heaters,
298
-// uncomment the 2 defines below:
299 275
 
300
-// Parameters for all extruder heaters
301
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
302
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
303
-
304
-// If you want to enable this feature for your bed heater,
305
-// uncomment the 2 defines below:
306
-
307
-// Parameters for the bed heater
308
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
309
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
276
+/**
277
+ * Thermal Runaway Protection protects your printer from damage and fire if a
278
+ * thermistor falls out or temperature sensors fail in any way.
279
+ *
280
+ * The issue: If a thermistor falls out or a temperature sensor fails,
281
+ * Marlin can no longer sense the actual temperature. Since a disconnected
282
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
283
+ *
284
+ * The solution: Once the temperature reaches the target, start observing.
285
+ * If the temperature stays too far below the target (hysteresis) for too long,
286
+ * the firmware will halt as a safety precaution.
287
+ */
310 288
 
289
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
290
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
311 291
 
312 292
 //===========================================================================
313 293
 //============================= Mechanical Settings =========================
@@ -377,7 +357,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
377 357
 
378 358
 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
379 359
 #define INVERT_X_DIR false
380
-#define INVERT_Y_DIR false
360
+#define INVERT_Y_DIR true
381 361
 #define INVERT_Z_DIR false
382 362
 
383 363
 // @section extruder
@@ -411,17 +391,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
411 391
 #define Z_MAX_POS 200
412 392
 
413 393
 //===========================================================================
414
-//============================= Filament Runout Sensor ======================
394
+//========================= Filament Runout Sensor ==========================
415 395
 //===========================================================================
416 396
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
417 397
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
418 398
                                  // It is assumed that when logic high = filament available
419 399
                                  //                    when logic  low = filament ran out
420
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
421
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
400
+#ifdef FILAMENT_RUNOUT_SENSOR
401
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
402
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
403
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
404
+#endif 
422 405
 
423 406
 //===========================================================================
424
-//============================ Mesh Bed Leveling ============================
407
+//=========================== Manual Bed Leveling ===========================
425 408
 //===========================================================================
426 409
 
427 410
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -442,7 +425,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
442 425
 #endif  // MESH_BED_LEVELING
443 426
 
444 427
 //===========================================================================
445
-//============================= Bed Auto Leveling ===========================
428
+//============================ Bed Auto Leveling ============================
446 429
 //===========================================================================
447 430
 
448 431
 // @section bedlevel
@@ -622,10 +605,9 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
622 605
 
623 606
 #ifdef EEPROM_SETTINGS
624 607
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
625
-  #define EEPROM_CHITCHAT // please keep turned on if you can.
608
+  #define EEPROM_CHITCHAT // Please keep turned on if you can.
626 609
 #endif
627 610
 
628
-
629 611
 // @section temperature
630 612
 
631 613
 // Preheat Constants

+ 40
- 15
Marlin/Configuration_adv.h Ver arquivo

@@ -14,13 +14,27 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
25 39
 #ifdef PIDTEMP
26 40
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
@@ -31,14 +45,16 @@
31 45
   #endif
32 46
 #endif
33 47
 
34
-
35
-//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
36
-//The maximum buffered steps/sec of the extruder motor are called "se".
37
-//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
38
-// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
39
-// you exit the value by any M109 without F*
40
-// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
41
-// on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+/**
49
+ * Automatic Temperature:
50
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
51
+ * The maximum buffered steps/sec of the extruder motor is called "se".
52
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
53
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
54
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
55
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
56
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
57
+ */
42 58
 #define AUTOTEMP
43 59
 #ifdef AUTOTEMP
44 60
   #define AUTOTEMP_OLDWEIGHT 0.98
@@ -376,6 +392,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 392
 #define MAX_CMD_SIZE 96
377 393
 #define BUFSIZE 4
378 394
 
395
+// Bad Serial-connections can miss a received command by sending an 'ok'
396
+// Therefore some clients abort after 30 seconds in a timeout.
397
+// Some other clients start sending commands while receiving a 'wait'.
398
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
399
+//#define NO_TIMEOUTS 1000 // Milliseconds
400
+
401
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
402
+//#define ADVANCED_OK
403
+
379 404
 // @section fwretract
380 405
 
381 406
 // Firmware based and LCD controlled retract

+ 2
- 2
Marlin/Makefile Ver arquivo

@@ -266,8 +266,8 @@ VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
266 266
 endif
267 267
 CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp	\
268 268
 	MarlinSerial.cpp Sd2Card.cpp SdBaseFile.cpp SdFatUtil.cpp	\
269
-	SdFile.cpp SdVolume.cpp motion_control.cpp planner.cpp		\
270
-	stepper.cpp temperature.cpp cardreader.cpp configuration_store.cpp \
269
+	SdFile.cpp SdVolume.cpp planner.cpp stepper.cpp \
270
+	temperature.cpp cardreader.cpp configuration_store.cpp \
271 271
 	watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
272 272
 	vector_3.cpp qr_solve.cpp
273 273
 ifeq ($(LIQUID_TWI2), 0)

+ 7
- 3
Marlin/Marlin.h Ver arquivo

@@ -21,6 +21,10 @@
21 21
 #include "fastio.h"
22 22
 #include "Configuration.h"
23 23
 
24
+#ifndef SANITYCHECK_H
25
+  #error Your Configuration.h and Configuration_adv.h files are outdated!
26
+#endif
27
+
24 28
 #if (ARDUINO >= 100)
25 29
   #include "Arduino.h"
26 30
 #else
@@ -109,7 +113,6 @@ FORCE_INLINE void serialprintPGM(const char *str) {
109 113
 }
110 114
 
111 115
 void get_command();
112
-void process_commands();
113 116
 
114 117
 void manage_inactivity(bool ignore_stepper_queue=false);
115 118
 
@@ -195,13 +198,14 @@ void manage_inactivity(bool ignore_stepper_queue=false);
195 198
  */
196 199
 enum AxisEnum {X_AXIS=0, Y_AXIS=1, A_AXIS=0, B_AXIS=1, Z_AXIS=2, E_AXIS=3, X_HEAD=4, Y_HEAD=5};
197 200
 
201
+enum EndstopEnum {X_MIN=0, Y_MIN=1, Z_MIN=2, Z_PROBE=3, X_MAX=4, Y_MAX=5, Z_MAX=6};
202
+
198 203
 void enable_all_steppers();
199 204
 void disable_all_steppers();
200 205
 
201 206
 void FlushSerialRequestResend();
202
-void ClearToSend();
207
+void ok_to_send();
203 208
 
204
-void get_coordinates();
205 209
 #ifdef DELTA
206 210
   void calculate_delta(float cartesian[3]);
207 211
   #ifdef ENABLE_AUTO_BED_LEVELING

+ 779
- 517
Marlin/Marlin_main.cpp
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 12
- 0
Marlin/SanityCheck.h Ver arquivo

@@ -313,4 +313,16 @@
313 313
     #error [XYZ]_HOME_RETRACT_MM settings have been renamed [XYZ]_HOME_BUMP_MM
314 314
   #endif
315 315
 
316
+  #if WATCH_TEMP_PERIOD > 500
317
+    #error WATCH_TEMP_PERIOD now uses seconds instead of milliseconds
318
+  #endif
319
+
320
+  #if !defined(THERMAL_PROTECTION_HOTENDS) && (defined(WATCH_TEMP_PERIOD) || defined(THERMAL_PROTECTION_PERIOD))
321
+    #error Thermal Runaway Protection for hotends must now be enabled with THERMAL_PROTECTION_HOTENDS
322
+  #endif
323
+
324
+  #if !defined(THERMAL_PROTECTION_BED) && defined(THERMAL_PROTECTION_BED_PERIOD)
325
+    #error Thermal Runaway Protection for the bed must now be enabled with THERMAL_PROTECTION_BED
326
+  #endif
327
+
316 328
 #endif //SANITYCHECK_H

+ 23
- 34
Marlin/SdBaseFile.cpp Ver arquivo

@@ -1097,8 +1097,9 @@ int16_t SdBaseFile::read(void* buf, uint16_t nbyte) {
1097 1097
  fail:
1098 1098
   return -1;
1099 1099
 }
1100
-//------------------------------------------------------------------------------
1101
-/** Read the next directory entry from a directory file.
1100
+
1101
+/**
1102
+ * Read the next entry in a directory.
1102 1103
  *
1103 1104
  * \param[out] dir The dir_t struct that will receive the data.
1104 1105
  *
@@ -1114,50 +1115,38 @@ int8_t SdBaseFile::readDir(dir_t* dir, char* longFilename) {
1114 1115
   if (!isDir() || (0X1F & curPosition_)) return -1;
1115 1116
   
1116 1117
   //If we have a longFilename buffer, mark it as invalid. If we find a long filename it will be filled automaticly.
1117
-  if (longFilename != NULL)
1118
-  {
1119
-  	longFilename[0] = '\0';
1120
-  }
1118
+  if (longFilename != NULL) longFilename[0] = '\0';
1121 1119
 
1122 1120
   while (1) {
1121
+
1123 1122
     n = read(dir, sizeof(dir_t));
1124 1123
     if (n != sizeof(dir_t)) return n == 0 ? 0 : -1;
1124
+
1125 1125
     // last entry if DIR_NAME_FREE
1126 1126
     if (dir->name[0] == DIR_NAME_FREE) return 0;
1127
+
1127 1128
     // skip empty entries and entry for .  and ..
1128 1129
     if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue;
1129
-    //Fill the long filename if we have a long filename entry,
1130
-	// long filename entries are stored before the actual filename.
1131
-	if (DIR_IS_LONG_NAME(dir) && longFilename != NULL)
1132
-    {
1133
-    	vfat_t *VFAT = (vfat_t*)dir;
1134
-		//Sanity check the VFAT entry. The first cluster is always set to zero. And th esequence number should be higher then 0
1135
-    	if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES)
1136
-    	{
1137
-			//TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1138
-    		n = ((VFAT->sequenceNumber & 0x1F) - 1) * FILENAME_LENGTH;
1139
-			longFilename[n+0] = VFAT->name1[0];
1140
-			longFilename[n+1] = VFAT->name1[1];
1141
-			longFilename[n+2] = VFAT->name1[2];
1142
-			longFilename[n+3] = VFAT->name1[3];
1143
-			longFilename[n+4] = VFAT->name1[4];
1144
-			longFilename[n+5] = VFAT->name2[0];
1145
-			longFilename[n+6] = VFAT->name2[1];
1146
-			longFilename[n+7] = VFAT->name2[2];
1147
-			longFilename[n+8] = VFAT->name2[3];
1148
-			longFilename[n+9] = VFAT->name2[4];
1149
-			longFilename[n+10] = VFAT->name2[5];
1150
-			longFilename[n+11] = VFAT->name3[0];
1151
-			longFilename[n+12] = VFAT->name3[1];
1152
-			//If this VFAT entry is the last one, add a NUL terminator at the end of the string
1153
-			if (VFAT->sequenceNumber & 0x40)
1154
-				longFilename[n+FILENAME_LENGTH] = '\0';
1155
-		}
1130
+
1131
+    // Fill the long filename if we have a long filename entry.
1132
+    // Long filename entries are stored before the short filename.
1133
+    if (longFilename != NULL && DIR_IS_LONG_NAME(dir)) {
1134
+      vfat_t *VFAT = (vfat_t*)dir;
1135
+      // Sanity-check the VFAT entry. The first cluster is always set to zero. And the sequence number should be higher than 0
1136
+      if (VFAT->firstClusterLow == 0 && (VFAT->sequenceNumber & 0x1F) > 0 && (VFAT->sequenceNumber & 0x1F) <= MAX_VFAT_ENTRIES) {
1137
+        // TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table.
1138
+        n = ((VFAT->sequenceNumber & 0x1F) - 1) * FILENAME_LENGTH;
1139
+        for (uint8_t i=0; i<FILENAME_LENGTH; i++)
1140
+          longFilename[n+i] = (i < 5) ? VFAT->name1[i] : (i < 11) ? VFAT->name2[i-5] : VFAT->name3[i-11];
1141
+        // If this VFAT entry is the last one, add a NUL terminator at the end of the string
1142
+        if (VFAT->sequenceNumber & 0x40) longFilename[n+FILENAME_LENGTH] = '\0';
1143
+      }
1156 1144
     }
1157
-    // return if normal file or subdirectory
1145
+    // Return if normal file or subdirectory
1158 1146
     if (DIR_IS_FILE_OR_SUBDIR(dir)) return n;
1159 1147
   }
1160 1148
 }
1149
+
1161 1150
 //------------------------------------------------------------------------------
1162 1151
 // Read next directory entry into the cache
1163 1152
 // Assumes file is correctly positioned

+ 2
- 0
Marlin/boards.h Ver arquivo

@@ -14,6 +14,7 @@
14 14
 #define BOARD_RAMPS_13_EEB      34   // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Bed)
15 15
 #define BOARD_RAMPS_13_EFF      35   // RAMPS 1.3 / 1.4 (Power outputs: Extruder, Fan, Fan)
16 16
 #define BOARD_RAMPS_13_EEF      36   // RAMPS 1.3 / 1.4 (Power outputs: Extruder0, Extruder1, Fan)
17
+#define BOARD_RAMPS_13_SF       38   // RAMPS 1.3 / 1.4 (Power outputs: Spindle, Controller Fan)
17 18
 #define BOARD_FELIX2            37   // Felix 2.0+ Electronics Board (RAMPS like)
18 19
 #define BOARD_DUEMILANOVE_328P  4    // Duemilanove w/ ATMega328P pin assignments
19 20
 #define BOARD_GEN6              5    // Gen6
@@ -50,6 +51,7 @@
50 51
 #define BOARD_ELEFU_3           21   // Elefu Ra Board (v3)
51 52
 #define BOARD_5DPRINT           88   // 5DPrint D8 Driver Board
52 53
 #define BOARD_LEAPFROG          999  // Leapfrog
54
+#define BOARD_MKS_BASE          40   // MKS BASE 1.0
53 55
 #define BOARD_WITBOX            41   // bq WITBOX
54 56
 #define BOARD_HEPHESTOS         42   // bq Prusa i3 Hephestos
55 57
 #define BOARD_BAM_DICE          401  // 2PrintBeta BAM&DICE with STK drivers

+ 49
- 27
Marlin/cardreader.cpp Ver arquivo

@@ -20,6 +20,7 @@ CardReader::CardReader() {
20 20
 
21 21
   autostart_stilltocheck = true; //the SD start is delayed, because otherwise the serial cannot answer fast enough to make contact with the host software.
22 22
   autostart_index = 0;
23
+
23 24
   //power to SD reader
24 25
   #if SDPOWER > -1
25 26
     OUT_WRITE(SDPOWER, HIGH);
@@ -39,24 +40,43 @@ char *createFilename(char *buffer, const dir_t &p) { //buffer > 12characters
39 40
   return buffer;
40 41
 }
41 42
 
43
+/**
44
+ * Dive into a folder and recurse depth-first to perform a pre-set operation lsAction:
45
+ *   LS_Count       - Add +1 to nrFiles for every file within the parent
46
+ *   LS_GetFilename - Get the filename of the file indexed by nrFiles
47
+ *   LS_SerialPrint - Print the full path of each file to serial output
48
+ */
42 49
 void CardReader::lsDive(const char *prepend, SdFile parent, const char * const match/*=NULL*/) {
43 50
   dir_t p;
44 51
   uint8_t cnt = 0;
45 52
 
53
+  // Read the next entry from a directory
46 54
   while (parent.readDir(p, longFilename) > 0) {
47
-    if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) { // hence LS_SerialPrint
48
-      char path[FILENAME_LENGTH*2];
55
+
56
+    // If the entry is a directory and the action is LS_SerialPrint
57
+    if (DIR_IS_SUBDIR(&p) && lsAction != LS_Count && lsAction != LS_GetFilename) {
58
+
59
+      // Allocate enough stack space for the full path to a folder
60
+      int len = strlen(prepend) + FILENAME_LENGTH + 1;
61
+      char path[len];
62
+
63
+      // Get the short name for the item, which we know is a folder
49 64
       char lfilename[FILENAME_LENGTH];
50 65
       createFilename(lfilename, p);
51 66
 
52
-      path[0] = 0;
53
-      if (prepend[0] == 0) strcat(path, "/"); //avoid leading / if already in prepend
67
+      // Append the FOLDERNAME12/ to the passed string.
68
+      // It contains the full path to the "parent" argument.
69
+      // We now have the full path to the item in this folder.
70
+      path[0] = '\0';
71
+      if (prepend[0] == '\0') strcat(path, "/"); // a root slash if prepend is empty
54 72
       strcat(path, prepend);
55 73
       strcat(path, lfilename);
56 74
       strcat(path, "/");
57 75
 
58
-      //Serial.print(path);
76
+      // Serial.print(path);
59 77
 
78
+      // Get a new directory object using the full path
79
+      // and dive recursively into it.
60 80
       SdFile dir;
61 81
       if (!dir.open(parent, lfilename, O_READ)) {
62 82
         if (lsAction == LS_SerialPrint) {
@@ -66,14 +86,13 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
66 86
         }
67 87
       }
68 88
       lsDive(path, dir);
69
-      //close done automatically by destructor of SdFile
89
+      // close() is done automatically by destructor of SdFile
70 90
     }
71 91
     else {
72 92
       char pn0 = p.name[0];
73 93
       if (pn0 == DIR_NAME_FREE) break;
74 94
       if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue;
75
-      char lf0 = longFilename[0];
76
-      if (lf0 == '.') continue;
95
+      if (longFilename[0] == '.') continue;
77 96
 
78 97
       if (!DIR_IS_FILE_OR_SUBDIR(&p)) continue;
79 98
 
@@ -81,24 +100,27 @@ void CardReader::lsDive(const char *prepend, SdFile parent, const char * const m
81 100
 
82 101
       if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue;
83 102
 
84
-      //if (cnt++ != nr) continue;
85
-      createFilename(filename, p);
86
-      if (lsAction == LS_SerialPrint) {
87
-        SERIAL_PROTOCOL(prepend);
88
-        SERIAL_PROTOCOLLN(filename);
89
-      }
90
-      else if (lsAction == LS_Count) {
91
-        nrFiles++;
92
-      }
93
-      else if (lsAction == LS_GetFilename) {
94
-        if (match != NULL) {
95
-          if (strcasecmp(match, filename) == 0) return;
96
-        }
97
-        else if (cnt == nrFiles) return;
98
-        cnt++;
103
+      switch (lsAction) {
104
+        case LS_Count:
105
+          nrFiles++;
106
+          break;
107
+        case LS_SerialPrint:
108
+          createFilename(filename, p);
109
+          SERIAL_PROTOCOL(prepend);
110
+          SERIAL_PROTOCOLLN(filename);
111
+          break;
112
+        case LS_GetFilename:
113
+          createFilename(filename, p);
114
+          if (match != NULL) {
115
+            if (strcasecmp(match, filename) == 0) return;
116
+          }
117
+          else if (cnt == nrFiles) return;
118
+          cnt++;
119
+          break;
99 120
       }
121
+
100 122
     }
101
-  }
123
+  } // while readDir
102 124
 }
103 125
 
104 126
 void CardReader::ls()  {
@@ -237,7 +259,7 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
237 259
   char *dirname_start, *dirname_end;
238 260
   if (name[0] == '/') {
239 261
     dirname_start = &name[1];
240
-    while(dirname_start > 0) {
262
+    while (dirname_start > 0) {
241 263
       dirname_end = strchr(dirname_start, '/');
242 264
       //SERIAL_ECHO("start:");SERIAL_ECHOLN((int)(dirname_start - name));
243 265
       //SERIAL_ECHO("end  :");SERIAL_ECHOLN((int)(dirname_end - name));
@@ -287,14 +309,14 @@ void CardReader::openFile(char* name, bool read, bool replace_current/*=true*/)
287 309
     else {
288 310
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
289 311
       SERIAL_PROTOCOL(fname);
290
-      SERIAL_PROTOCOLCHAR('.');
312
+      SERIAL_PROTOCOLPGM(".\n");
291 313
     }
292 314
   }
293 315
   else { //write
294 316
     if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)) {
295 317
       SERIAL_PROTOCOLPGM(MSG_SD_OPEN_FILE_FAIL);
296 318
       SERIAL_PROTOCOL(fname);
297
-      SERIAL_PROTOCOLCHAR('.');
319
+      SERIAL_PROTOCOLPGM(".\n");
298 320
     }
299 321
     else {
300 322
       saving = true;

+ 3
- 3
Marlin/configuration_store.cpp Ver arquivo

@@ -676,9 +676,9 @@ void Config_PrintSettings(bool forReplay) {
676 676
       SERIAL_ECHOLNPGM("Mesh bed leveling:");
677 677
       CONFIG_ECHO_START;
678 678
     }
679
-    SERIAL_ECHOPAIR("  M420 S", (int32_t)mbl.active);
680
-    SERIAL_ECHOPAIR(" X", MESH_NUM_X_POINTS);
681
-    SERIAL_ECHOPAIR(" Y", MESH_NUM_Y_POINTS);
679
+    SERIAL_ECHOPAIR("  M420 S", (unsigned long)mbl.active);
680
+    SERIAL_ECHOPAIR(" X", (unsigned long)MESH_NUM_X_POINTS);
681
+    SERIAL_ECHOPAIR(" Y", (unsigned long)MESH_NUM_Y_POINTS);
682 682
     SERIAL_EOL;
683 683
     for (int y=0; y<MESH_NUM_Y_POINTS; y++) {
684 684
       for (int x=0; x<MESH_NUM_X_POINTS; x++) {

+ 24
- 41
Marlin/configurator/config/Configuration.h Ver arquivo

@@ -270,44 +270,24 @@ Here are some standard links for getting your machine calibrated:
270 270
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
271 271
 
272 272
 //===========================================================================
273
-//============================= Thermal Runaway Protection ==================
273
+//======================== Thermal Runaway Protection =======================
274 274
 //===========================================================================
275
-/*
276
-This is a feature to protect your printer from burn up in flames if it has
277
-a thermistor coming off place (this happened to a friend of mine recently and
278
-motivated me writing this feature).
279
-
280
-The issue: If a thermistor come off, it will read a lower temperature than actual.
281
-The system will turn the heater on forever, burning up the filament and anything
282
-else around.
283
-
284
-After the temperature reaches the target for the first time, this feature will
285
-start measuring for how long the current temperature stays below the target
286
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
287
-
288
-If it stays longer than _PERIOD, it means the thermistor temperature
289
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
290
-safe side, the system will he halt.
291
-
292
-Bear in mind the count down will just start AFTER the first time the
293
-thermistor temperature is over the target, so you will have no problem if
294
-your extruder heater takes 2 minutes to hit the target on heating.
295
-
296
-*/
297
-// If you want to enable this feature for all your extruder heaters,
298
-// uncomment the 2 defines below:
299 275
 
300
-// Parameters for all extruder heaters
301
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
302
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
303
-
304
-// If you want to enable this feature for your bed heater,
305
-// uncomment the 2 defines below:
306
-
307
-// Parameters for the bed heater
308
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
309
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
276
+/**
277
+ * Thermal Runaway Protection protects your printer from damage and fire if a
278
+ * thermistor falls out or temperature sensors fail in any way.
279
+ *
280
+ * The issue: If a thermistor falls out or a temperature sensor fails,
281
+ * Marlin can no longer sense the actual temperature. Since a disconnected
282
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
283
+ *
284
+ * The solution: Once the temperature reaches the target, start observing.
285
+ * If the temperature stays too far below the target (hysteresis) for too long,
286
+ * the firmware will halt as a safety precaution.
287
+ */
310 288
 
289
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
290
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
311 291
 
312 292
 //===========================================================================
313 293
 //============================= Mechanical Settings =========================
@@ -377,7 +357,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
377 357
 
378 358
 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
379 359
 #define INVERT_X_DIR false
380
-#define INVERT_Y_DIR false
360
+#define INVERT_Y_DIR true
381 361
 #define INVERT_Z_DIR false
382 362
 
383 363
 // @section extruder
@@ -411,17 +391,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
411 391
 #define Z_MAX_POS 200
412 392
 
413 393
 //===========================================================================
414
-//============================= Filament Runout Sensor ======================
394
+//========================= Filament Runout Sensor ==========================
415 395
 //===========================================================================
416 396
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
417 397
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
418 398
                                  // It is assumed that when logic high = filament available
419 399
                                  //                    when logic  low = filament ran out
420
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
421
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
400
+#ifdef FILAMENT_RUNOUT_SENSOR
401
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
402
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
403
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
404
+#endif
422 405
 
423 406
 //===========================================================================
424
-//============================ Manual Bed Leveling ==========================
407
+//=========================== Manual Bed Leveling ===========================
425 408
 //===========================================================================
426 409
 
427 410
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -442,7 +425,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
442 425
 #endif  // MESH_BED_LEVELING
443 426
 
444 427
 //===========================================================================
445
-//============================= Bed Auto Leveling ===========================
428
+//============================ Bed Auto Leveling ============================
446 429
 //===========================================================================
447 430
 
448 431
 // @section bedlevel

+ 40
- 7
Marlin/configurator/config/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 11
- 10
Marlin/configurator/config/language.h Ver arquivo

@@ -30,6 +30,7 @@
30 30
 // eu       Basque-Euskera
31 31
 // kana     Japanese
32 32
 // kana_utf Japanese
33
+// cn       Chinese
33 34
 
34 35
 #ifndef LANGUAGE_INCLUDE
35 36
   // pick your language from the list above
@@ -122,21 +123,22 @@
122 123
 #define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
123 124
 #define MSG_OK                              "ok"
124 125
 #define MSG_FILE_SAVED                      "Done saving file."
125
-#define MSG_ERR_LINE_NO1                    "Line Number out of sequence. Expected: "
126
-#define MSG_ERR_LINE_NO2                    " Got: "
126
+#define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
127 127
 #define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "
128 128
 #define MSG_ERR_NO_CHECKSUM                 "No Checksum with line number, Last Line: "
129 129
 #define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No Line Number with checksum, Last Line: "
130 130
 #define MSG_FILE_PRINTED                    "Done printing file"
131 131
 #define MSG_BEGIN_FILE_LIST                 "Begin file list"
132 132
 #define MSG_END_FILE_LIST                   "End file list"
133
-#define MSG_M104_INVALID_EXTRUDER           "M104 Invalid extruder "
134
-#define MSG_M105_INVALID_EXTRUDER           "M105 Invalid extruder "
135
-#define MSG_M200_INVALID_EXTRUDER           "M200 Invalid extruder "
136
-#define MSG_M218_INVALID_EXTRUDER           "M218 Invalid extruder "
137
-#define MSG_M221_INVALID_EXTRUDER           "M221 Invalid extruder "
133
+#define MSG_INVALID_EXTRUDER                "Invalid extruder"
134
+#define MSG_INVALID_SOLENOID                "Invalid solenoid"
135
+#define MSG_M104_INVALID_EXTRUDER           "M104 " MSG_INVALID_EXTRUDER " "
136
+#define MSG_M105_INVALID_EXTRUDER           "M105 " MSG_INVALID_EXTRUDER " "
137
+#define MSG_M109_INVALID_EXTRUDER           "M109 " MSG_INVALID_EXTRUDER " "
138
+#define MSG_M200_INVALID_EXTRUDER           "M200 " MSG_INVALID_EXTRUDER " "
139
+#define MSG_M218_INVALID_EXTRUDER           "M218 " MSG_INVALID_EXTRUDER " "
140
+#define MSG_M221_INVALID_EXTRUDER           "M221 " MSG_INVALID_EXTRUDER " "
138 141
 #define MSG_ERR_NO_THERMISTORS              "No thermistors - no temperature"
139
-#define MSG_M109_INVALID_EXTRUDER           "M109 Invalid extruder "
140 142
 #define MSG_HEATING                         "Heating..."
141 143
 #define MSG_HEATING_COMPLETE                "Heating done."
142 144
 #define MSG_BED_HEATING                     "Bed Heating."
@@ -148,8 +150,6 @@
148 150
 #define MSG_RESEND                          "Resend: "
149 151
 #define MSG_UNKNOWN_COMMAND                 "Unknown command: \""
150 152
 #define MSG_ACTIVE_EXTRUDER                 "Active Extruder: "
151
-#define MSG_INVALID_EXTRUDER                "Invalid extruder"
152
-#define MSG_INVALID_SOLENOID                "Invalid solenoid"
153 153
 #define MSG_X_MIN                           "x_min: "
154 154
 #define MSG_X_MAX                           "x_max: "
155 155
 #define MSG_Y_MIN                           "y_min: "
@@ -161,6 +161,7 @@
161 161
 #define MSG_ERR_MATERIAL_INDEX              "M145 S<index> out of range (0-1)"
162 162
 #define MSG_ERR_M421_REQUIRES_XYZ           "M421 requires XYZ parameters"
163 163
 #define MSG_ERR_MESH_INDEX_OOB              "Mesh XY index is out of bounds"
164
+#define MSG_ERR_M428_TOO_FAR                "Too far from reference point"
164 165
 #define MSG_M119_REPORT                     "Reporting endstop status"
165 166
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
166 167
 #define MSG_ENDSTOP_OPEN                    "open"

+ 12
- 4
Marlin/dogm_lcd_implementation.h Ver arquivo

@@ -273,7 +273,6 @@ static void lcd_implementation_status_screen() {
273 273
     u8g.drawFrame(42, 49 - TALL_FONT_CORRECTION, 10, 4);
274 274
     u8g.drawPixel(50, 43 - TALL_FONT_CORRECTION);
275 275
 
276
-
277 276
     // Progress bar frame
278 277
     u8g.drawFrame(54, 49, 73, 4 - TALL_FONT_CORRECTION);
279 278
 
@@ -333,19 +332,28 @@ static void lcd_implementation_status_screen() {
333 332
   u8g.drawPixel(8,XYZ_BASELINE - 5);
334 333
   u8g.drawPixel(8,XYZ_BASELINE - 3);
335 334
   u8g.setPrintPos(10,XYZ_BASELINE);
336
-  lcd_print(ftostr31ns(current_position[X_AXIS]));
335
+  if (axis_known_position[X_AXIS])
336
+    lcd_print(ftostr31ns(current_position[X_AXIS]));
337
+  else
338
+    lcd_printPGM(PSTR("---"));
337 339
   u8g.setPrintPos(43,XYZ_BASELINE);
338 340
   lcd_print('Y');
339 341
   u8g.drawPixel(49,XYZ_BASELINE - 5);
340 342
   u8g.drawPixel(49,XYZ_BASELINE - 3);
341 343
   u8g.setPrintPos(51,XYZ_BASELINE);
342
-  lcd_print(ftostr31ns(current_position[Y_AXIS]));
344
+  if (axis_known_position[Y_AXIS])
345
+    lcd_print(ftostr31ns(current_position[Y_AXIS]));
346
+  else
347
+    lcd_printPGM(PSTR("---"));
343 348
   u8g.setPrintPos(83,XYZ_BASELINE);
344 349
   lcd_print('Z');
345 350
   u8g.drawPixel(89,XYZ_BASELINE - 5);
346 351
   u8g.drawPixel(89,XYZ_BASELINE - 3);
347 352
   u8g.setPrintPos(91,XYZ_BASELINE);
348
-  lcd_print(ftostr31(current_position[Z_AXIS]));
353
+  if (axis_known_position[Z_AXIS])
354
+    lcd_print(ftostr32sp(current_position[Z_AXIS]));
355
+  else
356
+    lcd_printPGM(PSTR("---.--"));
349 357
   u8g.setColorIndex(1); // black on white
350 358
  
351 359
   // Feedrate

+ 24
- 41
Marlin/example_configurations/Felix/Configuration.h Ver arquivo

@@ -236,44 +236,24 @@ Here are some standard links for getting your machine calibrated:
236 236
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
237 237
 
238 238
 //===========================================================================
239
-//============================= Thermal Runaway Protection ==================
239
+//======================== Thermal Runaway Protection =======================
240 240
 //===========================================================================
241
-/*
242
-This is a feature to protect your printer from burn up in flames if it has
243
-a thermistor coming off place (this happened to a friend of mine recently and
244
-motivated me writing this feature).
245
-
246
-The issue: If a thermistor come off, it will read a lower temperature than actual.
247
-The system will turn the heater on forever, burning up the filament and anything
248
-else around.
249
-
250
-After the temperature reaches the target for the first time, this feature will
251
-start measuring for how long the current temperature stays below the target
252
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
253
-
254
-If it stays longer than _PERIOD, it means the thermistor temperature
255
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
256
-safe side, the system will he halt.
257
-
258
-Bear in mind the count down will just start AFTER the first time the
259
-thermistor temperature is over the target, so you will have no problem if
260
-your extruder heater takes 2 minutes to hit the target on heating.
261
-
262
-*/
263
-// If you want to enable this feature for all your extruder heaters,
264
-// uncomment the 2 defines below:
265 241
 
266
-// Parameters for all extruder heaters
267
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
268
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
269
-
270
-// If you want to enable this feature for your bed heater,
271
-// uncomment the 2 defines below:
272
-
273
-// Parameters for the bed heater
274
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
275
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
242
+/**
243
+ * Thermal Runaway Protection protects your printer from damage and fire if a
244
+ * thermistor falls out or temperature sensors fail in any way.
245
+ *
246
+ * The issue: If a thermistor falls out or a temperature sensor fails,
247
+ * Marlin can no longer sense the actual temperature. Since a disconnected
248
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
249
+ *
250
+ * The solution: Once the temperature reaches the target, start observing.
251
+ * If the temperature stays too far below the target (hysteresis) for too long,
252
+ * the firmware will halt as a safety precaution.
253
+ */
276 254
 
255
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
256
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
277 257
 
278 258
 //===========================================================================
279 259
 //============================= Mechanical Settings =========================
@@ -350,17 +330,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
350 330
 #define Z_MAX_POS 235
351 331
 
352 332
 //===========================================================================
353
-//============================= Filament Runout Sensor ======================
333
+//========================= Filament Runout Sensor ==========================
354 334
 //===========================================================================
355 335
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
356 336
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
357 337
                                  // It is assumed that when logic high = filament available
358 338
                                  //                    when logic  low = filament ran out
359
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
360
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
361
-
339
+#ifdef FILAMENT_RUNOUT_SENSOR
340
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
341
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
342
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
343
+#endif 
344
+  
362 345
 //===========================================================================
363
-//============================ Manual Bed Leveling ==========================
346
+//=========================== Manual Bed Leveling ===========================
364 347
 //===========================================================================
365 348
 
366 349
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -381,7 +364,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
381 364
 #endif  // MESH_BED_LEVELING
382 365
 
383 366
 //===========================================================================
384
-//============================= Bed Auto Leveling ===========================
367
+//============================ Bed Auto Leveling ============================
385 368
 //===========================================================================
386 369
 
387 370
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 24
- 41
Marlin/example_configurations/Felix/Configuration_DUAL.h Ver arquivo

@@ -236,44 +236,24 @@ Here are some standard links for getting your machine calibrated:
236 236
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
237 237
 
238 238
 //===========================================================================
239
-//============================= Thermal Runaway Protection ==================
239
+//======================== Thermal Runaway Protection =======================
240 240
 //===========================================================================
241
-/*
242
-This is a feature to protect your printer from burn up in flames if it has
243
-a thermistor coming off place (this happened to a friend of mine recently and
244
-motivated me writing this feature).
245
-
246
-The issue: If a thermistor come off, it will read a lower temperature than actual.
247
-The system will turn the heater on forever, burning up the filament and anything
248
-else around.
249
-
250
-After the temperature reaches the target for the first time, this feature will
251
-start measuring for how long the current temperature stays below the target
252
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
253
-
254
-If it stays longer than _PERIOD, it means the thermistor temperature
255
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
256
-safe side, the system will he halt.
257
-
258
-Bear in mind the count down will just start AFTER the first time the
259
-thermistor temperature is over the target, so you will have no problem if
260
-your extruder heater takes 2 minutes to hit the target on heating.
261
-
262
-*/
263
-// If you want to enable this feature for all your extruder heaters,
264
-// uncomment the 2 defines below:
265 241
 
266
-// Parameters for all extruder heaters
267
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
268
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
269
-
270
-// If you want to enable this feature for your bed heater,
271
-// uncomment the 2 defines below:
272
-
273
-// Parameters for the bed heater
274
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
275
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
242
+/**
243
+ * Thermal Runaway Protection protects your printer from damage and fire if a
244
+ * thermistor falls out or temperature sensors fail in any way.
245
+ *
246
+ * The issue: If a thermistor falls out or a temperature sensor fails,
247
+ * Marlin can no longer sense the actual temperature. Since a disconnected
248
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
249
+ *
250
+ * The solution: Once the temperature reaches the target, start observing.
251
+ * If the temperature stays too far below the target (hysteresis) for too long,
252
+ * the firmware will halt as a safety precaution.
253
+ */
276 254
 
255
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
256
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
277 257
 
278 258
 //===========================================================================
279 259
 //============================= Mechanical Settings =========================
@@ -350,17 +330,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
350 330
 #define Z_MAX_POS 235
351 331
 
352 332
 //===========================================================================
353
-//============================= Filament Runout Sensor ======================
333
+//========================= Filament Runout Sensor ==========================
354 334
 //===========================================================================
355 335
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
356 336
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
357 337
                                  // It is assumed that when logic high = filament available
358 338
                                  //                    when logic  low = filament ran out
359
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
360
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
361
-
339
+#ifdef FILAMENT_RUNOUT_SENSOR
340
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
341
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
342
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
343
+#endif 
344
+  
362 345
 //===========================================================================
363
-//============================ Manual Bed Leveling ==========================
346
+//=========================== Manual Bed Leveling ===========================
364 347
 //===========================================================================
365 348
 
366 349
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -377,7 +360,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
377 360
 #endif  // MESH_BED_LEVELING
378 361
 
379 362
 //===========================================================================
380
-//============================= Bed Auto Leveling ===========================
363
+//============================ Bed Auto Leveling ============================
381 364
 //===========================================================================
382 365
 
383 366
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 40
- 7
Marlin/example_configurations/Felix/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 24
- 41
Marlin/example_configurations/Hephestos/Configuration.h Ver arquivo

@@ -257,44 +257,24 @@ Here are some standard links for getting your machine calibrated:
257 257
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
258 258
 
259 259
 //===========================================================================
260
-//============================= Thermal Runaway Protection ==================
260
+//======================== Thermal Runaway Protection =======================
261 261
 //===========================================================================
262
-/*
263
-This is a feature to protect your printer from burn up in flames if it has
264
-a thermistor coming off place (this happened to a friend of mine recently and
265
-motivated me writing this feature).
266
-
267
-The issue: If a thermistor come off, it will read a lower temperature than actual.
268
-The system will turn the heater on forever, burning up the filament and anything
269
-else around.
270
-
271
-After the temperature reaches the target for the first time, this feature will
272
-start measuring for how long the current temperature stays below the target
273
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
274
-
275
-If it stays longer than _PERIOD, it means the thermistor temperature
276
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
277
-safe side, the system will he halt.
278
-
279
-Bear in mind the count down will just start AFTER the first time the
280
-thermistor temperature is over the target, so you will have no problem if
281
-your extruder heater takes 2 minutes to hit the target on heating.
282
-
283
-*/
284
-// If you want to enable this feature for all your extruder heaters,
285
-// uncomment the 2 defines below:
286 262
 
287
-// Parameters for all extruder heaters
288
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
289
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
290
-
291
-// If you want to enable this feature for your bed heater,
292
-// uncomment the 2 defines below:
293
-
294
-// Parameters for the bed heater
295
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
296
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
263
+/**
264
+ * Thermal Runaway Protection protects your printer from damage and fire if a
265
+ * thermistor falls out or temperature sensors fail in any way.
266
+ *
267
+ * The issue: If a thermistor falls out or a temperature sensor fails,
268
+ * Marlin can no longer sense the actual temperature. Since a disconnected
269
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
270
+ *
271
+ * The solution: Once the temperature reaches the target, start observing.
272
+ * If the temperature stays too far below the target (hysteresis) for too long,
273
+ * the firmware will halt as a safety precaution.
274
+ */
297 275
 
276
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
277
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
298 278
 
299 279
 //===========================================================================
300 280
 //============================= Mechanical Settings =========================
@@ -371,17 +351,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
371 351
 #define Z_MAX_POS 180
372 352
 
373 353
 //===========================================================================
374
-//============================= Filament Runout Sensor ======================
354
+//========================= Filament Runout Sensor ==========================
375 355
 //===========================================================================
376 356
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
377 357
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
378 358
                                  // It is assumed that when logic high = filament available
379 359
                                  //                    when logic  low = filament ran out
380
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
381
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
382
-
360
+#ifdef FILAMENT_RUNOUT_SENSOR
361
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
362
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
363
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
364
+#endif 
365
+  
383 366
 //===========================================================================
384
-//============================ Manual Bed Leveling ==========================
367
+//=========================== Manual Bed Leveling ===========================
385 368
 //===========================================================================
386 369
 
387 370
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -402,7 +385,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
402 385
 #endif  // MESH_BED_LEVELING
403 386
 
404 387
 //===========================================================================
405
-//============================= Bed Auto Leveling ===========================
388
+//============================ Bed Auto Leveling ============================
406 389
 //===========================================================================
407 390
 
408 391
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 41
- 8
Marlin/example_configurations/Hephestos/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -374,7 +398,16 @@ const unsigned int dropsegments=5; //everything with less than this number of st
374 398
 
375 399
 //The ASCII buffer for receiving from the serial:
376 400
 #define MAX_CMD_SIZE 96
377
-#define BUFSIZE 5
401
+#define BUFSIZE 4
402
+
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
378 411
 
379 412
 // @section fwretract
380 413
 

+ 23
- 40
Marlin/example_configurations/K8200/Configuration.h Ver arquivo

@@ -286,44 +286,24 @@ Here are some standard links for getting your machine calibrated:
286 286
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
287 287
 
288 288
 //===========================================================================
289
-//============================= Thermal Runaway Protection ==================
289
+//======================== Thermal Runaway Protection =======================
290 290
 //===========================================================================
291
-/*
292
-This is a feature to protect your printer from burn up in flames if it has
293
-a thermistor coming off place (this happened to a friend of mine recently and
294
-motivated me writing this feature).
295
-
296
-The issue: If a thermistor come off, it will read a lower temperature than actual.
297
-The system will turn the heater on forever, burning up the filament and anything
298
-else around.
299
-
300
-After the temperature reaches the target for the first time, this feature will
301
-start measuring for how long the current temperature stays below the target
302
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
303
-
304
-If it stays longer than _PERIOD, it means the thermistor temperature
305
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
306
-safe side, the system will he halt.
307
-
308
-Bear in mind the count down will just start AFTER the first time the
309
-thermistor temperature is over the target, so you will have no problem if
310
-your extruder heater takes 2 minutes to hit the target on heating.
311
-
312
-*/
313
-// If you want to enable this feature for all your extruder heaters,
314
-// uncomment the 2 defines below:
315 291
 
316
-// Parameters for all extruder heaters
317
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
318
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
319
-
320
-// If you want to enable this feature for your bed heater,
321
-// uncomment the 2 defines below:
322
-
323
-// Parameters for the bed heater
324
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
325
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
292
+/**
293
+ * Thermal Runaway Protection protects your printer from damage and fire if a
294
+ * thermistor falls out or temperature sensors fail in any way.
295
+ *
296
+ * The issue: If a thermistor falls out or a temperature sensor fails,
297
+ * Marlin can no longer sense the actual temperature. Since a disconnected
298
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
299
+ *
300
+ * The solution: Once the temperature reaches the target, start observing.
301
+ * If the temperature stays too far below the target (hysteresis) for too long,
302
+ * the firmware will halt as a safety precaution.
303
+ */
326 304
 
305
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
306
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
327 307
 
328 308
 //===========================================================================
329 309
 //============================= Mechanical Settings =========================
@@ -427,17 +407,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
427 407
 #define Z_MAX_POS 200
428 408
 
429 409
 //===========================================================================
430
-//============================= Filament Runout Sensor ======================
410
+//========================= Filament Runout Sensor ==========================
431 411
 //===========================================================================
432 412
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
433 413
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
434 414
                                  // It is assumed that when logic high = filament available
435 415
                                  //                    when logic  low = filament ran out
436
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
437
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
416
+#ifdef FILAMENT_RUNOUT_SENSOR
417
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
418
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
419
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
420
+#endif 
438 421
 
439 422
 //===========================================================================
440
-//============================ Mesh Bed Leveling ============================
423
+//=========================== Manual Bed Leveling ===========================
441 424
 //===========================================================================
442 425
 
443 426
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -458,7 +441,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
458 441
 #endif  // MESH_BED_LEVELING
459 442
 
460 443
 //===========================================================================
461
-//============================= Bed Auto Leveling ===========================
444
+//============================ Bed Auto Leveling ============================
462 445
 //===========================================================================
463 446
 
464 447
 // @section bedlevel

+ 40
- 7
Marlin/example_configurations/K8200/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 799
- 0
Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h Ver arquivo

@@ -0,0 +1,799 @@
1
+#ifndef CONFIGURATION_H
2
+#define CONFIGURATION_H
3
+
4
+#include "boards.h"
5
+
6
+//===========================================================================
7
+//============================= Getting Started =============================
8
+//===========================================================================
9
+/*
10
+Here are some standard links for getting your machine calibrated:
11
+ * http://reprap.org/wiki/Calibration
12
+ * http://youtu.be/wAL9d7FgInk
13
+ * http://calculator.josefprusa.cz
14
+ * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
15
+ * http://www.thingiverse.com/thing:5573
16
+ * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
17
+ * http://www.thingiverse.com/thing:298812
18
+*/
19
+
20
+// This configuration file contains the basic settings.
21
+// Advanced settings can be found in Configuration_adv.h
22
+// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
23
+
24
+//===========================================================================
25
+//============================= DELTA Printer ===============================
26
+//===========================================================================
27
+// For a Delta printer replace the configuration files with the files in the
28
+// example_configurations/delta directory.
29
+//
30
+
31
+//===========================================================================
32
+//============================= SCARA Printer ===============================
33
+//===========================================================================
34
+// For a Scara printer replace the configuration files with the files in the
35
+// example_configurations/SCARA directory.
36
+//
37
+
38
+// @section info
39
+
40
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
41
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
42
+// build by the user have been successfully uploaded into firmware.
43
+#define STRING_VERSION "1.0.3 dev"
44
+#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
45
+#define STRING_CONFIG_H_AUTHOR "RepRapWorld.com" // Who made the changes.
46
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
47
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
48
+
49
+// @section machine
50
+
51
+// SERIAL_PORT selects which serial port should be used for communication with the host.
52
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
53
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
54
+// :[0,1,2,3,4,5,6,7]
55
+#define SERIAL_PORT 0
56
+
57
+// This determines the communication speed of the printer
58
+// :[2400,9600,19200,38400,57600,115200,250000]
59
+#define BAUDRATE 250000
60
+
61
+// This enables the serial port associated to the Bluetooth interface
62
+//#define BTENABLED              // Enable BT interface on AT90USB devices
63
+
64
+// The following define selects which electronics board you have.
65
+// Please choose the name from boards.h that matches your setup
66
+#ifndef MOTHERBOARD
67
+  #define MOTHERBOARD BOARD_MEGATRONICS_3
68
+#endif
69
+
70
+// Optional custom name for your RepStrap or other custom machine
71
+// Displayed in the LCD "Ready" message
72
+// #define CUSTOM_MACHINE_NAME "3D Printer"
73
+
74
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
75
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
76
+// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
77
+
78
+// This defines the number of extruders
79
+// :[1,2,3,4]
80
+#define EXTRUDERS 1
81
+
82
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
83
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
84
+// For the other hotends it is their distance from the extruder 0 hotend.
85
+//#define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
86
+//#define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
87
+
88
+//// The following define selects which power supply you have. Please choose the one that matches your setup
89
+// 1 = ATX
90
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
91
+// :{1:'ATX',2:'X-Box 360'}
92
+
93
+#define POWER_SUPPLY 1
94
+
95
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
96
+// #define PS_DEFAULT_OFF
97
+
98
+// @section temperature
99
+
100
+//===========================================================================
101
+//============================= Thermal Settings ============================
102
+//===========================================================================
103
+//
104
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
105
+//
106
+//// Temperature sensor settings:
107
+// -2 is thermocouple with MAX6675 (only for sensor 0)
108
+// -1 is thermocouple with AD595
109
+// 0 is not used
110
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
111
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
112
+// 3 is Mendel-parts thermistor (4.7k pullup)
113
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
114
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
115
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
116
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
117
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
118
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
119
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
120
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
121
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
122
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
123
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
124
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
125
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
126
+//
127
+//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
128
+//                          (but gives greater accuracy and more stable PID)
129
+// 51 is 100k thermistor - EPCOS (1k pullup)
130
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
131
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
132
+//
133
+// 1047 is Pt1000 with 4k7 pullup
134
+// 1010 is Pt1000 with 1k pullup (non standard)
135
+// 147 is Pt100 with 4k7 pullup
136
+// 110 is Pt100 with 1k pullup (non standard)
137
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
138
+//     Use it for Testing or Development purposes. NEVER for production machine.
139
+//     #define DUMMY_THERMISTOR_998_VALUE 25
140
+//     #define DUMMY_THERMISTOR_999_VALUE 100
141
+// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950  1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
142
+#define TEMP_SENSOR_0 1
143
+#define TEMP_SENSOR_1 0
144
+#define TEMP_SENSOR_2 0
145
+#define TEMP_SENSOR_3 0
146
+#define TEMP_SENSOR_BED 1
147
+
148
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
149
+//#define TEMP_SENSOR_1_AS_REDUNDANT
150
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
151
+
152
+// Actual temperature must be close to target for this long before M109 returns success
153
+#define TEMP_RESIDENCY_TIME 10  // (seconds)
154
+#define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
155
+#define TEMP_WINDOW     1       // (degC) Window around target to start the residency timer x degC early.
156
+
157
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
158
+// to check that the wiring to the thermistor is not broken.
159
+// Otherwise this would lead to the heater being powered on all the time.
160
+#define HEATER_0_MINTEMP 5
161
+#define HEATER_1_MINTEMP 5
162
+#define HEATER_2_MINTEMP 5
163
+#define HEATER_3_MINTEMP 5
164
+#define BED_MINTEMP 5
165
+
166
+// When temperature exceeds max temp, your heater will be switched off.
167
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
168
+// You should use MINTEMP for thermistor short/failure protection.
169
+#define HEATER_0_MAXTEMP 275
170
+#define HEATER_1_MAXTEMP 275
171
+#define HEATER_2_MAXTEMP 275
172
+#define HEATER_3_MAXTEMP 275
173
+#define BED_MAXTEMP 150
174
+
175
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
176
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
177
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
178
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
179
+
180
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
181
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
182
+//#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
183
+
184
+//===========================================================================
185
+//============================= PID Settings ================================
186
+//===========================================================================
187
+// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
188
+
189
+// Comment the following line to disable PID and enable bang-bang.
190
+#define PIDTEMP
191
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
192
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
193
+#ifdef PIDTEMP
194
+  //#define PID_DEBUG // Sends debug data to the serial port.
195
+  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
196
+  //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
197
+  //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
198
+                                    // Set/get with gcode: M301 E[extruder number, 0-2]
199
+  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
200
+                                  // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
201
+  #define PID_INTEGRAL_DRIVE_MAX PID_MAX  //limit for the integral term
202
+  #define K1 0.95 //smoothing factor within the PID
203
+
204
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
205
+// Ultimaker
206
+    #define  DEFAULT_Kp 22.2
207
+    #define  DEFAULT_Ki 1.08
208
+    #define  DEFAULT_Kd 114
209
+
210
+// MakerGear
211
+//    #define  DEFAULT_Kp 7.0
212
+//    #define  DEFAULT_Ki 0.1
213
+//    #define  DEFAULT_Kd 12
214
+
215
+// Mendel Parts V9 on 12V
216
+//    #define  DEFAULT_Kp 63.0
217
+//    #define  DEFAULT_Ki 2.25
218
+//    #define  DEFAULT_Kd 440
219
+#endif // PIDTEMP
220
+
221
+//===========================================================================
222
+//============================= PID > Bed Temperature Control ===============
223
+//===========================================================================
224
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
225
+//
226
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
227
+// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz,
228
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
229
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
230
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
231
+// shouldn't use bed PID until someone else verifies your hardware works.
232
+// If this is enabled, find your own PID constants below.
233
+//#define PIDTEMPBED
234
+//
235
+//#define BED_LIMIT_SWITCHING
236
+
237
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
238
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
239
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
240
+// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
241
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
242
+
243
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
244
+
245
+#ifdef PIDTEMPBED
246
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
247
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
248
+    #define  DEFAULT_bedKp 10.00
249
+    #define  DEFAULT_bedKi .023
250
+    #define  DEFAULT_bedKd 305.4
251
+
252
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
253
+//from pidautotune
254
+//    #define  DEFAULT_bedKp 97.1
255
+//    #define  DEFAULT_bedKi 1.41
256
+//    #define  DEFAULT_bedKd 1675.16
257
+
258
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
259
+#endif // PIDTEMPBED
260
+
261
+// @section extruder
262
+
263
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
264
+//can be software-disabled for whatever purposes by
265
+#define PREVENT_DANGEROUS_EXTRUDE
266
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
267
+#define PREVENT_LENGTHY_EXTRUDE
268
+
269
+#define EXTRUDE_MINTEMP 170
270
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
271
+
272
+//===========================================================================
273
+//======================== Thermal Runaway Protection =======================
274
+//===========================================================================
275
+
276
+/**
277
+ * Thermal Runaway Protection protects your printer from damage and fire if a
278
+ * thermistor falls out or temperature sensors fail in any way.
279
+ *
280
+ * The issue: If a thermistor falls out or a temperature sensor fails,
281
+ * Marlin can no longer sense the actual temperature. Since a disconnected
282
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
283
+ *
284
+ * The solution: Once the temperature reaches the target, start observing.
285
+ * If the temperature stays too far below the target (hysteresis) for too long,
286
+ * the firmware will halt as a safety precaution.
287
+ */
288
+
289
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
290
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
291
+
292
+//===========================================================================
293
+//============================= Mechanical Settings =========================
294
+//===========================================================================
295
+
296
+// @section machine
297
+
298
+// Uncomment this option to enable CoreXY kinematics
299
+// #define COREXY
300
+
301
+// Enable this option for Toshiba steppers
302
+// #define CONFIG_STEPPERS_TOSHIBA
303
+
304
+// @section homing
305
+
306
+// coarse Endstop Settings
307
+#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
308
+
309
+#ifndef ENDSTOPPULLUPS
310
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
311
+  // #define ENDSTOPPULLUP_XMAX
312
+  // #define ENDSTOPPULLUP_YMAX
313
+  // #define ENDSTOPPULLUP_ZMAX
314
+  // #define ENDSTOPPULLUP_XMIN
315
+  // #define ENDSTOPPULLUP_YMIN
316
+  // #define ENDSTOPPULLUP_ZMIN
317
+  // #define ENDSTOPPULLUP_ZPROBE
318
+#endif
319
+
320
+// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
321
+const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
322
+const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
323
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
324
+const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
325
+const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
326
+const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
327
+const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
328
+//#define DISABLE_MAX_ENDSTOPS
329
+//#define DISABLE_MIN_ENDSTOPS
330
+
331
+// @section machine
332
+// If you want to enable the Z Probe pin, but disable its use, uncomment the line below.
333
+// This only affects a Z Probe Endstop if you have separate Z min endstop as well and have
334
+// activated Z_PROBE_ENDSTOP below. If you are using the Z Min endstop on your Z Probe,
335
+// this has no effect.
336
+//#define DISABLE_Z_PROBE_ENDSTOP
337
+
338
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
339
+// :{0:'Low',1:'High'}
340
+#define X_ENABLE_ON 0
341
+#define Y_ENABLE_ON 0
342
+#define Z_ENABLE_ON 0
343
+#define E_ENABLE_ON 0 // For all extruders
344
+
345
+// Disables axis when it's not being used.
346
+// WARNING: When motors turn off there is a chance of losing position accuracy!
347
+#define DISABLE_X false
348
+#define DISABLE_Y false
349
+#define DISABLE_Z false
350
+
351
+// @section extruder
352
+
353
+#define DISABLE_E false // For all extruders
354
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
355
+
356
+// @section machine
357
+
358
+// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
359
+#define INVERT_X_DIR false
360
+#define INVERT_Y_DIR true
361
+#define INVERT_Z_DIR false
362
+
363
+// @section extruder
364
+
365
+// For direct drive extruder v9 set to true, for geared extruder set to false.
366
+#define INVERT_E0_DIR false
367
+#define INVERT_E1_DIR false
368
+#define INVERT_E2_DIR false
369
+#define INVERT_E3_DIR false
370
+
371
+// @section homing
372
+
373
+// ENDSTOP SETTINGS:
374
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
375
+// :[-1,1]
376
+#define X_HOME_DIR -1
377
+#define Y_HOME_DIR -1
378
+#define Z_HOME_DIR -1
379
+
380
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
381
+#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
382
+
383
+// @section machine
384
+
385
+// Travel limits after homing (units are in mm)
386
+#define X_MIN_POS 0
387
+#define Y_MIN_POS 0
388
+#define Z_MIN_POS 0
389
+#define X_MAX_POS 200
390
+#define Y_MAX_POS 200
391
+#define Z_MAX_POS 200
392
+
393
+//===========================================================================
394
+//========================= Filament Runout Sensor ==========================
395
+//===========================================================================
396
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
397
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
398
+                                 // It is assumed that when logic high = filament available
399
+                                 //                    when logic  low = filament ran out
400
+#ifdef FILAMENT_RUNOUT_SENSOR
401
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
402
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
403
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
404
+#endif 
405
+
406
+//===========================================================================
407
+//=========================== Manual Bed Leveling ===========================
408
+//===========================================================================
409
+
410
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
411
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
412
+
413
+#ifdef MANUAL_BED_LEVELING
414
+  #define MBL_Z_STEP 0.025  // Step size while manually probing Z axis
415
+#endif  // MANUAL_BED_LEVELING
416
+
417
+#ifdef MESH_BED_LEVELING
418
+  #define MESH_MIN_X 10
419
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
420
+  #define MESH_MIN_Y 10
421
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
422
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
423
+  #define MESH_NUM_Y_POINTS 3
424
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
425
+#endif  // MESH_BED_LEVELING
426
+
427
+//===========================================================================
428
+//============================ Bed Auto Leveling ============================
429
+//===========================================================================
430
+
431
+// @section bedlevel
432
+
433
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
434
+#define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.
435
+
436
+#ifdef ENABLE_AUTO_BED_LEVELING
437
+
438
+  // There are 2 different ways to specify probing locations
439
+  //
440
+  // - "grid" mode
441
+  //   Probe several points in a rectangular grid.
442
+  //   You specify the rectangle and the density of sample points.
443
+  //   This mode is preferred because there are more measurements.
444
+  //
445
+  // - "3-point" mode
446
+  //   Probe 3 arbitrary points on the bed (that aren't colinear)
447
+  //   You specify the XY coordinates of all 3 points.
448
+
449
+  // Enable this to sample the bed in a grid (least squares solution)
450
+  // Note: this feature generates 10KB extra code size
451
+  #define AUTO_BED_LEVELING_GRID
452
+
453
+  #ifdef AUTO_BED_LEVELING_GRID
454
+
455
+    #define LEFT_PROBE_BED_POSITION 15
456
+    #define RIGHT_PROBE_BED_POSITION 170
457
+    #define FRONT_PROBE_BED_POSITION 20
458
+    #define BACK_PROBE_BED_POSITION 170
459
+
460
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
461
+
462
+    // Set the number of grid points per dimension
463
+    // You probably don't need more than 3 (squared=9)
464
+    #define AUTO_BED_LEVELING_GRID_POINTS 2
465
+
466
+  #else  // !AUTO_BED_LEVELING_GRID
467
+
468
+      // Arbitrary points to probe. A simple cross-product
469
+      // is used to estimate the plane of the bed.
470
+      #define ABL_PROBE_PT_1_X 15
471
+      #define ABL_PROBE_PT_1_Y 180
472
+      #define ABL_PROBE_PT_2_X 15
473
+      #define ABL_PROBE_PT_2_Y 20
474
+      #define ABL_PROBE_PT_3_X 170
475
+      #define ABL_PROBE_PT_3_Y 20
476
+
477
+  #endif // AUTO_BED_LEVELING_GRID
478
+
479
+  // Offsets to the probe relative to the extruder tip (Hotend - Probe)
480
+  // X and Y offsets must be integers
481
+  #define X_PROBE_OFFSET_FROM_EXTRUDER -25     // Probe on: -left  +right
482
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29     // Probe on: -front +behind
483
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35  // -below (always!)
484
+
485
+  #define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
486
+                                        // Be sure you have this distance over your Z_MAX_POS in case
487
+
488
+  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
489
+
490
+  #define Z_RAISE_BEFORE_PROBING 15   //How much the extruder will be raised before traveling to the first probing point.
491
+  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
492
+  #define Z_RAISE_AFTER_PROBING 15    //How much the extruder will be raised after the last probing point.
493
+
494
+//   #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine.
495
+                                                                            //Useful to retract a deployable probe.
496
+                                                                           
497
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
498
+  //#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.
499
+
500
+  //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
501
+  //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.
502
+  // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
503
+
504
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
505
+
506
+
507
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
508
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
509
+
510
+  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
511
+                          // When defined, it will:
512
+                          // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
513
+                          // - If stepper drivers timeout, it will need X and Y homing again before Z homing
514
+                          // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
515
+                          // - Block Z homing only when the probe is outside bed area.
516
+
517
+  #ifdef Z_SAFE_HOMING
518
+
519
+    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
520
+    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
521
+
522
+  #endif
523
+
524
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
525
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
526
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
527
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
528
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
529
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
530
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
531
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
532
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
533
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
534
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
535
+
536
+  //#define Z_PROBE_ENDSTOP
537
+
538
+#endif // ENABLE_AUTO_BED_LEVELING
539
+
540
+
541
+// @section homing
542
+
543
+// The position of the homing switches
544
+//#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
545
+//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
546
+
547
+// Manual homing switch locations:
548
+// For deltabots this means top and center of the Cartesian print volume.
549
+#ifdef MANUAL_HOME_POSITIONS
550
+  #define MANUAL_X_HOME_POS 0
551
+  #define MANUAL_Y_HOME_POS 0
552
+  #define MANUAL_Z_HOME_POS 0
553
+  //#define MANUAL_Z_HOME_POS 402 // For delta: Distance between nozzle and print surface after homing.
554
+#endif
555
+
556
+// @section movement
557
+
558
+/**
559
+ * MOVEMENT SETTINGS
560
+ */
561
+
562
+#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
563
+
564
+// default settings
565
+
566
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402*2,78.7402*2,5120.00,760*1*1.5}  // default steps per unit for Ultimaker
567
+#define DEFAULT_MAX_FEEDRATE          {300, 300, 5, 25}    // (mm/sec)
568
+#define DEFAULT_MAX_ACCELERATION      {3000,3000,100,10000}    // 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.
569
+
570
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
571
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
572
+#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
573
+
574
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
575
+#define DEFAULT_XYJERK                20.0    // (mm/sec)
576
+#define DEFAULT_ZJERK                 0.4     // (mm/sec)
577
+#define DEFAULT_EJERK                 5.0    // (mm/sec)
578
+
579
+
580
+//=============================================================================
581
+//============================= Additional Features ===========================
582
+//=============================================================================
583
+
584
+// @section more
585
+
586
+// Custom M code points
587
+#define CUSTOM_M_CODES
588
+#ifdef CUSTOM_M_CODES
589
+  #ifdef ENABLE_AUTO_BED_LEVELING
590
+    #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
591
+    #define Z_PROBE_OFFSET_RANGE_MIN -20
592
+    #define Z_PROBE_OFFSET_RANGE_MAX 20
593
+  #endif
594
+#endif
595
+
596
+// @section extras
597
+
598
+// EEPROM
599
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
600
+// M500 - stores parameters in EEPROM
601
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
602
+// M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
603
+//define this to enable EEPROM support
604
+//#define EEPROM_SETTINGS
605
+
606
+#ifdef EEPROM_SETTINGS
607
+  // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
608
+  #define EEPROM_CHITCHAT // please keep turned on if you can.
609
+#endif
610
+
611
+
612
+// @section temperature
613
+
614
+// Preheat Constants
615
+#define PLA_PREHEAT_HOTEND_TEMP 180
616
+#define PLA_PREHEAT_HPB_TEMP 70
617
+#define PLA_PREHEAT_FAN_SPEED 0   // Insert Value between 0 and 255
618
+
619
+#define ABS_PREHEAT_HOTEND_TEMP 240
620
+#define ABS_PREHEAT_HPB_TEMP 110
621
+#define ABS_PREHEAT_FAN_SPEED 0   // Insert Value between 0 and 255
622
+
623
+//==============================LCD and SD support=============================
624
+// @section lcd
625
+
626
+// Define your display language below. Replace (en) with your language code and uncomment.
627
+// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test
628
+// See also language.h
629
+#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)
630
+
631
+// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display.
632
+// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset.
633
+// See also documentation/LCDLanguageFont.md
634
+  #define DISPLAY_CHARSET_HD44780_JAPAN        // this is the most common hardware
635
+  //#define DISPLAY_CHARSET_HD44780_WESTERN
636
+  //#define DISPLAY_CHARSET_HD44780_CYRILLIC
637
+
638
+#define ULTRA_LCD  //general LCD support, also 16x2
639
+//#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
640
+#define SDSUPPORT // Enable SD Card Support in Hardware Console
641
+//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
642
+#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
643
+//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
644
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
645
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
646
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
647
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
648
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
649
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
650
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
651
+// http://reprap.org/wiki/PanelOne
652
+//#define PANEL_ONE
653
+
654
+// The MaKr3d Makr-Panel with graphic controller and SD support
655
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
656
+//#define MAKRPANEL
657
+
658
+// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
659
+// http://panucatt.com
660
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
661
+//#define VIKI2
662
+//#define miniVIKI
663
+
664
+// The RepRapDiscount Smart Controller (white PCB)
665
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
666
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
667
+
668
+// The GADGETS3D G3D LCD/SD Controller (blue PCB)
669
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
670
+//#define G3D_PANEL
671
+
672
+// The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
673
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
674
+//
675
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
676
+//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
677
+
678
+// The RepRapWorld REPRAPWORLD_KEYPAD v1.1
679
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
680
+#define REPRAPWORLD_KEYPAD
681
+#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
682
+
683
+// The Elefu RA Board Control Panel
684
+// http://www.elefu.com/index.php?route=product/product&product_id=53
685
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
686
+//#define RA_CONTROL_PANEL
687
+
688
+/**
689
+ * I2C Panels
690
+ */
691
+
692
+//#define LCD_I2C_SAINSMART_YWROBOT
693
+
694
+// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
695
+//#define LCD_I2C_PANELOLU2
696
+
697
+// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
698
+//#define LCD_I2C_VIKI
699
+
700
+// Shift register panels
701
+// ---------------------
702
+// 2 wire Non-latching LCD SR from:
703
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
704
+
705
+//#define SAV_3DLCD
706
+
707
+// @section extras
708
+
709
+// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
710
+//#define FAST_PWM_FAN
711
+
712
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
713
+// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
714
+// is too low, you should also increment SOFT_PWM_SCALE.
715
+//#define FAN_SOFT_PWM
716
+
717
+// Incrementing this by 1 will double the software PWM frequency,
718
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
719
+// However, control resolution will be halved for each increment;
720
+// at zero value, there are 128 effective control positions.
721
+#define SOFT_PWM_SCALE 0
722
+
723
+// Temperature status LEDs that display the hotend and bet temperature.
724
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
725
+// Otherwise the RED led is on. There is 1C hysteresis.
726
+//#define TEMP_STAT_LEDS
727
+
728
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
729
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
730
+// #define PHOTOGRAPH_PIN     23
731
+
732
+// SkeinForge sends the wrong arc g-codes when using Arc Point as fillet procedure
733
+//#define SF_ARC_FIX
734
+
735
+// Support for the BariCUDA Paste Extruder.
736
+//#define BARICUDA
737
+
738
+//define BlinkM/CyzRgb Support
739
+//#define BLINKM
740
+
741
+/*********************************************************************\
742
+* R/C SERVO support
743
+* Sponsored by TrinityLabs, Reworked by codexmas
744
+**********************************************************************/
745
+
746
+// Number of servos
747
+//
748
+// If you select a configuration below, this will receive a default value and does not need to be set manually
749
+// set it manually if you have more servos than extruders and wish to manually control some
750
+// leaving it undefined or defining as 0 will disable the servo subsystem
751
+// If unsure, leave commented / disabled
752
+//
753
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
754
+
755
+// Servo Endstops
756
+//
757
+// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
758
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
759
+//
760
+//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
761
+//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
762
+
763
+/**********************************************************************\
764
+ * Support for a filament diameter sensor
765
+ * Also allows adjustment of diameter at print time (vs  at slicing)
766
+ * Single extruder only at this point (extruder 0)
767
+ *
768
+ * Motherboards
769
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector
770
+ * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E)
771
+ * 301 - Rambo  - uses Analog input 3
772
+ * Note may require analog pins to be defined for different motherboards
773
+ **********************************************************************/
774
+// Uncomment below to enable
775
+//#define FILAMENT_SENSOR
776
+
777
+#define FILAMENT_SENSOR_EXTRUDER_NUM 0   //The number of the extruder that has the filament sensor (0,1,2)
778
+#define MEASUREMENT_DELAY_CM        14   //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
779
+
780
+#define DEFAULT_NOMINAL_FILAMENT_DIA 3.0 //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
781
+#define MEASURED_UPPER_LIMIT         3.3 //upper limit factor used for sensor reading validation in mm
782
+#define MEASURED_LOWER_LIMIT         1.9 //lower limit factor for sensor reading validation in mm
783
+#define MAX_MEASUREMENT_DELAY       20   //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
784
+
785
+//defines used in the code
786
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially
787
+
788
+//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status.  Status will appear for 5 sec.
789
+//#define FILAMENT_LCD_DISPLAY
790
+
791
+
792
+
793
+
794
+
795
+
796
+#include "Configuration_adv.h"
797
+#include "thermistortables.h"
798
+
799
+#endif //CONFIGURATION_H

+ 25
- 42
Marlin/example_configurations/SCARA/Configuration.h Ver arquivo

@@ -30,7 +30,7 @@ Here are some standard links for getting your machine calibrated:
30 30
 // You might need Z-Min endstop on SCARA-Printer to use this feature. Actually untested!
31 31
 // Uncomment to use Morgan scara mode
32 32
 #define SCARA  
33
-#define scara_segments_per_second 200 //careful, two much will decrease performance...
33
+#define SCARA_SEGMENTS_PER_SECOND 200 // If movement is choppy try lowering this value
34 34
 // Length of inner support arm
35 35
 #define Linkage_1 150 //mm      Preprocessor cannot handle decimal point...
36 36
 // Length of outer support arm     Measure arm lengths precisely and enter 
@@ -288,44 +288,24 @@ Here are some standard links for getting your machine calibrated:
288 288
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
289 289
 
290 290
 //===========================================================================
291
-//============================= Thermal Runaway Protection ==================
291
+//======================== Thermal Runaway Protection =======================
292 292
 //===========================================================================
293
-/*
294
-This is a feature to protect your printer from burn up in flames if it has
295
-a thermistor coming off place (this happened to a friend of mine recently and
296
-motivated me writing this feature).
297
-
298
-The issue: If a thermistor come off, it will read a lower temperature than actual.
299
-The system will turn the heater on forever, burning up the filament and anything
300
-else around.
301
-
302
-After the temperature reaches the target for the first time, this feature will
303
-start measuring for how long the current temperature stays below the target
304
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
305
-
306
-If it stays longer than _PERIOD, it means the thermistor temperature
307
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
308
-safe side, the system will he halt.
309
-
310
-Bear in mind the count down will just start AFTER the first time the
311
-thermistor temperature is over the target, so you will have no problem if
312
-your extruder heater takes 2 minutes to hit the target on heating.
313
-
314
-*/
315
-// If you want to enable this feature for all your extruder heaters,
316
-// uncomment the 2 defines below:
317
-
318
-// Parameters for all extruder heaters
319
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
320
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
321 293
 
322
-// If you want to enable this feature for your bed heater,
323
-// uncomment the 2 defines below:
324
-
325
-// Parameters for the bed heater
326
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
327
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
294
+/**
295
+ * Thermal Runaway Protection protects your printer from damage and fire if a
296
+ * thermistor falls out or temperature sensors fail in any way.
297
+ *
298
+ * The issue: If a thermistor falls out or a temperature sensor fails,
299
+ * Marlin can no longer sense the actual temperature. Since a disconnected
300
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
301
+ *
302
+ * The solution: Once the temperature reaches the target, start observing.
303
+ * If the temperature stays too far below the target (hysteresis) for too long,
304
+ * the firmware will halt as a safety precaution.
305
+ */
328 306
 
307
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
308
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
329 309
 
330 310
 //===========================================================================
331 311
 //============================= Mechanical Settings =========================
@@ -402,17 +382,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
402 382
 #define Z_MAX_POS 225
403 383
 
404 384
 //===========================================================================
405
-//============================= Filament Runout Sensor ======================
385
+//========================= Filament Runout Sensor ==========================
406 386
 //===========================================================================
407 387
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
408 388
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
409 389
                                  // It is assumed that when logic high = filament available
410 390
                                  //                    when logic  low = filament ran out
411
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
412
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
413
-
391
+#ifdef FILAMENT_RUNOUT_SENSOR
392
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
393
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
394
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
395
+#endif 
396
+  
414 397
 //===========================================================================
415
-//============================ Manual Bed Leveling ==========================
398
+//=========================== Manual Bed Leveling ===========================
416 399
 //===========================================================================
417 400
 
418 401
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -433,7 +416,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
433 416
 #endif  // MESH_BED_LEVELING
434 417
 
435 418
 //===========================================================================
436
-//============================= Bed Auto Leveling ===========================
419
+//============================ Bed Auto Leveling ============================
437 420
 //===========================================================================
438 421
 
439 422
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 40
- 7
Marlin/example_configurations/SCARA/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 3000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 24
- 41
Marlin/example_configurations/WITBOX/Configuration.h Ver arquivo

@@ -256,44 +256,24 @@ Here are some standard links for getting your machine calibrated:
256 256
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
257 257
 
258 258
 //===========================================================================
259
-//============================= Thermal Runaway Protection ==================
259
+//======================== Thermal Runaway Protection =======================
260 260
 //===========================================================================
261
-/*
262
-This is a feature to protect your printer from burn up in flames if it has
263
-a thermistor coming off place (this happened to a friend of mine recently and
264
-motivated me writing this feature).
265
-
266
-The issue: If a thermistor come off, it will read a lower temperature than actual.
267
-The system will turn the heater on forever, burning up the filament and anything
268
-else around.
269
-
270
-After the temperature reaches the target for the first time, this feature will
271
-start measuring for how long the current temperature stays below the target
272
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
273
-
274
-If it stays longer than _PERIOD, it means the thermistor temperature
275
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
276
-safe side, the system will he halt.
277
-
278
-Bear in mind the count down will just start AFTER the first time the
279
-thermistor temperature is over the target, so you will have no problem if
280
-your extruder heater takes 2 minutes to hit the target on heating.
281
-
282
-*/
283
-// If you want to enable this feature for all your extruder heaters,
284
-// uncomment the 2 defines below:
285 261
 
286
-// Parameters for all extruder heaters
287
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
288
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
289
-
290
-// If you want to enable this feature for your bed heater,
291
-// uncomment the 2 defines below:
292
-
293
-// Parameters for the bed heater
294
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
295
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
262
+/**
263
+ * Thermal Runaway Protection protects your printer from damage and fire if a
264
+ * thermistor falls out or temperature sensors fail in any way.
265
+ *
266
+ * The issue: If a thermistor falls out or a temperature sensor fails,
267
+ * Marlin can no longer sense the actual temperature. Since a disconnected
268
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
269
+ *
270
+ * The solution: Once the temperature reaches the target, start observing.
271
+ * If the temperature stays too far below the target (hysteresis) for too long,
272
+ * the firmware will halt as a safety precaution.
273
+ */
296 274
 
275
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
276
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
297 277
 
298 278
 //===========================================================================
299 279
 //============================= Mechanical Settings =========================
@@ -370,17 +350,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
370 350
 #define Z_MAX_POS 200
371 351
 
372 352
 //===========================================================================
373
-//============================= Filament Runout Sensor ======================
353
+//========================= Filament Runout Sensor ==========================
374 354
 //===========================================================================
375 355
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
376 356
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
377 357
                                  // It is assumed that when logic high = filament available
378 358
                                  //                    when logic  low = filament ran out
379
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
380
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
381
-
359
+#ifdef FILAMENT_RUNOUT_SENSOR
360
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
361
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
362
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
363
+#endif 
364
+  
382 365
 //===========================================================================
383
-//============================ Manual Bed Leveling ==========================
366
+//=========================== Manual Bed Leveling ===========================
384 367
 //===========================================================================
385 368
 
386 369
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -401,7 +384,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
401 384
 #endif  // MESH_BED_LEVELING
402 385
 
403 386
 //===========================================================================
404
-//============================= Bed Auto Leveling ===========================
387
+//============================ Bed Auto Leveling ============================
405 388
 //===========================================================================
406 389
 
407 390
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 41
- 8
Marlin/example_configurations/WITBOX/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -374,7 +398,16 @@ const unsigned int dropsegments=5; //everything with less than this number of st
374 398
 
375 399
 //The ASCII buffer for receiving from the serial:
376 400
 #define MAX_CMD_SIZE 96
377
-#define BUFSIZE 5
401
+#define BUFSIZE 4
402
+
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
378 411
 
379 412
 // @section fwretract
380 413
 

+ 803
- 0
Marlin/example_configurations/delta/biv2.5/Configuration.h Ver arquivo

@@ -0,0 +1,803 @@
1
+#ifndef CONFIGURATION_H
2
+#define CONFIGURATION_H
3
+
4
+#include "boards.h"
5
+
6
+//===========================================================================
7
+//============================= Getting Started =============================
8
+//===========================================================================
9
+/*
10
+Here are some standard links for getting your machine calibrated:
11
+ * http://reprap.org/wiki/Calibration
12
+ * http://youtu.be/wAL9d7FgInk
13
+ * http://calculator.josefprusa.cz
14
+ * http://reprap.org/wiki/Triffid_Hunter%27s_Calibration_Guide
15
+ * http://www.thingiverse.com/thing:5573
16
+ * https://sites.google.com/site/repraplogphase/calibration-of-your-reprap
17
+ * http://www.thingiverse.com/thing:298812
18
+*/
19
+
20
+// This configuration file contains the basic settings.
21
+// Advanced settings can be found in Configuration_adv.h
22
+// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration
23
+
24
+//===========================================================================
25
+//============================= DELTA Printer ===============================
26
+//===========================================================================
27
+// For a Delta printer replace the configuration files with the files in the
28
+// example_configurations/delta directory.
29
+//
30
+
31
+//===========================================================================
32
+//============================= SCARA Printer ===============================
33
+//===========================================================================
34
+// For a Delta printer replace the configuration files with the files in the
35
+// example_configurations/SCARA directory.
36
+//
37
+
38
+// User-specified version info of this build to display in [Pronterface, etc] terminal window during
39
+// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
40
+// build by the user have been successfully uploaded into firmware.
41
+#define STRING_VERSION "1.0.3 dev"
42
+#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
43
+#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
44
+#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
45
+//#define STRING_SPLASH_LINE2 STRING_VERSION_CONFIG_H // will be shown during bootup in line2
46
+
47
+// SERIAL_PORT selects which serial port should be used for communication with the host.
48
+// This allows the connection of wireless adapters (for instance) to non-default port pins.
49
+// Serial port 0 is still used by the Arduino bootloader regardless of this setting.
50
+#define SERIAL_PORT 0
51
+
52
+// This determines the communication speed of the printer
53
+#define BAUDRATE 250000
54
+
55
+// This enables the serial port associated to the Bluetooth interface
56
+//#define BTENABLED              // Enable BT interface on AT90USB devices
57
+
58
+// The following define selects which electronics board you have.
59
+// Please choose the name from boards.h that matches your setup
60
+#ifndef MOTHERBOARD
61
+  #define MOTHERBOARD BOARD_RUMBA
62
+#endif
63
+
64
+// Optional custom name for your RepStrap or other custom machine
65
+// Displayed in the LCD "Ready" message
66
+#define CUSTOM_MACHINE_NAME "BI V2.5"
67
+
68
+// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
69
+// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
70
+// #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"
71
+
72
+// This defines the number of extruders
73
+#define EXTRUDERS 2
74
+
75
+//// The following define selects which power supply you have. Please choose the one that matches your setup
76
+// 1 = ATX
77
+// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC)
78
+
79
+#define POWER_SUPPLY 1
80
+
81
+// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
82
+// #define PS_DEFAULT_OFF
83
+
84
+
85
+//===========================================================================
86
+//============================== Delta Settings =============================
87
+//===========================================================================
88
+// Enable DELTA kinematics and most of the default configuration for Deltas
89
+#define DELTA
90
+
91
+// Make delta curves from many straight lines (linear interpolation).
92
+// This is a trade-off between visible corners (not enough segments)
93
+// and processor overload (too many expensive sqrt calls).
94
+#define DELTA_SEGMENTS_PER_SECOND 100
95
+
96
+// NOTE NB all values for DELTA_* values MUST be floating point, so always have a decimal point in them
97
+
98
+// Center-to-center distance of the holes in the diagonal push rods.
99
+#define DELTA_DIAGONAL_ROD 440.0 // mm
100
+
101
+// Horizontal offset from middle of printer to smooth rod center.
102
+#define DELTA_SMOOTH_ROD_OFFSET 330.0 // mm
103
+
104
+// Horizontal offset of the universal joints on the end effector.
105
+#define DELTA_EFFECTOR_OFFSET 50.0 // mm
106
+
107
+// Horizontal offset of the universal joints on the carriages.
108
+#define DELTA_CARRIAGE_OFFSET 20.0 // mm
109
+
110
+// Horizontal distance bridged by diagonal push rods when effector is centered.
111
+#define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET)
112
+
113
+// Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
114
+#define DELTA_PRINTABLE_RADIUS 160
115
+
116
+
117
+//===========================================================================
118
+//============================= Thermal Settings ============================
119
+//===========================================================================
120
+//
121
+//--NORMAL IS 4.7kohm PULLUP!-- 1kohm pullup can be used on hotend sensor, using correct resistor and table
122
+//
123
+//// Temperature sensor settings:
124
+// -2 is thermocouple with MAX6675 (only for sensor 0)
125
+// -1 is thermocouple with AD595
126
+// 0 is not used
127
+// 1 is 100k thermistor - best choice for EPCOS 100k (4.7k pullup)
128
+// 2 is 200k thermistor - ATC Semitec 204GT-2 (4.7k pullup)
129
+// 3 is Mendel-parts thermistor (4.7k pullup)
130
+// 4 is 10k thermistor !! do not use it for a hotend. It gives bad resolution at high temp. !!
131
+// 5 is 100K thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (4.7k pullup)
132
+// 6 is 100k EPCOS - Not as accurate as table 1 (created using a fluke thermocouple) (4.7k pullup)
133
+// 7 is 100k Honeywell thermistor 135-104LAG-J01 (4.7k pullup)
134
+// 71 is 100k Honeywell thermistor 135-104LAF-J01 (4.7k pullup)
135
+// 8 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup)
136
+// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
137
+// 10 is 100k RS thermistor 198-961 (4.7k pullup)
138
+// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
139
+// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
140
+// 13 is 100k Hisens 3950  1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
141
+// 20 is the PT100 circuit found in the Ultimainboard V2.x
142
+// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
143
+//
144
+//    1k ohm pullup tables - This is not normal, you would have to have changed out your 4.7k for 1k
145
+//                          (but gives greater accuracy and more stable PID)
146
+// 51 is 100k thermistor - EPCOS (1k pullup)
147
+// 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
148
+// 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
149
+//
150
+// 1047 is Pt1000 with 4k7 pullup
151
+// 1010 is Pt1000 with 1k pullup (non standard)
152
+// 147 is Pt100 with 4k7 pullup
153
+// 110 is Pt100 with 1k pullup (non standard)
154
+// 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
155
+//     Use it for Testing or Development purposes. NEVER for production machine.
156
+//     #define DUMMY_THERMISTOR_998_VALUE 25
157
+//     #define DUMMY_THERMISTOR_999_VALUE 100
158
+// :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950  1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
159
+#define TEMP_SENSOR_0 5
160
+#define TEMP_SENSOR_1 5
161
+#define TEMP_SENSOR_2 0
162
+#define TEMP_SENSOR_3 0
163
+#define TEMP_SENSOR_BED 1
164
+
165
+// This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
166
+//#define TEMP_SENSOR_1_AS_REDUNDANT
167
+#define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10
168
+
169
+// Actual temperature must be close to target for this long before M109 returns success
170
+#define TEMP_RESIDENCY_TIME 10  // (seconds)
171
+#define TEMP_HYSTERESIS 3       // (degC) range of +/- temperatures considered "close" to the target one
172
+#define TEMP_WINDOW     1       // (degC) Window around target to start the residency timer x degC early.
173
+
174
+// The minimal temperature defines the temperature below which the heater will not be enabled It is used
175
+// to check that the wiring to the thermistor is not broken.
176
+// Otherwise this would lead to the heater being powered on all the time.
177
+#define HEATER_0_MINTEMP 5
178
+#define HEATER_1_MINTEMP 5
179
+#define HEATER_2_MINTEMP 5
180
+#define HEATER_3_MINTEMP 5
181
+#define BED_MINTEMP 5
182
+
183
+// When temperature exceeds max temp, your heater will be switched off.
184
+// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
185
+// You should use MINTEMP for thermistor short/failure protection.
186
+#define HEATER_0_MAXTEMP 275
187
+#define HEATER_1_MAXTEMP 275
188
+#define HEATER_2_MAXTEMP 275
189
+#define HEATER_3_MAXTEMP 275
190
+#define BED_MAXTEMP 150
191
+
192
+// If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
193
+// average current. The value should be an integer and the heat bed will be turned on for 1 interval of
194
+// HEATER_BED_DUTY_CYCLE_DIVIDER intervals.
195
+//#define HEATER_BED_DUTY_CYCLE_DIVIDER 4
196
+
197
+// If you want the M105 heater power reported in watts, define the BED_WATTS, and (shared for all extruders) EXTRUDER_WATTS
198
+//#define EXTRUDER_WATTS (12.0*12.0/6.7) //  P=I^2/R
199
+//#define BED_WATTS (12.0*12.0/1.1)      // P=I^2/R
200
+
201
+//===========================================================================
202
+//============================= PID Settings ================================
203
+//===========================================================================
204
+// PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning
205
+
206
+// Comment the following line to disable PID and enable bang-bang.
207
+#define PIDTEMP
208
+#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
209
+#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
210
+#ifdef PIDTEMP
211
+  //#define PID_DEBUG // Sends debug data to the serial port.
212
+  //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
213
+  //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
214
+  //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
215
+                                    // Set/get with gcode: M301 E[extruder number, 0-2]
216
+  #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
217
+                                  // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
218
+  #define PID_INTEGRAL_DRIVE_MAX PID_MAX  //limit for the integral term
219
+  #define K1 0.95 //smoothing factor within the PID
220
+
221
+// If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
222
+// Ultimaker
223
+    #define  DEFAULT_Kp 22.2
224
+    #define  DEFAULT_Ki 1.08
225
+    #define  DEFAULT_Kd 114
226
+
227
+// MakerGear
228
+//    #define  DEFAULT_Kp 7.0
229
+//    #define  DEFAULT_Ki 0.1
230
+//    #define  DEFAULT_Kd 12
231
+
232
+// Mendel Parts V9 on 12V
233
+//    #define  DEFAULT_Kp 63.0
234
+//    #define  DEFAULT_Ki 2.25
235
+//    #define  DEFAULT_Kd 440
236
+#endif // PIDTEMP
237
+
238
+//===========================================================================
239
+//============================= PID > Bed Temperature Control ===============
240
+//===========================================================================
241
+// Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
242
+//
243
+// Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
244
+// If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz,
245
+// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
246
+// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
247
+// If your configuration is significantly different than this and you don't understand the issues involved, you probably
248
+// shouldn't use bed PID until someone else verifies your hardware works.
249
+// If this is enabled, find your own PID constants below.
250
+//#define PIDTEMPBED
251
+//
252
+//#define BED_LIMIT_SWITCHING
253
+
254
+// This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
255
+// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
256
+// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
257
+// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
258
+#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
259
+
260
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
261
+
262
+#ifdef PIDTEMPBED
263
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
264
+//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
265
+    #define  DEFAULT_bedKp 10.00
266
+    #define  DEFAULT_bedKi .023
267
+    #define  DEFAULT_bedKd 305.4
268
+
269
+//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
270
+//from pidautotune
271
+//    #define  DEFAULT_bedKp 97.1
272
+//    #define  DEFAULT_bedKi 1.41
273
+//    #define  DEFAULT_bedKd 1675.16
274
+
275
+// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
276
+#endif // PIDTEMPBED
277
+
278
+
279
+//this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
280
+//can be software-disabled for whatever purposes by
281
+#define PREVENT_DANGEROUS_EXTRUDE
282
+//if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
283
+#define PREVENT_LENGTHY_EXTRUDE
284
+
285
+#define EXTRUDE_MINTEMP 170
286
+#define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
287
+
288
+//===========================================================================
289
+//======================== Thermal Runaway Protection =======================
290
+//===========================================================================
291
+
292
+/**
293
+ * Thermal Runaway Protection protects your printer from damage and fire if a
294
+ * thermistor falls out or temperature sensors fail in any way.
295
+ *
296
+ * The issue: If a thermistor falls out or a temperature sensor fails,
297
+ * Marlin can no longer sense the actual temperature. Since a disconnected
298
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
299
+ *
300
+ * The solution: Once the temperature reaches the target, start observing.
301
+ * If the temperature stays too far below the target (hysteresis) for too long,
302
+ * the firmware will halt as a safety precaution.
303
+ */
304
+
305
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
306
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
307
+
308
+//===========================================================================
309
+//============================= Mechanical Settings =========================
310
+//===========================================================================
311
+
312
+// Uncomment this option to enable CoreXY kinematics
313
+// #define COREXY
314
+
315
+// Enable this option for Toshiba steppers
316
+// #define CONFIG_STEPPERS_TOSHIBA
317
+
318
+// coarse Endstop Settings
319
+#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors
320
+
321
+#ifndef ENDSTOPPULLUPS
322
+  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
323
+  // #define ENDSTOPPULLUP_XMAX
324
+  // #define ENDSTOPPULLUP_YMAX
325
+  // #define ENDSTOPPULLUP_ZMAX
326
+  // #define ENDSTOPPULLUP_XMIN
327
+  // #define ENDSTOPPULLUP_YMIN
328
+  // #define ENDSTOPPULLUP_ZMIN
329
+#endif
330
+
331
+// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
332
+const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
333
+const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
334
+const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
335
+const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
336
+const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
337
+const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
338
+const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
339
+//#define DISABLE_MAX_ENDSTOPS
340
+#define DISABLE_MIN_ENDSTOPS // Deltas only use min endstops for probing
341
+
342
+// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
343
+#define X_ENABLE_ON 0
344
+#define Y_ENABLE_ON 0
345
+#define Z_ENABLE_ON 0
346
+#define E_ENABLE_ON 0 // For all extruders
347
+
348
+// Disables axis when it's not being used.
349
+// WARNING: When motors turn off there is a chance of losing position accuracy!
350
+#define DISABLE_X false
351
+#define DISABLE_Y false
352
+#define DISABLE_Z false
353
+#define DISABLE_E false // For all extruders
354
+#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled
355
+
356
+// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
357
+#define INVERT_X_DIR false // DELTA does not invert
358
+#define INVERT_Y_DIR false
359
+#define INVERT_Z_DIR false
360
+#define INVERT_E0_DIR false
361
+#define INVERT_E1_DIR false
362
+#define INVERT_E2_DIR false
363
+#define INVERT_E3_DIR false
364
+
365
+// ENDSTOP SETTINGS:
366
+// Sets direction of endstops when homing; 1=MAX, -1=MIN
367
+#define X_HOME_DIR 1 // deltas always home to max
368
+#define Y_HOME_DIR 1
369
+#define Z_HOME_DIR 1
370
+
371
+#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
372
+#define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.
373
+
374
+// Travel limits after homing (units are in mm)
375
+#define X_MIN_POS -DELTA_PRINTABLE_RADIUS
376
+#define Y_MIN_POS -DELTA_PRINTABLE_RADIUS
377
+#define Z_MIN_POS 0
378
+#define X_MAX_POS DELTA_PRINTABLE_RADIUS
379
+#define Y_MAX_POS DELTA_PRINTABLE_RADIUS
380
+#define Z_MAX_POS MANUAL_Z_HOME_POS
381
+
382
+//===========================================================================
383
+//========================= Filament Runout Sensor ==========================
384
+//===========================================================================
385
+//#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
386
+                                 // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
387
+                                 // It is assumed that when logic high = filament available
388
+                                 //                    when logic  low = filament ran out
389
+//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
390
+//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
391
+
392
+//===========================================================================
393
+//=========================== Manual Bed Leveling ===========================
394
+//===========================================================================
395
+
396
+// #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
397
+// #define MESH_BED_LEVELING    // Enable mesh bed leveling
398
+
399
+#ifdef MANUAL_BED_LEVELING
400
+  #define MBL_Z_STEP 0.025
401
+#endif  // MANUAL_BED_LEVELING
402
+
403
+#ifdef MESH_BED_LEVELING
404
+  #define MESH_MIN_X 10
405
+  #define MESH_MAX_X (X_MAX_POS - MESH_MIN_X)
406
+  #define MESH_MIN_Y 10
407
+  #define MESH_MAX_Y (Y_MAX_POS - MESH_MIN_Y)
408
+  #define MESH_NUM_X_POINTS 3  // Don't use more than 7 points per axis, implementation limited
409
+  #define MESH_NUM_Y_POINTS 3
410
+  #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0
411
+#endif  // MESH_BED_LEVELING
412
+
413
+//===========================================================================
414
+//============================ Bed Auto Leveling ============================
415
+//===========================================================================
416
+
417
+//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
418
+//#define Z_PROBE_REPEATABILITY_TEST // Z-Probe Repeatability test is not supported in Deltas yet.
419
+
420
+#ifdef ENABLE_AUTO_BED_LEVELING
421
+
422
+  // There are 2 different ways to specify probing locations
423
+  //
424
+  // - "grid" mode
425
+  //   Probe several points in a rectangular grid.
426
+  //   You specify the rectangle and the density of sample points.
427
+  //   This mode is preferred because there are more measurements.
428
+  //
429
+  // - "3-point" mode
430
+  //   Probe 3 arbitrary points on the bed (that aren't colinear)
431
+  //   You specify the XY coordinates of all 3 points.
432
+
433
+  // Enable this to sample the bed in a grid (least squares solution)
434
+  // Note: this feature generates 10KB extra code size
435
+  #define AUTO_BED_LEVELING_GRID  // Deltas only support grid mode
436
+
437
+  #ifdef AUTO_BED_LEVELING_GRID
438
+
439
+    #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS - 10)
440
+
441
+    #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
442
+    #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
443
+    #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
444
+    #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
445
+    
446
+    #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this
447
+
448
+    // Non-linear bed leveling will be used.
449
+    // Compensate by interpolating between the nearest four Z probe values for each point.
450
+    // Useful for deltas where the print surface may appear like a bowl or dome shape.
451
+    // Works best with ACCURATE_BED_LEVELING_POINTS 5 or higher.
452
+    #define AUTO_BED_LEVELING_GRID_POINTS 9
453
+
454
+  #else  // !AUTO_BED_LEVELING_GRID
455
+
456
+      // Arbitrary points to probe. A simple cross-product
457
+      // is used to estimate the plane of the bed.
458
+      #define ABL_PROBE_PT_1_X 15
459
+      #define ABL_PROBE_PT_1_Y 180
460
+      #define ABL_PROBE_PT_2_X 15
461
+      #define ABL_PROBE_PT_2_Y 20
462
+      #define ABL_PROBE_PT_3_X 170
463
+      #define ABL_PROBE_PT_3_Y 20
464
+
465
+  #endif // AUTO_BED_LEVELING_GRID
466
+
467
+  // Offsets to the probe relative to the extruder tip (Hotend - Probe)
468
+  // X and Y offsets must be integers
469
+  #define X_PROBE_OFFSET_FROM_EXTRUDER 0     // Probe on: -left  +right
470
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER -10   // Probe on: -front +behind
471
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.5  // -below (always!)
472
+
473
+  #define Z_RAISE_BEFORE_HOMING 4       // (in mm) Raise Z before homing (G28) for Probe Clearance.
474
+                                        // Be sure you have this distance over your Z_MAX_POS in case
475
+
476
+  #define XY_TRAVEL_SPEED 4000         // X and Y axis travel speed between probes, in mm/min
477
+
478
+  #define Z_RAISE_BEFORE_PROBING 15   //How much the extruder will be raised before traveling to the first probing point.
479
+  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
480
+  #define Z_RAISE_AFTER_PROBING 50    //How much the extruder will be raised after the last probing point.
481
+
482
+//   #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine.
483
+                                                                            //Useful to retract a deployable probe.
484
+                                                                           
485
+  //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
486
+  //#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.
487
+
488
+  // Allen key retractable z-probe as seen on many Kossel delta printers - http://reprap.org/wiki/Kossel#Automatic_bed_leveling_probe
489
+  // Deploys by touching z-axis belt. Retracts by pushing the probe down. Uses Z_MIN_PIN.
490
+  //#define Z_PROBE_ALLEN_KEY
491
+  #ifdef Z_PROBE_ALLEN_KEY
492
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_X 30
493
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_Y DELTA_PRINTABLE_RADIUS
494
+    #define Z_PROBE_ALLEN_KEY_DEPLOY_Z 100
495
+    
496
+    #define Z_PROBE_ALLEN_KEY_STOW_X     -64
497
+    #define Z_PROBE_ALLEN_KEY_STOW_Y     56
498
+    #define Z_PROBE_ALLEN_KEY_STOW_Z     23
499
+    #define Z_PROBE_ALLEN_KEY_STOW_DEPTH 20
500
+  #endif
501
+  
502
+  //If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
503
+  //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.
504
+  // You MUST HAVE the SERVO_ENDSTOPS defined to use here a value higher than zero otherwise your code will not compile.
505
+
506
+//  #define PROBE_SERVO_DEACTIVATION_DELAY 300
507
+
508
+
509
+//If you have enabled the Bed Auto Leveling and are using the same Z Probe for Z Homing,
510
+//it is highly recommended you let this Z_SAFE_HOMING enabled!!!
511
+
512
+  #define Z_SAFE_HOMING   // This feature is meant to avoid Z homing with probe outside the bed area.
513
+                          // When defined, it will:
514
+                          // - Allow Z homing only after X and Y homing AND stepper drivers still enabled
515
+                          // - If stepper drivers timeout, it will need X and Y homing again before Z homing
516
+                          // - Position the probe in a defined XY point before Z Homing when homing all axis (G28)
517
+                          // - Block Z homing only when the probe is outside bed area.
518
+
519
+  #ifdef Z_SAFE_HOMING
520
+
521
+    #define Z_SAFE_HOMING_X_POINT (X_MAX_LENGTH/2)    // X point for Z homing when homing all axis (G28)
522
+    #define Z_SAFE_HOMING_Y_POINT (Y_MAX_LENGTH/2)    // Y point for Z homing when homing all axis (G28)
523
+
524
+  #endif
525
+
526
+  // Support for a dedicated Z PROBE endstop separate from the Z MIN endstop.
527
+  // If you would like to use both a Z PROBE and a Z MIN endstop together or just a Z PROBE with a custom pin, uncomment #define Z_PROBE_ENDSTOP and read the instructions below.
528
+  // If you want to still use the Z min endstop for homing, disable Z_SAFE_HOMING above. Eg; to park the head outside the bed area when homing with G28.
529
+  // WARNING: The Z MIN endstop will need to set properly as it would without a Z PROBE to prevent head crashes and premature stopping during a print.
530
+  // To use a separate Z PROBE endstop, you must have a Z_PROBE_PIN defined in the pins.h file for your control board.
531
+  // If you are using a servo based Z PROBE, you will need to enable NUM_SERVOS, SERVO_ENDSTOPS and SERVO_ENDSTOPS_ANGLES in the R/C Servo below.
532
+  // RAMPS 1.3/1.4 boards may be able to use the 5V, Ground and the D32 pin in the Aux 4 section of the RAMPS board. Use 5V for powered sensors, otherwise connect to ground and D32
533
+  // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
534
+  // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
535
+  // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
536
+  // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.
537
+
538
+  //#define Z_PROBE_ENDSTOP
539
+
540
+#endif // ENABLE_AUTO_BED_LEVELING
541
+
542
+
543
+// The position of the homing switches
544
+#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
545
+//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)
546
+
547
+// Manual homing switch locations:
548
+// For deltabots this means top and center of the Cartesian print volume.
549
+#ifdef MANUAL_HOME_POSITIONS
550
+  #define MANUAL_X_HOME_POS 0
551
+  #define MANUAL_Y_HOME_POS 0
552
+  #define MANUAL_Z_HOME_POS 405 // For delta: Distance between nozzle and print surface after homing.
553
+#endif
554
+
555
+/**
556
+ * MOVEMENT SETTINGS
557
+ */
558
+
559
+
560
+// delta homing speeds must be the same on xyz
561
+#define HOMING_FEEDRATE {200*30, 200*30, 200*30, 0}  // set the homing speeds (mm/min)
562
+
563
+// default settings
564
+// delta speeds must be the same on xyz
565
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {72.9, 72.9, 72.9, 291}  // default steps per unit for BI v2.5 (cable drive)
566
+#define DEFAULT_MAX_FEEDRATE          {500, 500, 500, 150}    // (mm/sec)
567
+#define DEFAULT_MAX_ACCELERATION      {9000,9000,9000,10000}    // 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.
568
+
569
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
570
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
571
+#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
572
+
573
+// Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
574
+// The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).
575
+// For the other hotends it is their distance from the extruder 0 hotend.
576
+// #define EXTRUDER_OFFSET_X {0.0, 20.00} // (in mm) for each extruder, offset of the hotend on the X axis
577
+// #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis
578
+
579
+// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
580
+#define DEFAULT_XYJERK                15.0    // (mm/sec)
581
+#define DEFAULT_ZJERK                 15.0    // (mm/sec) Must be same as XY for delta
582
+#define DEFAULT_EJERK                 5.0    // (mm/sec)
583
+
584
+
585
+//=============================================================================
586
+//============================= Additional Features ===========================
587
+//=============================================================================
588
+
589
+// Custom M code points
590
+#define CUSTOM_M_CODES
591
+#ifdef CUSTOM_M_CODES
592
+  #ifdef ENABLE_AUTO_BED_LEVELING
593
+    #define CUSTOM_M_CODE_SET_Z_PROBE_OFFSET 851
594
+    #define Z_PROBE_OFFSET_RANGE_MIN -20
595
+    #define Z_PROBE_OFFSET_RANGE_MAX 20
596
+  #endif
597
+#endif
598
+
599
+
600
+// EEPROM
601
+// The microcontroller can store settings in the EEPROM, e.g. max velocity...
602
+// M500 - stores parameters in EEPROM
603
+// M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
604
+// M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
605
+//define this to enable EEPROM support
606
+//#define EEPROM_SETTINGS
607
+
608
+#ifdef EEPROM_SETTINGS
609
+  // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
610
+  #define EEPROM_CHITCHAT // please keep turned on if you can.
611
+#endif
612
+
613
+// Preheat Constants
614
+#define PLA_PREHEAT_HOTEND_TEMP 180
615
+#define PLA_PREHEAT_HPB_TEMP 70
616
+#define PLA_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
617
+
618
+#define ABS_PREHEAT_HOTEND_TEMP 240
619
+#define ABS_PREHEAT_HPB_TEMP 100
620
+#define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255
621
+
622
+//==============================LCD and SD support=============================
623
+
624
+// Define your display language below. Replace (en) with your language code and uncomment.
625
+// en, pl, fr, de, es, ru, it, pt, pt-br, fi, an, nl, ca, eu, kana, kana_utf8, cn, test
626
+// See also language.h
627
+#define LANGUAGE_INCLUDE GENERATE_LANGUAGE_INCLUDE(en)
628
+
629
+// Choose ONE of these 3 charsets. This has to match your hardware. Ignored for full graphic display.
630
+// To find out what type you have - compile with (test) - upload - click to get the menu. You'll see two typical lines from the upper half of the charset.
631
+// See also documentation/LCDLanguageFont.md
632
+  #define DISPLAY_CHARSET_HD44780_JAPAN        // this is the most common hardware
633
+  //#define DISPLAY_CHARSET_HD44780_WESTERN
634
+  //#define DISPLAY_CHARSET_HD44780_CYRILLIC
635
+
636
+//#define ULTRA_LCD  //general LCD support, also 16x2
637
+//#define DOGLCD  // Support for SPI LCD 128x64 (Controller ST7565R graphic Display Family)
638
+//#define SDSUPPORT // Enable SD Card Support in Hardware Console
639
+//#define SDSLOW // Use slower SD transfer mode (not normally needed - uncomment if you're getting volume init error)
640
+//#define SD_CHECK_AND_RETRY // Use CRC checks and retries on the SD communication
641
+//#define ENCODER_PULSES_PER_STEP 1 // Increase if you have a high resolution encoder
642
+//#define ENCODER_STEPS_PER_MENU_ITEM 5 // Set according to ENCODER_PULSES_PER_STEP or your liking
643
+//#define ULTIMAKERCONTROLLER //as available from the Ultimaker online store.
644
+//#define ULTIPANEL  //the UltiPanel as on Thingiverse
645
+//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 100 // the duration the buzzer plays the UI feedback sound. ie Screen Click
646
+//#define LCD_FEEDBACK_FREQUENCY_HZ 1000         // this is the tone frequency the buzzer plays when on UI feedback. ie Screen Click
647
+                                                 // 0 to disable buzzer feedback. Test with M300 S<frequency Hz> P<duration ms>
648
+
649
+// PanelOne from T3P3 (via RAMPS 1.4 AUX2/AUX3)
650
+// http://reprap.org/wiki/PanelOne
651
+//#define PANEL_ONE
652
+
653
+// The MaKr3d Makr-Panel with graphic controller and SD support
654
+// http://reprap.org/wiki/MaKr3d_MaKrPanel
655
+//#define MAKRPANEL
656
+
657
+// The Panucatt Devices Viki 2.0 and mini Viki with Graphic LCD
658
+// http://panucatt.com
659
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
660
+//#define VIKI2
661
+//#define miniVIKI
662
+
663
+// The RepRapDiscount Smart Controller (white PCB)
664
+// http://reprap.org/wiki/RepRapDiscount_Smart_Controller
665
+//#define REPRAP_DISCOUNT_SMART_CONTROLLER
666
+
667
+// The GADGETS3D G3D LCD/SD Controller (blue PCB)
668
+// http://reprap.org/wiki/RAMPS_1.3/1.4_GADGETS3D_Shield_with_Panel
669
+//#define G3D_PANEL
670
+
671
+// The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
672
+// http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
673
+//
674
+// ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
675
+#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
676
+
677
+// The RepRapWorld REPRAPWORLD_KEYPAD v1.1
678
+// http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
679
+//#define REPRAPWORLD_KEYPAD
680
+//#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
681
+
682
+// The Elefu RA Board Control Panel
683
+// http://www.elefu.com/index.php?route=product/product&product_id=53
684
+// REMEMBER TO INSTALL LiquidCrystal_I2C.h in your ARDUINO library folder: https://github.com/kiyoshigawa/LiquidCrystal_I2C
685
+//#define RA_CONTROL_PANEL
686
+
687
+// Delta calibration menu
688
+// uncomment to add three points calibration menu option.
689
+// See http://minow.blogspot.com/index.html#4918805519571907051
690
+// If needed, adjust the X, Y, Z calibration coordinates
691
+// in ultralcd.cpp@lcd_delta_calibrate_menu()
692
+// #define DELTA_CALIBRATION_MENU
693
+
694
+/**
695
+ * I2C Panels
696
+ */
697
+
698
+//#define LCD_I2C_SAINSMART_YWROBOT
699
+
700
+// PANELOLU2 LCD with status LEDs, separate encoder and click inputs
701
+//#define LCD_I2C_PANELOLU2
702
+
703
+// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
704
+//#define LCD_I2C_VIKI
705
+
706
+// Shift register panels
707
+// ---------------------
708
+// 2 wire Non-latching LCD SR from:
709
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
710
+
711
+//#define SAV_3DLCD
712
+
713
+// Increase the FAN pwm frequency. Removes the PWM noise but increases heating in the FET/Arduino
714
+//#define FAST_PWM_FAN
715
+
716
+// Use software PWM to drive the fan, as for the heaters. This uses a very low frequency
717
+// which is not as annoying as with the hardware PWM. On the other hand, if this frequency
718
+// is too low, you should also increment SOFT_PWM_SCALE.
719
+//#define FAN_SOFT_PWM
720
+
721
+// Incrementing this by 1 will double the software PWM frequency,
722
+// affecting heaters, and the fan if FAN_SOFT_PWM is enabled.
723
+// However, control resolution will be halved for each increment;
724
+// at zero value, there are 128 effective control positions.
725
+#define SOFT_PWM_SCALE 0
726
+
727
+// Temperature status LEDs that display the hotend and bet temperature.
728
+// If all hotends and bed temperature and temperature setpoint are < 54C then the BLUE led is on.
729
+// Otherwise the RED led is on. There is 1C hysteresis.
730
+//#define TEMP_STAT_LEDS
731
+
732
+// M240  Triggers a camera by emulating a Canon RC-1 Remote
733
+// Data from: http://www.doc-diy.net/photo/rc-1_hacked/
734
+// #define PHOTOGRAPH_PIN     23
735
+
736
+// SF send wrong arc g-codes when using Arc Point as fillet procedure
737
+//#define SF_ARC_FIX
738
+
739
+// Support for the BariCUDA Paste Extruder.
740
+//#define BARICUDA
741
+
742
+//define BlinkM/CyzRgb Support
743
+//#define BLINKM
744
+
745
+/*********************************************************************\
746
+* R/C SERVO support
747
+* Sponsored by TrinityLabs, Reworked by codexmas
748
+**********************************************************************/
749
+
750
+// Number of servos
751
+//
752
+// If you select a configuration below, this will receive a default value and does not need to be set manually
753
+// set it manually if you have more servos than extruders and wish to manually control some
754
+// leaving it undefined or defining as 0 will disable the servo subsystem
755
+// If unsure, leave commented / disabled
756
+//
757
+//#define NUM_SERVOS 3 // Servo index starts with 0 for M280 command
758
+
759
+// Servo Endstops
760
+//
761
+// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.
762
+// Use M851 to set the z-probe vertical offset from the nozzle. Store that setting with M500.
763
+//
764
+//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
765
+//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles
766
+
767
+/**********************************************************************\
768
+ * Support for a filament diameter sensor
769
+ * Also allows adjustment of diameter at print time (vs  at slicing)
770
+ * Single extruder only at this point (extruder 0)
771
+ *
772
+ * Motherboards
773
+ * 34 - RAMPS1.4 - uses Analog input 5 on the AUX2 connector
774
+ * 81 - Printrboard - Uses Analog input 2 on the Exp1 connector (version B,C,D,E)
775
+ * 301 - Rambo  - uses Analog input 3
776
+ * Note may require analog pins to be defined for different motherboards
777
+ **********************************************************************/
778
+// Uncomment below to enable
779
+//#define FILAMENT_SENSOR
780
+
781
+#define FILAMENT_SENSOR_EXTRUDER_NUM	0  //The number of the extruder that has the filament sensor (0,1,2)
782
+#define MEASUREMENT_DELAY_CM			14  //measurement delay in cm.  This is the distance from filament sensor to middle of barrel
783
+
784
+#define DEFAULT_NOMINAL_FILAMENT_DIA  1.75  //Enter the diameter (in mm) of the filament generally used (3.0 mm or 1.75 mm) - this is then used in the slicer software.  Used for sensor reading validation
785
+#define MEASURED_UPPER_LIMIT          3.30  //upper limit factor used for sensor reading validation in mm
786
+#define MEASURED_LOWER_LIMIT          1.90  //lower limit factor for sensor reading validation in mm
787
+#define MAX_MEASUREMENT_DELAY			20  //delay buffer size in bytes (1 byte = 1cm)- limits maximum measurement delay allowable (must be larger than MEASUREMENT_DELAY_CM  and lower number saves RAM)
788
+
789
+//defines used in the code
790
+#define DEFAULT_MEASURED_FILAMENT_DIA  DEFAULT_NOMINAL_FILAMENT_DIA  //set measured to nominal initially
791
+
792
+//When using an LCD, uncomment the line below to display the Filament sensor data on the last line instead of status.  Status will appear for 5 sec.
793
+//#define FILAMENT_LCD_DISPLAY
794
+
795
+
796
+
797
+
798
+
799
+
800
+#include "Configuration_adv.h"
801
+#include "thermistortables.h"
802
+
803
+#endif //CONFIGURATION_H

+ 585
- 0
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h Ver arquivo

@@ -0,0 +1,585 @@
1
+#ifndef CONFIGURATION_ADV_H
2
+#define CONFIGURATION_ADV_H
3
+
4
+#include "Conditionals.h"
5
+
6
+// @section temperature
7
+
8
+//===========================================================================
9
+//=============================Thermal Settings  ============================
10
+//===========================================================================
11
+
12
+#ifdef BED_LIMIT_SWITCHING
13
+  #define BED_HYSTERESIS 2 //only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS
14
+#endif
15
+#define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16
+
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 120   // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius
37
+#endif
38
+
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
49
+#ifdef PIDTEMP
50
+  // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
51
+  // if Kc is chosen well, the additional required power due to increased melting should be compensated.
52
+  #define PID_ADD_EXTRUSION_RATE
53
+  #ifdef PID_ADD_EXTRUSION_RATE
54
+    #define  DEFAULT_Kc (1) //heating power=Kc*(e_speed)
55
+  #endif
56
+#endif
57
+
58
+
59
+//automatic temperature: The hot end target temperature is calculated by all the buffered lines of gcode.
60
+//The maximum buffered steps/sec of the extruder motor are called "se".
61
+//You enter the autotemp mode by a M109 S<mintemp> B<maxtemp> F<factor>
62
+// the target temperature is set to mintemp+factor*se[steps/sec] and limited by mintemp and maxtemp
63
+// you exit the value by any M109 without F*
64
+// Also, if the temperature is set to a value <mintemp, it is not changed by autotemp.
65
+// on an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
66
+#define AUTOTEMP
67
+#ifdef AUTOTEMP
68
+  #define AUTOTEMP_OLDWEIGHT 0.98
69
+#endif
70
+
71
+//Show Temperature ADC value
72
+//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
73
+//#define SHOW_TEMP_ADC_VALUES
74
+
75
+// @section extruder
76
+
77
+//  extruder run-out prevention.
78
+//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
79
+//#define EXTRUDER_RUNOUT_PREVENT
80
+#define EXTRUDER_RUNOUT_MINTEMP 190
81
+#define EXTRUDER_RUNOUT_SECONDS 30.
82
+#define EXTRUDER_RUNOUT_ESTEPS 14. //mm filament
83
+#define EXTRUDER_RUNOUT_SPEED 1500.  //extrusion speed
84
+#define EXTRUDER_RUNOUT_EXTRUDE 100
85
+
86
+// @section temperature
87
+
88
+//These defines help to calibrate the AD595 sensor in case you get wrong temperature measurements.
89
+//The measured temperature is defined as "actualTemp = (measuredTemp * TEMP_SENSOR_AD595_GAIN) + TEMP_SENSOR_AD595_OFFSET"
90
+#define TEMP_SENSOR_AD595_OFFSET 0.0
91
+#define TEMP_SENSOR_AD595_GAIN   1.0
92
+
93
+//This is for controlling a fan to cool down the stepper drivers
94
+//it will turn on when any driver is enabled
95
+//and turn off after the set amount of seconds from last driver being disabled again
96
+#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
97
+#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
98
+#define CONTROLLERFAN_SPEED 255  // == full speed
99
+
100
+// When first starting the main fan, run it at full speed for the
101
+// given number of milliseconds.  This gets the fan spinning reliably
102
+// before setting a PWM value. (Does not work with software PWM for fan on Sanguinololu)
103
+//#define FAN_KICKSTART_TIME 100
104
+
105
+// @section extruder
106
+
107
+// Extruder cooling fans
108
+// Configure fan pin outputs to automatically turn on/off when the associated
109
+// extruder temperature is above/below EXTRUDER_AUTO_FAN_TEMPERATURE.
110
+// Multiple extruders can be assigned to the same pin in which case
111
+// the fan will turn on when any selected extruder is above the threshold.
112
+#define EXTRUDER_0_AUTO_FAN_PIN -1
113
+#define EXTRUDER_1_AUTO_FAN_PIN -1
114
+#define EXTRUDER_2_AUTO_FAN_PIN -1
115
+#define EXTRUDER_3_AUTO_FAN_PIN -1
116
+#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
117
+#define EXTRUDER_AUTO_FAN_SPEED   255  // == full speed
118
+
119
+
120
+//===========================================================================
121
+//=============================Mechanical Settings===========================
122
+//===========================================================================
123
+
124
+// @section homing
125
+
126
+#define ENDSTOPS_ONLY_FOR_HOMING // If defined the endstops will only be used for homing
127
+
128
+// @section extras
129
+
130
+//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.
131
+
132
+// A single Z stepper driver is usually used to drive 2 stepper motors.
133
+// Uncomment this define to utilize a separate stepper driver for each Z axis motor.
134
+// Only a few motherboards support this, like RAMPS, which have dual extruder support (the 2nd, often unused, extruder driver is used
135
+// to control the 2nd Z axis stepper motor). The pins are currently only defined for a RAMPS motherboards.
136
+// On a RAMPS (or other 5 driver) motherboard, using this feature will limit you to using 1 extruder.
137
+//#define Z_DUAL_STEPPER_DRIVERS
138
+
139
+#ifdef Z_DUAL_STEPPER_DRIVERS
140
+
141
+  // Z_DUAL_ENDSTOPS is a feature to enable the use of 2 endstops for both Z steppers - Let's call them Z stepper and Z2 stepper.
142
+  // That way the machine is capable to align the bed during home, since both Z steppers are homed. 
143
+  // There is also an implementation of M666 (software endstops adjustment) to this feature.
144
+  // After Z homing, this adjustment is applied to just one of the steppers in order to align the bed.
145
+  // One just need to home the Z axis and measure the distance difference between both Z axis and apply the math: Z adjust = Z - Z2.
146
+  // If the Z stepper axis is closer to the bed, the measure Z > Z2 (yes, it is.. think about it) and the Z adjust would be positive.
147
+  // Play a little bit with small adjustments (0.5mm) and check the behaviour.
148
+  // The M119 (endstops report) will start reporting the Z2 Endstop as well.
149
+
150
+  #define Z_DUAL_ENDSTOPS
151
+
152
+  #ifdef Z_DUAL_ENDSTOPS
153
+    #define Z2_STEP_PIN E2_STEP_PIN           // Stepper to be used to Z2 axis.
154
+    #define Z2_DIR_PIN E2_DIR_PIN
155
+    #define Z2_ENABLE_PIN E2_ENABLE_PIN
156
+    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
157
+    const bool Z2_MAX_ENDSTOP_INVERTING = false;
158
+    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
159
+  #endif
160
+
161
+#endif // Z_DUAL_STEPPER_DRIVERS
162
+
163
+// Same again but for Y Axis.
164
+//#define Y_DUAL_STEPPER_DRIVERS
165
+
166
+// Define if the two Y drives need to rotate in opposite directions
167
+#define INVERT_Y2_VS_Y_DIR true
168
+
169
+// Enable this for dual x-carriage printers.
170
+// A dual x-carriage design has the advantage that the inactive extruder can be parked which
171
+// prevents hot-end ooze contaminating the print. It also reduces the weight of each x-carriage
172
+// allowing faster printing speeds.
173
+//#define DUAL_X_CARRIAGE
174
+#ifdef DUAL_X_CARRIAGE
175
+  // Configuration for second X-carriage
176
+  // Note: the first x-carriage is defined as the x-carriage which homes to the minimum endstop;
177
+  // the second x-carriage always homes to the maximum endstop.
178
+  #define X2_MIN_POS 80     // set minimum to ensure second x-carriage doesn't hit the parked first X-carriage
179
+  #define X2_MAX_POS 353    // set maximum to the distance between toolheads when both heads are homed
180
+  #define X2_HOME_DIR 1     // the second X-carriage always homes to the maximum endstop position
181
+  #define X2_HOME_POS X2_MAX_POS // default home position is the maximum carriage position
182
+      // However: In this mode the EXTRUDER_OFFSET_X value for the second extruder provides a software
183
+      // override for X2_HOME_POS. This also allow recalibration of the distance between the two endstops
184
+      // without modifying the firmware (through the "M218 T1 X???" command).
185
+      // Remember: you should set the second extruder x-offset to 0 in your slicer.
186
+
187
+  // Pins for second x-carriage stepper driver (defined here to avoid further complicating pins.h)
188
+  #define X2_ENABLE_PIN 29
189
+  #define X2_STEP_PIN 25
190
+  #define X2_DIR_PIN 23
191
+
192
+  // There are a few selectable movement modes for dual x-carriages using M605 S<mode>
193
+  //    Mode 0: Full control. The slicer has full control over both x-carriages and can achieve optimal travel results
194
+  //                           as long as it supports dual x-carriages. (M605 S0)
195
+  //    Mode 1: Auto-park mode. The firmware will automatically park and unpark the x-carriages on tool changes so
196
+  //                           that additional slicer support is not required. (M605 S1)
197
+  //    Mode 2: Duplication mode. The firmware will transparently make the second x-carriage and extruder copy all
198
+  //                           actions of the first x-carriage. This allows the printer to print 2 arbitrary items at
199
+  //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
200
+
201
+  // This is the default power-up mode which can be later using M605.
202
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
203
+
204
+  // Default settings in "Auto-park Mode"
205
+  #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder
206
+  #define TOOLCHANGE_UNPARK_ZLIFT 1        // the distance to raise Z axis when unparking an extruder
207
+
208
+  // Default x offset in duplication mode (typically set to half print bed width)
209
+  #define DEFAULT_DUPLICATION_X_OFFSET 100
210
+
211
+#endif //DUAL_X_CARRIAGE
212
+
213
+// @section homing
214
+
215
+//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
216
+#define X_HOME_BUMP_MM 5
217
+#define Y_HOME_BUMP_MM 5
218
+#define Z_HOME_BUMP_MM 5 // deltas need the same for all three axis
219
+#define HOMING_BUMP_DIVISOR {10, 10, 20}  // Re-Bump Speed Divisor (Divides the Homing Feedrate)
220
+//#define QUICK_HOME  //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
221
+
222
+// When G28 is called, this option will make Y home before X
223
+// #define HOME_Y_BEFORE_X
224
+
225
+// @section machine
226
+
227
+#define AXIS_RELATIVE_MODES {false, false, false, false}
228
+
229
+// @section machine
230
+
231
+//By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
232
+#define INVERT_X_STEP_PIN false
233
+#define INVERT_Y_STEP_PIN false
234
+#define INVERT_Z_STEP_PIN false
235
+#define INVERT_E_STEP_PIN false
236
+
237
+// Default stepper release if idle. Set to 0 to deactivate.
238
+#define DEFAULT_STEPPER_DEACTIVE_TIME 0
239
+
240
+#define DEFAULT_MINIMUMFEEDRATE       0.0     // minimum feedrate
241
+#define DEFAULT_MINTRAVELFEEDRATE     0.0
242
+
243
+// @section lcd
244
+
245
+#ifdef ULTIPANEL
246
+  #define MANUAL_FEEDRATE {50*60, 50*60, 4*60, 60} // Feedrates for manual moves along X, Y, Z, E from panel
247
+  #define ULTIPANEL_FEEDMULTIPLY  // Comment to disable setting feedrate multiplier via encoder
248
+#endif
249
+
250
+// @section extras
251
+
252
+// minimum time in microseconds that a movement needs to take if the buffer is emptied.
253
+#define DEFAULT_MINSEGMENTTIME        20000
254
+
255
+// If defined the movements slow down when the look ahead buffer is only half full
256
+// (don't use SLOWDOWN with DELTA because DELTA generates hundreds of segments per second)
257
+//#define SLOWDOWN
258
+
259
+// Frequency limit
260
+// See nophead's blog for more info
261
+// Not working O
262
+//#define XY_FREQUENCY_LIMIT  15
263
+
264
+// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end
265
+// of the buffer and all stops. This should not be much greater than zero and should only be changed
266
+// if unwanted behavior is observed on a user's machine when running at very slow speeds.
267
+#define MINIMUM_PLANNER_SPEED 0.05// (mm/sec)
268
+
269
+// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
270
+#define MICROSTEP_MODES {16,16,16,16,16} // [1,2,4,8,16]
271
+
272
+// Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
273
+#define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
274
+
275
+// uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
276
+//#define DIGIPOT_I2C
277
+// Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
278
+#define DIGIPOT_I2C_NUM_CHANNELS 8
279
+// actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS
280
+#define DIGIPOT_I2C_MOTOR_CURRENTS {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}
281
+
282
+//===========================================================================
283
+//=============================Additional Features===========================
284
+//===========================================================================
285
+
286
+#define ENCODER_RATE_MULTIPLIER         // If defined, certain menu edit operations automatically multiply the steps when the encoder is moved quickly
287
+#define ENCODER_10X_STEPS_PER_SEC 75    // If the encoder steps per sec exceeds this value, multiply steps moved x10 to quickly advance the value
288
+#define ENCODER_100X_STEPS_PER_SEC 160  // If the encoder steps per sec exceeds this value, multiply steps moved x100 to really quickly advance the value
289
+
290
+//#define CHDK 4        //Pin for triggering CHDK to take a picture see how to use it here http://captain-slow.dk/2014/03/09/3d-printing-timelapses/
291
+#define CHDK_DELAY 50 //How long in ms the pin should stay HIGH before going LOW again
292
+
293
+// @section lcd
294
+
295
+#ifdef SDSUPPORT
296
+
297
+  // If you are using a RAMPS board or cheap E-bay purchased boards that do not detect when an SD card is inserted
298
+  // You can get round this by connecting a push button or single throw switch to the pin defined as SDCARDCARDDETECT
299
+  // in the pins.h file.  When using a push button pulling the pin to ground this will need inverted.  This setting should
300
+  // be commented out otherwise
301
+  #define SDCARDDETECTINVERTED
302
+
303
+  #define SD_FINISHED_STEPPERRELEASE true  //if sd support and the file is finished: disable steppers?
304
+  #define SD_FINISHED_RELEASECOMMAND "M84 X Y Z E" // You might want to keep the z enabled so your bed stays in place.
305
+
306
+  #define SDCARD_RATHERRECENTFIRST  //reverse file order of sd card menu display. Its sorted practically after the file system block order.
307
+  // if a file is deleted, it frees a block. hence, the order is not purely chronological. To still have auto0.g accessible, there is again the option to do that.
308
+  // using:
309
+  //#define MENU_ADDAUTOSTART
310
+
311
+  // Show a progress bar on HD44780 LCDs for SD printing
312
+  //#define LCD_PROGRESS_BAR
313
+
314
+  #ifdef LCD_PROGRESS_BAR
315
+    // Amount of time (ms) to show the bar
316
+    #define PROGRESS_BAR_BAR_TIME 2000
317
+    // Amount of time (ms) to show the status message
318
+    #define PROGRESS_BAR_MSG_TIME 3000
319
+    // Amount of time (ms) to retain the status message (0=forever)
320
+    #define PROGRESS_MSG_EXPIRE   0
321
+    // Enable this to show messages for MSG_TIME then hide them
322
+    //#define PROGRESS_MSG_ONCE
323
+  #endif
324
+
325
+#endif // SDSUPPORT
326
+
327
+// @section more
328
+
329
+// The hardware watchdog should reset the microcontroller disabling all outputs, in case the firmware gets stuck and doesn't do temperature regulation.
330
+//#define USE_WATCHDOG
331
+
332
+#ifdef USE_WATCHDOG
333
+// If you have a watchdog reboot in an ArduinoMega2560 then the device will hang forever, as a watchdog reset will leave the watchdog on.
334
+// The "WATCHDOG_RESET_MANUAL" goes around this by not using the hardware reset.
335
+//  However, THIS FEATURE IS UNSAFE!, as it will only work if interrupts are disabled. And the code could hang in an interrupt routine with interrupts disabled.
336
+//#define WATCHDOG_RESET_MANUAL
337
+#endif
338
+
339
+// Enable the option to stop SD printing when hitting and endstops, needs to be enabled from the LCD menu when this option is enabled.
340
+//#define ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
341
+
342
+// @section lcd
343
+
344
+// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
345
+// it can e.g. be used to change z-positions in the print startup phase in real-time
346
+// does not respect endstops!
347
+//#define BABYSTEPPING
348
+#ifdef BABYSTEPPING
349
+  #define BABYSTEP_XY  //not only z, but also XY in the menu. more clutter, more functions
350
+  #define BABYSTEP_INVERT_Z false  //true for inverse movements in Z
351
+  #define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
352
+#endif
353
+
354
+// @section extruder
355
+
356
+// extruder advance constant (s2/mm3)
357
+//
358
+// advance (steps) = STEPS_PER_CUBIC_MM_E * EXTRUDER_ADVANCE_K * cubic mm per second ^ 2
359
+//
360
+// Hooke's law says:    force = k * distance
361
+// Bernoulli's principle says:  v ^ 2 / 2 + g . h + pressure / density = constant
362
+// so: v ^ 2 is proportional to number of steps we advance the extruder
363
+//#define ADVANCE
364
+
365
+#ifdef ADVANCE
366
+  #define EXTRUDER_ADVANCE_K .0
367
+  #define D_FILAMENT 2.85
368
+  #define STEPS_MM_E 836
369
+#endif
370
+
371
+// @section extras
372
+
373
+// Arc interpretation settings:
374
+#define MM_PER_ARC_SEGMENT 1
375
+#define N_ARC_CORRECTION 25
376
+
377
+const unsigned int dropsegments=5; //everything with less than this number of steps will be ignored as move and joined with the next movement
378
+
379
+// @section temperature
380
+
381
+// Control heater 0 and heater 1 in parallel.
382
+//#define HEATERS_PARALLEL
383
+
384
+//===========================================================================
385
+//================================= Buffers =================================
386
+//===========================================================================
387
+
388
+// @section hidden
389
+
390
+// The number of linear motions that can be in the plan at any give time.
391
+// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
392
+#ifdef SDSUPPORT
393
+  #define BLOCK_BUFFER_SIZE 16   // SD,LCD,Buttons take more memory, block buffer needs to be smaller
394
+#else
395
+  #define BLOCK_BUFFER_SIZE 16 // maximize block buffer
396
+#endif
397
+
398
+// @section more
399
+
400
+//The ASCII buffer for receiving from the serial:
401
+#define MAX_CMD_SIZE 96
402
+#define BUFSIZE 4
403
+
404
+// Bad Serial-connections can miss a received command by sending an 'ok'
405
+// Therefore some clients abort after 30 seconds in a timeout.
406
+// Some other clients start sending commands while receiving a 'wait'.
407
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
408
+//#define NO_TIMEOUTS 1000 // Milliseconds
409
+
410
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
411
+//#define ADVANCED_OK
412
+
413
+// @section fwretract
414
+
415
+// Firmware based and LCD controlled retract
416
+// M207 and M208 can be used to define parameters for the retraction.
417
+// The retraction can be called by the slicer using G10 and G11
418
+// until then, intended retractions can be detected by moves that only extrude and the direction.
419
+// the moves are than replaced by the firmware controlled ones.
420
+
421
+#define FWRETRACT  //ONLY PARTIALLY TESTED
422
+#ifdef FWRETRACT
423
+  #define MIN_RETRACT 0.1                //minimum extruded mm to accept a automatic gcode retraction attempt
424
+  #define RETRACT_LENGTH 5               //default retract length (positive mm)
425
+  #define RETRACT_LENGTH_SWAP 13         //default swap retract length (positive mm), for extruder change
426
+  #define RETRACT_FEEDRATE 100            //default feedrate for retracting (mm/s)
427
+  #define RETRACT_ZLIFT 0                //default retract Z-lift
428
+  #define RETRACT_RECOVER_LENGTH 0       //default additional recover length (mm, added to retract length when recovering)
429
+  #define RETRACT_RECOVER_LENGTH_SWAP 0  //default additional swap recover length (mm, added to retract length when recovering from extruder change)
430
+  #define RETRACT_RECOVER_FEEDRATE 100     //default feedrate for recovering from retraction (mm/s)
431
+#endif
432
+
433
+// Add support for experimental filament exchange support M600; requires display
434
+#ifdef ULTIPANEL
435
+  //#define FILAMENTCHANGEENABLE
436
+  #ifdef FILAMENTCHANGEENABLE
437
+    #define FILAMENTCHANGE_XPOS 3
438
+    #define FILAMENTCHANGE_YPOS 3
439
+    #define FILAMENTCHANGE_ZADD 10
440
+    #define FILAMENTCHANGE_FIRSTRETRACT -2
441
+    #define FILAMENTCHANGE_FINALRETRACT -100
442
+  #endif
443
+#endif
444
+
445
+/******************************************************************************\
446
+ * enable this section if you have TMC26X motor drivers. 
447
+ * you need to import the TMC26XStepper library into the arduino IDE for this
448
+ ******************************************************************************/
449
+
450
+// @section tmc
451
+
452
+//#define HAVE_TMCDRIVER
453
+#ifdef HAVE_TMCDRIVER
454
+
455
+//  #define X_IS_TMC
456
+  #define X_MAX_CURRENT 1000  //in mA
457
+  #define X_SENSE_RESISTOR 91 //in mOhms
458
+  #define X_MICROSTEPS 16     //number of microsteps
459
+  
460
+//  #define X2_IS_TMC
461
+  #define X2_MAX_CURRENT 1000  //in mA
462
+  #define X2_SENSE_RESISTOR 91 //in mOhms
463
+  #define X2_MICROSTEPS 16     //number of microsteps
464
+  
465
+//  #define Y_IS_TMC
466
+  #define Y_MAX_CURRENT 1000  //in mA
467
+  #define Y_SENSE_RESISTOR 91 //in mOhms
468
+  #define Y_MICROSTEPS 16     //number of microsteps
469
+  
470
+//  #define Y2_IS_TMC
471
+  #define Y2_MAX_CURRENT 1000  //in mA
472
+  #define Y2_SENSE_RESISTOR 91 //in mOhms
473
+  #define Y2_MICROSTEPS 16     //number of microsteps 
474
+  
475
+//  #define Z_IS_TMC
476
+  #define Z_MAX_CURRENT 1000  //in mA
477
+  #define Z_SENSE_RESISTOR 91 //in mOhms
478
+  #define Z_MICROSTEPS 16     //number of microsteps
479
+  
480
+//  #define Z2_IS_TMC
481
+  #define Z2_MAX_CURRENT 1000  //in mA
482
+  #define Z2_SENSE_RESISTOR 91 //in mOhms
483
+  #define Z2_MICROSTEPS 16     //number of microsteps
484
+  
485
+//  #define E0_IS_TMC
486
+  #define E0_MAX_CURRENT 1000  //in mA
487
+  #define E0_SENSE_RESISTOR 91 //in mOhms
488
+  #define E0_MICROSTEPS 16     //number of microsteps
489
+  
490
+//  #define E1_IS_TMC
491
+  #define E1_MAX_CURRENT 1000  //in mA
492
+  #define E1_SENSE_RESISTOR 91 //in mOhms
493
+  #define E1_MICROSTEPS 16     //number of microsteps 
494
+  
495
+//  #define E2_IS_TMC
496
+  #define E2_MAX_CURRENT 1000  //in mA
497
+  #define E2_SENSE_RESISTOR 91 //in mOhms
498
+  #define E2_MICROSTEPS 16     //number of microsteps 
499
+  
500
+//  #define E3_IS_TMC
501
+  #define E3_MAX_CURRENT 1000  //in mA
502
+  #define E3_SENSE_RESISTOR 91 //in mOhms
503
+  #define E3_MICROSTEPS 16     //number of microsteps   
504
+
505
+#endif
506
+
507
+/******************************************************************************\
508
+ * enable this section if you have L6470  motor drivers. 
509
+ * you need to import the L6470 library into the arduino IDE for this
510
+ ******************************************************************************/
511
+
512
+// @section l6470
513
+
514
+//#define HAVE_L6470DRIVER
515
+#ifdef HAVE_L6470DRIVER
516
+
517
+//  #define X_IS_L6470
518
+  #define X_MICROSTEPS 16     //number of microsteps
519
+  #define X_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
520
+  #define X_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
521
+  #define X_STALLCURRENT 1500 //current in mA where the driver will detect a stall
522
+  
523
+//  #define X2_IS_L6470
524
+  #define X2_MICROSTEPS 16     //number of microsteps
525
+  #define X2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
526
+  #define X2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
527
+  #define X2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
528
+  
529
+//  #define Y_IS_L6470
530
+  #define Y_MICROSTEPS 16     //number of microsteps
531
+  #define Y_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
532
+  #define Y_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
533
+  #define Y_STALLCURRENT 1500 //current in mA where the driver will detect a stall
534
+  
535
+//  #define Y2_IS_L6470
536
+  #define Y2_MICROSTEPS 16     //number of microsteps 
537
+  #define Y2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
538
+  #define Y2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
539
+  #define Y2_STALLCURRENT 1500 //current in mA where the driver will detect a stall 
540
+  
541
+//  #define Z_IS_L6470
542
+  #define Z_MICROSTEPS 16     //number of microsteps
543
+  #define Z_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
544
+  #define Z_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
545
+  #define Z_STALLCURRENT 1500 //current in mA where the driver will detect a stall
546
+  
547
+//  #define Z2_IS_L6470
548
+  #define Z2_MICROSTEPS 16     //number of microsteps
549
+  #define Z2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
550
+  #define Z2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
551
+  #define Z2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
552
+  
553
+//  #define E0_IS_L6470
554
+  #define E0_MICROSTEPS 16     //number of microsteps
555
+  #define E0_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
556
+  #define E0_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
557
+  #define E0_STALLCURRENT 1500 //current in mA where the driver will detect a stall
558
+  
559
+//  #define E1_IS_L6470
560
+  #define E1_MICROSTEPS 16     //number of microsteps 
561
+  #define E1_MICROSTEPS 16     //number of microsteps
562
+  #define E1_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
563
+  #define E1_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
564
+  #define E1_STALLCURRENT 1500 //current in mA where the driver will detect a stall
565
+  
566
+//  #define E2_IS_L6470
567
+  #define E2_MICROSTEPS 16     //number of microsteps 
568
+  #define E2_MICROSTEPS 16     //number of microsteps
569
+  #define E2_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
570
+  #define E2_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
571
+  #define E2_STALLCURRENT 1500 //current in mA where the driver will detect a stall
572
+  
573
+//  #define E3_IS_L6470
574
+  #define E3_MICROSTEPS 16     //number of microsteps   
575
+  #define E3_MICROSTEPS 16     //number of microsteps
576
+  #define E3_K_VAL 50          // 0 - 255, Higher values, are higher power. Be carefull not to go too high    
577
+  #define E3_OVERCURRENT 2000  //maxc current in mA. If the current goes over this value, the driver will switch off
578
+  #define E3_STALLCURRENT 1500 //current in mA where the driver will detect a stall
579
+  
580
+#endif
581
+
582
+#include "Conditionals.h"
583
+#include "SanityCheck.h"
584
+
585
+#endif //CONFIGURATION_ADV_H

+ 24
- 41
Marlin/example_configurations/delta/generic/Configuration.h Ver arquivo

@@ -286,44 +286,24 @@ Here are some standard links for getting your machine calibrated:
286 286
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
287 287
 
288 288
 //===========================================================================
289
-//============================= Thermal Runaway Protection ==================
289
+//======================== Thermal Runaway Protection =======================
290 290
 //===========================================================================
291
-/*
292
-This is a feature to protect your printer from burn up in flames if it has
293
-a thermistor coming off place (this happened to a friend of mine recently and
294
-motivated me writing this feature).
295
-
296
-The issue: If a thermistor come off, it will read a lower temperature than actual.
297
-The system will turn the heater on forever, burning up the filament and anything
298
-else around.
299
-
300
-After the temperature reaches the target for the first time, this feature will
301
-start measuring for how long the current temperature stays below the target
302
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
303
-
304
-If it stays longer than _PERIOD, it means the thermistor temperature
305
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
306
-safe side, the system will he halt.
307
-
308
-Bear in mind the count down will just start AFTER the first time the
309
-thermistor temperature is over the target, so you will have no problem if
310
-your extruder heater takes 2 minutes to hit the target on heating.
311
-
312
-*/
313
-// If you want to enable this feature for all your extruder heaters,
314
-// uncomment the 2 defines below:
315
-
316
-// Parameters for all extruder heaters
317
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
318
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
319 291
 
320
-// If you want to enable this feature for your bed heater,
321
-// uncomment the 2 defines below:
322
-
323
-// Parameters for the bed heater
324
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
325
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
292
+/**
293
+ * Thermal Runaway Protection protects your printer from damage and fire if a
294
+ * thermistor falls out or temperature sensors fail in any way.
295
+ *
296
+ * The issue: If a thermistor falls out or a temperature sensor fails,
297
+ * Marlin can no longer sense the actual temperature. Since a disconnected
298
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
299
+ *
300
+ * The solution: Once the temperature reaches the target, start observing.
301
+ * If the temperature stays too far below the target (hysteresis) for too long,
302
+ * the firmware will halt as a safety precaution.
303
+ */
326 304
 
305
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
306
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
327 307
 
328 308
 //===========================================================================
329 309
 //============================= Mechanical Settings =========================
@@ -400,17 +380,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
400 380
 #define Z_MAX_POS MANUAL_Z_HOME_POS
401 381
 
402 382
 //===========================================================================
403
-//============================= Filament Runout Sensor ======================
383
+//========================= Filament Runout Sensor ==========================
404 384
 //===========================================================================
405 385
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
406 386
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
407 387
                                  // It is assumed that when logic high = filament available
408 388
                                  //                    when logic  low = filament ran out
409
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
410
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
411
-
389
+#ifdef FILAMENT_RUNOUT_SENSOR
390
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
391
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
392
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
393
+#endif 
394
+  
412 395
 //===========================================================================
413
-//============================ Manual Bed Leveling ==========================
396
+//=========================== Manual Bed Leveling ===========================
414 397
 //===========================================================================
415 398
 
416 399
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -431,7 +414,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
431 414
 #endif  // MESH_BED_LEVELING
432 415
 
433 416
 //===========================================================================
434
-//============================= Bed Auto Leveling ===========================
417
+//============================ Bed Auto Leveling ============================
435 418
 //===========================================================================
436 419
 
437 420
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 40
- 7
Marlin/example_configurations/delta/generic/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -377,6 +401,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
377 401
 #define MAX_CMD_SIZE 96
378 402
 #define BUFSIZE 4
379 403
 
404
+// Bad Serial-connections can miss a received command by sending an 'ok'
405
+// Therefore some clients abort after 30 seconds in a timeout.
406
+// Some other clients start sending commands while receiving a 'wait'.
407
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
408
+//#define NO_TIMEOUTS 1000 // Milliseconds
409
+
410
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
411
+//#define ADVANCED_OK
412
+
380 413
 // @section fwretract
381 414
 
382 415
 // Firmware based and LCD controlled retract

+ 24
- 41
Marlin/example_configurations/delta/kossel_mini/Configuration.h Ver arquivo

@@ -286,44 +286,24 @@ Here are some standard links for getting your machine calibrated:
286 286
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
287 287
 
288 288
 //===========================================================================
289
-//============================= Thermal Runaway Protection ==================
289
+//======================== Thermal Runaway Protection =======================
290 290
 //===========================================================================
291
-/*
292
-This is a feature to protect your printer from burn up in flames if it has
293
-a thermistor coming off place (this happened to a friend of mine recently and
294
-motivated me writing this feature).
295
-
296
-The issue: If a thermistor come off, it will read a lower temperature than actual.
297
-The system will turn the heater on forever, burning up the filament and anything
298
-else around.
299
-
300
-After the temperature reaches the target for the first time, this feature will
301
-start measuring for how long the current temperature stays below the target
302
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
303
-
304
-If it stays longer than _PERIOD, it means the thermistor temperature
305
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
306
-safe side, the system will he halt.
307
-
308
-Bear in mind the count down will just start AFTER the first time the
309
-thermistor temperature is over the target, so you will have no problem if
310
-your extruder heater takes 2 minutes to hit the target on heating.
311
-
312
-*/
313
-// If you want to enable this feature for all your extruder heaters,
314
-// uncomment the 2 defines below:
315
-
316
-// Parameters for all extruder heaters
317
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
318
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
319 291
 
320
-// If you want to enable this feature for your bed heater,
321
-// uncomment the 2 defines below:
322
-
323
-// Parameters for the bed heater
324
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
325
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
292
+/**
293
+ * Thermal Runaway Protection protects your printer from damage and fire if a
294
+ * thermistor falls out or temperature sensors fail in any way.
295
+ *
296
+ * The issue: If a thermistor falls out or a temperature sensor fails,
297
+ * Marlin can no longer sense the actual temperature. Since a disconnected
298
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
299
+ *
300
+ * The solution: Once the temperature reaches the target, start observing.
301
+ * If the temperature stays too far below the target (hysteresis) for too long,
302
+ * the firmware will halt as a safety precaution.
303
+ */
326 304
 
305
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
306
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
327 307
 
328 308
 //===========================================================================
329 309
 //============================= Mechanical Settings =========================
@@ -400,17 +380,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
400 380
 #define Z_MAX_POS MANUAL_Z_HOME_POS
401 381
 
402 382
 //===========================================================================
403
-//============================= Filament Runout Sensor ======================
383
+//========================= Filament Runout Sensor ==========================
404 384
 //===========================================================================
405 385
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
406 386
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
407 387
                                  // It is assumed that when logic high = filament available
408 388
                                  //                    when logic  low = filament ran out
409
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
410
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
411
-
389
+#ifdef FILAMENT_RUNOUT_SENSOR
390
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
391
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
392
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
393
+#endif 
394
+  
412 395
 //===========================================================================
413
-//============================ Manual Bed Leveling ==========================
396
+//=========================== Manual Bed Leveling ===========================
414 397
 //===========================================================================
415 398
 
416 399
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -431,7 +414,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
431 414
 #endif  // MESH_BED_LEVELING
432 415
 
433 416
 //===========================================================================
434
-//============================= Bed Auto Leveling ===========================
417
+//============================ Bed Auto Leveling ============================
435 418
 //===========================================================================
436 419
 
437 420
 #define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 40
- 7
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 24
- 41
Marlin/example_configurations/makibox/Configuration.h Ver arquivo

@@ -256,44 +256,24 @@ Here are some standard links for getting your machine calibrated:
256 256
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
257 257
 
258 258
 //===========================================================================
259
-//============================= Thermal Runaway Protection ==================
259
+//======================== Thermal Runaway Protection =======================
260 260
 //===========================================================================
261
-/*
262
-This is a feature to protect your printer from burn up in flames if it has
263
-a thermistor coming off place (this happened to a friend of mine recently and
264
-motivated me writing this feature).
265
-
266
-The issue: If a thermistor come off, it will read a lower temperature than actual.
267
-The system will turn the heater on forever, burning up the filament and anything
268
-else around.
269
-
270
-After the temperature reaches the target for the first time, this feature will
271
-start measuring for how long the current temperature stays below the target
272
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
273
-
274
-If it stays longer than _PERIOD, it means the thermistor temperature
275
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
276
-safe side, the system will he halt.
277
-
278
-Bear in mind the count down will just start AFTER the first time the
279
-thermistor temperature is over the target, so you will have no problem if
280
-your extruder heater takes 2 minutes to hit the target on heating.
281
-
282
-*/
283
-// If you want to enable this feature for all your extruder heaters,
284
-// uncomment the 2 defines below:
285
-
286
-// Parameters for all extruder heaters
287
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
288
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
289 261
 
290
-// If you want to enable this feature for your bed heater,
291
-// uncomment the 2 defines below:
292
-
293
-// Parameters for the bed heater
294
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
295
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
262
+/**
263
+ * Thermal Runaway Protection protects your printer from damage and fire if a
264
+ * thermistor falls out or temperature sensors fail in any way.
265
+ *
266
+ * The issue: If a thermistor falls out or a temperature sensor fails,
267
+ * Marlin can no longer sense the actual temperature. Since a disconnected
268
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
269
+ *
270
+ * The solution: Once the temperature reaches the target, start observing.
271
+ * If the temperature stays too far below the target (hysteresis) for too long,
272
+ * the firmware will halt as a safety precaution.
273
+ */
296 274
 
275
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
276
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
297 277
 
298 278
 //===========================================================================
299 279
 //============================= Mechanical Settings =========================
@@ -347,6 +327,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
347 327
 #define INVERT_X_DIR false
348 328
 #define INVERT_Y_DIR false
349 329
 #define INVERT_Z_DIR false
330
+
350 331
 #define INVERT_E0_DIR true
351 332
 #define INVERT_E1_DIR false
352 333
 #define INVERT_E2_DIR false
@@ -370,17 +351,19 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
370 351
 #define Z_MAX_POS 86
371 352
 
372 353
 //===========================================================================
373
-//============================= Filament Runout Sensor ======================
354
+//========================= Filament Runout Sensor ==========================
374 355
 //===========================================================================
375 356
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
376 357
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
377 358
                                  // It is assumed that when logic high = filament available
378 359
                                  //                    when logic  low = filament ran out
379
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
380
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
381
-
360
+#ifdef FILAMENT_RUNOUT_SENSOR
361
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
362
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
363
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
364
+#endif 
382 365
 //===========================================================================
383
-//============================ Manual Bed Leveling ==========================
366
+//=========================== Manual Bed Leveling ===========================
384 367
 //===========================================================================
385 368
 
386 369
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -401,7 +384,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic
401 384
 #endif  // MESH_BED_LEVELING
402 385
 
403 386
 //===========================================================================
404
-//============================= Bed Auto Leveling ===========================
387
+//============================ Bed Auto Leveling ============================
405 388
 //===========================================================================
406 389
 
407 390
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 40
- 7
Marlin/example_configurations/makibox/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 23
- 40
Marlin/example_configurations/tvrrug/Round2/Configuration.h Ver arquivo

@@ -258,44 +258,24 @@ Here are some standard links for getting your machine calibrated:
258 258
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.
259 259
 
260 260
 //===========================================================================
261
-//============================= Thermal Runaway Protection ==================
261
+//======================== Thermal Runaway Protection =======================
262 262
 //===========================================================================
263
-/*
264
-This is a feature to protect your printer from burn up in flames if it has
265
-a thermistor coming off place (this happened to a friend of mine recently and
266
-motivated me writing this feature).
267
-
268
-The issue: If a thermistor come off, it will read a lower temperature than actual.
269
-The system will turn the heater on forever, burning up the filament and anything
270
-else around.
271
-
272
-After the temperature reaches the target for the first time, this feature will
273
-start measuring for how long the current temperature stays below the target
274
-minus _HYSTERESIS (set_temperature - THERMAL_RUNAWAY_PROTECTION_HYSTERESIS).
275
-
276
-If it stays longer than _PERIOD, it means the thermistor temperature
277
-cannot catch up with the target, so something *may be* wrong. Then, to be on the
278
-safe side, the system will he halt.
279
-
280
-Bear in mind the count down will just start AFTER the first time the
281
-thermistor temperature is over the target, so you will have no problem if
282
-your extruder heater takes 2 minutes to hit the target on heating.
283
-
284
-*/
285
-// If you want to enable this feature for all your extruder heaters,
286
-// uncomment the 2 defines below:
287 263
 
288
-// Parameters for all extruder heaters
289
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
290
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
291
-
292
-// If you want to enable this feature for your bed heater,
293
-// uncomment the 2 defines below:
294
-
295
-// Parameters for the bed heater
296
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
297
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
264
+/**
265
+ * Thermal Runaway Protection protects your printer from damage and fire if a
266
+ * thermistor falls out or temperature sensors fail in any way.
267
+ *
268
+ * The issue: If a thermistor falls out or a temperature sensor fails,
269
+ * Marlin can no longer sense the actual temperature. Since a disconnected
270
+ * thermistor reads as a low temperature, the firmware will keep the heater on.
271
+ *
272
+ * The solution: Once the temperature reaches the target, start observing.
273
+ * If the temperature stays too far below the target (hysteresis) for too long,
274
+ * the firmware will halt as a safety precaution.
275
+ */
298 276
 
277
+#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all extruders
278
+#define THERMAL_PROTECTION_BED     // Enable thermal protection for the heated bed
299 279
 
300 280
 //===========================================================================
301 281
 //============================= Mechanical Settings =========================
@@ -372,17 +352,20 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
372 352
 #define Z_MAX_POS 120
373 353
 
374 354
 //===========================================================================
375
-//============================= Filament Runout Sensor ======================
355
+//========================= Filament Runout Sensor ==========================
376 356
 //===========================================================================
377 357
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
378 358
                                  // In RAMPS uses servo pin 2. Can be changed in pins file. For other boards pin definition should be made.
379 359
                                  // It is assumed that when logic high = filament available
380 360
                                  //                    when logic  low = filament ran out
381
-//const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
382
-//#define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
361
+#ifdef FILAMENT_RUNOUT_SENSOR
362
+  const bool FIL_RUNOUT_INVERTING = true;  // Should be uncommented and true or false should assigned
363
+  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
364
+  #define FILAMENT_RUNOUT_SCRIPT "M600"
365
+#endif 
383 366
 
384 367
 //===========================================================================
385
-//============================ Manual Bed Leveling ==========================
368
+//=========================== Manual Bed Leveling ===========================
386 369
 //===========================================================================
387 370
 
388 371
 // #define MANUAL_BED_LEVELING  // Add display menu option for bed leveling
@@ -403,7 +386,7 @@ const bool Z_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the logic
403 386
 #endif  // MESH_BED_LEVELING
404 387
 
405 388
 //===========================================================================
406
-//============================= Bed Auto Leveling ===========================
389
+//============================ Bed Auto Leveling ============================
407 390
 //===========================================================================
408 391
 
409 392
 //#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)

+ 40
- 7
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h Ver arquivo

@@ -14,14 +14,38 @@
14 14
 #endif
15 15
 #define BED_CHECK_INTERVAL 5000 //ms between checks in bang-bang control
16 16
 
17
-//// Heating sanity check:
18
-// This waits for the watch period in milliseconds whenever an M104 or M109 increases the target temperature
19
-// If the temperature has not increased at the end of that period, the target temperature is set to zero.
20
-// It can be reset with another M104/M109. This check is also only triggered if the target temperature and the current temperature
21
-//  differ by at least 2x WATCH_TEMP_INCREASE
22
-//#define WATCH_TEMP_PERIOD 40000 //40 seconds
23
-//#define WATCH_TEMP_INCREASE 10  //Heat up at least 10 degree in 20 seconds
17
+/**
18
+ * Thermal Protection parameters
19
+ */
20
+#ifdef THERMAL_PROTECTION_HOTENDS
21
+  #define THERMAL_PROTECTION_PERIOD 40        // Seconds
22
+  #define THERMAL_PROTECTION_HYSTERESIS 4     // Degrees Celsius
23
+
24
+  /**
25
+   * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
26
+   * WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
27
+   * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
28
+   * but only if the current temperature is far enough below the target for a reliable test.
29
+   */
30
+  #define WATCH_TEMP_PERIOD 16                // Seconds
31
+  #define WATCH_TEMP_INCREASE 4               // Degrees Celsius
32
+#endif
33
+
34
+#ifdef THERMAL_PROTECTION_BED
35
+  #define THERMAL_PROTECTION_BED_PERIOD 20    // Seconds
36
+  #define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
37
+#endif
24 38
 
39
+/**
40
+ * Automatic Temperature:
41
+ * The hotend target temperature is calculated by all the buffered lines of gcode.
42
+ * The maximum buffered steps/sec of the extruder motor is called "se".
43
+ * Start autotemp mode with M109 S<mintemp> B<maxtemp> F<factor>
44
+ * The target temperature is set to mintemp+factor*se[steps/sec] and is limited by
45
+ * mintemp and maxtemp. Turn this off by excuting M109 without F*
46
+ * Also, if the temperature is set to a value below mintemp, it will not be changed by autotemp.
47
+ * On an Ultimaker, some initial testing worked with M109 S215 B260 F1 in the start.gcode
48
+ */
25 49
 #ifdef PIDTEMP
26 50
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
27 51
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
@@ -376,6 +400,15 @@ const unsigned int dropsegments=5; //everything with less than this number of st
376 400
 #define MAX_CMD_SIZE 96
377 401
 #define BUFSIZE 4
378 402
 
403
+// Bad Serial-connections can miss a received command by sending an 'ok'
404
+// Therefore some clients abort after 30 seconds in a timeout.
405
+// Some other clients start sending commands while receiving a 'wait'.
406
+// This "wait" is only sent when the buffer is empty. 1 second is a good value here.
407
+//#define NO_TIMEOUTS 1000 // Milliseconds
408
+
409
+// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary.
410
+//#define ADVANCED_OK
411
+
379 412
 // @section fwretract
380 413
 
381 414
 // Firmware based and LCD controlled retract

+ 11
- 10
Marlin/language.h Ver arquivo

@@ -123,22 +123,24 @@
123 123
 #define MSG_FREE_MEMORY                     " Free Memory: "
124 124
 #define MSG_PLANNER_BUFFER_BYTES            "  PlannerBufferBytes: "
125 125
 #define MSG_OK                              "ok"
126
+#define MSG_WAIT                            "wait"
126 127
 #define MSG_FILE_SAVED                      "Done saving file."
127
-#define MSG_ERR_LINE_NO1                    "Line Number out of sequence. Expected: "
128
-#define MSG_ERR_LINE_NO2                    " Got: "
128
+#define MSG_ERR_LINE_NO                     "Line Number is not Last Line Number+1, Last Line: "
129 129
 #define MSG_ERR_CHECKSUM_MISMATCH           "checksum mismatch, Last Line: "
130 130
 #define MSG_ERR_NO_CHECKSUM                 "No Checksum with line number, Last Line: "
131 131
 #define MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM "No Line Number with checksum, Last Line: "
132 132
 #define MSG_FILE_PRINTED                    "Done printing file"
133 133
 #define MSG_BEGIN_FILE_LIST                 "Begin file list"
134 134
 #define MSG_END_FILE_LIST                   "End file list"
135
-#define MSG_M104_INVALID_EXTRUDER           "M104 Invalid extruder "
136
-#define MSG_M105_INVALID_EXTRUDER           "M105 Invalid extruder "
137
-#define MSG_M200_INVALID_EXTRUDER           "M200 Invalid extruder "
138
-#define MSG_M218_INVALID_EXTRUDER           "M218 Invalid extruder "
139
-#define MSG_M221_INVALID_EXTRUDER           "M221 Invalid extruder "
135
+#define MSG_INVALID_EXTRUDER                "Invalid extruder"
136
+#define MSG_INVALID_SOLENOID                "Invalid solenoid"
137
+#define MSG_M104_INVALID_EXTRUDER           "M104 " MSG_INVALID_EXTRUDER " "
138
+#define MSG_M105_INVALID_EXTRUDER           "M105 " MSG_INVALID_EXTRUDER " "
139
+#define MSG_M109_INVALID_EXTRUDER           "M109 " MSG_INVALID_EXTRUDER " "
140
+#define MSG_M200_INVALID_EXTRUDER           "M200 " MSG_INVALID_EXTRUDER " "
141
+#define MSG_M218_INVALID_EXTRUDER           "M218 " MSG_INVALID_EXTRUDER " "
142
+#define MSG_M221_INVALID_EXTRUDER           "M221 " MSG_INVALID_EXTRUDER " "
140 143
 #define MSG_ERR_NO_THERMISTORS              "No thermistors - no temperature"
141
-#define MSG_M109_INVALID_EXTRUDER           "M109 Invalid extruder "
142 144
 #define MSG_HEATING                         "Heating..."
143 145
 #define MSG_HEATING_COMPLETE                "Heating done."
144 146
 #define MSG_BED_HEATING                     "Bed Heating."
@@ -150,8 +152,6 @@
150 152
 #define MSG_RESEND                          "Resend: "
151 153
 #define MSG_UNKNOWN_COMMAND                 "Unknown command: \""
152 154
 #define MSG_ACTIVE_EXTRUDER                 "Active Extruder: "
153
-#define MSG_INVALID_EXTRUDER                "Invalid extruder"
154
-#define MSG_INVALID_SOLENOID                "Invalid solenoid"
155 155
 #define MSG_X_MIN                           "x_min: "
156 156
 #define MSG_X_MAX                           "x_max: "
157 157
 #define MSG_Y_MIN                           "y_min: "
@@ -163,6 +163,7 @@
163 163
 #define MSG_ERR_MATERIAL_INDEX              "M145 S<index> out of range (0-1)"
164 164
 #define MSG_ERR_M421_REQUIRES_XYZ           "M421 requires XYZ parameters"
165 165
 #define MSG_ERR_MESH_INDEX_OOB              "Mesh XY index is out of bounds"
166
+#define MSG_ERR_M428_TOO_FAR                "Too far from reference point"
166 167
 #define MSG_M119_REPORT                     "Reporting endstop status"
167 168
 #define MSG_ENDSTOP_HIT                     "TRIGGERED"
168 169
 #define MSG_ENDSTOP_OPEN                    "open"

+ 8
- 7
Marlin/language_fr.h Ver arquivo

@@ -39,16 +39,17 @@
39 39
 #define MSG_EXTRUDE                         "Extrusion"
40 40
 #define MSG_RETRACT                         "Retraction"
41 41
 #define MSG_MOVE_AXIS                       "Deplacer un axe"
42
-#define MSG_MOVE_X                          "Move X"
43
-#define MSG_MOVE_Y                          "Move Y"
44
-#define MSG_MOVE_Z                          "Move Z"
42
+#define MSG_MOVE_X                          "Depl. X"
43
+#define MSG_MOVE_Y                          "Depl. Y"
44
+#define MSG_MOVE_Z                          "Depl. Z"
45 45
 #define MSG_MOVE_E                          "Extruder"
46
-#define MSG_MOVE_01MM                       "Move 0.1mm"
47
-#define MSG_MOVE_1MM                        "Move 1mm"
48
-#define MSG_MOVE_10MM                       "Move 10mm"
46
+#define MSG_MOVE_01MM                       "Depl. 0.1mm"
47
+#define MSG_MOVE_1MM                        "Depl. 1mm"
48
+#define MSG_MOVE_10MM                       "Depl. 10mm"
49 49
 #define MSG_SPEED                           " Vitesse"
50 50
 #define MSG_NOZZLE                          "Buse"
51 51
 #define MSG_BED                             "Plateau"
52
+#define MSG_LEVEL_BED                       "Regl. Niv. Plateau"
52 53
 #define MSG_FAN_SPEED                       "Vite. ventilateur"
53 54
 #define MSG_FLOW                            "Flux"
54 55
 #define MSG_CONTROL                         "Controler"
@@ -102,7 +103,7 @@
102 103
 #define MSG_DWELL                           "Repos..."
103 104
 #define MSG_USERWAIT                        "Atten. de l'util."
104 105
 #define MSG_RESUMING                        "Repri. de l'impr."
105
-#define MSG_PRINT_ABORTED                   "Print aborted"
106
+#define MSG_PRINT_ABORTED                   "Impr. Annulee"
106 107
 #define MSG_NO_MOVE                         "Aucun mouvement."
107 108
 #define MSG_KILLED                          "MORT."
108 109
 #define MSG_STOPPED                         "STOPPE."

+ 0
- 145
Marlin/motion_control.cpp Ver arquivo

@@ -1,145 +0,0 @@
1
-/*
2
-  motion_control.c - high level interface for issuing motion commands
3
-  Part of Grbl
4
-
5
-  Copyright (c) 2009-2011 Simen Svale Skogsrud
6
-  Copyright (c) 2011 Sungeun K. Jeon
7
-  
8
-  Grbl is free software: you can redistribute it and/or modify
9
-  it under the terms of the GNU General Public License as published by
10
-  the Free Software Foundation, either version 3 of the License, or
11
-  (at your option) any later version.
12
-
13
-  Grbl is distributed in the hope that it will be useful,
14
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-  GNU General Public License for more details.
17
-
18
-  You should have received a copy of the GNU General Public License
19
-  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
20
-*/
21
-
22
-#include "Marlin.h"
23
-#include "stepper.h"
24
-#include "planner.h"
25
-
26
-// The arc is approximated by generating a huge number of tiny, linear segments. The length of each 
27
-// segment is configured in settings.mm_per_arc_segment.  
28
-void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8_t axis_1, 
29
-  uint8_t axis_linear, float feed_rate, float radius, uint8_t isclockwise, uint8_t extruder)
30
-{      
31
-  //   int acceleration_manager_was_enabled = plan_is_acceleration_manager_enabled();
32
-  //   plan_set_acceleration_manager_enabled(false); // disable acceleration management for the duration of the arc
33
-  float center_axis0 = position[axis_0] + offset[axis_0];
34
-  float center_axis1 = position[axis_1] + offset[axis_1];
35
-  float linear_travel = target[axis_linear] - position[axis_linear];
36
-  float extruder_travel = target[E_AXIS] - position[E_AXIS];
37
-  float r_axis0 = -offset[axis_0];  // Radius vector from center to current location
38
-  float r_axis1 = -offset[axis_1];
39
-  float rt_axis0 = target[axis_0] - center_axis0;
40
-  float rt_axis1 = target[axis_1] - center_axis1;
41
-  
42
-  // CCW angle between position and target from circle center. Only one atan2() trig computation required.
43
-  float angular_travel = atan2(r_axis0*rt_axis1-r_axis1*rt_axis0, r_axis0*rt_axis0+r_axis1*rt_axis1);
44
-  if (angular_travel < 0) { angular_travel += 2*M_PI; }
45
-  if (isclockwise) { angular_travel -= 2*M_PI; }
46
-  
47
-  //20141002:full circle for G03 did not work, e.g. G03 X80 Y80 I20 J0 F2000 is giving an Angle of zero so head is not moving
48
-  //to compensate when start pos = target pos && angle is zero -> angle = 2Pi
49
-  if (position[axis_0] == target[axis_0] && position[axis_1] == target[axis_1] && angular_travel == 0)
50
-  {
51
-	  angular_travel += 2*M_PI;
52
-  }
53
-  //end fix G03
54
-  
55
-  float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
56
-  if (millimeters_of_travel < 0.001) { return; }
57
-  uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);
58
-  if(segments == 0) segments = 1;
59
-  
60
-  /*  
61
-    // Multiply inverse feed_rate to compensate for the fact that this movement is approximated
62
-    // by a number of discrete segments. The inverse feed_rate should be correct for the sum of 
63
-    // all segments.
64
-    if (invert_feed_rate) { feed_rate *= segments; }
65
-  */
66
-  float theta_per_segment = angular_travel/segments;
67
-  float linear_per_segment = linear_travel/segments;
68
-  float extruder_per_segment = extruder_travel/segments;
69
-  
70
-  /* Vector rotation by transformation matrix: r is the original vector, r_T is the rotated vector,
71
-     and phi is the angle of rotation. Based on the solution approach by Jens Geisler.
72
-         r_T = [cos(phi) -sin(phi);
73
-                sin(phi)  cos(phi] * r ;
74
-     
75
-     For arc generation, the center of the circle is the axis of rotation and the radius vector is 
76
-     defined from the circle center to the initial position. Each line segment is formed by successive
77
-     vector rotations. This requires only two cos() and sin() computations to form the rotation
78
-     matrix for the duration of the entire arc. Error may accumulate from numerical round-off, since
79
-     all double numbers are single precision on the Arduino. (True double precision will not have
80
-     round off issues for CNC applications.) Single precision error can accumulate to be greater than
81
-     tool precision in some cases. Therefore, arc path correction is implemented. 
82
-
83
-     Small angle approximation may be used to reduce computation overhead further. This approximation
84
-     holds for everything, but very small circles and large mm_per_arc_segment values. In other words,
85
-     theta_per_segment would need to be greater than 0.1 rad and N_ARC_CORRECTION would need to be large
86
-     to cause an appreciable drift error. N_ARC_CORRECTION~=25 is more than small enough to correct for 
87
-     numerical drift error. N_ARC_CORRECTION may be on the order a hundred(s) before error becomes an
88
-     issue for CNC machines with the single precision Arduino calculations.
89
-     
90
-     This approximation also allows mc_arc to immediately insert a line segment into the planner 
91
-     without the initial overhead of computing cos() or sin(). By the time the arc needs to be applied
92
-     a correction, the planner should have caught up to the lag caused by the initial mc_arc overhead. 
93
-     This is important when there are successive arc motions. 
94
-  */
95
-  // Vector rotation matrix values
96
-  float cos_T = 1-0.5*theta_per_segment*theta_per_segment; // Small angle approximation
97
-  float sin_T = theta_per_segment;
98
-  
99
-  float arc_target[4];
100
-  float sin_Ti;
101
-  float cos_Ti;
102
-  float r_axisi;
103
-  uint16_t i;
104
-  int8_t count = 0;
105
-
106
-  // Initialize the linear axis
107
-  arc_target[axis_linear] = position[axis_linear];
108
-  
109
-  // Initialize the extruder axis
110
-  arc_target[E_AXIS] = position[E_AXIS];
111
-
112
-  for (i = 1; i<segments; i++) { // Increment (segments-1)
113
-    
114
-    if (count < N_ARC_CORRECTION) {
115
-      // Apply vector rotation matrix 
116
-      r_axisi = r_axis0*sin_T + r_axis1*cos_T;
117
-      r_axis0 = r_axis0*cos_T - r_axis1*sin_T;
118
-      r_axis1 = r_axisi;
119
-      count++;
120
-    } else {
121
-      // Arc correction to radius vector. Computed only every N_ARC_CORRECTION increments.
122
-      // Compute exact location by applying transformation matrix from initial radius vector(=-offset).
123
-      cos_Ti = cos(i*theta_per_segment);
124
-      sin_Ti = sin(i*theta_per_segment);
125
-      r_axis0 = -offset[axis_0]*cos_Ti + offset[axis_1]*sin_Ti;
126
-      r_axis1 = -offset[axis_0]*sin_Ti - offset[axis_1]*cos_Ti;
127
-      count = 0;
128
-    }
129
-
130
-    // Update arc_target location
131
-    arc_target[axis_0] = center_axis0 + r_axis0;
132
-    arc_target[axis_1] = center_axis1 + r_axis1;
133
-    arc_target[axis_linear] += linear_per_segment;
134
-    arc_target[E_AXIS] += extruder_per_segment;
135
-
136
-    clamp_to_software_endstops(arc_target);
137
-    plan_buffer_line(arc_target[X_AXIS], arc_target[Y_AXIS], arc_target[Z_AXIS], arc_target[E_AXIS], feed_rate, extruder);
138
-    
139
-  }
140
-  // Ensure last segment arrives at target location.
141
-  plan_buffer_line(target[X_AXIS], target[Y_AXIS], target[Z_AXIS], target[E_AXIS], feed_rate, extruder);
142
-
143
-  //   plan_set_acceleration_manager_enabled(acceleration_manager_was_enabled);
144
-}
145
-

+ 0
- 32
Marlin/motion_control.h Ver arquivo

@@ -1,32 +0,0 @@
1
-/*
2
-  motion_control.h - high level interface for issuing motion commands
3
-  Part of Grbl
4
-
5
-  Copyright (c) 2009-2011 Simen Svale Skogsrud
6
-  Copyright (c) 2011 Sungeun K. Jeon
7
-  
8
-  Grbl is free software: you can redistribute it and/or modify
9
-  it under the terms of the GNU General Public License as published by
10
-  the Free Software Foundation, either version 3 of the License, or
11
-  (at your option) any later version.
12
-
13
-  Grbl is distributed in the hope that it will be useful,
14
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
-  GNU General Public License for more details.
17
-
18
-  You should have received a copy of the GNU General Public License
19
-  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
20
-*/
21
-
22
-#ifndef motion_control_h
23
-#define motion_control_h
24
-
25
-// Execute an arc in offset mode format. position == current xyz, target == target xyz, 
26
-// offset == offset from current xyz, axis_XXX defines circle plane in tool space, axis_linear is
27
-// the direction of helical travel, radius == circle radius, isclockwise boolean. Used
28
-// for vector transformation direction.
29
-void mc_arc(float *position, float *target, float *offset, unsigned char axis_0, unsigned char axis_1,
30
-  unsigned char axis_linear, float feed_rate, float radius, unsigned char isclockwise, uint8_t extruder);
31
-  
32
-#endif

+ 2
- 1
Marlin/pins.h Ver arquivo

@@ -34,7 +34,7 @@
34 34
   #include "pins_SETHI.h"
35 35
 #elif MB(RAMPS_OLD)
36 36
   #include "pins_RAMPS_OLD.h"
37
-#elif MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF)
37
+#elif MB(RAMPS_13_EFB) || MB(RAMPS_13_EEB) || MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
38 38
   #include "pins_RAMPS_13.h"
39 39
 #elif MB(DUEMILANOVE_328P)
40 40
   #include "pins_DUEMILANOVE_328P.h"
@@ -190,6 +190,7 @@
190 190
 #endif
191 191
 
192 192
 #if defined(DISABLE_Z_PROBE_ENDSTOP) || !defined(Z_PROBE_ENDSTOP) // Allow code to compile regardless of Z_PROBE_ENDSTOP setting.
193
+  #undef Z_PROBE_PIN
193 194
   #define Z_PROBE_PIN        -1
194 195
 #endif
195 196
 

+ 13
- 8
Marlin/pins_MEGATRONICS_3.h Ver arquivo

@@ -8,6 +8,11 @@
8 8
 
9 9
 #define LARGE_FLASH        true
10 10
 
11
+
12
+#ifdef Z_PROBE_SLED
13
+  #define SLED_PIN         -1
14
+#endif
15
+
11 16
 // Servo support
12 17
 #ifdef NUM_SERVOS
13 18
   #define SERVO0_PIN       46 //AUX3-6
@@ -26,19 +31,19 @@
26 31
 #define X_DIR_PIN          57
27 32
 #define X_ENABLE_PIN       59
28 33
 #define X_MIN_PIN          37
29
-#define X_MAX_PIN          40   // 2 // Max endstops default to disabled "-1", set to commented value to enable.
34
+#define X_MAX_PIN          40 // put to -1 to disable  
30 35
 
31
-#define Y_STEP_PIN         5 // A6
32
-#define Y_DIR_PIN          17 // A0
36
+#define Y_STEP_PIN         5 
37
+#define Y_DIR_PIN          17 
33 38
 #define Y_ENABLE_PIN       4
34 39
 #define Y_MIN_PIN          41
35
-#define Y_MAX_PIN          38   // 15
40
+#define Y_MAX_PIN          38 // put to -1 to disable
36 41
 
37
-#define Z_STEP_PIN         16 // A2
38
-#define Z_DIR_PIN          11 // A6
39
-#define Z_ENABLE_PIN       3 // A1
42
+#define Z_STEP_PIN         16 
43
+#define Z_DIR_PIN          11
44
+#define Z_ENABLE_PIN       3 
40 45
 #define Z_MIN_PIN          18
41
-#define Z_MAX_PIN          19
46
+#define Z_MAX_PIN          19 // put to -1 to disable
42 47
 
43 48
 #define E0_STEP_PIN        28
44 49
 #define E0_DIR_PIN         27

+ 11
- 0
Marlin/pins_MKS_BASE.h Ver arquivo

@@ -0,0 +1,11 @@
1
+/**
2
+ * MKS BASE 1.0 – Arduino Mega2560 with RAMPS v1.4 pin assignments
3
+ */
4
+
5
+#include "pins_RAMPS_13.h"
6
+
7
+#undef FAN_PIN
8
+#define FAN_PIN             9 // (Sprinter config)
9
+
10
+#undef HEATER_1_PIN
11
+#define HEATER_1_PIN        7

+ 13
- 12
Marlin/pins_OMCA.h Ver arquivo

@@ -48,9 +48,9 @@
48 48
 #define Z_ENABLE_PIN       10
49 49
 #define Z_STOP_PIN         2
50 50
 
51
-#define E0_STEP_PIN         24
52
-#define E0_DIR_PIN          21
53
-#define E0_ENABLE_PIN       10
51
+#define E0_STEP_PIN        24
52
+#define E0_DIR_PIN         21
53
+#define E0_ENABLE_PIN      10
54 54
 
55 55
 // future proofing
56 56
 #define __FS  20
@@ -58,15 +58,15 @@
58 58
 #define __GS  18
59 59
 #define __GD  13
60 60
 
61
-#define UNUSED_PWM           14 // PWM on LEFT connector
61
+#define UNUSED_PWM         14 // PWM on LEFT connector
62 62
 
63
-#define E1_STEP_PIN         -1 // 21
64
-#define E1_DIR_PIN          -1 // 20
65
-#define E1_ENABLE_PIN       -1 // 19
63
+#define E1_STEP_PIN        -1 // 21
64
+#define E1_DIR_PIN         -1 // 20
65
+#define E1_ENABLE_PIN      -1 // 19
66 66
 
67
-#define E2_STEP_PIN         -1 // 21
68
-#define E2_DIR_PIN          -1 // 20
69
-#define E2_ENABLE_PIN       -1 // 18
67
+#define E2_STEP_PIN        -1 // 21
68
+#define E2_DIR_PIN         -1 // 20
69
+#define E2_ENABLE_PIN      -1 // 18
70 70
 
71 71
 #define SDPOWER            -1
72 72
 #define SDSS               11
@@ -87,5 +87,6 @@
87 87
 #define HEATER_BED_PIN      4
88 88
 #define TEMP_BED_PIN        2 // 1,2 or I2C
89 89
 
90
-#define I2C_SCL       16
91
-#define I2C_SDA       17
90
+#define I2C_SCL            16
91
+#define I2C_SDA            17
92
+

+ 4
- 0
Marlin/pins_RAMBO.h Ver arquivo

@@ -22,6 +22,10 @@
22 22
   #endif
23 23
 #endif
24 24
 
25
+#ifdef Z_PROBE_SLED
26
+  #define SLED_PIN         -1
27
+#endif
28
+
25 29
 #undef X_MS1_PIN
26 30
 #undef X_MS2_PIN
27 31
 #undef Y_MS1_PIN

+ 8
- 3
Marlin/pins_RAMPS_13.h Ver arquivo

@@ -7,6 +7,7 @@
7 7
  *  RAMPS_13_EEB (Extruder, Extruder, Bed)
8 8
  *  RAMPS_13_EFF (Extruder, Fan, Fan)
9 9
  *  RAMPS_13_EEF (Extruder, Extruder, Fan)
10
+ *  RAMPS_13_SF  (Spindle, Controller Fan)
10 11
  *
11 12
  *  Other pins_MYBOARD.h files may override these defaults
12 13
  */
@@ -81,7 +82,7 @@
81 82
   #if MB(RAMPS_13_EFF)
82 83
     #define CONTROLLERFAN_PIN  -1 // Pin used for the fan to cool controller
83 84
   #endif
84
-#elif MB(RAMPS_13_EEF)
85
+#elif MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
85 86
   #define FAN_PIN            8
86 87
 #else
87 88
   #define FAN_PIN            4 // IO pin. Buffer needed
@@ -101,7 +102,7 @@
101 102
   #define HEATER_0_PIN       10   // EXTRUDER 1
102 103
 #endif
103 104
 
104
-#if MB(RAMPS_13_EFB)
105
+#if MB(RAMPS_13_EFB) || MB(RAMPS_13_SF)
105 106
   #define HEATER_1_PIN       -1
106 107
 #else
107 108
   #define HEATER_1_PIN       9    // EXTRUDER 2 (FAN On Sprinter)
@@ -113,7 +114,7 @@
113 114
 #define TEMP_1_PIN         15   // ANALOG NUMBERING
114 115
 #define TEMP_2_PIN         -1   // ANALOG NUMBERING
115 116
 
116
-#if MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF)
117
+#if MB(RAMPS_13_EFF) || MB(RAMPS_13_EEF) || MB(RAMPS_13_SF)
117 118
   #define HEATER_BED_PIN     -1    // NO BED
118 119
 #else
119 120
   #define HEATER_BED_PIN     8    // BED
@@ -134,6 +135,10 @@
134 135
   #endif
135 136
 #endif
136 137
 
138
+#ifdef Z_PROBE_SLED
139
+  #define SLED_PIN         -1
140
+#endif
141
+
137 142
 #ifdef ULTRA_LCD
138 143
 
139 144
   #ifdef NEWPANEL

+ 4
- 0
Marlin/pins_SANGUINOLOLU_11.h Ver arquivo

@@ -44,6 +44,10 @@
44 44
   #define FAN_PIN            4
45 45
 #endif
46 46
 
47
+#ifdef Z_PROBE_SLED
48
+  #define SLED_PIN         -1
49
+#endif
50
+
47 51
 #ifdef NUM_SERVOS
48 52
   #define SERVO0_PIN          -1
49 53
 

+ 8
- 7
Marlin/planner.cpp Ver arquivo

@@ -429,11 +429,12 @@ void check_axes_activity() {
429 429
     #ifdef FAN_KICKSTART_TIME
430 430
       static millis_t fan_kick_end;
431 431
       if (tail_fan_speed) {
432
+        millis_t ms = millis();
432 433
         if (fan_kick_end == 0) {
433 434
           // Just starting up fan - run at full power.
434
-          fan_kick_end = millis() + FAN_KICKSTART_TIME;
435
+          fan_kick_end = ms + FAN_KICKSTART_TIME;
435 436
           tail_fan_speed = 255;
436
-        } else if (fan_kick_end > millis())
437
+        } else if (fan_kick_end > ms)
437 438
           // Fan still spinning up.
438 439
           tail_fan_speed = 255;
439 440
         } else {
@@ -959,7 +960,7 @@ float junction_deviation = 0.1;
959 960
     vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS));
960 961
 
961 962
     //position.debug("in plan_get position");
962
-    //plan_bed_level_matrix.debug("in plan_get bed_level");
963
+    //plan_bed_level_matrix.debug("in plan_get_position");
963 964
     matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_level_matrix);
964 965
     //inverse.debug("in plan_get inverse");
965 966
     position.apply_rotation(inverse);
@@ -981,10 +982,10 @@ float junction_deviation = 0.1;
981 982
       apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
982 983
     #endif
983 984
 
984
-    float nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]);
985
-    float ny = position[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]);
986
-    float nz = position[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]);
987
-    float ne = position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
985
+    float nx = position[X_AXIS] = lround(x * axis_steps_per_unit[X_AXIS]),
986
+          ny = position[Y_AXIS] = lround(y * axis_steps_per_unit[Y_AXIS]),
987
+          nz = position[Z_AXIS] = lround(z * axis_steps_per_unit[Z_AXIS]),
988
+          ne = position[E_AXIS] = lround(e * axis_steps_per_unit[E_AXIS]);
988 989
     st_set_position(nx, ny, nz, ne);
989 990
     previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest.
990 991
 

Marlin/Servo.cpp → Marlin/servo.cpp Ver arquivo

@@ -48,7 +48,7 @@
48 48
 #include <avr/interrupt.h>
49 49
 #include <Arduino.h>
50 50
 
51
-#include "Servo.h"
51
+#include "servo.h"
52 52
 
53 53
 #define usToTicks(_us)    (( clockCyclesPerMicrosecond()* _us) / 8)     // converts microseconds to tick (assumes prescale of 8)  // 12 Aug 2009
54 54
 #define ticksToUs(_ticks) (( (unsigned)_ticks * 8)/ clockCyclesPerMicrosecond() ) // converts from ticks back to microseconds

Marlin/Servo.h → Marlin/servo.h Ver arquivo


+ 139
- 164
Marlin/stepper.cpp Ver arquivo

@@ -1,22 +1,23 @@
1
-/*
2
-  stepper.c - stepper motor driver: executes motion plans using stepper motors
3
-  Part of Grbl
4
-
5
-  Copyright (c) 2009-2011 Simen Svale Skogsrud
6
-
7
-  Grbl is free software: you can redistribute it and/or modify
8
-  it under the terms of the GNU General Public License as published by
9
-  the Free Software Foundation, either version 3 of the License, or
10
-  (at your option) any later version.
11
-
12
-  Grbl is distributed in the hope that it will be useful,
13
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
-  GNU General Public License for more details.
16
-
17
-  You should have received a copy of the GNU General Public License
18
-  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
19
-*/
1
+/**
2
+ * stepper.cpp - stepper motor driver: executes motion plans using stepper motors
3
+ * Marlin Firmware
4
+ *
5
+ * Derived from Grbl
6
+ * Copyright (c) 2009-2011 Simen Svale Skogsrud
7
+ *
8
+ * Grbl is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * Grbl is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
20
+ */
20 21
 
21 22
 /* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith
22 23
    and Philipp Tiefenbacher. */
@@ -45,7 +46,7 @@ block_t *current_block;  // A pointer to the block currently being traced
45 46
 //static makes it impossible to be called from outside of this file by extern.!
46 47
 
47 48
 // Variables used by The Stepper Driver Interrupt
48
-static unsigned char out_bits;        // The next stepping-bits to be output
49
+static unsigned char out_bits = 0;        // The next stepping-bits to be output
49 50
 static unsigned int cleaning_buffer_counter;
50 51
 
51 52
 #ifdef Z_DUAL_ENDSTOPS
@@ -73,10 +74,7 @@ static unsigned short step_loops_nominal;
73 74
 
74 75
 volatile long endstops_trigsteps[3] = { 0 };
75 76
 volatile long endstops_stepsTotal, endstops_stepsDone;
76
-static volatile bool endstop_x_hit = false;
77
-static volatile bool endstop_y_hit = false;
78
-static volatile bool endstop_z_hit = false;
79
-static volatile bool endstop_z_probe_hit = false; // Leaving this in even if Z_PROBE_ENDSTOP isn't defined, keeps code below cleaner. #ifdef it and usage below to save space.
77
+static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROBE as BIT value
80 78
 
81 79
 #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
82 80
   bool abort_on_endstop_hit = false;
@@ -264,27 +262,27 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
264 262
 #define DISABLE_STEPPER_DRIVER_INTERRUPT() TIMSK1 &= ~BIT(OCIE1A)
265 263
 
266 264
 void endstops_hit_on_purpose() {
267
-  endstop_x_hit = endstop_y_hit = endstop_z_hit = endstop_z_probe_hit = false; // #ifdef endstop_z_probe_hit = to save space if needed.
265
+  endstop_hit_bits = 0;
268 266
 }
269 267
 
270 268
 void checkHitEndstops() {
271
-  if (endstop_x_hit || endstop_y_hit || endstop_z_hit || endstop_z_probe_hit) { // #ifdef || endstop_z_probe_hit to save space if needed.
269
+  if (endstop_hit_bits) { // #ifdef || endstop_z_probe_hit to save space if needed.
272 270
     SERIAL_ECHO_START;
273 271
     SERIAL_ECHOPGM(MSG_ENDSTOPS_HIT);
274
-    if (endstop_x_hit) {
272
+    if (endstop_hit_bits & BIT(X_MIN)) {
275 273
       SERIAL_ECHOPAIR(" X:", (float)endstops_trigsteps[X_AXIS] / axis_steps_per_unit[X_AXIS]);
276 274
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "X");
277 275
     }
278
-    if (endstop_y_hit) {
276
+    if (endstop_hit_bits & BIT(Y_MIN)) {
279 277
       SERIAL_ECHOPAIR(" Y:", (float)endstops_trigsteps[Y_AXIS] / axis_steps_per_unit[Y_AXIS]);
280 278
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Y");
281 279
     }
282
-    if (endstop_z_hit) {
280
+    if (endstop_hit_bits & BIT(Z_MIN)) {
283 281
       SERIAL_ECHOPAIR(" Z:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
284 282
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "Z");
285 283
     }
286 284
     #ifdef Z_PROBE_ENDSTOP
287
-    if (endstop_z_probe_hit) {
285
+    if (endstop_hit_bits & BIT(Z_PROBE)) {
288 286
       SERIAL_ECHOPAIR(" Z_PROBE:", (float)endstops_trigsteps[Z_AXIS] / axis_steps_per_unit[Z_AXIS]);
289 287
       LCD_MESSAGEPGM(MSG_ENDSTOPS_HIT "ZP");
290 288
     }
@@ -366,9 +364,58 @@ FORCE_INLINE unsigned short calc_timer(unsigned short step_rate) {
366 364
   return timer;
367 365
 }
368 366
 
367
+// set the stepper direction of each axis
368
+void set_stepper_direction() {
369
+  
370
+  // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
371
+  if (TEST(out_bits, X_AXIS)) {
372
+    X_APPLY_DIR(INVERT_X_DIR,0);
373
+    count_direction[X_AXIS] = -1;
374
+  }
375
+  else {
376
+    X_APPLY_DIR(!INVERT_X_DIR,0);
377
+    count_direction[X_AXIS] = 1;
378
+  }
379
+
380
+  if (TEST(out_bits, Y_AXIS)) {
381
+    Y_APPLY_DIR(INVERT_Y_DIR,0);
382
+    count_direction[Y_AXIS] = -1;
383
+  }
384
+  else {
385
+    Y_APPLY_DIR(!INVERT_Y_DIR,0);
386
+    count_direction[Y_AXIS] = 1;
387
+  }
388
+  
389
+  if (TEST(out_bits, Z_AXIS)) {
390
+    Z_APPLY_DIR(INVERT_Z_DIR,0);
391
+    count_direction[Z_AXIS] = -1;
392
+  }
393
+  else {
394
+    Z_APPLY_DIR(!INVERT_Z_DIR,0);
395
+    count_direction[Z_AXIS] = 1;
396
+  }
397
+  
398
+  #ifndef ADVANCE
399
+    if (TEST(out_bits, E_AXIS)) {
400
+      REV_E_DIR();
401
+      count_direction[E_AXIS] = -1;
402
+    }
403
+    else {
404
+      NORM_E_DIR();
405
+      count_direction[E_AXIS] = 1;
406
+    }
407
+  #endif //!ADVANCE
408
+}
409
+
369 410
 // Initializes the trapezoid generator from the current block. Called whenever a new
370 411
 // block begins.
371 412
 FORCE_INLINE void trapezoid_generator_reset() {
413
+
414
+  if (current_block->direction_bits != out_bits) {
415
+    out_bits = current_block->direction_bits;
416
+    set_stepper_direction();
417
+  }
418
+  
372 419
   #ifdef ADVANCE
373 420
     advance = current_block->initial_advance;
374 421
     final_advance = current_block->final_advance;
@@ -441,47 +488,27 @@ ISR(TIMER1_COMPA_vect) {
441 488
   }
442 489
 
443 490
   if (current_block != NULL) {
444
-    // Set directions TO DO This should be done once during init of trapezoid. Endstops -> interrupt
445
-    out_bits = current_block->direction_bits;
446
-
447
-    // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY)
448
-    if (TEST(out_bits, X_AXIS)) {
449
-      X_APPLY_DIR(INVERT_X_DIR,0);
450
-      count_direction[X_AXIS] = -1;
451
-    }
452
-    else {
453
-      X_APPLY_DIR(!INVERT_X_DIR,0);
454
-      count_direction[X_AXIS] = 1;
455
-    }
456
-
457
-    if (TEST(out_bits, Y_AXIS)) {
458
-      Y_APPLY_DIR(INVERT_Y_DIR,0);
459
-      count_direction[Y_AXIS] = -1;
460
-    }
461
-    else {
462
-      Y_APPLY_DIR(!INVERT_Y_DIR,0);
463
-      count_direction[Y_AXIS] = 1;
464
-    }
465
-
466
-    #define _ENDSTOP(axis, minmax) axis ##_## minmax ##_endstop
467
-    #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
468
-    #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
469
-    #define _OLD_ENDSTOP(axis, minmax) old_## axis ##_## minmax ##_endstop
470
-    #define _AXIS(AXIS) AXIS ##_AXIS
471
-    #define _ENDSTOP_HIT(axis) endstop_## axis ##_hit
472
-
473
-    #define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \
474
-      bool _ENDSTOP(axis, minmax) = (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)); \
475
-      if (_ENDSTOP(axis, minmax) && _OLD_ENDSTOP(axis, minmax) && (current_block->steps[_AXIS(AXIS)] > 0)) { \
476
-        endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \
477
-        _ENDSTOP_HIT(axis) = true; \
478
-        step_events_completed = current_block->step_event_count; \
479
-      } \
480
-      _OLD_ENDSTOP(axis, minmax) = _ENDSTOP(axis, minmax);
481
-
482 491
 
483
-    // Check X and Y endstops
492
+    // Check endstops
484 493
     if (check_endstops) {
494
+      
495
+      #define _ENDSTOP(axis, minmax) axis ##_## minmax ##_endstop
496
+      #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
497
+      #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
498
+      #define _OLD_ENDSTOP(axis, minmax) old_## axis ##_## minmax ##_endstop
499
+      #define _AXIS(AXIS) AXIS ##_AXIS
500
+      #define _HIT_BIT(AXIS) AXIS ##_MIN
501
+      #define _ENDSTOP_HIT(AXIS) endstop_hit_bits |= BIT(_HIT_BIT(AXIS))
502
+
503
+      #define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \
504
+        bool _ENDSTOP(axis, minmax) = (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)); \
505
+        if (_ENDSTOP(axis, minmax) && _OLD_ENDSTOP(axis, minmax) && (current_block->steps[_AXIS(AXIS)] > 0)) { \
506
+          endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \
507
+          _ENDSTOP_HIT(AXIS); \
508
+          step_events_completed = current_block->step_event_count; \
509
+        } \
510
+        _OLD_ENDSTOP(axis, minmax) = _ENDSTOP(axis, minmax);
511
+      
485 512
       #ifdef COREXY
486 513
         // Head direction in -X axis for CoreXY bots.
487 514
         // If DeltaX == -DeltaY, the movement is only in Y axis
@@ -534,15 +561,7 @@ ISR(TIMER1_COMPA_vect) {
534 561
       #ifdef COREXY
535 562
         }
536 563
       #endif
537
-    }
538
-
539
-    if (TEST(out_bits, Z_AXIS)) {   // -direction
540
-
541
-      Z_APPLY_DIR(INVERT_Z_DIR,0);
542
-      count_direction[Z_AXIS] = -1;
543
-
544
-      if (check_endstops) {
545
-
564
+      if (TEST(out_bits, Z_AXIS)) { // z -direction
546 565
         #if HAS_Z_MIN
547 566
 
548 567
           #ifdef Z_DUAL_ENDSTOPS
@@ -560,7 +579,7 @@ ISR(TIMER1_COMPA_vect) {
560 579
                 z2_min_both = z2_min_endstop && old_z2_min_endstop;
561 580
             if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) {
562 581
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
563
-              endstop_z_hit = true;
582
+              endstop_hit_bits |= BIT(Z_MIN);
564 583
               if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing...
565 584
                 step_events_completed = current_block->step_event_count;
566 585
             }
@@ -581,23 +600,13 @@ ISR(TIMER1_COMPA_vect) {
581 600
           if(z_probe_endstop && old_z_probe_endstop)
582 601
           {
583 602
             endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
584
-            endstop_z_probe_hit=true;
585
-
586
-//            if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
603
+            endstop_hit_bits |= BIT(Z_PROBE);
604
+  //        if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
587 605
           }
588 606
           old_z_probe_endstop = z_probe_endstop;
589 607
         #endif
590
-
591
-      } // check_endstops
592
-
593
-    }
594
-    else { // +direction
595
-
596
-      Z_APPLY_DIR(!INVERT_Z_DIR,0);
597
-      count_direction[Z_AXIS] = 1;
598
-
599
-      if (check_endstops) {
600
-
608
+      }
609
+      else { // z +direction
601 610
         #if HAS_Z_MAX
602 611
 
603 612
           #ifdef Z_DUAL_ENDSTOPS
@@ -615,7 +624,7 @@ ISR(TIMER1_COMPA_vect) {
615 624
                 z2_max_both = z2_max_endstop && old_z2_max_endstop;
616 625
             if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) {
617 626
               endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
618
-              endstop_z_hit = true;
627
+              endstop_hit_bits |= BIT(Z_MIN);
619 628
 
620 629
              // if (z_max_both) SERIAL_ECHOLN("z_max_endstop = true");
621 630
              // if (z2_max_both) SERIAL_ECHOLN("z2_max_endstop = true");
@@ -633,33 +642,23 @@ ISR(TIMER1_COMPA_vect) {
633 642
           #endif // !Z_DUAL_ENDSTOPS
634 643
 
635 644
         #endif // Z_MAX_PIN
636
-
645
+        
637 646
         #ifdef Z_PROBE_ENDSTOP
638 647
           UPDATE_ENDSTOP(z, Z, probe, PROBE);
639 648
           z_probe_endstop=(READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING);
640 649
           if(z_probe_endstop && old_z_probe_endstop)
641 650
           {
642 651
             endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
643
-            endstop_z_probe_hit=true;
644
-//            if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
652
+            endstop_hit_bits |= BIT(Z_PROBE);
653
+//          if (z_probe_endstop && old_z_probe_endstop) SERIAL_ECHOLN("z_probe_endstop = true");
645 654
           }
646 655
           old_z_probe_endstop = z_probe_endstop;
647 656
         #endif
657
+      }
648 658
 
649
-      } // check_endstops
659
+    }
650 660
 
651
-    } // +direction
652 661
 
653
-    #ifndef ADVANCE
654
-      if (TEST(out_bits, E_AXIS)) {  // -direction
655
-        REV_E_DIR();
656
-        count_direction[E_AXIS] = -1;
657
-      }
658
-      else { // +direction
659
-        NORM_E_DIR();
660
-        count_direction[E_AXIS] = 1;
661
-      }
662
-    #endif //!ADVANCE
663 662
 
664 663
     // Take multiple steps per interrupt (For high speed moves)
665 664
     for (int8_t i = 0; i < step_loops; i++) {
@@ -676,60 +675,34 @@ ISR(TIMER1_COMPA_vect) {
676 675
       #endif //ADVANCE
677 676
 
678 677
       #define _COUNTER(axis) counter_## axis
679
-      #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
680 678
       #define _APPLY_STEP(AXIS) AXIS ##_APPLY_STEP
681 679
       #define _INVERT_STEP_PIN(AXIS) INVERT_## AXIS ##_STEP_PIN
682 680
 
683
-      #ifdef CONFIG_STEPPERS_TOSHIBA
684
-        /**
685
-         * The Toshiba stepper controller require much longer pulses.
686
-         * So we 'stage' decompose the pulses between high and low
687
-         * instead of doing each in turn. The extra tests add enough
688
-         * lag to allow it work with without needing NOPs
689
-         */
690
-        #define STEP_ADD(axis, AXIS) \
691
-         _COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
692
-         if (_COUNTER(axis) > 0) { _WRITE_STEP(AXIS, HIGH); }
693
-        STEP_ADD(x,X);
694
-        STEP_ADD(y,Y);
695
-        STEP_ADD(z,Z);
696
-        #ifndef ADVANCE
697
-          STEP_ADD(e,E);
698
-        #endif
699
-
700
-        #define STEP_IF_COUNTER(axis, AXIS) \
701
-          if (_COUNTER(axis) > 0) { \
702
-            _COUNTER(axis) -= current_block->step_event_count; \
703
-            count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
704
-            _WRITE_STEP(AXIS, LOW); \
705
-          }
706
-
707
-        STEP_IF_COUNTER(x, X);
708
-        STEP_IF_COUNTER(y, Y);
709
-        STEP_IF_COUNTER(z, Z);
710
-        #ifndef ADVANCE
711
-          STEP_IF_COUNTER(e, E);
712
-        #endif
681
+      #define STEP_ADD(axis, AXIS) \
682
+        _COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
683
+        if (_COUNTER(axis) > 0) { _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); }
713 684
 
714
-      #else // !CONFIG_STEPPERS_TOSHIBA
685
+      STEP_ADD(x,X);
686
+      STEP_ADD(y,Y);
687
+      STEP_ADD(z,Z);
688
+      #ifndef ADVANCE
689
+        STEP_ADD(e,E);
690
+      #endif
715 691
 
716
-        #define APPLY_MOVEMENT(axis, AXIS) \
717
-          _COUNTER(axis) += current_block->steps[_AXIS(AXIS)]; \
718
-          if (_COUNTER(axis) > 0) { \
719
-            _APPLY_STEP(AXIS)(!_INVERT_STEP_PIN(AXIS),0); \
720
-            _COUNTER(axis) -= current_block->step_event_count; \
721
-            count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
722
-            _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
723
-          }
692
+      #define STEP_IF_COUNTER(axis, AXIS) \
693
+        if (_COUNTER(axis) > 0) { \
694
+          _COUNTER(axis) -= current_block->step_event_count; \
695
+          count_position[_AXIS(AXIS)] += count_direction[_AXIS(AXIS)]; \
696
+          _APPLY_STEP(AXIS)(_INVERT_STEP_PIN(AXIS),0); \
697
+        }
724 698
 
725
-        APPLY_MOVEMENT(x, X);
726
-        APPLY_MOVEMENT(y, Y);
727
-        APPLY_MOVEMENT(z, Z);
728
-        #ifndef ADVANCE
729
-          APPLY_MOVEMENT(e, E);
730
-        #endif
699
+      STEP_IF_COUNTER(x, X);
700
+      STEP_IF_COUNTER(y, Y);
701
+      STEP_IF_COUNTER(z, Z);
702
+      #ifndef ADVANCE
703
+        STEP_IF_COUNTER(e, E);
704
+      #endif
731 705
 
732
-      #endif // CONFIG_STEPPERS_TOSHIBA
733 706
       step_events_completed++;
734 707
       if (step_events_completed >= current_block->step_event_count) break;
735 708
     }
@@ -1016,14 +989,15 @@ void st_init() {
1016 989
     #endif
1017 990
   #endif
1018 991
 
1019
-#if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used.
1020
-  SET_INPUT(Z_PROBE_PIN);
1021
-  #ifdef ENDSTOPPULLUP_ZPROBE
1022
-    WRITE(Z_PROBE_PIN,HIGH);
992
+  #if (defined(Z_PROBE_PIN) && Z_PROBE_PIN >= 0) && defined(Z_PROBE_ENDSTOP) // Check for Z_PROBE_ENDSTOP so we don't pull a pin high unless it's to be used.
993
+    SET_INPUT(Z_PROBE_PIN);
994
+    #ifdef ENDSTOPPULLUP_ZPROBE
995
+      WRITE(Z_PROBE_PIN,HIGH);
996
+    #endif
1023 997
   #endif
1024
-#endif
1025 998
 
1026 999
   #define _STEP_INIT(AXIS) AXIS ##_STEP_INIT
1000
+  #define _WRITE_STEP(AXIS, HIGHLOW) AXIS ##_STEP_WRITE(HIGHLOW)
1027 1001
   #define _DISABLE(axis) disable_## axis()
1028 1002
 
1029 1003
   #define AXIS_INIT(axis, AXIS, PIN) \
@@ -1099,6 +1073,8 @@ void st_init() {
1099 1073
 
1100 1074
   enable_endstops(true); // Start with endstops active. After homing they can be disabled
1101 1075
   sei();
1076
+  
1077
+  set_stepper_direction(); // Init directions to out_bits = 0
1102 1078
 }
1103 1079
 
1104 1080
 
@@ -1136,9 +1112,8 @@ long st_get_position(uint8_t axis) {
1136 1112
 
1137 1113
 #ifdef ENABLE_AUTO_BED_LEVELING
1138 1114
 
1139
-  float st_get_position_mm(uint8_t axis) {
1140
-    float steper_position_in_steps = st_get_position(axis);
1141
-    return steper_position_in_steps / axis_steps_per_unit[axis];
1115
+  float st_get_position_mm(AxisEnum axis) {
1116
+    return st_get_position(axis) / axis_steps_per_unit[axis];
1142 1117
   }
1143 1118
 
1144 1119
 #endif  // ENABLE_AUTO_BED_LEVELING

+ 3
- 3
Marlin/stepper.h Ver arquivo

@@ -67,9 +67,9 @@ void st_set_e_position(const long &e);
67 67
 long st_get_position(uint8_t axis);
68 68
 
69 69
 #ifdef ENABLE_AUTO_BED_LEVELING
70
-// Get current position in mm
71
-float st_get_position_mm(uint8_t axis);
72
-#endif  //ENABLE_AUTO_BED_LEVELING
70
+  // Get current position in mm
71
+  float st_get_position_mm(AxisEnum axis);
72
+#endif
73 73
 
74 74
 // The stepper subsystem goes to sleep when it runs out of things to execute. Call this
75 75
 // to notify the subsystem that it is time to go to work.

+ 56
- 46
Marlin/temperature.cpp Ver arquivo

@@ -73,16 +73,14 @@ unsigned char soft_pwm_bed;
73 73
   int current_raw_filwidth = 0;  //Holds measured filament diameter - one extruder only
74 74
 #endif  
75 75
 
76
-#define HAS_HEATER_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_PERIOD) && THERMAL_RUNAWAY_PROTECTION_PERIOD > 0)
77
-#define HAS_BED_THERMAL_PROTECTION (defined(THERMAL_RUNAWAY_PROTECTION_BED_PERIOD) && THERMAL_RUNAWAY_PROTECTION_BED_PERIOD > 0 && TEMP_SENSOR_BED != 0)
78
-#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
76
+#if defined(THERMAL_PROTECTION_HOTENDS) || defined(THERMAL_PROTECTION_BED)
79 77
   enum TRState { TRReset, TRInactive, TRFirstHeating, TRStable, TRRunaway };
80 78
   void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc);
81
-  #if HAS_HEATER_THERMAL_PROTECTION
79
+  #ifdef THERMAL_PROTECTION_HOTENDS
82 80
     static TRState thermal_runaway_state_machine[4] = { TRReset, TRReset, TRReset, TRReset };
83 81
     static millis_t thermal_runaway_timer[4]; // = {0,0,0,0};
84 82
   #endif
85
-  #if HAS_BED_THERMAL_PROTECTION
83
+  #ifdef THERMAL_PROTECTION_BED
86 84
     static TRState thermal_runaway_bed_state_machine = TRReset;
87 85
     static millis_t thermal_runaway_bed_timer;
88 86
   #endif
@@ -170,10 +168,10 @@ static float analog2temp(int raw, uint8_t e);
170 168
 static float analog2tempBed(int raw);
171 169
 static void updateTemperaturesFromRawValues();
172 170
 
173
-#ifdef WATCH_TEMP_PERIOD
174
-  int watch_start_temp[EXTRUDERS] = { 0 };
175
-  millis_t watchmillis[EXTRUDERS] = { 0 };
176
-#endif //WATCH_TEMP_PERIOD
171
+#ifdef THERMAL_PROTECTION_HOTENDS
172
+  int watch_target_temp[EXTRUDERS] = { 0 };
173
+  millis_t watch_heater_next_ms[EXTRUDERS] = { 0 };
174
+#endif
177 175
 
178 176
 #ifndef SOFT_PWM_SCALE
179 177
   #define SOFT_PWM_SCALE 0
@@ -247,8 +245,8 @@ void PID_autotune(float temp, int extruder, int ncycles)
247 245
         }
248 246
       #endif
249 247
 
250
-      if (heating == true && input > temp) {
251
-        if (ms - t2 > 5000) {
248
+      if (heating && input > temp) {
249
+        if (ms > t2 + 5000) {
252 250
           heating = false;
253 251
           if (extruder < 0)
254 252
             soft_pwm_bed = (bias - d) >> 1;
@@ -259,8 +257,9 @@ void PID_autotune(float temp, int extruder, int ncycles)
259 257
           max = temp;
260 258
         }
261 259
       }
262
-      if (heating == false && input < temp) {
263
-        if (ms - t1 > 5000) {
260
+
261
+      if (!heating && input < temp) {
262
+        if (ms > t1 + 5000) {
264 263
           heating = true;
265 264
           t2 = ms;
266 265
           t_low = t2 - t1;
@@ -313,7 +312,8 @@ void PID_autotune(float temp, int extruder, int ncycles)
313 312
         }
314 313
       } 
315 314
     }
316
-    if (input > temp + 20) {
315
+    #define MAX_OVERSHOOT_PID_AUTOTUNE 20
316
+    if (input > temp + MAX_OVERSHOOT_PID_AUTOTUNE) {
317 317
       SERIAL_PROTOCOLLNPGM(MSG_PID_TEMP_TOO_HIGH);
318 318
       return;
319 319
     }
@@ -447,14 +447,14 @@ void checkExtruderAutoFans()
447 447
 //
448 448
 // Temperature Error Handlers
449 449
 //
450
-inline void _temp_error(int e, const char *msg1, const char *msg2) {
450
+inline void _temp_error(int e, const char *serial_msg, const char *lcd_msg) {
451 451
   if (IsRunning()) {
452 452
     SERIAL_ERROR_START;
453 453
     if (e >= 0) SERIAL_ERRORLN((int)e);
454
-    serialprintPGM(msg1);
454
+    serialprintPGM(serial_msg);
455 455
     MYSERIAL.write('\n');
456 456
     #ifdef ULTRA_LCD
457
-      lcd_setalertstatuspgm(msg2);
457
+      lcd_setalertstatuspgm(lcd_msg);
458 458
     #endif
459 459
   }
460 460
   #ifndef BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE
@@ -602,17 +602,17 @@ void manage_heater() {
602 602
     float ct = current_temperature[0];
603 603
     if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
604 604
     if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
605
-  #endif //HEATER_0_USES_MAX6675
605
+  #endif
606 606
 
607
-  #if defined(WATCH_TEMP_PERIOD) || !defined(PIDTEMPBED) || HAS_AUTO_FAN
607
+  #if defined(THERMAL_PROTECTION_HOTENDS) || !defined(PIDTEMPBED) || HAS_AUTO_FAN
608 608
     millis_t ms = millis();
609 609
   #endif
610 610
 
611 611
   // Loop through all extruders
612 612
   for (int e = 0; e < EXTRUDERS; e++) {
613 613
 
614
-    #if HAS_HEATER_THERMAL_PROTECTION
615
-      thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_RUNAWAY_PROTECTION_PERIOD, THERMAL_RUNAWAY_PROTECTION_HYSTERESIS);
614
+    #ifdef THERMAL_PROTECTION_HOTENDS
615
+      thermal_runaway_protection(&thermal_runaway_state_machine[e], &thermal_runaway_timer[e], current_temperature[e], target_temperature[e], e, THERMAL_PROTECTION_PERIOD, THERMAL_PROTECTION_HYSTERESIS);
616 616
     #endif
617 617
 
618 618
     float pid_output = get_pid_output(e);
@@ -620,26 +620,31 @@ void manage_heater() {
620 620
     // Check if temperature is within the correct range
621 621
     soft_pwm[e] = current_temperature[e] > minttemp[e] && current_temperature[e] < maxttemp[e] ? (int)pid_output >> 1 : 0;
622 622
 
623
-    #ifdef WATCH_TEMP_PERIOD
624
-      if (watchmillis[e] && ms > watchmillis[e] + WATCH_TEMP_PERIOD) {
625
-        if (degHotend(e) < watch_start_temp[e] + WATCH_TEMP_INCREASE) {
626
-          setTargetHotend(0, e);
627
-          LCD_MESSAGEPGM(MSG_HEATING_FAILED_LCD); // translatable
628
-          SERIAL_ECHO_START;
629
-          SERIAL_ECHOLNPGM(MSG_HEATING_FAILED);
623
+    // Check if the temperature is failing to increase
624
+    #ifdef THERMAL_PROTECTION_HOTENDS
625
+
626
+      // Is it time to check this extruder's heater?
627
+      if (watch_heater_next_ms[e] && ms > watch_heater_next_ms[e]) {
628
+        // Has it failed to increase enough?
629
+        if (degHotend(e) < watch_target_temp[e]) {
630
+          // Stop!
631
+          disable_all_heaters();
632
+          _temp_error(e, PSTR(MSG_HEATING_FAILED), PSTR(MSG_HEATING_FAILED_LCD));
630 633
         }
631 634
         else {
632
-          watchmillis[e] = 0;
635
+          // Start again if the target is still far off
636
+          start_watching_heater(e);
633 637
         }
634 638
       }
635
-    #endif //WATCH_TEMP_PERIOD
639
+
640
+    #endif // THERMAL_PROTECTION_HOTENDS
636 641
 
637 642
     #ifdef TEMP_SENSOR_1_AS_REDUNDANT
638 643
       if (fabs(current_temperature[0] - redundant_temperature) > MAX_REDUNDANT_TEMP_SENSOR_DIFF) {
639 644
         disable_all_heaters();
640 645
         _temp_error(0, PSTR(MSG_EXTRUDER_SWITCHED_OFF), PSTR(MSG_ERR_REDUNDANT_TEMP));
641 646
       }
642
-    #endif // TEMP_SENSOR_1_AS_REDUNDANT
647
+    #endif
643 648
 
644 649
   } // Extruders Loop
645 650
 
@@ -672,8 +677,8 @@ void manage_heater() {
672 677
 
673 678
   #if TEMP_SENSOR_BED != 0
674 679
   
675
-    #if HAS_BED_THERMAL_PROTECTION
676
-      thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_RUNAWAY_PROTECTION_BED_PERIOD, THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS);
680
+    #ifdef THERMAL_PROTECTION_BED
681
+      thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS);
677 682
     #endif
678 683
 
679 684
     #ifdef PIDTEMPBED
@@ -784,7 +789,7 @@ static void updateTemperaturesFromRawValues() {
784 789
   #ifdef HEATER_0_USES_MAX6675
785 790
     current_temperature_raw[0] = read_max6675();
786 791
   #endif
787
-  for(uint8_t e = 0; e < EXTRUDERS; e++) {
792
+  for (uint8_t e = 0; e < EXTRUDERS; e++) {
788 793
     current_temperature[e] = analog2temp(current_temperature_raw[e], e);
789 794
   }
790 795
   current_temperature_bed = analog2tempBed(current_temperature_bed_raw);
@@ -996,19 +1001,24 @@ void tp_init() {
996 1001
   #endif //BED_MAXTEMP
997 1002
 }
998 1003
 
999
-void setWatch() {
1000
-  #ifdef WATCH_TEMP_PERIOD
1001
-    millis_t ms = millis();
1002
-    for (int e = 0; e < EXTRUDERS; e++) {
1003
-      if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
1004
-        watch_start_temp[e] = degHotend(e);
1005
-        watchmillis[e] = ms;
1006
-      } 
1004
+#ifdef THERMAL_PROTECTION_HOTENDS
1005
+  /**
1006
+   * Start Heating Sanity Check for hotends that are below
1007
+   * their target temperature by a configurable margin.
1008
+   * This is called when the temperature is set. (M104, M109)
1009
+   */
1010
+  void start_watching_heater(int e) {
1011
+    millis_t ms = millis() + WATCH_TEMP_PERIOD * 1000;
1012
+    if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
1013
+      watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
1014
+      watch_heater_next_ms[e] = ms;
1007 1015
     }
1008
-  #endif 
1009
-}
1016
+    else
1017
+      watch_heater_next_ms[e] = 0;
1018
+  }
1019
+#endif
1010 1020
 
1011
-#if HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1021
+#if defined(THERMAL_PROTECTION_HOTENDS) || defined(THERMAL_PROTECTION_BED)
1012 1022
 
1013 1023
   void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
1014 1024
 
@@ -1074,7 +1084,7 @@ void setWatch() {
1074 1084
     }
1075 1085
   }
1076 1086
 
1077
-#endif // HAS_HEATER_THERMAL_PROTECTION || HAS_BED_THERMAL_PROTECTION
1087
+#endif // THERMAL_PROTECTION_HOTENDS || THERMAL_PROTECTION_BED
1078 1088
 
1079 1089
 void disable_all_heaters() {
1080 1090
   for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);

+ 4
- 1
Marlin/temperature.h Ver arquivo

@@ -130,7 +130,6 @@ HOTEND_ROUTINES(0);
130 130
 
131 131
 int getHeaterPower(int heater);
132 132
 void disable_all_heaters();
133
-void setWatch();
134 133
 void updatePID();
135 134
 
136 135
 void PID_autotune(float temp, int extruder, int ncycles);
@@ -138,6 +137,10 @@ void PID_autotune(float temp, int extruder, int ncycles);
138 137
 void setExtruderAutoFanState(int pin, bool state);
139 138
 void checkExtruderAutoFans();
140 139
 
140
+#ifdef THERMAL_PROTECTION_HOTENDS
141
+  void start_watching_heater(int e=0);
142
+#endif
143
+
141 144
 FORCE_INLINE void autotempShutdown() {
142 145
   #ifdef AUTOTEMP
143 146
     if (autotemp_enabled) {

+ 50
- 32
Marlin/ultralcd.cpp Ver arquivo

@@ -7,12 +7,11 @@
7 7
 #include "stepper.h"
8 8
 #include "configuration_store.h"
9 9
 
10
-int8_t encoderDiff; /* encoderDiff is updated from interrupt context and added to encoderPosition every LCD update */
10
+int8_t encoderDiff; // updated from interrupt context and added to encoderPosition every LCD update
11 11
 
12 12
 bool encoderRateMultiplierEnabled;
13 13
 int32_t lastEncoderMovementMillis;
14 14
 
15
-/* Configuration settings */
16 15
 int plaPreheatHotendTemp;
17 16
 int plaPreheatHPBTemp;
18 17
 int plaPreheatFanSpeed;
@@ -25,9 +24,7 @@ int absPreheatFanSpeed;
25 24
   millis_t previous_lcd_status_ms = 0;
26 25
 #endif
27 26
 
28
-/* !Configuration settings */
29
-
30
-//Function pointer to menu functions.
27
+// Function pointer to menu functions.
31 28
 typedef void (*menuFunc_t)();
32 29
 
33 30
 uint8_t lcd_status_message_level;
@@ -212,11 +209,11 @@ static void lcd_status_screen();
212 209
       } } while(0)
213 210
 
214 211
   /** Used variables to keep track of the menu */
215
-  #ifndef REPRAPWORLD_KEYPAD
216
-    volatile uint8_t buttons; // Bits of the pressed buttons.
217
-  #else
218
-    volatile uint8_t buttons_reprapworld_keypad; // The reprapworld_keypad shift register values
212
+  volatile uint8_t buttons;  //the last checked buttons in a bit array.
213
+  #ifdef REPRAPWORLD_KEYPAD
214
+    volatile uint8_t buttons_reprapworld_keypad; // to store the keypad shift register values
219 215
   #endif
216
+    
220 217
   #ifdef LCD_HAS_SLOW_BUTTONS
221 218
     volatile uint8_t slow_buttons; // Bits of the pressed buttons.
222 219
   #endif
@@ -438,17 +435,12 @@ static void lcd_main_menu() {
438 435
   }
439 436
 #endif
440 437
 
438
+/**
439
+ * Set the home offset based on the current_position
440
+ */
441 441
 void lcd_set_home_offsets() {
442
-  for (int8_t i=0; i < NUM_AXIS; i++) {
443
-    if (i != E_AXIS) {
444
-      home_offset[i] -= current_position[i];
445
-      current_position[i] = 0.0;
446
-    }
447
-  }
448
-  plan_set_position(0.0, 0.0, 0.0, current_position[E_AXIS]);
449
-
450
-  // Audio feedback
451
-  enqueuecommands_P(PSTR("M300 S659 P200\nM300 S698 P200"));
442
+  // M428 Command
443
+  enqueuecommands_P(PSTR("M428"));
452 444
   lcd_return_to_status();
453 445
 }
454 446
 
@@ -526,7 +518,9 @@ void _lcd_preheat(int endnum, const float temph, const float tempb, const int fa
526 518
   setTargetBed(tempb);
527 519
   fanSpeed = fan;
528 520
   lcd_return_to_status();
529
-  setWatch(); // heater sanity check timer
521
+  #ifdef WATCH_TEMP_PERIOD
522
+    if (endnum >= 0) start_watching_heater(endnum);
523
+  #endif
530 524
 }
531 525
 void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
532 526
 void lcd_preheat_abs0() { _lcd_preheat(0, absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed); }
@@ -878,10 +872,17 @@ static void lcd_control_menu() {
878 872
  * "Control" > "Temperature" submenu
879 873
  *
880 874
  */
881
-
882 875
 static void lcd_control_temperature_menu() {
883 876
   START_MENU();
877
+
878
+  //
879
+  // ^ Control
880
+  //
884 881
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
882
+
883
+  //
884
+  // Nozzle, Nozzle 2, Nozzle 3, Nozzle 4
885
+  //
885 886
   #if TEMP_SENSOR_0 != 0
886 887
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_NOZZLE, &target_temperature[0], 0, HEATER_0_MAXTEMP - 15);
887 888
   #endif
@@ -900,16 +901,32 @@ static void lcd_control_temperature_menu() {
900 901
       #endif // EXTRUDERS > 3
901 902
     #endif // EXTRUDERS > 2
902 903
   #endif // EXTRUDERS > 1
904
+
905
+  //
906
+  // Bed
907
+  //
903 908
   #if TEMP_SENSOR_BED != 0
904 909
     MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_BED, &target_temperature_bed, 0, BED_MAXTEMP - 15);
905 910
   #endif
911
+
912
+  //
913
+  // Fan Speed
914
+  //
906 915
   MENU_MULTIPLIER_ITEM_EDIT(int3, MSG_FAN_SPEED, &fanSpeed, 0, 255);
916
+
917
+  //
918
+  // Autotemp, Min, Max, Fact
919
+  //
907 920
   #if defined(AUTOTEMP) && (TEMP_SENSOR_0 != 0)
908 921
     MENU_ITEM_EDIT(bool, MSG_AUTOTEMP, &autotemp_enabled);
909 922
     MENU_ITEM_EDIT(float3, MSG_MIN, &autotemp_min, 0, HEATER_0_MAXTEMP - 15);
910 923
     MENU_ITEM_EDIT(float3, MSG_MAX, &autotemp_max, 0, HEATER_0_MAXTEMP - 15);
911 924
     MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0);
912 925
   #endif
926
+
927
+  //
928
+  // PID-P, PID-I, PID-D, PID-C
929
+  //
913 930
   #ifdef PIDTEMP
914 931
     // set up temp variables - undo the default scaling
915 932
     raw_Ki = unscalePID_i(PID_PARAM(Ki,0));
@@ -962,7 +979,15 @@ static void lcd_control_temperature_menu() {
962 979
       #endif//EXTRUDERS > 1
963 980
     #endif //PID_PARAMS_PER_EXTRUDER
964 981
   #endif//PIDTEMP
982
+
983
+  //
984
+  // Preheat PLA conf
985
+  //
965 986
   MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
987
+
988
+  //
989
+  // Preheat ABS conf
990
+  //
966 991
   MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
967 992
   END_MENU();
968 993
 }
@@ -972,7 +997,6 @@ static void lcd_control_temperature_menu() {
972 997
  * "Temperature" > "Preheat PLA conf" submenu
973 998
  *
974 999
  */
975
-
976 1000
 static void lcd_control_temperature_preheat_pla_settings_menu() {
977 1001
   START_MENU();
978 1002
   MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
@@ -994,7 +1018,6 @@ static void lcd_control_temperature_preheat_pla_settings_menu() {
994 1018
  * "Temperature" > "Preheat ABS conf" submenu
995 1019
  *
996 1020
  */
997
-
998 1021
 static void lcd_control_temperature_preheat_abs_settings_menu() {
999 1022
   START_MENU();
1000 1023
   MENU_ITEM(back, MSG_TEMPERATURE, lcd_control_temperature_menu);
@@ -1016,7 +1039,6 @@ static void lcd_control_temperature_preheat_abs_settings_menu() {
1016 1039
  * "Control" > "Motion" submenu
1017 1040
  *
1018 1041
  */
1019
-
1020 1042
 static void lcd_control_motion_menu() {
1021 1043
   START_MENU();
1022 1044
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
@@ -1058,7 +1080,6 @@ static void lcd_control_motion_menu() {
1058 1080
  * "Control" > "Filament" submenu
1059 1081
  *
1060 1082
  */
1061
-
1062 1083
 static void lcd_control_volumetric_menu() {
1063 1084
   START_MENU();
1064 1085
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
@@ -1086,7 +1107,6 @@ static void lcd_control_volumetric_menu() {
1086 1107
  * "Control" > "Contrast" submenu
1087 1108
  *
1088 1109
  */
1089
-
1090 1110
 #ifdef HAS_LCD_CONTRAST
1091 1111
   static void lcd_set_contrast() {
1092 1112
     if (encoderPosition != 0) {
@@ -1106,7 +1126,6 @@ static void lcd_control_volumetric_menu() {
1106 1126
  * "Control" > "Retract" submenu
1107 1127
  *
1108 1128
  */
1109
-
1110 1129
 #ifdef FWRETRACT
1111 1130
   static void lcd_control_retract_menu() {
1112 1131
     START_MENU();
@@ -1144,7 +1163,6 @@ static void lcd_sd_updir() {
1144 1163
  * "Print from SD" submenu
1145 1164
  *
1146 1165
  */
1147
-
1148 1166
 void lcd_sdcard_menu() {
1149 1167
   if (lcdDrawUpdate == 0 && LCD_CLICKED == 0) return;	// nothing to do (so don't thrash the SD card)
1150 1168
   uint16_t fileCnt = card.getnrfilenames();
@@ -1290,7 +1308,7 @@ void lcd_quick_feedback() {
1290 1308
       #define LCD_FEEDBACK_FREQUENCY_DURATION_MS (1000/6)
1291 1309
     #endif    
1292 1310
     lcd_buzz(LCD_FEEDBACK_FREQUENCY_DURATION_MS, LCD_FEEDBACK_FREQUENCY_HZ);
1293
-  #elif defined(BEEPER) && BEEPER > -1
1311
+  #elif defined(BEEPER) && BEEPER >= 0
1294 1312
     #ifndef LCD_FEEDBACK_FREQUENCY_HZ
1295 1313
       #define LCD_FEEDBACK_FREQUENCY_HZ 5000
1296 1314
     #endif
@@ -1723,12 +1741,12 @@ void lcd_reset_alert_level() { lcd_status_message_level = 0; }
1723 1741
 
1724 1742
   void lcd_buzz(long duration, uint16_t freq) {
1725 1743
     if (freq > 0) {
1726
-      #if BEEPER > 0
1744
+      #ifdef LCD_USE_I2C_BUZZER
1745
+        lcd.buzz(duration, freq);
1746
+      #elif defined(BEEPER) && BEEPER >= 0
1727 1747
         SET_OUTPUT(BEEPER);
1728 1748
         tone(BEEPER, freq, duration);
1729 1749
         delay(duration);
1730
-      #elif defined(LCD_USE_I2C_BUZZER)
1731
-        lcd.buzz(duration, freq);
1732 1750
       #else
1733 1751
         delay(duration);
1734 1752
       #endif

+ 1
- 1
Marlin/ultralcd.h Ver arquivo

@@ -106,7 +106,7 @@
106 106
   FORCE_INLINE void lcd_setstatuspgm(const char* message, const uint8_t level=0) {}
107 107
   FORCE_INLINE void lcd_buttons_update() {}
108 108
   FORCE_INLINE void lcd_reset_alert_level() {}
109
-  FORCE_INLINE void lcd_buzz(long duration,uint16_t freq) {}
109
+  FORCE_INLINE void lcd_buzz(long duration, uint16_t freq) {}
110 110
   FORCE_INLINE bool lcd_detected(void) { return true; }
111 111
 
112 112
   #define LCD_MESSAGEPGM(x) do{}while(0)

+ 150
- 144
Marlin/ultralcd_implementation_hitachi_HD44780.h Ver arquivo

@@ -6,17 +6,17 @@
6 6
 * When selecting the Russian language, a slightly different LCD implementation is used to handle UTF8 characters.
7 7
 **/
8 8
 
9
-#ifndef REPRAPWORLD_KEYPAD
10
-  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11
-#else
12
-  extern volatile uint16_t buttons;  //an extended version of the last checked buttons in a bit array.
13
-#endif
9
+//#ifndef REPRAPWORLD_KEYPAD
10
+//  extern volatile uint8_t buttons;  //the last checked buttons in a bit array.
11
+//#else
12
+  extern volatile uint8_t buttons;  //an extended version of the last checked buttons in a bit array.
13
+//#endif
14 14
 
15 15
 ////////////////////////////////////
16 16
 // Setup button and encode mappings for each panel (into 'buttons' variable
17 17
 //
18
-// This is just to map common functions (across different panels) onto the same 
19
-// macro name. The mapping is independent of whether the button is directly connected or 
18
+// This is just to map common functions (across different panels) onto the same
19
+// macro name. The mapping is independent of whether the button is directly connected or
20 20
 // via a shift/i2c register.
21 21
 
22 22
 #ifdef ULTIPANEL
@@ -38,7 +38,7 @@
38 38
 //
39 39
 #if defined(LCD_I2C_VIKI)
40 40
   #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
41
-  
41
+
42 42
   // button and encoder bit positions within 'buttons'
43 43
   #define B_LE (BUTTON_LEFT<<B_I2C_BTN_OFFSET)    // The remaining normalized buttons are all read via I2C
44 44
   #define B_UP (BUTTON_UP<<B_I2C_BTN_OFFSET)
@@ -46,22 +46,22 @@
46 46
   #define B_DW (BUTTON_DOWN<<B_I2C_BTN_OFFSET)
47 47
   #define B_RI (BUTTON_RIGHT<<B_I2C_BTN_OFFSET)
48 48
 
49
-  #if defined(BTN_ENC) && BTN_ENC > -1 
49
+  #if defined(BTN_ENC) && BTN_ENC > -1
50 50
     // the pause/stop/restart button is connected to BTN_ENC when used
51
-    #define B_ST (EN_C)                            // Map the pause/stop/resume button into its normalized functional name 
51
+    #define B_ST (EN_C)                            // Map the pause/stop/resume button into its normalized functional name
52 52
     #define LCD_CLICKED (buttons&(B_MI|B_RI|B_ST)) // pause/stop button also acts as click until we implement proper pause/stop.
53 53
   #else
54 54
     #define LCD_CLICKED (buttons&(B_MI|B_RI))
55
-  #endif  
55
+  #endif
56 56
 
57 57
   // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
58 58
   #define LCD_HAS_SLOW_BUTTONS
59 59
 
60 60
 #elif defined(LCD_I2C_PANELOLU2)
61 61
   // encoder click can be read through I2C if not directly connected
62
-  #if BTN_ENC <= 0 
62
+  #if BTN_ENC <= 0
63 63
     #define B_I2C_BTN_OFFSET 3 // (the first three bit positions reserved for EN_A, EN_B, EN_C)
64
-  
64
+
65 65
     #define B_MI (PANELOLU2_ENCODER_C<<B_I2C_BTN_OFFSET) // requires LiquidTWI2 library v1.2.3 or later
66 66
 
67 67
     #define LCD_CLICKED (buttons&B_MI)
@@ -69,7 +69,7 @@
69 69
     // I2C buttons take too long to read inside an interrupt context and so we read them during lcd_update
70 70
     #define LCD_HAS_SLOW_BUTTONS
71 71
   #else
72
-    #define LCD_CLICKED (buttons&EN_C)  
72
+    #define LCD_CLICKED (buttons&EN_C)
73 73
   #endif
74 74
 
75 75
 #elif defined(REPRAPWORLD_KEYPAD)
@@ -77,13 +77,13 @@
77 77
     #define BLEN_REPRAPWORLD_KEYPAD_F3 0
78 78
     #define BLEN_REPRAPWORLD_KEYPAD_F2 1
79 79
     #define BLEN_REPRAPWORLD_KEYPAD_F1 2
80
-    #define BLEN_REPRAPWORLD_KEYPAD_UP 3
80
+    #define BLEN_REPRAPWORLD_KEYPAD_UP 6
81 81
     #define BLEN_REPRAPWORLD_KEYPAD_RIGHT 4
82 82
     #define BLEN_REPRAPWORLD_KEYPAD_MIDDLE 5
83
-    #define BLEN_REPRAPWORLD_KEYPAD_DOWN 6
83
+    #define BLEN_REPRAPWORLD_KEYPAD_DOWN 3
84 84
     #define BLEN_REPRAPWORLD_KEYPAD_LEFT 7
85 85
     
86
-    #define REPRAPWORLD_BTN_OFFSET 3 // bit offset into buttons for shift register values
86
+    #define REPRAPWORLD_BTN_OFFSET 0 // bit offset into buttons for shift register values
87 87
 
88 88
     #define EN_REPRAPWORLD_KEYPAD_F3 BIT((BLEN_REPRAPWORLD_KEYPAD_F3+REPRAPWORLD_BTN_OFFSET))
89 89
     #define EN_REPRAPWORLD_KEYPAD_F2 BIT((BLEN_REPRAPWORLD_KEYPAD_F2+REPRAPWORLD_BTN_OFFSET))
@@ -94,14 +94,14 @@
94 94
     #define EN_REPRAPWORLD_KEYPAD_DOWN BIT((BLEN_REPRAPWORLD_KEYPAD_DOWN+REPRAPWORLD_BTN_OFFSET))
95 95
     #define EN_REPRAPWORLD_KEYPAD_LEFT BIT((BLEN_REPRAPWORLD_KEYPAD_LEFT+REPRAPWORLD_BTN_OFFSET))
96 96
 
97
-    #define LCD_CLICKED ((buttons&EN_C) || (buttons&EN_REPRAPWORLD_KEYPAD_F1))
98
-    #define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons&EN_REPRAPWORLD_KEYPAD_DOWN)
99
-    #define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons&EN_REPRAPWORLD_KEYPAD_UP)
100
-    #define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons&EN_REPRAPWORLD_KEYPAD_MIDDLE)
97
+    //#define LCD_CLICKED ((buttons&EN_C) || (buttons&EN_REPRAPWORLD_KEYPAD_F1))
98
+    //#define REPRAPWORLD_KEYPAD_MOVE_Y_DOWN (buttons&EN_REPRAPWORLD_KEYPAD_DOWN)
99
+    //#define REPRAPWORLD_KEYPAD_MOVE_Y_UP (buttons&EN_REPRAPWORLD_KEYPAD_UP)
100
+    //#define REPRAPWORLD_KEYPAD_MOVE_HOME (buttons&EN_REPRAPWORLD_KEYPAD_MIDDLE)
101 101
 
102 102
 #elif defined(NEWPANEL)
103 103
   #define LCD_CLICKED (buttons&EN_C)
104
-  
104
+
105 105
 #else // old style ULTIPANEL
106 106
   //bits in the shift register that carry the buttons for:
107 107
   // left up center down right red(stop)
@@ -143,7 +143,7 @@
143 143
   #include <LiquidCrystal_I2C.h>
144 144
   #define LCD_CLASS LiquidCrystal_I2C
145 145
   LCD_CLASS lcd(LCD_I2C_ADDRESS,LCD_I2C_PIN_EN,LCD_I2C_PIN_RW,LCD_I2C_PIN_RS,LCD_I2C_PIN_D4,LCD_I2C_PIN_D5,LCD_I2C_PIN_D6,LCD_I2C_PIN_D7);
146
-  
146
+
147 147
 #elif defined(LCD_I2C_TYPE_MCP23017)
148 148
   //for the LED indicators (which maybe mapped to different things in lcd_implementation_update_indicators())
149 149
   #define LED_A 0x04 //100
@@ -156,28 +156,28 @@
156 156
   #include <LiquidTWI2.h>
157 157
   #define LCD_CLASS LiquidTWI2
158 158
   #if defined(DETECT_DEVICE)
159
-     LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
159
+    LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
160 160
   #else
161
-     LCD_CLASS lcd(LCD_I2C_ADDRESS);
161
+    LCD_CLASS lcd(LCD_I2C_ADDRESS);
162 162
   #endif
163
-  
163
+
164 164
 #elif defined(LCD_I2C_TYPE_MCP23008)
165 165
   #include <Wire.h>
166 166
   #include <LiquidTWI2.h>
167 167
   #define LCD_CLASS LiquidTWI2
168 168
   #if defined(DETECT_DEVICE)
169
-     LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
169
+    LCD_CLASS lcd(LCD_I2C_ADDRESS, 1);
170 170
   #else
171
-     LCD_CLASS lcd(LCD_I2C_ADDRESS);
171
+    LCD_CLASS lcd(LCD_I2C_ADDRESS);
172 172
   #endif
173 173
 
174 174
 #elif defined(LCD_I2C_TYPE_PCA8574)
175 175
     #include <LiquidCrystal_I2C.h>
176 176
     #define LCD_CLASS LiquidCrystal_I2C
177 177
     LCD_CLASS lcd(LCD_I2C_ADDRESS, LCD_WIDTH, LCD_HEIGHT);
178
-    
178
+
179 179
 // 2 wire Non-latching LCD SR from:
180
-// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection 
180
+// https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/schematics#!shiftregister-connection
181 181
 #elif defined(SR_LCD_2W_NL)
182 182
   extern "C" void __cxa_pure_virtual() { while (1); }
183 183
   #include <LCD.h>
@@ -353,159 +353,152 @@ static void lcd_implementation_init(
353 353
   #endif
354 354
 ) {
355 355
 
356
-#if defined(LCD_I2C_TYPE_PCF8575)
356
+  #if defined(LCD_I2C_TYPE_PCF8575)
357 357
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
358
-  #ifdef LCD_I2C_PIN_BL
359
-    lcd.setBacklightPin(LCD_I2C_PIN_BL,POSITIVE);
360
-    lcd.setBacklight(HIGH);
361
-  #endif
362
-  
363
-#elif defined(LCD_I2C_TYPE_MCP23017)
358
+    #ifdef LCD_I2C_PIN_BL
359
+      lcd.setBacklightPin(LCD_I2C_PIN_BL, POSITIVE);
360
+      lcd.setBacklight(HIGH);
361
+    #endif
362
+
363
+  #elif defined(LCD_I2C_TYPE_MCP23017)
364 364
     lcd.setMCPType(LTI_TYPE_MCP23017);
365 365
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
366 366
     lcd.setBacklight(0); //set all the LEDs off to begin with
367
-    
368
-#elif defined(LCD_I2C_TYPE_MCP23008)
367
+
368
+  #elif defined(LCD_I2C_TYPE_MCP23008)
369 369
     lcd.setMCPType(LTI_TYPE_MCP23008);
370 370
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
371 371
 
372
-#elif defined(LCD_I2C_TYPE_PCA8574)
373
-      lcd.init();
374
-      lcd.backlight();
375
-    
376
-#else
372
+  #elif defined(LCD_I2C_TYPE_PCA8574)
373
+    lcd.init();
374
+    lcd.backlight();
375
+
376
+  #else
377 377
     lcd.begin(LCD_WIDTH, LCD_HEIGHT);
378
-#endif
378
+  #endif
379 379
 
380
-    lcd_set_custom_characters(
381
-        #ifdef LCD_PROGRESS_BAR
382
-            progress_bar_set
383
-        #endif
384
-    );
380
+  lcd_set_custom_characters(
381
+    #ifdef LCD_PROGRESS_BAR
382
+      progress_bar_set
383
+    #endif
384
+  );
385 385
 
386
-    lcd.clear();
387
-}
388
-static void lcd_implementation_clear()
389
-{
390
-    lcd.clear();
386
+  lcd.clear();
391 387
 }
392 388
 
389
+static void lcd_implementation_clear() { lcd.clear(); }
390
+
393 391
 /* Arduino < 1.0.0 is missing a function to print PROGMEM strings, so we need to implement our own */
394 392
 char lcd_printPGM(const char* str) {
395
-  char c;
396
-  char n = 0;
397
-  while((c = pgm_read_byte(str++))) {
398
-      n += charset_mapper(c);
399
-  }
393
+  char c, n = 0;
394
+  while ((c = pgm_read_byte(str++))) n += charset_mapper(c);
400 395
   return n;
401 396
 }
402 397
 
403 398
 char lcd_print(char* str) {
404 399
   char c, n = 0;;
405 400
   unsigned char i = 0;
406
-  while((c = str[i++])) {
407
-      n += charset_mapper(c);
408
-  }
401
+  while ((c = str[i++])) n += charset_mapper(c);
409 402
   return n;
410 403
 }
411 404
 
412
-unsigned lcd_print(char c) {
413
-    return charset_mapper(c);
414
-}
405
+unsigned lcd_print(char c) { return charset_mapper(c); }
415 406
 
416 407
 /*
417 408
 Possible status screens:
418
-16x2   |0123456789012345|
419
-       |000/000 B000/000|
420
-       |Status line.....|
409
+16x2   |000/000 B000/000|
410
+       |0123456789012345|
421 411
 
422
-16x4   |0123456789012345|
423
-       |000/000 B000/000|
424
-       |SD100%    Z000.0|
412
+16x4   |000/000 B000/000|
413
+       |SD100%  Z000.00 |
425 414
        |F100%     T--:--|
426
-       |Status line.....|
415
+       |0123456789012345|
427 416
 
428
-20x2   |01234567890123456789|
429
-       |T000/000D B000/000D |
430
-       |Status line.........|
417
+20x2   |T000/000D B000/000D |
418
+       |01234567890123456789|
431 419
 
432
-20x4   |01234567890123456789|
433
-       |T000/000D B000/000D |
434
-       |X000  Y000   Z000.00|
420
+20x4   |T000/000D B000/000D |
421
+       |X000  Y000  Z000.00 |
435 422
        |F100%  SD100% T--:--|
436
-       |Status line.........|
423
+       |01234567890123456789|
437 424
 
438
-20x4   |01234567890123456789|
439
-       |T000/000D B000/000D |
440
-       |T000/000D     Z000.0|
425
+20x4   |T000/000D B000/000D |
426
+       |T000/000D   Z000.00 |
441 427
        |F100%  SD100% T--:--|
442
-       |Status line.........|
428
+       |01234567890123456789|
443 429
 */
444 430
 static void lcd_implementation_status_screen() {
445
-  int tHotend = int(degHotend(0) + 0.5);
446
-  int tTarget = int(degTargetHotend(0) + 0.5);
431
+
432
+  #define LCD_TEMP_ONLY(T1,T2) \
433
+    lcd.print(itostr3(T1 + 0.5)); \
434
+    lcd.print('/'); \
435
+    lcd.print(itostr3left(T2 + 0.5))
436
+
437
+  #define LCD_TEMP(T1,T2,PREFIX) \
438
+    lcd.print(PREFIX); \
439
+    LCD_TEMP_ONLY(T1,T2); \
440
+    lcd_printPGM(PSTR(LCD_STR_DEGREE " ")); \
441
+    if (T2 < 10) lcd.print(' ')
442
+
443
+  //
444
+  // Line 1
445
+  //
446
+
447
+  lcd.setCursor(0, 0);
447 448
 
448 449
   #if LCD_WIDTH < 20
449 450
 
450
-    lcd.setCursor(0, 0);
451
-    lcd.print(itostr3(tHotend));
452
-    lcd.print('/');
453
-    lcd.print(itostr3left(tTarget));
451
+    //
452
+    // Hotend 0 Temperature
453
+    //
454
+    LCD_TEMP_ONLY(degHotend(0), degTargetHotend(0));
454 455
 
456
+    //
457
+    // Hotend 1 or Bed Temperature
458
+    //
455 459
     #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
456 460
 
457
-      // If we have an 2nd extruder or heated bed, show that in the top right corner
458 461
       lcd.setCursor(8, 0);
459 462
       #if EXTRUDERS > 1
460
-        tHotend = int(degHotend(1) + 0.5);
461
-        tTarget = int(degTargetHotend(1) + 0.5);
462 463
         lcd.print(LCD_STR_THERMOMETER[0]);
463
-      #else // Heated bed
464
-        tHotend = int(degBed() + 0.5);
465
-        tTarget = int(degTargetBed() + 0.5);
464
+        LCD_TEMP_ONLY(degHotend(1), degTargetHotend(1));
465
+      #else
466 466
         lcd.print(LCD_STR_BEDTEMP[0]);
467
+        LCD_TEMP_ONLY(degBed(), degTargetBed());
467 468
       #endif
468
-      lcd.print(itostr3(tHotend));
469
-      lcd.print('/');
470
-      lcd.print(itostr3left(tTarget));
471 469
 
472 470
     #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
473 471
 
474
-  #else // LCD_WIDTH > 19
472
+  #else // LCD_WIDTH >= 20
475 473
 
476
-    lcd.setCursor(0, 0);
477
-    lcd.print(LCD_STR_THERMOMETER[0]);
478
-    lcd.print(itostr3(tHotend));
479
-    lcd.print('/');
480
-    lcd.print(itostr3left(tTarget));
481
-    lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
482
-    if (tTarget < 10) lcd.print(' ');
474
+    //
475
+    // Hotend 0 Temperature
476
+    //
477
+    LCD_TEMP(degHotend(0), degTargetHotend(0), LCD_STR_THERMOMETER[0]);
483 478
 
479
+    //
480
+    // Hotend 1 or Bed Temperature
481
+    //
484 482
     #if EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
485
-      // If we have an 2nd extruder or heated bed, show that in the top right corner
486 483
       lcd.setCursor(10, 0);
487 484
       #if EXTRUDERS > 1
488
-        tHotend = int(degHotend(1) + 0.5);
489
-        tTarget = int(degTargetHotend(1) + 0.5);
490
-        lcd.print(LCD_STR_THERMOMETER[0]);
491
-      #else // Heated bed
492
-        tHotend = int(degBed() + 0.5);
493
-        tTarget = int(degTargetBed() + 0.5);
494
-        lcd.print(LCD_STR_BEDTEMP[0]);
485
+        LCD_TEMP(degHotend(1), degTargetHotend(1), LCD_STR_THERMOMETER[0]);
486
+      #else
487
+        LCD_TEMP(degBed(), degTargetBed(), LCD_STR_BEDTEMP[0]);
495 488
       #endif
496
-      lcd.print(itostr3(tHotend));
497
-      lcd.print('/');
498
-      lcd.print(itostr3left(tTarget));
499
-      lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
500
-      if (tTarget < 10) lcd.print(' ');
501 489
 
502 490
     #endif  // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
503 491
 
504
-  #endif // LCD_WIDTH > 19
492
+  #endif // LCD_WIDTH >= 20
493
+
494
+  //
495
+  // Line 2
496
+  //
505 497
 
506 498
   #if LCD_HEIGHT > 2
507
-    // Lines 2 for 4 line LCD
499
+
508 500
     #if LCD_WIDTH < 20
501
+
509 502
       #ifdef SDSUPPORT
510 503
         lcd.setCursor(0, 2);
511 504
         lcd_printPGM(PSTR("SD"));
@@ -516,36 +509,48 @@ static void lcd_implementation_status_screen() {
516 509
           lcd.print('%');
517 510
       #endif // SDSUPPORT
518 511
 
519
-    #else // LCD_WIDTH > 19
512
+    #else // LCD_WIDTH >= 20
513
+
514
+      lcd.setCursor(0, 1);
520 515
 
521 516
       #if EXTRUDERS > 1 && TEMP_SENSOR_BED != 0
522
-        // If we both have a 2nd extruder and a heated bed, show the heated bed temp on the 2nd line on the left, as the first line is filled with extruder temps
523
-        tHotend = int(degBed() + 0.5);
524
-        tTarget = int(degTargetBed() + 0.5);
525 517
 
526
-        lcd.setCursor(0, 1);
527
-        lcd.print(LCD_STR_BEDTEMP[0]);
528
-        lcd.print(itostr3(tHotend));
529
-        lcd.print('/');
530
-        lcd.print(itostr3left(tTarget));
531
-        lcd_printPGM(PSTR(LCD_STR_DEGREE " "));
532
-        if (tTarget < 10) lcd.print(' ');
518
+        // If we both have a 2nd extruder and a heated bed,
519
+        // show the heated bed temp on the left,
520
+        // since the first line is filled with extruder temps
521
+        LCD_TEMP(degBed(), degTargetBed(), LCD_STR_BEDTEMP[0]);
522
+
533 523
       #else
534
-        lcd.setCursor(0,1);
524
+
535 525
         lcd.print('X');
536
-        lcd.print(ftostr3(current_position[X_AXIS]));
526
+        if (axis_known_position[X_AXIS])
527
+          lcd.print(ftostr3(current_position[X_AXIS]));
528
+        else
529
+          lcd_printPGM(PSTR("---"));
530
+
537 531
         lcd_printPGM(PSTR("  Y"));
538
-        lcd.print(ftostr3(current_position[Y_AXIS]));
532
+        if (axis_known_position[Y_AXIS])
533
+          lcd.print(ftostr3(current_position[Y_AXIS]));
534
+        else
535
+          lcd_printPGM(PSTR("---"));
536
+
539 537
       #endif // EXTRUDERS > 1 || TEMP_SENSOR_BED != 0
540 538
 
541
-    #endif // LCD_WIDTH > 19
539
+    #endif // LCD_WIDTH >= 20
542 540
 
543 541
     lcd.setCursor(LCD_WIDTH - 8, 1);
544 542
     lcd.print('Z');
545
-    lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
543
+    if (axis_known_position[Z_AXIS])
544
+      lcd.print(ftostr32sp(current_position[Z_AXIS] + 0.00001));
545
+    else
546
+      lcd_printPGM(PSTR("---.--"));
546 547
 
547 548
   #endif // LCD_HEIGHT > 2
548 549
 
550
+  //
551
+  // Line 3
552
+  //
553
+
549 554
   #if LCD_HEIGHT > 3
550 555
 
551 556
     lcd.setCursor(0, 2);
@@ -579,9 +584,10 @@ static void lcd_implementation_status_screen() {
579 584
 
580 585
   #endif // LCD_HEIGHT > 3
581 586
 
582
-  /**
583
-   * Display Progress Bar, Filament display, and/or Status Message on the last line
584
-   */
587
+  //
588
+  // Last Line
589
+  // Status Message (which may be a Progress Bar or Filament display)
590
+  //
585 591
 
586 592
   lcd.setCursor(0, LCD_HEIGHT - 1);
587 593
 
@@ -728,13 +734,13 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const
728 734
 
729 735
   static void lcd_implementation_update_indicators() {
730 736
     #if defined(LCD_I2C_PANELOLU2) || defined(LCD_I2C_VIKI)
731
-      //set the LEDS - referred to as backlights by the LiquidTWI2 library 
737
+      // Set the LEDS - referred to as backlights by the LiquidTWI2 library
732 738
       static uint8_t ledsprev = 0;
733 739
       uint8_t leds = 0;
734 740
       if (target_temperature_bed > 0) leds |= LED_A;
735 741
       if (target_temperature[0] > 0) leds |= LED_B;
736 742
       if (fanSpeed) leds |= LED_C;
737
-      #if EXTRUDERS > 1  
743
+      #if EXTRUDERS > 1
738 744
         if (target_temperature[1] > 0) leds |= LED_C;
739 745
       #endif
740 746
       if (leds != ledsprev) {
@@ -766,4 +772,4 @@ static void lcd_implementation_drawmenu_sddirectory(bool sel, uint8_t row, const
766 772
 
767 773
 #endif // LCD_HAS_SLOW_BUTTONS
768 774
 
769
-#endif //__ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H
775
+#endif // ULTRALCD_IMPLEMENTATION_HITACHI_HD44780_H

+ 15
- 25
README.md Ver arquivo

@@ -1,25 +1,7 @@
1 1
 # Marlin 3D Printer Firmware
2 2
 <img align="right" src="Documentation/Logo/Marlin%20Logo%20GitHub.png" />
3 3
 
4
-  * [Configuration & Compilation](/Documentation/Compilation.md)
5
-  * Supported
6
-    * [Features](/Documentation/Features.md)
7
-    * [Hardware](/Documentation/Hardware.md)
8
-    * [GCodes](/Documentation/GCodes.md)
9
-  * Notes
10
-    * [Auto Bed Leveling](/Documentation/BedLeveling.md)
11
-    * [Filament Sensor](/Documentation/FilamentSensor.md)
12
-    * [Ramps Servo Power](/Documentation/RampsServoPower.md)
13
-    * [LCD Language - Font - System](Documentation/LCDLanguageFont.md)
14
-    * [Mesh Bed Leveling](/Documentation/MeshBedLeveling.md)
15
-
16
-##### [RepRap.org Wiki Page](http://reprap.org/wiki/Marlin)
17
-
18
-## Quick Information
19
-
20
-This is a firmware for reprap single-processor electronics setups.
21
-It also works on the Ultimaker PCB. It supports printing from SD card+Folders and look-ahead trajectory planning.
22
-This firmware is a mashup between [Sprinter](https://github.com/kliment/Sprinter), [grbl](https://github.com/simen/grbl), and many original parts.
4
+ Documentation has moved to http://www.marlinfirmware.org
23 5
 
24 6
 ## Current Status: Bug Fixing
25 7
 
@@ -28,20 +10,28 @@ The Marlin development is currently revived. There's a long list of reported iss
28 10
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/2224/badge.svg)](https://scan.coverity.com/projects/2224)
29 11
 [![Travis Build Status](https://travis-ci.org/MarlinFirmware/Marlin.svg)](https://travis-ci.org/MarlinFirmware/Marlin)
30 12
 
13
+##### [RepRap.org Wiki Page](http://reprap.org/wiki/Marlin)
14
+
31 15
 ## Contact
32 16
 
33
-__Google Hangout:__ <a href="https://plus.google.com/hangouts/_/gxn3wrea5gdhoo223yimsiforia" target="_blank">Hangout</a>
17
+__Google Hangout:__ <a href="https://plus.google.com/hangouts/_/gxn3wrea5gdhoo223yimsiforia" target="_blank">. Hangout</a> We have a hangout every 2 weeks. Search the issue list for "Hangout" and you will see what time and date the next event is going on.
34 18
 
35 19
 ## Credits
36 20
 
37 21
 The current Marlin dev team consists of:
38 22
 
39 23
  - Scott Lahteine [@thinkyhead]
40
- - 
41
-
42
-## Donation
43
-
44
-If you find our work usefull please consider donating. Donations will be used to pay for our website http://www.marlinfirmware.org/ and to pay some food or rent money for the very active Collaborators
24
+ - Andreas Hardtung [@AnHardt]
25
+ - [@Wurstnase]
26
+ - [@fmalpartida]
27
+ - [@CONSULitAS]
28
+ - [@maverikou]
29
+ - Chris Palmer [@nophead]
30
+ - [@paclema]
31
+ - [@epatel]
32
+ - Erik van der Zalm [@ErikZalm]
33
+ - David Braam [@daid]
34
+ - Bernhard Kubicek [@bkubicek]
45 35
 
46 36
 More features have been added by:
47 37
   - Lampmaker,

Carregando…
Cancelar
Salvar