Compare commits
10 commits
master
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e879af0a3 | ||
|
|
308cce734a | ||
|
|
f84de85ec9 | ||
|
|
79da42fb65 | ||
|
|
8c065571c5 | ||
|
|
76e83bd73e | ||
|
|
c32bfe0899 | ||
|
|
9e71ca018d | ||
|
|
c719b3820f | ||
|
|
165cb93452 |
7 changed files with 343 additions and 132 deletions
89
README
89
README
|
|
@ -1,38 +1,62 @@
|
|||
The leading developers of Sprinter are currently Kliment, caru and midopple, though many others contribute with their patches.
|
||||
The leading developers of Sprinter are currently Kliment, caru and
|
||||
midopple, though many others contribute with their patches.
|
||||
|
||||
This is a firmware for RAMPS and other reprap single-processor electronics setups. It supports printing from SD card, active heatbed control, and ATmega internal pullups.
|
||||
This is a firmware for RAMPS and other reprap single-processor
|
||||
electronics setups. It supports printing from SD card, active heatbed
|
||||
control, and ATmega internal pullups.
|
||||
|
||||
This work is licensed under the GNU GPL v3 or (at the user's discretion) any later version.
|
||||
This work is licensed under the GNU GPL v3 or (at the user's
|
||||
discretion) any later version.
|
||||
|
||||
It is based on Tonokips's firmware, which was licensed under GPL v2 or later.
|
||||
It is based on Tonokips's firmware, which was licensed under GPL v2 or
|
||||
later.
|
||||
|
||||
WARNING: This version (April 19th, 2011) fixes a bug that caused speeds to be lower than what
|
||||
set in GCODE. So before attempting any print, you will have to check all
|
||||
your axis max speed, including the extruder retract speed. Not following
|
||||
this guidelines can seriously damage your printer.
|
||||
NEW ARDUINO BUILDS, 2012:
|
||||
If you are running a current version, after October 2012, see the
|
||||
file Arduino-build.txt in Sprinter for build instructions.
|
||||
|
||||
The configuration file now has an option to set the wanted temperature table file. If you copy and paste a temperature file from older versions, make sure that the configuration is pointing to it. For example:
|
||||
#include "ThermistorTable.h"
|
||||
WARNING: This version (April 19th, 2011) fixes a bug that caused
|
||||
speeds to be lower than what set in GCODE. So before attempting
|
||||
any print, you will have to check all your axis max speed,
|
||||
including the extruder retract speed. Not following this
|
||||
guidelines can seriously damage your printer.
|
||||
|
||||
In addition, you can optionally use a different thermistor table for hot-end and bed. To do so, comment out the following lines in configuration.h:
|
||||
The configuration file now has an option to set the wanted temperature
|
||||
table file. If you copy and paste a temperature file from older
|
||||
versions, make sure that the configuration is pointing to it. For
|
||||
example: #include "ThermistorTable.h"
|
||||
|
||||
In addition, you can optionally use a different thermistor table for
|
||||
hot-end and bed. To do so, comment out the following lines in
|
||||
configuration.h:
|
||||
#define BNUMTEMPS NUMPTEMPS
|
||||
#define bedtemptable temptable
|
||||
|
||||
Then add a line pointing to your second thermistor table, for example:
|
||||
#include "BedThermistorTable.h"
|
||||
Finally, make sure that the nozzle thermistor table, inside ThermistorTable.h in this case, is defined as "temptable" and that the bed thermistor table is defined as "bedtemptable", and that the number of temps is defined as NUMTEMPS for the heater and BNUMTEMPS for the bed.
|
||||
|
||||
There are examples of all these configurations in the configuration.h file. Please look at them before you change anything.
|
||||
Finally, make sure that the nozzle thermistor table, inside
|
||||
ThermistorTable.h in this case, is defined as "temptable" and that the
|
||||
bed thermistor table is defined as "bedtemptable", and that the number
|
||||
of temps is defined as NUMTEMPS for the heater and BNUMTEMPS for the
|
||||
bed.
|
||||
|
||||
There are examples of all these configurations in the configuration.h
|
||||
file. Please look at them before you change anything.
|
||||
|
||||
|
||||
Complete beginners guide
|
||||
=======================
|
||||
|
||||
From a fresh Ubuntu install how to update the firmware of your Prusa Mendel ?
|
||||
(the specifics are for the Prusa Mendel built at the Bath RepRap masterclass.
|
||||
This version uses the http://reprap.org/wiki/Sanguinololu.
|
||||
Some details may not fit your hardware, be sure to check what you are doing)
|
||||
From a fresh Ubuntu install how to update the firmware of your Prusa
|
||||
Mendel ? (the specifics are for the Prusa Mendel built at the Bath
|
||||
RepRap masterclass. This version uses the
|
||||
http://reprap.org/wiki/Sanguinololu. Some details may not fit your
|
||||
hardware, be sure to check what you are doing)
|
||||
|
||||
Steps 3,10,11 are hardware-specific to the Sanguinololu and Bath Prusa and should be skipped or modified accordingly for other hardware such as the Arduino Mega 2560
|
||||
Steps 3,10,11 are hardware-specific to the Sanguinololu and Bath Prusa
|
||||
and should be skipped or modified accordingly for other hardware such
|
||||
as the Arduino Mega 2560
|
||||
|
||||
Software installation
|
||||
----------------------
|
||||
|
|
@ -40,8 +64,9 @@ Software installation
|
|||
1. Install the required packages (gcc-avr, avr-libc, etc.)
|
||||
sudo apt-get install arduino-core
|
||||
|
||||
2. Get the arduino software version 0023, uncompress it in a directory.
|
||||
Arduino software v1 has not been tested much, but is known to work with some boards.
|
||||
2. Get the arduino software version 0023, uncompress it in a
|
||||
directory. Arduino software v1 has not been tested much, but is known
|
||||
to work with some boards.
|
||||
http://www.arduino.cc/en/Main/Software
|
||||
|
||||
3. Get the sanguino software, version 0023
|
||||
|
|
@ -61,10 +86,12 @@ Optionally, switch to the desired branch
|
|||
Firmware compilation and upload
|
||||
-------------------------------
|
||||
|
||||
5. Edit INSTALL_DIR inside Sprinter/Makefile (do not mind the default reference to arduino 0022)
|
||||
5. Edit INSTALL_DIR inside Sprinter/Makefile (do not mind the default
|
||||
reference to arduino 0022)
|
||||
|
||||
6. Run make. If everything goes well Sprinter/applet/Sprinter.cpp should have been created.
|
||||
You can safely ignore the error message mentioning arduino-0023/hardware/arduino/cores/arduino/WString.o
|
||||
6. Run make. If everything goes well Sprinter/applet/Sprinter.cpp
|
||||
should have been created. You can safely ignore the error message
|
||||
mentioning arduino-0023/hardware/arduino/cores/arduino/WString.o
|
||||
|
||||
7. Connect your Sanguinololu to your computer
|
||||
http://reprap.org/wiki/Sanguinololu
|
||||
|
|
@ -81,7 +108,8 @@ You can safely ignore the error message mentioning arduino-0023/hardware/arduino
|
|||
|
||||
float axis_steps_per_unit[]
|
||||
|
||||
set values that match your hardware. For the special cast gears of the Bath Masterclass Prusa Mendel, these values are
|
||||
set values that match your hardware. For the special cast gears of the
|
||||
Bath Masterclass Prusa Mendel, these values are
|
||||
float axis_steps_per_unit[] = {91.42857, 91.42857, 3200/1.25,700};
|
||||
|
||||
also for the mentioned hardware setup
|
||||
|
|
@ -90,10 +118,12 @@ also for the mentioned hardware setup
|
|||
// "no touch == closed circuit == SIG connects to GND"
|
||||
// see http://reprap.org/wiki/Sanguinololu#Endstops
|
||||
|
||||
12. Click on the "play" button to compile. If everything goes well you should see a "Binary sketch size: " message.
|
||||
12. Click on the "play" button to compile. If everything goes well you
|
||||
should see a "Binary sketch size: " message.
|
||||
|
||||
13. Click on "the arrow going to the right" button to upload (you had done steps 7,8,9 before, right ?).
|
||||
If everything goes well you should see the message "Done uploading".
|
||||
13. Click on "the arrow going to the right" button to upload (you had
|
||||
done steps 7,8,9 before, right ?). If everything goes well you should
|
||||
see the message "Done uploading".
|
||||
|
||||
if GEN7 with 20 Mhz is in use set the Fuses for Bootloader to
|
||||
lfuse= 0xF7 hfuse = 0xD4 efuse = FD
|
||||
|
|
@ -101,8 +131,9 @@ Brownout must be 2,7 V
|
|||
|
||||
Congratulations, you have just upgraded the firmware of your RepRap !
|
||||
|
||||
You can use pronterface.py to do some manual verifications by moving the printer's tip along
|
||||
the axes and verifying that the physical displacements match the ones indicated on the interface.
|
||||
You can use pronterface.py to do some manual verifications by moving
|
||||
the printer's tip along the axes and verifying that the physical
|
||||
displacements match the ones indicated on the interface.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
99
Sprinter/Arduino-build.txt
Normal file
99
Sprinter/Arduino-build.txt
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
Arduino build docs rev 0001
|
||||
jet@allartburns.org
|
||||
31 Oct 2012 (Merry Goth Xmas!)
|
||||
[TODO insert boilerplate for FSF/GPL copyright process docs or
|
||||
Sprinter license]
|
||||
|
||||
These docs were written under
|
||||
Arduino: Arduino-1.0.1
|
||||
Host: OSX 10.6.8
|
||||
Sprinter: kliment/experimental clone on 31 Oct 2012
|
||||
|
||||
These docs where tested under
|
||||
Arduino: Arduino-1.0.1
|
||||
Host: Win7
|
||||
Sprinter: kliment/experimental clone on 31 Oct 2012
|
||||
Tester: jet
|
||||
Status: NOT DONE
|
||||
|
||||
Arduino: Arduino-1.0.1
|
||||
Host: Win8
|
||||
Sprinter: kliment/experimental clone on 31 Oct 2012
|
||||
Tester: jet
|
||||
Status: NOT DONE
|
||||
|
||||
Arduino: Arduino-1.0.1
|
||||
Host: Ubuntu 12
|
||||
Sprinter: kliment/experimental clone on 31 Oct 2012
|
||||
Tester: jet
|
||||
Status: NOT DONE
|
||||
|
||||
|
||||
#####################
|
||||
# BUILD REQUIREMENTS
|
||||
#####################
|
||||
|
||||
These instructions only apply if you are required to build the code
|
||||
from source. If you are not required to do this, fetch the compiled
|
||||
binaries and follow their instructions.
|
||||
|
||||
This is not an instructional document on how to use github, avr
|
||||
utilities, or other development packages. If you do not know how to
|
||||
use these, find a local friend and ask for their assistance.
|
||||
|
||||
On all platforms the build is similar:
|
||||
- verify that Arduino 1.0.1 or later is installed and generates
|
||||
code for your specific Arduino.
|
||||
- get a copy of the Sprinter code. Since we are building from source,
|
||||
you should branch kliment/Sprinter and clone that code.
|
||||
|
||||
The currently supported platforms are
|
||||
OSX 10.6.8 TODO
|
||||
OSX 10.7 TODO
|
||||
Win7/32 TODO
|
||||
Win7/64 TODO
|
||||
Win8 TODO
|
||||
Ubuntu12 TODO
|
||||
|
||||
##################
|
||||
#BUILD STEPS FLASH
|
||||
##################
|
||||
|
||||
1) Launch arduino-1.0.1, set the board and port, verify that it can
|
||||
see your RAMPS controller.
|
||||
|
||||
2) Open the Sprinter.pde or Sprinter.ino file. Arduino-1.0.1 suports
|
||||
the old format, the name will change now or in the future.
|
||||
|
||||
3) Verify (compile) the Sprinter sketch. If it does not compile
|
||||
completely, exit these instructions and resolve the problem[
|
||||
This could be as simple as changing a variable in Sprinter.pde or
|
||||
as complex as installing new/different Arduino software.
|
||||
|
||||
4) Upload the sketch to the board. As of 1.0.1, Arduino still
|
||||
re-compiles everything before an upload, this is a bug in Arduino
|
||||
not in Sprinter software.
|
||||
|
||||
5) If "Done uploading." appears in the dialog box
|
||||
reset the RAMPS unit
|
||||
If anything else appears, correct the problem and retry this step
|
||||
|
||||
6) Open the Serial Port Monitor and verify the port and bps rate of
|
||||
your connection. This should trigger a RAMPS reset and you should
|
||||
see the software announcement in the Serial Monitor.
|
||||
|
||||
7) Restart the RAMPS controller by pushing the resset pin. After the
|
||||
reset, the Serial Monitor should update.
|
||||
|
||||
8) At this point the installation should be considered complete.
|
||||
Exit Arduino
|
||||
|
||||
###################
|
||||
#BUILD STEPS CLIENT
|
||||
###################
|
||||
|
||||
No client software is included in Sprinter. An open-source client
|
||||
designed to work with RAMPS will be your best test subject. I test
|
||||
with pronterface, but am happy to test with other clients if
|
||||
pronterface works and they don't.
|
||||
|
||||
|
|
@ -162,9 +162,12 @@ const int NUM_AXIS = 4; // The axis order in all axis related arrays is X, Y, Z,
|
|||
//// Not used at the Moment
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
// Min step delay in microseconds. If you are experiencing missing steps, try to raise the delay microseconds, but be aware this
|
||||
// Extended step pulse in microseconds.
|
||||
// If you enable this, make sure STEP_DELAY_RATIO is disabled.
|
||||
//#define STEP_DELAY_MICROS 1
|
||||
// Minimum High Time for Stepperpulse at 16 Mhz (E-Axis) is 2,4 us
|
||||
// Minimum High Time for Stepperpulse on X = 6,7 us / Y = 5,6 us / Z = 3,6 us
|
||||
// if you want Stepperpulse like 8 us set the value to 6
|
||||
#define EXTEND_STEP_PULSE_USEC 0
|
||||
|
||||
// Step delay over interval ratio. If you are still experiencing missing steps, try to uncomment the following line, but be aware this
|
||||
// If you enable this, make sure STEP_DELAY_MICROS is disabled. (except for Gen6: both need to be enabled.)
|
||||
|
|
@ -236,9 +239,9 @@ const int dropsegments=5; //everything with less than this number of steps will
|
|||
|
||||
// Arc interpretation settings:
|
||||
//Step to split a cirrcle in small Lines
|
||||
#define MM_PER_ARC_SEGMENT 1
|
||||
#define MM_PER_ARC_SEGMENT 0.5
|
||||
//After this count of steps a new SIN / COS caluclation is startet to correct the circle interpolation
|
||||
#define N_ARC_CORRECTION 25
|
||||
#define N_ARC_CORRECTION 40
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
//// FANCONTROL WITH SOFT PWM
|
||||
|
|
@ -304,6 +307,10 @@ const int dropsegments=5; //everything with less than this number of steps will
|
|||
// magic formula 1, to get approximate "zero error" PWM duty. Take few measurements with low PWM duty and make linear fit to get the formula
|
||||
// for my makergear hot-end: linear fit {50,10},{60,20},{80,30},{105,50},{176,100},{128,64},{208,128}
|
||||
#define HEATER_DUTY_FOR_SETPOINT(setpoint) ((int)((187L*(long)setpoint)>>8)-27)
|
||||
|
||||
//For reprap-feb Extruder V4 with heaterelement
|
||||
//#define HEATER_DUTY_FOR_SETPOINT(setpoint) ((int)((72L*(long)setpoint)>>8)-14)
|
||||
|
||||
// magic formula 2, to make led brightness approximately linear
|
||||
#define LED_PWM_FOR_BRIGHTNESS(brightness) ((64*brightness-1384)/(300-brightness))
|
||||
#endif
|
||||
|
|
@ -338,8 +345,9 @@ const int dropsegments=5; //everything with less than this number of steps will
|
|||
//#define WATCHPERIOD 5000 //5 seconds
|
||||
|
||||
// Actual temperature must be close to target for this long before M109 returns success
|
||||
//#define TEMP_RESIDENCY_TIME 20 // (seconds)
|
||||
//#define TEMP_HYSTERESIS 5 // (C°) range of +/- temperatures considered "close" to the target one
|
||||
#define TEMP_RESIDENCY_TIME 10 // (seconds)
|
||||
#define TEMP_HYSTERESIS 3 // (C°) range of +/- temperatures considered "close" to the target one
|
||||
#define TEMP_WINDOW 1 // (degC) Window around target to start the recidency timer x degC early.
|
||||
|
||||
//// The minimal temperature defines the temperature below which the heater will not be enabled
|
||||
#define MINTEMP 5
|
||||
|
|
@ -349,6 +357,7 @@ const int dropsegments=5; //everything with less than this number of steps will
|
|||
// This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
|
||||
// You should use MINTEMP for thermistor short/failure protection.
|
||||
#define MAXTEMP 275
|
||||
#define MAXTEMP_BED 140
|
||||
|
||||
// Select one of these only to define how the nozzle temp is read.
|
||||
#define HEATER_USES_THERMISTOR
|
||||
|
|
|
|||
|
|
@ -142,6 +142,25 @@
|
|||
- Error in JERK calculation after G92 command is send, make problems
|
||||
with Z-Lift function in Slic3r
|
||||
- Add homing values can shown with M206 D
|
||||
- M303 Autotune use HEATER_CURRENT val for Maximum PWM Value
|
||||
|
||||
Version 1.3.23T
|
||||
- Change max overshoot for Autotune to 55 °C
|
||||
- Analog pins was added with the wrong pin number, needs to be offset +55 to protect against using the pin as a digital
|
||||
- Min step delay in microseconds (EXTEND_STEP_PULSE_USEC)
|
||||
|
||||
Version 1.3.24T / 21.09.2013
|
||||
- M105 show same format as Marlin work better with new Pronterface
|
||||
|
||||
Version 1.3.25T / 12.01.2014
|
||||
- M105 use the wrong convert function for Heatbed Target Temperatur
|
||||
- Correct bug in calculate_trapezoid_for_block(..)
|
||||
- smoother Steps for arc funtion G2/G3
|
||||
- example for HEATER_DUTY_FOR_SETPOINT for reprap-fab Extruder V4
|
||||
- more cycles for Autotune (M303) old 5 cycles, new 7 cycles
|
||||
- New Thermistortable for ATC Semitec 104GT-2 (Type 5)
|
||||
|
||||
.
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -249,7 +268,7 @@ void __cxa_pure_virtual(){};
|
|||
// M603 - Show Free Ram
|
||||
|
||||
|
||||
#define _VERSION_TEXT "1.3.22T / 20.08.2012"
|
||||
#define _VERSION_TEXT "1.3.25T / 12.01.2014"
|
||||
|
||||
//Stepper Movement Variables
|
||||
char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
|
||||
|
|
@ -1492,7 +1511,7 @@ FORCE_INLINE void process_commands()
|
|||
if (code_seen('S')) target_bed_raw = temp2analogBed(code_value());
|
||||
#endif
|
||||
break;
|
||||
case 105: // M105
|
||||
case 105: // M105 ok T:21.2 /50.0 B:22.2 /50.0 @:127 B@:0
|
||||
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_MAX6675)|| defined HEATER_USES_AD595
|
||||
hotendtC = analog2temp(current_raw);
|
||||
#endif
|
||||
|
|
@ -1502,6 +1521,18 @@ FORCE_INLINE void process_commands()
|
|||
#if (TEMP_0_PIN > -1) || defined (HEATER_USES_MAX6675) || defined HEATER_USES_AD595
|
||||
showString(PSTR("ok T:"));
|
||||
Serial.print(hotendtC);
|
||||
showString(PSTR(" /"));
|
||||
Serial.print(analog2temp(target_raw));
|
||||
|
||||
#if TEMP_1_PIN > -1 || defined BED_USES_AD595
|
||||
showString(PSTR(" B:"));
|
||||
Serial.print(bedtempC);
|
||||
showString(PSTR(" /"));
|
||||
Serial.print(analog2tempBed(target_bed_raw));
|
||||
#else
|
||||
Serial.print(PSTR(" B:0 /0"));
|
||||
#endif
|
||||
|
||||
#ifdef PIDTEMP
|
||||
showString(PSTR(" @:"));
|
||||
Serial.print(heater_duty);
|
||||
|
|
@ -1517,23 +1548,40 @@ FORCE_INLINE void process_commands()
|
|||
showString(PSTR(",AU:"));
|
||||
Serial.print(autotemp_setpoint);
|
||||
#endif
|
||||
#endif
|
||||
#if TEMP_1_PIN > -1 || defined BED_USES_AD595
|
||||
showString(PSTR(" B:"));
|
||||
Serial.println(bedtempC);
|
||||
#else
|
||||
Serial.println();
|
||||
showString(PSTR(" @:0"));
|
||||
#if (HEATER_0_PIN > -1)
|
||||
if(READ(HEATER_0_PIN))
|
||||
Serial.println(255);
|
||||
else
|
||||
Serial.println(0);
|
||||
#else
|
||||
Serial.println(0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
showString(PSTR(" B@:"));
|
||||
#if (HEATER_1_PIN > -1)
|
||||
if(READ(HEATER_1_PIN))
|
||||
Serial.println(255);
|
||||
else
|
||||
Serial.println(0);
|
||||
#else
|
||||
Serial.println(0);
|
||||
#endif
|
||||
#else
|
||||
#error No temperature source available
|
||||
#endif
|
||||
return;
|
||||
//break;
|
||||
case 109: { // M109 - Wait for extruder heater to reach target.
|
||||
case 109: // M109 - Wait for extruder heater to reach target.
|
||||
{
|
||||
#ifdef CHAIN_OF_COMMAND
|
||||
st_synchronize(); // wait for all movements to finish
|
||||
#endif
|
||||
|
||||
if (code_seen('S')) target_raw = temp2analogh(target_temp = code_value());
|
||||
|
||||
#ifdef WATCHPERIOD
|
||||
if(target_raw>current_raw)
|
||||
{
|
||||
|
|
@ -1555,27 +1603,51 @@ FORCE_INLINE void process_commands()
|
|||
residencyStart = -1;
|
||||
/* continue to loop until we have reached the target temp
|
||||
_and_ until TEMP_RESIDENCY_TIME hasn't passed since we reached it */
|
||||
while( (target_direction ? (current_raw < target_raw) : (current_raw > target_raw))
|
||||
|| (residencyStart > -1 && (millis() - residencyStart) < TEMP_RESIDENCY_TIME*1000) ) {
|
||||
while((residencyStart == -1) ||
|
||||
(residencyStart >= 0 && (((unsigned int) (millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))) ) {
|
||||
#else
|
||||
while ( target_direction ? (current_raw < target_raw) : (current_raw > target_raw) ) {
|
||||
#endif
|
||||
if( (millis() - codenum) > 1000 ) //Print Temp Reading every 1 second while heating up/cooling down
|
||||
#endif //TEMP_RESIDENCY_TIME
|
||||
//Print Temp Reading every 1 second while heating up/cooling down
|
||||
if( (millis() - codenum) > 1000UL )
|
||||
{
|
||||
showString(PSTR("T:"));
|
||||
#ifndef TEMP_RESIDENCY_TIME
|
||||
Serial.println( analog2temp(current_raw) );
|
||||
#else
|
||||
Serial.print( analog2temp(current_raw) );
|
||||
showString(PSTR(" E:0"));
|
||||
showString(PSTR(" W:"));
|
||||
if(residencyStart > -1)
|
||||
{
|
||||
codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (millis() - residencyStart)) / 1000UL;
|
||||
Serial.print( codenum );
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.print("?");
|
||||
}
|
||||
|
||||
showString(PSTR(" D:"));
|
||||
Serial.println( analog2temp(current_raw) - analog2temp(target_raw) );
|
||||
#endif
|
||||
codenum = millis();
|
||||
}
|
||||
|
||||
//Call Heatercontrol
|
||||
manage_heater();
|
||||
|
||||
#if (MINIMUM_FAN_START_SPEED > 0)
|
||||
manage_fan_start_speed();
|
||||
#endif
|
||||
#ifdef TEMP_RESIDENCY_TIME
|
||||
/* start/restart the TEMP_RESIDENCY_TIME timer whenever we reach target temp for the first time
|
||||
or when current temp falls outside the hysteresis after target temp was reached */
|
||||
if ( (residencyStart == -1 && target_direction && current_raw >= target_raw)
|
||||
|| (residencyStart == -1 && !target_direction && current_raw <= target_raw)
|
||||
|| (residencyStart > -1 && labs(analog2temp(current_raw) - analog2temp(target_raw)) > TEMP_HYSTERESIS) ) {
|
||||
|
||||
if ((residencyStart == -1 && target_direction && (analog2temp(current_raw) >= (analog2temp(target_raw)-TEMP_WINDOW))) ||
|
||||
(residencyStart == -1 && !target_direction && (analog2temp(current_raw) <= (analog2temp(target_raw)+TEMP_WINDOW))) ||
|
||||
(residencyStart > -1 && labs(analog2temp(current_raw) - analog2temp(target_raw)) > TEMP_HYSTERESIS) )
|
||||
{
|
||||
residencyStart = millis();
|
||||
}
|
||||
#endif
|
||||
|
|
@ -2239,9 +2311,9 @@ void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exi
|
|||
|
||||
long acceleration = block->acceleration_st;
|
||||
int32_t accelerate_steps =
|
||||
ceil(estimate_acceleration_distance(block->initial_rate, block->nominal_rate, acceleration));
|
||||
ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, acceleration));
|
||||
int32_t decelerate_steps =
|
||||
floor(estimate_acceleration_distance(block->nominal_rate, block->final_rate, -acceleration));
|
||||
floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration));
|
||||
|
||||
// Calculate the size of Plateau of Nominal Rate.
|
||||
int32_t plateau_steps = block->step_event_count-accelerate_steps-decelerate_steps;
|
||||
|
|
@ -2249,9 +2321,10 @@ void calculate_trapezoid_for_block(block_t *block, float entry_factor, float exi
|
|||
// Is the Plateau of Nominal Rate smaller than nothing? That means no cruising, and we will
|
||||
// have to use intersection_distance() to calculate when to abort acceleration and start breaking
|
||||
// in order to reach the final_rate exactly at the end of this block.
|
||||
if (plateau_steps < 0) {
|
||||
if (plateau_steps < 0)
|
||||
{
|
||||
accelerate_steps = ceil(
|
||||
intersection_distance(block->initial_rate, block->final_rate, acceleration, block->step_event_count));
|
||||
intersection_distance(initial_rate, final_rate, acceleration, block->step_event_count));
|
||||
accelerate_steps = max(accelerate_steps,0); // Check limits due to numerical round-off
|
||||
accelerate_steps = min(accelerate_steps,block->step_event_count);
|
||||
plateau_steps = 0;
|
||||
|
|
@ -3314,7 +3387,7 @@ ISR(TIMER1_COMPA_vect)
|
|||
virtual_steps_x++;
|
||||
|
||||
counter_x -= current_block->step_event_count;
|
||||
WRITE(X_STEP_PIN, LOW);
|
||||
//WRITE(X_STEP_PIN, LOW);
|
||||
}
|
||||
|
||||
counter_y += current_block->steps_y;
|
||||
|
|
@ -3330,7 +3403,7 @@ ISR(TIMER1_COMPA_vect)
|
|||
virtual_steps_y++;
|
||||
|
||||
counter_y -= current_block->step_event_count;
|
||||
WRITE(Y_STEP_PIN, LOW);
|
||||
//WRITE(Y_STEP_PIN, LOW);
|
||||
}
|
||||
|
||||
counter_z += current_block->steps_z;
|
||||
|
|
@ -3346,7 +3419,7 @@ ISR(TIMER1_COMPA_vect)
|
|||
virtual_steps_z++;
|
||||
|
||||
counter_z -= current_block->step_event_count;
|
||||
WRITE(Z_STEP_PIN, LOW);
|
||||
//WRITE(Z_STEP_PIN, LOW);
|
||||
}
|
||||
|
||||
#ifndef ADVANCE
|
||||
|
|
@ -3354,11 +3427,23 @@ ISR(TIMER1_COMPA_vect)
|
|||
if (counter_e > 0) {
|
||||
WRITE(E_STEP_PIN, HIGH);
|
||||
counter_e -= current_block->step_event_count;
|
||||
WRITE(E_STEP_PIN, LOW);
|
||||
//WRITE(E_STEP_PIN, LOW);
|
||||
}
|
||||
#endif //!ADVANCE
|
||||
|
||||
step_events_completed += 1;
|
||||
|
||||
#if (EXTEND_STEP_PULSE_USEC > 0)
|
||||
delayMicroseconds(EXTEND_STEP_PULSE_USEC);
|
||||
#endif
|
||||
|
||||
WRITE(X_STEP_PIN, LOW);
|
||||
WRITE(Y_STEP_PIN, LOW);
|
||||
WRITE(Z_STEP_PIN, LOW);
|
||||
#ifndef ADVANCE
|
||||
WRITE(E_STEP_PIN, LOW);
|
||||
#endif
|
||||
|
||||
if(step_events_completed >= current_block->step_event_count) break;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,10 @@ unsigned long previous_millis_heater, previous_millis_bed_heater, previous_milli
|
|||
int maxttemp = temp2analogh(MAXTEMP);
|
||||
#endif
|
||||
|
||||
#ifdef MAXTEMP_BED
|
||||
int maxttemp_bed = temp2analogBed(MAXTEMP_BED);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define HEAT_INTERVAL 250
|
||||
|
|
@ -305,6 +309,9 @@ ISR(TIMER2_OVF_vect)
|
|||
// Some information see:
|
||||
// http://brettbeauregard.com/blog/2012/01/arduino-pid-autotune-library/
|
||||
//------------------------------------------------------------------
|
||||
|
||||
//HEATER_CURRENT --> 255
|
||||
|
||||
#ifdef PID_AUTOTUNE
|
||||
void PID_autotune(int PIDAT_test_temp)
|
||||
{
|
||||
|
|
@ -413,7 +420,7 @@ void PID_autotune(int PIDAT_test_temp)
|
|||
showString(PSTR(" min: ")); Serial.print(PIDAT_min);
|
||||
showString(PSTR(" max: ")); Serial.println(PIDAT_max);
|
||||
|
||||
if(PIDAT_cycles > 2)
|
||||
if(PIDAT_cycles > 3)
|
||||
{
|
||||
PIDAT_Ku = (4.0*PIDAT_d)/(3.14159*(PIDAT_max-PIDAT_min));
|
||||
PIDAT_Tu = ((float)(PIDAT_t_low + PIDAT_t_high)/1000.0);
|
||||
|
|
@ -425,9 +432,6 @@ void PID_autotune(int PIDAT_test_temp)
|
|||
PIDAT_Ki = 2*PIDAT_Kp/PIDAT_Tu;
|
||||
PIDAT_Kd = PIDAT_Kp*PIDAT_Tu/8;
|
||||
showString(PSTR(" Clasic PID \r\n"));
|
||||
//showString(PSTR(" Kp: ")); Serial.println(PIDAT_Kp);
|
||||
//showString(PSTR(" Ki: ")); Serial.println(PIDAT_Ki);
|
||||
//showString(PSTR(" Kd: ")); Serial.println(PIDAT_Kd);
|
||||
showString(PSTR(" CFG Kp: ")); Serial.println((unsigned int)(PIDAT_Kp*256));
|
||||
showString(PSTR(" CFG Ki: ")); Serial.println((unsigned int)(PIDAT_Ki*PIDAT_TIME_FACTOR));
|
||||
showString(PSTR(" CFG Kd: ")); Serial.println((unsigned int)(PIDAT_Kd*PIDAT_TIME_FACTOR));
|
||||
|
|
@ -488,7 +492,7 @@ void PID_autotune(int PIDAT_test_temp)
|
|||
return;
|
||||
}
|
||||
|
||||
if(PIDAT_cycles > 5)
|
||||
if(PIDAT_cycles > 7)
|
||||
{
|
||||
showString(PSTR("PID Autotune finished ! Place the Kp, Ki and Kd constants in the configuration.h\r\n"));
|
||||
return;
|
||||
|
|
@ -742,7 +746,11 @@ void PID_autotune(int PIDAT_test_temp)
|
|||
|
||||
|
||||
#ifdef MINTEMP
|
||||
#ifdef MAXTEMP_BED
|
||||
if(current_bed_raw >= target_bed_raw || current_bed_raw < minttemp || current_bed_raw > maxttemp_bed)
|
||||
#else
|
||||
if(current_bed_raw >= target_bed_raw || current_bed_raw < minttemp)
|
||||
#endif
|
||||
#else
|
||||
if(current_bed_raw >= target_bed_raw)
|
||||
#endif
|
||||
|
|
@ -794,7 +802,7 @@ int temp2analog_thermistor(int celsius, const short table[][2], int numtemps)
|
|||
#if defined (HEATER_USES_AD595) || defined (BED_USES_AD595)
|
||||
int temp2analog_ad595(int celsius)
|
||||
{
|
||||
return celsius * 1024 / (500);
|
||||
return (celsius * 1024.0) / (500.0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -835,7 +843,7 @@ int analog2temp_thermistor(int raw,const short table[][2], int numtemps) {
|
|||
#if defined (HEATER_USES_AD595) || defined (BED_USES_AD595)
|
||||
int analog2temp_ad595(int raw)
|
||||
{
|
||||
return raw * 500 / 1024;
|
||||
return (raw * 500.0) / 1024.0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -899,7 +899,7 @@
|
|||
|
||||
|
||||
//List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
|
||||
const int sensitive_pins[] = {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, E_STEP_PIN, E_DIR_PIN, E_ENABLE_PIN, LED_PIN, PS_ON_PIN, HEATER_0_PIN, HEATER_1_PIN, FAN_PIN, TEMP_0_PIN, TEMP_1_PIN};
|
||||
const int sensitive_pins[] = {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, E_STEP_PIN, E_DIR_PIN, E_ENABLE_PIN, LED_PIN, PS_ON_PIN, HEATER_0_PIN, HEATER_1_PIN, FAN_PIN, TEMP_0_PIN+55, TEMP_1_PIN+55, TEMP_2_PIN+55, TEMP_BED_PIN+55};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -200,71 +200,50 @@ const short temptable_4[NUMTEMPS_4][2] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
#if (THERMISTORHEATER == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (104GT-2)
|
||||
#if (THERMISTORHEATER == 5) || (THERMISTORBED == 5) //100k ParCan thermistor (ATC Semitec 104GT-2)
|
||||
|
||||
#define NUMTEMPS_5 61
|
||||
#define NUMTEMPS_5 33
|
||||
const short temptable_5[NUMTEMPS_5][2] = {
|
||||
|
||||
// ATC Semitec 104GT-2 (Used in ParCan) --> Change to SMD Sensor RS 769-1899
|
||||
// 33 Fields
|
||||
// Verified by linagee. Source: http://shop.arcol.hu/static/datasheets/thermistors.pdf
|
||||
// Calculated using 4.7kohm pullup, voltage divider math, and manufacturer provided temp/resistance
|
||||
{1, 713},
|
||||
{18, 316},
|
||||
{35, 266},
|
||||
{52, 239},
|
||||
{69, 221},
|
||||
{86, 208},
|
||||
{103, 197},
|
||||
{120, 188},
|
||||
{137, 181},
|
||||
{154, 174},
|
||||
{171, 169},
|
||||
{188, 163},
|
||||
{205, 159},
|
||||
{222, 154},
|
||||
{239, 150},
|
||||
{256, 147},
|
||||
{273, 143},
|
||||
{290, 140},
|
||||
{307, 136},
|
||||
{324, 133},
|
||||
{341, 130},
|
||||
{358, 128},
|
||||
{375, 125},
|
||||
{392, 122},
|
||||
{409, 120},
|
||||
{426, 117},
|
||||
{443, 115},
|
||||
{460, 112},
|
||||
{477, 110},
|
||||
{494, 108},
|
||||
{511, 106},
|
||||
{528, 103},
|
||||
{545, 101},
|
||||
{562, 99},
|
||||
{579, 97},
|
||||
{596, 95},
|
||||
{613, 92},
|
||||
{630, 90},
|
||||
{647, 88},
|
||||
{664, 86},
|
||||
{681, 84},
|
||||
{698, 81},
|
||||
{715, 79},
|
||||
{732, 77},
|
||||
{749, 75},
|
||||
{766, 72},
|
||||
{783, 70},
|
||||
{800, 67},
|
||||
{817, 64},
|
||||
{834, 61},
|
||||
{851, 58},
|
||||
{868, 55},
|
||||
{885, 52},
|
||||
{902, 48},
|
||||
{919, 44},
|
||||
{936, 40},
|
||||
{953, 34},
|
||||
{970, 28},
|
||||
{987, 20},
|
||||
{1004, 8},
|
||||
{17, 300}, //top rating 300C
|
||||
{20, 290},
|
||||
{23, 280},
|
||||
{27, 270},
|
||||
{31, 260},
|
||||
{37, 250},
|
||||
{43, 240},
|
||||
{51, 230},
|
||||
{61, 220},
|
||||
{73, 210},
|
||||
{87, 200},
|
||||
{106, 190},
|
||||
{128, 180},
|
||||
{155, 170},
|
||||
{189, 160},
|
||||
{230, 150},
|
||||
{278, 140},
|
||||
{336, 130},
|
||||
{357, 119},
|
||||
{402, 112},
|
||||
{476, 103},
|
||||
{554, 94},
|
||||
{635, 84},
|
||||
{713, 76},
|
||||
{784, 69},
|
||||
{846, 60},
|
||||
{897, 50},
|
||||
{937, 40},
|
||||
{966, 30},
|
||||
{986, 20},
|
||||
{1000, 10},
|
||||
{1021, 0}
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue