Compare commits
10 Commits
b0f3a0737d
...
8168d2a66f
| Author | SHA1 | Date |
|---|---|---|
|
|
8168d2a66f | |
|
|
9b934c364e | |
|
|
a7423019ba | |
|
|
08b95047df | |
|
|
20dd299c7a | |
|
|
a32974b182 | |
|
|
b8687c4eac | |
|
|
e4896a1257 | |
|
|
86123f80f7 | |
|
|
ec9fa99b66 |
|
|
@ -0,0 +1,31 @@
|
|||
Markus Hitter <mah@jump-ing.de>
|
||||
|
||||
Michael Moon <triffid.hunter@gmail.com> triffid <triffid.hunter@gmail.com>
|
||||
|
||||
Nico Tonnhofer <wurstnase.reprap@gmail.com> wurstnase <wurstnase.reprap@gmail.com>
|
||||
Nico Tonnhofer <wurstnase.reprap@gmail.com> Wurstnase <wurstnase.reprap@gmail.com>
|
||||
|
||||
Phil Hord <phord@purestorage.com> Phil Hord <phil.hord@technicolor.com>
|
||||
Phil Hord <phord@purestorage.com> Phil Hord <hordp@cisco.com>
|
||||
|
||||
Jeff Bernardis <jeff.bernardis@gmail.com> jbernardis <jeff.bernardis@gmail.com>
|
||||
|
||||
Markus Amsler <markus.amsler@oribi.org> Markus Amsler <markus.amsler@gmail.com>
|
||||
|
||||
David Forrest <drf@vims.edu>
|
||||
|
||||
Jim McGee <madscifi@jetblackcat.com>
|
||||
|
||||
Ben Jackson <ben@ben.com>
|
||||
|
||||
Robert Konklewski <nythil@gmail.com>
|
||||
|
||||
Bas Laarhoven <sjml@xs4all.nl>
|
||||
|
||||
Stephan Walter <stephan@walter.name>
|
||||
|
||||
Ruslan Popov <ruslan.popov@gmail.com>
|
||||
|
||||
Jens Ch. Restemeier <jens.restemeier@gmail.com>
|
||||
|
||||
Roland Brochard <zuzuf86@gmail.com>
|
||||
|
|
@ -0,0 +1,265 @@
|
|||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 1. CPU *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def CPU_TYPE
|
||||
CPU types a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define CPU_TYPE atmega644p
|
||||
|
||||
/** \def CPU
|
||||
CPU actually present on the board.
|
||||
*/
|
||||
#define CPU atmega644p
|
||||
|
||||
/** \def F_CPU_OPT
|
||||
CPU clock frequencies a user should be able to choose from in configtool.
|
||||
All commented out.
|
||||
*/
|
||||
//#define F_CPU_OPT 16000000UL
|
||||
|
||||
/** \def F_CPU
|
||||
Actual CPU clock rate. #ifndef required for Arduino compatibility.
|
||||
*/
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/** \def MOTHERBOARD
|
||||
This is the motherboard, as opposed to the extruder. See extruder/ directory
|
||||
for GEN3 extruder firmware.
|
||||
*/
|
||||
#define MOTHERBOARD
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 2. PINOUTS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
#define TX_ENABLE_PIN DIO12
|
||||
#define RX_ENABLE_PIN DIO13
|
||||
|
||||
#define X_STEP_PIN DIO15
|
||||
#define X_DIR_PIN DIO18
|
||||
#define X_MIN_PIN DIO20
|
||||
#define X_MAX_PIN DIO21
|
||||
#define X_ENABLE_PIN DIO19
|
||||
//#define X_INVERT_DIR
|
||||
#define X_INVERT_MIN
|
||||
#define X_INVERT_MAX
|
||||
#define X_INVERT_ENABLE
|
||||
|
||||
#define Y_STEP_PIN DIO23
|
||||
#define Y_DIR_PIN DIO22
|
||||
#define Y_MIN_PIN DIO25
|
||||
//#define Y_MAX_PIN DIO26
|
||||
#define Y_ENABLE_PIN DIO24
|
||||
//#define Y_INVERT_DIR
|
||||
#define Y_INVERT_MIN
|
||||
#define Y_INVERT_MAX
|
||||
#define Y_INVERT_ENABLE
|
||||
|
||||
#define Z_STEP_PIN DIO27
|
||||
#define Z_DIR_PIN DIO28
|
||||
#define Z_MIN_PIN DIO30
|
||||
//#define Z_MAX_PIN DIO31
|
||||
#define Z_ENABLE_PIN DIO29
|
||||
//#define Z_INVERT_DIR
|
||||
#define Z_INVERT_MIN
|
||||
#define Z_INVERT_MAX
|
||||
#define Z_INVERT_ENABLE
|
||||
|
||||
#define E_STEP_PIN DIO17
|
||||
#define E_DIR_PIN DIO16
|
||||
//#define E_ENABLE_PIN xxxx
|
||||
//#define E_INVERT_DIR
|
||||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO14
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define STEPPER_ENABLE_PIN DIO25
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
/** \def DEBUG_LED_PIN
|
||||
|
||||
Enable flashing of a LED during motor stepping.
|
||||
|
||||
Disabled by default. Uncommenting this makes the binary a few bytes larger
|
||||
and adds a few cycles to the step timing interrrupt in timer.c. Also used
|
||||
for precision profiling (profiling works even without actually having such
|
||||
a LED in hardware), see
|
||||
http://reprap.org/wiki/Teacup_Firmware#Doing_precision_profiling
|
||||
*/
|
||||
//#define DEBUG_LED_PIN DIO21
|
||||
|
||||
/** \def SD_CARD_SELECT_PIN
|
||||
|
||||
Chip Select pin of the SD card.
|
||||
|
||||
SD cards work over SPI and have a Chip Select or Slave Select (SS) pin.
|
||||
Choose this pin according to where on the board your SD card adapter is
|
||||
connected. Disabling this pin also disables SD card support and makes the
|
||||
firmware binary about 4.5 kB smaller.
|
||||
|
||||
Connecting a device to SPI actually uses 4 signal lines, the other three
|
||||
pins are choosen by Teacup automatically.
|
||||
*/
|
||||
#define SD_CARD_SELECT_PIN DIO4
|
||||
|
||||
/** \def MCP3008_SELECT_PIN
|
||||
|
||||
Chip Select pin of the MCP3008 ADC.
|
||||
|
||||
MCP3008/4 analog-digital converter works over SPI and has a Chip Select pin.
|
||||
Choose this pin according to where the MCP3008 is connected. Setting this
|
||||
pin is required only if at least one temperature sensor of type MCP3008 is
|
||||
configured. Else it's ignored.
|
||||
*/
|
||||
//#define MCP3008_SELECT_PIN xxxx
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 3. TEMPERATURE SENSORS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
#ifndef DEFINE_TEMP_SENSOR
|
||||
#define DEFINE_TEMP_SENSOR(...)
|
||||
#endif
|
||||
|
||||
/** \def TEMP_MAX6675 TEMP_THERMISTOR TEMP_AD595 TEMP_PT100 TEMP_INTERCOM
|
||||
\def TEMP_MCP3008
|
||||
|
||||
Which temperature sensor types are you using? Leave all used ones
|
||||
uncommented, comment out all others to save binary size and enhance
|
||||
performance.
|
||||
*/
|
||||
//#define TEMP_MAX6675
|
||||
//#define TEMP_THERMISTOR
|
||||
//#define TEMP_AD595
|
||||
//#define TEMP_PT100
|
||||
#define TEMP_INTERCOM
|
||||
//#define TEMP_MCP3008
|
||||
|
||||
/** \def TEMP_SENSOR_PIN
|
||||
Temperature sensor pins a user should be able to choose from in configtool.
|
||||
All commented out.
|
||||
*/
|
||||
//#define TEMP_SENSOR_PIN AIO0
|
||||
|
||||
/** \def DEFINE_TEMP_SENSOR
|
||||
Define your temperature sensors here. One line for each sensor, only
|
||||
limited by the number of available ATmega pins.
|
||||
|
||||
Name must match the name of the corresponding heater. If a heater "extruder"
|
||||
exists, a temperature sensor of that name has to exist as well. Same for
|
||||
heater "bed". There can be one sensor without corresponding heater, name it
|
||||
"noheater".
|
||||
|
||||
Types are same as TEMP_ list above - TT_MAX6675, TT_THERMISTOR, TT_AD595,
|
||||
TT_PT100, TT_INTERCOM, TT_MCP3008. See list in temp.c.
|
||||
|
||||
The "additional" field is used for TT_THERMISTOR and TT_MCP3008 only. It
|
||||
defines the name of the table(s) in thermistortable.h to use. This name is
|
||||
arbitrary, often used names include THERMISTOR_EXTRUDER and THERMISTOR_BED.
|
||||
Also, several sensors can share the same table, which saves binary size.
|
||||
|
||||
For a GEN3 set temp_type to TT_INTERCOM and temp_pin to AIO0. The pin
|
||||
won't be used in this case.
|
||||
*/
|
||||
//DEFINE_TEMP_SENSORS_START
|
||||
// name type pin additional
|
||||
DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0)
|
||||
|
||||
// Beta algorithm r0 beta r2 vadc
|
||||
// Steinhart-Hart rp t0 r0 t1 r1 t2 r2
|
||||
//DEFINE_TEMP_SENSORS_END
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 4. HEATERS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
#ifndef DEFINE_HEATER
|
||||
#define DEFINE_HEATER(...)
|
||||
#endif
|
||||
|
||||
/** \def HEATER_PIN
|
||||
Heater pins a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HEATER_PIN xxxx
|
||||
|
||||
/** \def DEFINE_HEATER
|
||||
Define your heaters and devices here.
|
||||
|
||||
To attach a heater to a temp sensor above, simply use exactly the same
|
||||
name - copy+paste is your friend. Some common names are 'extruder',
|
||||
'bed', 'fan', 'motor', ... names with special meaning can be found
|
||||
in gcode_process.c. Currently, these are:
|
||||
HEATER_extruder (M104)
|
||||
HEATER_bed (M140)
|
||||
HEATER_fan (M106)
|
||||
|
||||
Devices don't neccessarily have a temperature sensor, e.g. fans or
|
||||
milling spindles. Operate such devices by setting their power (M106),
|
||||
instead of setting their temperature (M104).
|
||||
|
||||
Also note, the index of a heater (M106 P#) can differ from the index of
|
||||
its attached temperature sensor (M104 P#) in case sensor-less devices
|
||||
are defined or the order of the definitions differs. The first defined
|
||||
device has the index 0 (zero).
|
||||
|
||||
Set 'invert' to 0 for normal heaters. Setting it to 1 inverts the pin signal
|
||||
for this pin, e.g. for a MOSFET with a driver.
|
||||
|
||||
Set 'pwm' to ...
|
||||
1 for using PWM on a PWM-able pin and on/off on other pins.
|
||||
0 for using on/off on a PWM-able pin, too.
|
||||
|
||||
Using PWM usually gives smoother temperature control but can conflict
|
||||
with slow switches, like solid state relays. PWM frequency can be
|
||||
influenced globally with FAST_PWM, see below.
|
||||
*/
|
||||
//DEFINE_HEATERS_START
|
||||
// name pin invert pwm
|
||||
|
||||
//DEFINE_HEATERS_END
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 5. COMMUNICATION OPTIONS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def BAUD
|
||||
Baud rate for the serial RS232 protocol connection to the host. Usually
|
||||
115200, other common values are 19200, 38400 or 57600. Ignored when USB_SERIAL
|
||||
is defined.
|
||||
*/
|
||||
#define BAUD 115200
|
||||
|
||||
/** \def XONXOFF
|
||||
Xon/Xoff flow control.
|
||||
|
||||
Redundant when using RepRap Host for sending G-code, but mandatory when
|
||||
sending G-code files with a plain terminal emulator, like GtkTerm (Linux),
|
||||
CoolTerm (Mac) or HyperTerminal (Windows).
|
||||
*/
|
||||
//#define XONXOFF
|
||||
|
||||
/** \def USB_SERIAL
|
||||
Define this for using USB instead of the serial RS232 protocol. Works on
|
||||
USB-equipped ATmegas, like the ATmega32U4, only.
|
||||
*/
|
||||
//#define USB_SERIAL
|
||||
|
|
@ -0,0 +1,311 @@
|
|||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 1. CPU *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def CPU_TYPE
|
||||
CPU types a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define CPU_TYPE atmega644p
|
||||
|
||||
/** \def CPU
|
||||
CPU actually present on the board.
|
||||
*/
|
||||
#define CPU atmega644p
|
||||
|
||||
/** \def F_CPU_OPT
|
||||
CPU clock frequencies a user should be able to choose from in configtool.
|
||||
All commented out.
|
||||
*/
|
||||
//#define F_CPU_OPT 16000000UL
|
||||
|
||||
/** \def F_CPU
|
||||
Actual CPU clock rate. #ifndef required for Arduino compatibility.
|
||||
*/
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/** \def MOTHERBOARD
|
||||
This is the motherboard, as opposed to the extruder. See extruder/ directory
|
||||
for GEN3 extruder firmware.
|
||||
*/
|
||||
#define MOTHERBOARD
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 2. PINOUTS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
#define TX_ENABLE_PIN DIO12
|
||||
#define RX_ENABLE_PIN DIO13
|
||||
|
||||
#define X_STEP_PIN DIO15
|
||||
#define X_DIR_PIN DIO18
|
||||
#define X_MIN_PIN DIO20
|
||||
#define X_MAX_PIN DIO21
|
||||
#define X_ENABLE_PIN DIO19
|
||||
//#define X_INVERT_DIR
|
||||
#define X_INVERT_MIN
|
||||
#define X_INVERT_MAX
|
||||
//#define X_INVERT_ENABLE
|
||||
|
||||
#define Y_STEP_PIN DIO23
|
||||
#define Y_DIR_PIN DIO22
|
||||
#define Y_MIN_PIN AIO6
|
||||
#define Y_MAX_PIN AIO5
|
||||
#define Y_ENABLE_PIN AIO7
|
||||
//#define Y_INVERT_DIR
|
||||
#define Y_INVERT_MIN
|
||||
#define Y_INVERT_MAX
|
||||
//#define Y_INVERT_ENABLE
|
||||
|
||||
#define Z_STEP_PIN AIO4
|
||||
#define Z_DIR_PIN AIO3
|
||||
#define Z_MIN_PIN AIO1
|
||||
#define Z_MAX_PIN AIO0
|
||||
#define Z_ENABLE_PIN AIO2
|
||||
//#define Z_INVERT_DIR
|
||||
#define Z_INVERT_MIN
|
||||
#define Z_INVERT_MAX
|
||||
//#define Z_INVERT_ENABLE
|
||||
|
||||
#define E_STEP_PIN DIO17
|
||||
#define E_DIR_PIN DIO16
|
||||
//#define E_ENABLE_PIN xxxx
|
||||
//#define E_INVERT_DIR
|
||||
//#define E_INVERT_ENABLE
|
||||
|
||||
#define PS_ON_PIN DIO14
|
||||
//#define PS_INVERT_ON
|
||||
//#define PS_MOSFET_PIN xxxx
|
||||
//#define STEPPER_ENABLE_PIN DIO25
|
||||
//#define STEPPER_INVERT_ENABLE
|
||||
|
||||
/** \def DEBUG_LED_PIN
|
||||
|
||||
Enable flashing of a LED during motor stepping.
|
||||
|
||||
Disabled by default. Uncommenting this makes the binary a few bytes larger
|
||||
and adds a few cycles to the step timing interrrupt in timer.c. Also used
|
||||
for precision profiling (profiling works even without actually having such
|
||||
a LED in hardware), see
|
||||
http://reprap.org/wiki/Teacup_Firmware#Doing_precision_profiling
|
||||
*/
|
||||
//#define DEBUG_LED_PIN DIO21
|
||||
|
||||
/** \def SD_CARD_SELECT_PIN
|
||||
|
||||
Chip Select pin of the SD card.
|
||||
|
||||
SD cards work over SPI and have a Chip Select or Slave Select (SS) pin.
|
||||
Choose this pin according to where on the board your SD card adapter is
|
||||
connected. Disabling this pin also disables SD card support and makes the
|
||||
firmware binary about 4.5 kB smaller.
|
||||
|
||||
Connecting a device to SPI actually uses 4 signal lines, the other three
|
||||
pins are choosen by Teacup automatically.
|
||||
*/
|
||||
#define SD_CARD_SELECT_PIN DIO4
|
||||
|
||||
/** \def MCP3008_SELECT_PIN
|
||||
|
||||
Chip Select pin of the MCP3008 ADC.
|
||||
|
||||
MCP3008/4 analog-digital converter works over SPI and has a Chip Select pin.
|
||||
Choose this pin according to where the MCP3008 is connected. Setting this
|
||||
pin is required only if at least one temperature sensor of type MCP3008 is
|
||||
configured. Else it's ignored.
|
||||
*/
|
||||
//#define MCP3008_SELECT_PIN xxxx
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 3. TEMPERATURE SENSORS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
#ifndef DEFINE_TEMP_SENSOR
|
||||
#define DEFINE_TEMP_SENSOR(...)
|
||||
#endif
|
||||
|
||||
/** \def TEMP_MAX6675 TEMP_THERMISTOR TEMP_AD595 TEMP_PT100 TEMP_INTERCOM
|
||||
\def TEMP_MCP3008
|
||||
|
||||
Which temperature sensor types are you using? Leave all used ones
|
||||
uncommented, comment out all others to save binary size and enhance
|
||||
performance.
|
||||
*/
|
||||
//#define TEMP_MAX6675
|
||||
//#define TEMP_THERMISTOR
|
||||
//#define TEMP_AD595
|
||||
//#define TEMP_PT100
|
||||
#define TEMP_INTERCOM
|
||||
//#define TEMP_MCP3008
|
||||
|
||||
/** \def TEMP_SENSOR_PIN
|
||||
Temperature sensor pins a user should be able to choose from in configtool.
|
||||
All commented out.
|
||||
*/
|
||||
//#define TEMP_SENSOR_PIN AIO0
|
||||
|
||||
/** \def DEFINE_TEMP_SENSOR
|
||||
Define your temperature sensors here. One line for each sensor, only
|
||||
limited by the number of available ATmega pins.
|
||||
|
||||
Name must match the name of the corresponding heater. If a heater "extruder"
|
||||
exists, a temperature sensor of that name has to exist as well. Same for
|
||||
heater "bed". There can be one sensor without corresponding heater, name it
|
||||
"noheater".
|
||||
|
||||
Types are same as TEMP_ list above - TT_MAX6675, TT_THERMISTOR, TT_AD595,
|
||||
TT_PT100, TT_INTERCOM, TT_MCP3008. See list in temp.c.
|
||||
|
||||
The "additional" field is used for TT_THERMISTOR and TT_MCP3008 only. It
|
||||
defines the name of the table(s) in thermistortable.h to use. This name is
|
||||
arbitrary, often used names include THERMISTOR_EXTRUDER and THERMISTOR_BED.
|
||||
Also, several sensors can share the same table, which saves binary size.
|
||||
|
||||
For a GEN3 set temp_type to TT_INTERCOM and temp_pin to AIO0. The pin
|
||||
won't be used in this case.
|
||||
*/
|
||||
//DEFINE_TEMP_SENSORS_START
|
||||
// name type pin additional
|
||||
DEFINE_TEMP_SENSOR(noheater, TT_INTERCOM, AIO0, 0)
|
||||
|
||||
// Beta algorithm r0 beta r2 vadc
|
||||
// Steinhart-Hart rp t0 r0 t1 r1 t2 r2
|
||||
//DEFINE_TEMP_SENSORS_END
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 4. HEATERS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
#ifndef DEFINE_HEATER
|
||||
#define DEFINE_HEATER(...)
|
||||
#endif
|
||||
|
||||
/** \def HEATER_PIN
|
||||
Heater pins a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HEATER_PIN xxxx
|
||||
|
||||
/** \def DEFINE_HEATER
|
||||
Define your heaters and devices here.
|
||||
|
||||
To attach a heater to a temp sensor above, simply use exactly the same
|
||||
name - copy+paste is your friend. Some common names are 'extruder',
|
||||
'bed', 'fan', 'motor', ... names with special meaning can be found
|
||||
in gcode_process.c. Currently, these are:
|
||||
HEATER_extruder (M104)
|
||||
HEATER_bed (M140)
|
||||
HEATER_fan (M106)
|
||||
|
||||
Devices don't neccessarily have a temperature sensor, e.g. fans or
|
||||
milling spindles. Operate such devices by setting their power (M106),
|
||||
instead of setting their temperature (M104).
|
||||
|
||||
Also note, the index of a heater (M106 P#) can differ from the index of
|
||||
its attached temperature sensor (M104 P#) in case sensor-less devices
|
||||
are defined or the order of the definitions differs. The first defined
|
||||
device has the index 0 (zero).
|
||||
|
||||
Set 'invert' to 0 for normal heaters. Setting it to 1 inverts the pin signal
|
||||
for this pin, e.g. for a MOSFET with a driver.
|
||||
|
||||
Set 'pwm' to ...
|
||||
1 for using PWM on a PWM-able pin and on/off on other pins.
|
||||
0 for using on/off on a PWM-able pin, too.
|
||||
|
||||
Using PWM usually gives smoother temperature control but can conflict
|
||||
with slow switches, like solid state relays. PWM frequency can be
|
||||
influenced globally with FAST_PWM, see below.
|
||||
*/
|
||||
//DEFINE_HEATERS_START
|
||||
// name pin invert pwm
|
||||
|
||||
//DEFINE_HEATERS_END
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 5. COMMUNICATION OPTIONS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def BAUD
|
||||
Baud rate for the serial RS232 protocol connection to the host. Usually
|
||||
115200, other common values are 19200, 38400 or 57600. Ignored when USB_SERIAL
|
||||
is defined.
|
||||
*/
|
||||
#define BAUD 115200
|
||||
|
||||
/** \def XONXOFF
|
||||
Xon/Xoff flow control.
|
||||
|
||||
Redundant when using RepRap Host for sending G-code, but mandatory when
|
||||
sending G-code files with a plain terminal emulator, like GtkTerm (Linux),
|
||||
CoolTerm (Mac) or HyperTerminal (Windows).
|
||||
*/
|
||||
//#define XONXOFF
|
||||
|
||||
/** \def USB_SERIAL
|
||||
Define this for using USB instead of the serial RS232 protocol. Works on
|
||||
USB-equipped ATmegas, like the ATmega32U4, only.
|
||||
*/
|
||||
//#define USB_SERIAL
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 6. DISPLAY SUPPORT *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def DISPLAY_BUS_4BIT DISPLAY_BUS_8BIT DISPLAY_BUS_I2C DISPLAY_BUS_SPI
|
||||
|
||||
The bus used to connect the display to the controller. This is a property
|
||||
of the display. With most displays there can be only one correct choice.
|
||||
|
||||
Comment in the one in use, comment out all others. If there is no display,
|
||||
comment out all of them to remove display code for better performance.
|
||||
*/
|
||||
//#define DISPLAY_BUS_4BIT
|
||||
//#define DISPLAY_BUS_8BIT
|
||||
//#define DISPLAY_BUS_I2C
|
||||
//#define DISPLAY_BUS_SPI
|
||||
|
||||
/** \def DISPLAY_RS_PIN DISPLAY_RW_PIN DISPLAY_E_PIN
|
||||
\def DISPLAY_D4_PIN DISPLAY_D5_PIN DISPLAY_D6_PIN DISPLAY_D7_PIN
|
||||
|
||||
Pins necessary for the 4-bit parallel display bus. Taken into account with
|
||||
DISPLAY_BUS_4BIT defined, only.
|
||||
*/
|
||||
//#define DISPLAY_RS_PIN xxxx
|
||||
//#define DISPLAY_RW_PIN xxxx
|
||||
//#define DISPLAY_E_PIN xxxx
|
||||
//#define DISPLAY_D4_PIN xxxx
|
||||
//#define DISPLAY_D5_PIN xxxx
|
||||
//#define DISPLAY_D6_PIN xxxx
|
||||
//#define DISPLAY_D7_PIN xxxx
|
||||
|
||||
/** \def DISPLAY_TYPE_SSD1306 DISPLAY_TYPE_HD44780
|
||||
|
||||
The type of display in use. There can be only one choice. Taken into account
|
||||
only if one of DISPLAY_BUS_xxx is defined.
|
||||
|
||||
Comment in the display in use, comment out all others. If there is no
|
||||
display, comment out all of DISPLAY_BUS_xxx.
|
||||
*/
|
||||
//#define DISPLAY_TYPE_SSD1306
|
||||
//#define DISPLAY_TYPE_HD44780
|
||||
|
|
@ -112,9 +112,8 @@
|
|||
#define E_ABSOLUTE
|
||||
|
||||
/** \def HOMING_OPT
|
||||
|
||||
Options for homing movements. 'none' means no movement at all. For each
|
||||
option XXX, a function home_XXX() has to exist, typically in home.c/.h.
|
||||
Options for homing movements a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HOMING_OPT none
|
||||
//#define HOMING_OPT x_negative
|
||||
|
|
@ -125,15 +124,10 @@
|
|||
//#define HOMING_OPT z_positive
|
||||
|
||||
/** \def DEFINE_HOMING
|
||||
|
||||
Order (and number) of homing movements.
|
||||
Order (and number) of homing movements. Up to 4 homing steps are allowed.
|
||||
If you don't need even one axis just DEFINE_HOMING(none).
|
||||
*/
|
||||
#ifndef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(...)
|
||||
#endif
|
||||
//DEFINE_HOMING_START
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative, none)
|
||||
//DEFINE_HOMING_END
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative)
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
|
|
|
|||
|
|
@ -112,9 +112,8 @@
|
|||
#define E_ABSOLUTE
|
||||
|
||||
/** \def HOMING_OPT
|
||||
|
||||
Options for homing movements. 'none' means no movement at all. For each
|
||||
option XXX, a function home_XXX() has to exist, typically in home.c/.h.
|
||||
Options for homing movements a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HOMING_OPT none
|
||||
//#define HOMING_OPT x_negative
|
||||
|
|
@ -125,15 +124,10 @@
|
|||
//#define HOMING_OPT z_positive
|
||||
|
||||
/** \def DEFINE_HOMING
|
||||
|
||||
Order (and number) of homing movements.
|
||||
Order (and number) of homing movements. Up to 4 homing steps are allowed.
|
||||
If you don't need even one axis just DEFINE_HOMING(none).
|
||||
*/
|
||||
#ifndef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(...)
|
||||
#endif
|
||||
//DEFINE_HOMING_START
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative, none)
|
||||
//DEFINE_HOMING_END
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative)
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
|
|
|
|||
|
|
@ -112,9 +112,8 @@
|
|||
#define E_ABSOLUTE
|
||||
|
||||
/** \def HOMING_OPT
|
||||
|
||||
Options for homing movements. 'none' means no movement at all. For each
|
||||
option XXX, a function home_XXX() has to exist, typically in home.c/.h.
|
||||
Options for homing movements a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HOMING_OPT none
|
||||
//#define HOMING_OPT x_negative
|
||||
|
|
@ -125,15 +124,10 @@
|
|||
//#define HOMING_OPT z_positive
|
||||
|
||||
/** \def DEFINE_HOMING
|
||||
|
||||
Order (and number) of homing movements.
|
||||
Order (and number) of homing movements. Up to 4 homing steps are allowed.
|
||||
If you don't need even one axis just DEFINE_HOMING(none).
|
||||
*/
|
||||
#ifndef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(...)
|
||||
#endif
|
||||
//DEFINE_HOMING_START
|
||||
DEFINE_HOMING(z_negative, x_negative, y_negative, none)
|
||||
//DEFINE_HOMING_END
|
||||
DEFINE_HOMING(z_negative, x_negative, y_negative)
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
|
|
|
|||
|
|
@ -112,9 +112,8 @@
|
|||
#define E_ABSOLUTE
|
||||
|
||||
/** \def HOMING_OPT
|
||||
|
||||
Options for homing movements. 'none' means no movement at all. For each
|
||||
option XXX, a function home_XXX() has to exist, typically in home.c/.h.
|
||||
Options for homing movements a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HOMING_OPT none
|
||||
//#define HOMING_OPT x_negative
|
||||
|
|
@ -125,15 +124,10 @@
|
|||
//#define HOMING_OPT z_positive
|
||||
|
||||
/** \def DEFINE_HOMING
|
||||
|
||||
Order (and number) of homing movements.
|
||||
Order (and number) of homing movements. Up to 4 homing steps are allowed.
|
||||
If you don't need even one axis just DEFINE_HOMING(none).
|
||||
*/
|
||||
#ifndef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(...)
|
||||
#endif
|
||||
//DEFINE_HOMING_START
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative, none)
|
||||
//DEFINE_HOMING_END
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative)
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
|
|
|
|||
|
|
@ -112,9 +112,8 @@
|
|||
#define E_ABSOLUTE
|
||||
|
||||
/** \def HOMING_OPT
|
||||
|
||||
Options for homing movements. 'none' means no movement at all. For each
|
||||
option XXX, a function home_XXX() has to exist, typically in home.c/.h.
|
||||
Options for homing movements a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HOMING_OPT none
|
||||
//#define HOMING_OPT x_negative
|
||||
|
|
@ -125,15 +124,10 @@
|
|||
//#define HOMING_OPT z_positive
|
||||
|
||||
/** \def DEFINE_HOMING
|
||||
|
||||
Order (and number) of homing movements.
|
||||
Order (and number) of homing movements. Up to 4 homing steps are allowed.
|
||||
If you don't need even one axis just DEFINE_HOMING(none).
|
||||
*/
|
||||
#ifndef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(...)
|
||||
#endif
|
||||
//DEFINE_HOMING_START
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative, none)
|
||||
//DEFINE_HOMING_END
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative)
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
|
|
|
|||
|
|
@ -24,6 +24,18 @@
|
|||
#define DHTR_5(name, pin, invert, pwm, max_pwm) DEFINE_HEATER_ACTUAL(name, pin, invert, pwm, max_pwm)
|
||||
#define DHTR_6(name, pin, invert, pwm, max_pwm, arg6) DEFINE_HEATER_ACTUAL(name, pin, invert, pwm, max_pwm)
|
||||
|
||||
#ifndef DEFINE_HOMING_ACTUAL
|
||||
#define DEFINE_HOMING_ACTUAL(...)
|
||||
#endif
|
||||
|
||||
// Homing movements helpers.
|
||||
#define GET_MACRO_HOME(_1, _2, _3, _4, NAME, ...) NAME
|
||||
#define DEFINE_HOMING(...) GET_MACRO_HOME(__VA_ARGS__, DHM_4, DHM_3, DHM_2, DHM_1)(__VA_ARGS__)
|
||||
#define DHM_1(STEP_1) DEFINE_HOMING_ACTUAL(STEP_1, none, none, none)
|
||||
#define DHM_2(STEP_1, STEP_2) DEFINE_HOMING_ACTUAL(STEP_1, STEP_2, none, none)
|
||||
#define DHM_3(STEP_1, STEP_2, STEP_3) DEFINE_HOMING_ACTUAL(STEP_1, STEP_2, STEP_3, none)
|
||||
#define DHM_4(STEP_1, STEP_2, STEP_3, STEP_4) DEFINE_HOMING_ACTUAL(STEP_1, STEP_2, STEP_3, STEP_4)
|
||||
|
||||
/**
|
||||
This wrapper config header is used to allow makefiles and test scripts to
|
||||
replace or augment the user's 'config.h' file in a controlled manner. A
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ cflags = -DF_CPU=%%F_CPU%% -mmcu=%%CPU%% -Wall -Wstrict-prototypes -std=gnu99
|
|||
-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums
|
||||
-Winline -fno-move-loop-invariants -fno-tree-scev-cprop -Os
|
||||
-ffunction-sections -finline-functions-called-once -mcall-prologues
|
||||
-Wa,-adhlns=%%ALNAME%% -save-temps=obj
|
||||
-flto -Wa,-adhlns=%%ALNAME%% -save-temps=obj
|
||||
|
||||
# Flags passed to avr-gcc to be passed on to the linker.
|
||||
ldflags = -Wl,--as-needed -Wl,--gc-sections
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class Board:
|
|||
helpKey = None
|
||||
|
||||
self.cfgValues = {}
|
||||
self.cfgNames = []
|
||||
self.cfgNames = set()
|
||||
self.helpText = {}
|
||||
|
||||
prevLines = ""
|
||||
|
|
@ -230,7 +230,7 @@ class Board:
|
|||
if m:
|
||||
t = m.groups()
|
||||
if len(t) == 1:
|
||||
self.cfgNames.append(t[0])
|
||||
self.cfgNames.add(t[0])
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class ScriptThread:
|
|||
return
|
||||
obuf = ""
|
||||
while not self.cancelled:
|
||||
o = p.stdout.read(1)
|
||||
o = p.stdout.read(1).decode("utf-8", "ignore")
|
||||
if o == "":
|
||||
break
|
||||
if o == "\r" or o == "\n":
|
||||
|
|
|
|||
|
|
@ -95,3 +95,7 @@ defineValueFormat = "#define %-24s %s\n"
|
|||
defineBoolFormat = "#define %s\n"
|
||||
defineHeaterFormat = "#define HEATER_%s HEATER_%s\n"
|
||||
defineDCExtruderFormat = "#define %-24s HEATER_%s\n"
|
||||
|
||||
reCandHomingOptions = re.compile("^\s*//\s*#define\s+HOMING_OPT\s+(\w+)")
|
||||
reDefHoming = re.compile(r"\s*(DEFINE_HOMING\([^)]*\))")
|
||||
reHoming = re.compile(r".*?\W(\w+)")
|
||||
|
|
|
|||
|
|
@ -657,28 +657,27 @@ class ConfigFrame(wx.Frame):
|
|||
|
||||
def onAbout(self, evt):
|
||||
# Get the contributors' top 10 with something like this:
|
||||
# export B=experimental
|
||||
# git log $B | grep "Author:" | sort | uniq | while \
|
||||
# read A; do N=$(git log $B | grep "$A" | wc -l); echo "$N $A"; done | \
|
||||
# sort -rn
|
||||
# git shortlog experimental -sne | perl -ne \
|
||||
# '/([0-9]+)\s*(.*)\s*(\<.*)/g && \
|
||||
# printf "\n%12s\" %s (%d commits)\\n\"", "", $2, $1;
|
||||
#
|
||||
# Most recent commiters are in the .mailmap
|
||||
self.message(
|
||||
"Teacup Firmware is a 3D Printer and CNC machine controlling "
|
||||
"firmware with emphasis on performance, efficiency and "
|
||||
"outstanding quality. What Teacup does, shall it do very well."
|
||||
"\n\n\n"
|
||||
"Lots of people hard at work! Top 10 contributors:\n\n"
|
||||
" Markus Hitter (542 commits)\n"
|
||||
" Michael Moon (322 commits)\n"
|
||||
" Phil Hord (55 commits)\n"
|
||||
" Jeff Bernardis (51 commits)\n"
|
||||
" Markus Amsler (47 commits)\n"
|
||||
" David Forrest (27 commits)\n"
|
||||
" Jim McGee (15 commits)\n"
|
||||
" Ben Jackson (12 commits)\n"
|
||||
" Bas Laarhoven (10 commits)\n"
|
||||
" Stephan Walter (9 commits)\n"
|
||||
" Roland Brochard (3 commits)\n"
|
||||
" Jens Ch. Restemeier (3 commits)\n",
|
||||
" Markus Hitter (870 commits)\n"
|
||||
" Michael Moon (325 commits)\n"
|
||||
" Nico Tonnhofer (164 commits)\n"
|
||||
" Phil Hord (117 commits)\n"
|
||||
" Jeff Bernardis (55 commits)\n"
|
||||
" Markus Amsler (48 commits)\n"
|
||||
" David Forrest (27 commits)\n"
|
||||
" Jim McGee (15 commits)\n"
|
||||
" Ben Jackson (12 commits)\n"
|
||||
" Robert Konklewski (12 commits)\n"
|
||||
"About Teacup",
|
||||
style=wx.OK,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class HeaterList(wx.ListCtrl):
|
|||
self.setRowValidity(i, flag)
|
||||
|
||||
def OnItemSelected(self, event):
|
||||
self.currentItem = event.m_itemIndex
|
||||
self.currentItem = event.GetIndex()
|
||||
self.parent.setItemSelected(self.currentItem)
|
||||
|
||||
def OnItemDeselected(self, event):
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ class MechanicalPage(wx.Panel, Page):
|
|||
self.parent = parent
|
||||
self.font = font
|
||||
|
||||
self.homing = []
|
||||
|
||||
self.spmKeys = [
|
||||
"STEPS_PER_M_X",
|
||||
"STEPS_PER_M_Y",
|
||||
|
|
@ -39,6 +41,13 @@ class MechanicalPage(wx.Panel, Page):
|
|||
|
||||
self.kinematicsKeys = ["KINEMATICS_STRAIGHT", "KINEMATICS_COREXY"]
|
||||
|
||||
self.homingKeys = [
|
||||
"HOMING_STEP1",
|
||||
"HOMING_STEP2",
|
||||
"HOMING_STEP3",
|
||||
"HOMING_STEP4",
|
||||
]
|
||||
|
||||
self.labels = {
|
||||
"STEPS_PER_M_X": "X:",
|
||||
"STEPS_PER_M_Y": "Y:",
|
||||
|
|
@ -63,6 +72,17 @@ class MechanicalPage(wx.Panel, Page):
|
|||
"E_ABSOLUTE": "Absolute E Coordinates",
|
||||
"KINEMATICS_STRAIGHT": "Straight",
|
||||
"KINEMATICS_COREXY": "CoreXY",
|
||||
"HOMING_STEP1": "Step 1:",
|
||||
"HOMING_STEP2": "Step 2:",
|
||||
"HOMING_STEP3": "Step 3:",
|
||||
"HOMING_STEP4": "Step 4:",
|
||||
"none": "-",
|
||||
"x_negative": "X min",
|
||||
"x_positive": "X max",
|
||||
"y_negative": "Y min",
|
||||
"y_positive": "Y max",
|
||||
"z_negative": "Z min",
|
||||
"z_positive": "Z max",
|
||||
}
|
||||
|
||||
labelWidth = 40
|
||||
|
|
@ -167,6 +187,16 @@ class MechanicalPage(wx.Panel, Page):
|
|||
|
||||
sz.Add(bsz, pos=(1, 3))
|
||||
|
||||
b = wx.StaticBox(self, wx.ID_ANY, "Homing Order")
|
||||
b.SetFont(font)
|
||||
sbox = wx.StaticBoxSizer(b, wx.VERTICAL)
|
||||
sbox.Add((5, 5))
|
||||
for k in self.homingKeys:
|
||||
tc = self.addChoice(k, self.homing, 0, labelWidth + 20, self.onChoice)
|
||||
sbox.Add(tc)
|
||||
sbox.Add((5, 5))
|
||||
sz.Add(sbox, pos=(3, 3))
|
||||
|
||||
self.enableAll(False)
|
||||
self.SetSizer(sz)
|
||||
|
||||
|
|
@ -203,6 +233,15 @@ class MechanicalPage(wx.Panel, Page):
|
|||
for k in self.kinematicsKeys:
|
||||
self.radioButtons[k].SetToolTip(ht["KINEMATICS"])
|
||||
|
||||
def setCandidateHomingOptions(self, hlist):
|
||||
for k in self.homingKeys:
|
||||
self.choices[k].Clear()
|
||||
self.choices[k].AppendItems(hlist)
|
||||
self.homingOptions = hlist
|
||||
|
||||
def setHoming(self, homing):
|
||||
self.homing = homing
|
||||
|
||||
def insertValues(self, cfgValues):
|
||||
Page.insertValues(self, cfgValues)
|
||||
|
||||
|
|
@ -210,6 +249,13 @@ class MechanicalPage(wx.Panel, Page):
|
|||
if tag in cfgValues.keys() and cfgValues[tag]:
|
||||
self.radioButtons[tag].SetValue(True)
|
||||
|
||||
for i, k in enumerate(self.homingKeys):
|
||||
try:
|
||||
index = self.homingOptions.index(self.homing[i])
|
||||
self.choices[k].SetSelection(index)
|
||||
except IndexError:
|
||||
self.choices[k].SetSelection(0)
|
||||
|
||||
def getValues(self):
|
||||
result = Page.getValues(self)
|
||||
|
||||
|
|
|
|||
|
|
@ -112,9 +112,8 @@
|
|||
#define E_ABSOLUTE
|
||||
|
||||
/** \def HOMING_OPT
|
||||
|
||||
Options for homing movements. 'none' means no movement at all. For each
|
||||
option XXX, a function home_XXX() has to exist, typically in home.c/.h.
|
||||
Options for homing movements a user should be able to choose from in configtool. All
|
||||
commented out.
|
||||
*/
|
||||
//#define HOMING_OPT none
|
||||
//#define HOMING_OPT x_negative
|
||||
|
|
@ -125,15 +124,10 @@
|
|||
//#define HOMING_OPT z_positive
|
||||
|
||||
/** \def DEFINE_HOMING
|
||||
|
||||
Order (and number) of homing movements.
|
||||
Order (and number) of homing movements. Up to 4 homing steps are allowed.
|
||||
If you don't need even one axis just DEFINE_HOMING(none).
|
||||
*/
|
||||
#ifndef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(...)
|
||||
#endif
|
||||
//DEFINE_HOMING_START
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative, none)
|
||||
//DEFINE_HOMING_END
|
||||
DEFINE_HOMING(x_negative, y_negative, z_negative)
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
|
|
|
|||
|
|
@ -16,16 +16,27 @@ from configtool.data import (
|
|||
reDefQSm2,
|
||||
reDefBool,
|
||||
reDefBoolBL,
|
||||
reCandHomingOptions,
|
||||
reDefHoming,
|
||||
reHoming,
|
||||
)
|
||||
|
||||
|
||||
class Printer:
|
||||
def __init__(self, settings):
|
||||
self.settings = settings
|
||||
self.configFile = None
|
||||
self.cfgDir = os.path.join(self.settings.folder, "configtool")
|
||||
|
||||
self.cfgValues = {}
|
||||
self.settings = settings
|
||||
self.cfgDir = os.path.join(self.settings.folder, "configtool")
|
||||
self.homing = []
|
||||
self.candHomingOptions = []
|
||||
self.homingKeys = [
|
||||
"HOMING_STEP1",
|
||||
"HOMING_STEP2",
|
||||
"HOMING_STEP3",
|
||||
"HOMING_STEP4",
|
||||
]
|
||||
|
||||
def getValues(self):
|
||||
vars = [(x, self.cfgValues[x]) for x in self.cfgValues]
|
||||
|
|
@ -51,12 +62,14 @@ class Printer:
|
|||
|
||||
self.configFile = fn
|
||||
|
||||
self.homing = []
|
||||
self.candHomingOptions = []
|
||||
gatheringHelpText = False
|
||||
helpTextString = ""
|
||||
helpKey = None
|
||||
|
||||
self.cfgValues = {}
|
||||
self.cfgNames = []
|
||||
self.cfgNames = set()
|
||||
self.helpText = {}
|
||||
|
||||
prevLines = ""
|
||||
|
|
@ -129,7 +142,20 @@ class Printer:
|
|||
ln = prevLines + ln
|
||||
prevLines = ""
|
||||
|
||||
self.parseDefineValue(ln)
|
||||
if self.parseCandidateValues(ln):
|
||||
continue
|
||||
|
||||
if self.parseDefineValue(ln):
|
||||
continue
|
||||
|
||||
m = reDefHoming.search(ln)
|
||||
if m:
|
||||
t = m.groups()
|
||||
if len(t) == 1:
|
||||
s = self.parseHoming(t[0])
|
||||
if s:
|
||||
self.homing = s
|
||||
continue
|
||||
|
||||
# Parsing done. All parsed stuff is now in these array and dicts.
|
||||
if self.settings.verbose >= 2:
|
||||
|
|
@ -145,7 +171,7 @@ class Printer:
|
|||
if m:
|
||||
t = m.groups()
|
||||
if len(t) == 1:
|
||||
self.cfgNames.append(t[0])
|
||||
self.cfgNames.add(t[0])
|
||||
return True
|
||||
|
||||
return False
|
||||
|
|
@ -197,6 +223,27 @@ class Printer:
|
|||
|
||||
return False
|
||||
|
||||
def parseCandidateValues(self, ln):
|
||||
m = reCandHomingOptions.match(ln)
|
||||
if m:
|
||||
t = m.groups()
|
||||
if len(t) == 1:
|
||||
self.candHomingOptions.append(t[0])
|
||||
return True
|
||||
|
||||
def parseHoming(self, s):
|
||||
m = re.findall(reHoming, s)
|
||||
if not m:
|
||||
return None
|
||||
|
||||
for i, tag in enumerate(self.homingKeys):
|
||||
try:
|
||||
self.cfgValues[tag] = m[i], True
|
||||
except IndexError:
|
||||
self.cfgValues[tag] = "none", False
|
||||
|
||||
return m
|
||||
|
||||
def saveConfigFile(self, path, values):
|
||||
if not values:
|
||||
values = self.cfgValues
|
||||
|
|
@ -209,7 +256,23 @@ class Printer:
|
|||
fp = open(path, "w")
|
||||
self.configFile = path
|
||||
|
||||
homingWritten = False
|
||||
|
||||
for ln in self.cfgBuffer:
|
||||
if reDefHoming.match(ln):
|
||||
if not homingWritten:
|
||||
home = []
|
||||
for h in self.homingKeys:
|
||||
home.append(values[h][0])
|
||||
while "none" in home:
|
||||
home.remove("none")
|
||||
if not home:
|
||||
home = ["none"]
|
||||
homing_str = "DEFINE_HOMING({})\n".format(", ".join(home))
|
||||
fp.write(homing_str)
|
||||
homingWritten = True
|
||||
continue
|
||||
|
||||
m = reDefine.match(ln)
|
||||
if m:
|
||||
t = m.groups()
|
||||
|
|
|
|||
|
|
@ -198,7 +198,10 @@ class PrinterPanel(wx.Panel):
|
|||
else:
|
||||
self.protFileLoaded = False
|
||||
self.parent.enableSavePrinter(True, True)
|
||||
|
||||
self.parent.setPrinterTabFile(os.path.basename(fn))
|
||||
self.pgMech.setCandidateHomingOptions(self.printer.candHomingOptions)
|
||||
self.pgMech.setHoming(self.printer.homing)
|
||||
|
||||
for pg in self.pages:
|
||||
pg.insertValues(self.printer.cfgValues)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class SensorList(wx.ListCtrl):
|
|||
self.setRowValidity(i, flag)
|
||||
|
||||
def OnItemSelected(self, event):
|
||||
self.currentItem = event.m_itemIndex
|
||||
self.currentItem = event.GetIndex()
|
||||
self.parent.setItemSelected(self.currentItem)
|
||||
|
||||
def OnItemDeselected(self, event):
|
||||
|
|
|
|||
8
home.c
8
home.c
|
|
@ -71,9 +71,9 @@ void set_axis_home_position(enum axis_e n, int8_t dir);
|
|||
|
||||
/// home all 3 axes
|
||||
void home() {
|
||||
#ifdef DEFINE_HOMING
|
||||
#undef DEFINE_HOMING
|
||||
#define DEFINE_HOMING(first, second, third, fourth) \
|
||||
#ifdef DEFINE_HOMING_ACTUAL
|
||||
#undef DEFINE_HOMING_ACTUAL
|
||||
#define DEFINE_HOMING_ACTUAL(first, second, third, fourth) \
|
||||
{ \
|
||||
home_##first(); \
|
||||
home_##second(); \
|
||||
|
|
@ -81,7 +81,7 @@ void home() {
|
|||
home_##fourth(); \
|
||||
};
|
||||
#include "config_wrapper.h"
|
||||
#undef DEFINE_HOMING
|
||||
#undef DEFINE_HOMING_ACTUAL
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,357 @@
|
|||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 6. MECHANICAL/HARDWARE *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY
|
||||
|
||||
This defines the type of kinematics your printer uses. That's essential!
|
||||
|
||||
Valid values (see dda_kinematics.h):
|
||||
|
||||
KINEMATICS_STRAIGHT
|
||||
Motors move axis directions directly. This is the
|
||||
traditional type, found in many printers, including
|
||||
Mendel, Prusa i3, Mendel90, Ormerod, Mantis.
|
||||
|
||||
KINEMATICS_COREXY
|
||||
A bot using CoreXY kinematics. Typical for CoreXY
|
||||
are long and crossing toothed belts and a print head
|
||||
moving on the X-Y-plane.
|
||||
*/
|
||||
#define KINEMATICS_STRAIGHT
|
||||
//#define KINEMATICS_COREXY
|
||||
|
||||
/** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E
|
||||
Steps per meter ( = steps per mm * 1000 ), calculate these values
|
||||
appropriate for your machine.
|
||||
|
||||
All numbers are integers, so no decimal point, please :-)
|
||||
|
||||
Valid range: 20 to 4'0960'000 (0.02 to 40960 steps/mm)
|
||||
*/
|
||||
#define STEPS_PER_M_X 1280000
|
||||
#define STEPS_PER_M_Y 1280000
|
||||
#define STEPS_PER_M_Z 1280000
|
||||
#define STEPS_PER_M_E 96271
|
||||
|
||||
/** \def MAXIMUM_FEEDRATE_X MAXIMUM_FEEDRATE_Y MAXIMUM_FEEDRATE_Z MAXIMUM_FEEDRATE_E
|
||||
Used for G0 rapid moves and as a cap for all other feedrates.
|
||||
*/
|
||||
#define MAXIMUM_FEEDRATE_X 600
|
||||
#define MAXIMUM_FEEDRATE_Y 600
|
||||
#define MAXIMUM_FEEDRATE_Z 600
|
||||
#define MAXIMUM_FEEDRATE_E 2000
|
||||
|
||||
/** \def SEARCH_FEEDRATE_X SEARCH_FEEDRATE_Y SEARCH_FEEDRATE_Z
|
||||
Used when doing precision endstop search and as default feedrate. No
|
||||
SEARCH_FEEDRATE_E, as E can't be searched.
|
||||
*/
|
||||
#define SEARCH_FEEDRATE_X 50
|
||||
#define SEARCH_FEEDRATE_Y 50
|
||||
#define SEARCH_FEEDRATE_Z 50
|
||||
|
||||
/** \def ENDSTOP_CLEARANCE_X ENDSTOP_CLEARANCE_Y ENDSTOP_CLEARANCE_Z
|
||||
|
||||
When hitting an endstop, Teacup properly decelerates instead of doing an
|
||||
aprupt stop to save your mechanics. Ineviteably, this means it overshoots
|
||||
the endstop trigger point by some distance.
|
||||
|
||||
To deal with this, Teacup adapts homing movement speeds to what your
|
||||
endstops can deal with. The higher the allowed acceleration ( = deceleration,
|
||||
see #define ACCELERATION) and the more clearance the endstop comes with,
|
||||
the faster Teacup will do homing movements.
|
||||
|
||||
Set here how many micrometers (mm * 1000) your endstop allows the carriage
|
||||
to overshoot the trigger point. Typically 1000 or 2000 for mechanical
|
||||
endstops, more for optical ones. You can set it to zero, in which case
|
||||
SEARCH_FEEDRATE_{XYZ} is used, but expect very slow homing movements.
|
||||
|
||||
Units: micrometers
|
||||
Sane values: 0 to 20000 (0 to 20 mm)
|
||||
Valid range: 0 to 1000000
|
||||
*/
|
||||
#define ENDSTOP_CLEARANCE_X 1000
|
||||
#define ENDSTOP_CLEARANCE_Y 1000
|
||||
#define ENDSTOP_CLEARANCE_Z 100
|
||||
|
||||
/** \def X_MIN X_MAX Y_MIN Y_MAX Z_MIN Z_MAX
|
||||
Soft axis limits. Define them to your machine's size relative to what your
|
||||
G-code considers to be the origin (typically the bed's center or the bed's
|
||||
front left corner).
|
||||
|
||||
Note that relocating the origin at runtime with G92 will also relocate these
|
||||
limits.
|
||||
|
||||
Not defining them at all will disable limits checking and make the binary
|
||||
about 250 bytes smaller. Enabling only some of them is perfectly fine.
|
||||
|
||||
Units: millimeters
|
||||
Sane values: according to printer build room size
|
||||
Valid range: -1000.0 to 1000.0
|
||||
*/
|
||||
//#define X_MIN 0.0
|
||||
//#define X_MAX 200.0
|
||||
|
||||
//#define Y_MIN 0.0
|
||||
//#define Y_MAX 200.0
|
||||
|
||||
//#define Z_MIN 0.0
|
||||
//#define Z_MAX 140.0
|
||||
|
||||
/** \def E_ABSOLUTE
|
||||
Some G-code creators produce relative length commands for the extruder,
|
||||
others absolute ones. G-code using absolute lengths can be recognized when
|
||||
there are G92 E0 commands from time to time. If you have G92 E0 in your
|
||||
G-code, define this flag.
|
||||
|
||||
This is the startup default and can be changed with M82/M83 while running.
|
||||
*/
|
||||
#define E_ABSOLUTE
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
ACCELERATION_TEMPORAL. With none of them defined, movements are done
|
||||
without acceleration. Recommended is ACCELERATION_RAMPING.
|
||||
*/
|
||||
//#define ACCELERATION_REPRAP
|
||||
#define ACCELERATION_RAMPING
|
||||
//#define ACCELERATION_TEMPORAL
|
||||
|
||||
/** \def ACCELERATION
|
||||
How fast to accelerate when using ACCELERATION_RAMPING. Start with 10 for
|
||||
milling (high precision) or 1000 for printing.
|
||||
|
||||
Units: mm/s^2
|
||||
Useful range: 1 to 10'000
|
||||
*/
|
||||
#define ACCELERATION 100
|
||||
|
||||
/** \def LOOKAHEAD
|
||||
Define this to enable look-ahead during *ramping* acceleration to smoothly
|
||||
transition between moves instead of performing a dead stop every move.
|
||||
Enabling look-ahead requires about 3600 bytes of flash memory.
|
||||
*/
|
||||
#define LOOKAHEAD
|
||||
|
||||
/** \def MAX_JERK_X MAX_JERK_Y MAX_JERK_Z MAX_JERK_E
|
||||
When performing look-ahead, we need to decide what an acceptable jerk to the
|
||||
mechanics is. Look-ahead attempts to instantly change direction at movement
|
||||
crossings, which means instant changes in the speed of the axes participating
|
||||
in the movement. Define here how big the speed bumps on each of the axes is
|
||||
allowed to be.
|
||||
|
||||
If you want a full stop before and after moving a specific axis, define
|
||||
MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want
|
||||
to ignore jerk on an axis, define it to twice the maximum feedrate of this
|
||||
axis.
|
||||
|
||||
Having these values too low results in more than neccessary slowdown at
|
||||
movement crossings, but is otherwise harmless. Too high values can result
|
||||
in stepper motors suddenly stalling. If angles between movements in your
|
||||
G-code are small and your printer runs through entire curves full speed,
|
||||
there's no point in raising the values.
|
||||
|
||||
Units: mm/min
|
||||
Sane values: 0 to 400
|
||||
Valid range: 0 to 65535
|
||||
*/
|
||||
#define MAX_JERK_X 20
|
||||
#define MAX_JERK_Y 20
|
||||
#define MAX_JERK_Z 0
|
||||
#define MAX_JERK_E 200
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 7. MISCELLANEOUS OPTIONS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def USE_INTERNAL_PULLUPS
|
||||
|
||||
Most controller chips feature internal pullup resistors on their input pins,
|
||||
which get used for endstops by turning on this switch. Don't turn it on when
|
||||
using endstops which need no pull resistor, e.g. optical endstops, because
|
||||
pull resistors are counterproductive there.
|
||||
|
||||
One can't use USE_INTERNAL_PULLUPS and USE_INTERNAL_PULLDOWNS at the same
|
||||
time, of course.
|
||||
*/
|
||||
//#define USE_INTERNAL_PULLUPS
|
||||
|
||||
/** \def USE_INTERNAL_PULLDOWNS
|
||||
|
||||
Some controller chips feature internal pulldown resistors on their input
|
||||
pins, which get used for endstops by turning on this switch. Don't turn it
|
||||
on when using endstops which need no pull resistor, e.g. optical endstops,
|
||||
because pull resistors are counterproductive there.
|
||||
|
||||
One can't use USE_INTERNAL_PULLDOWNS and USE_INTERNAL_PULLUPS at the same
|
||||
time, of course.
|
||||
*/
|
||||
//#define USE_INTERNAL_PULLDOWNS
|
||||
|
||||
/** \def Z_AUTODISABLE
|
||||
Automatically disable Z axis when not in use. This is useful for printers
|
||||
with a self-locking Z axis, e.g. the various Mendel derivates.
|
||||
|
||||
Other printers have a heavy Z axis or a not self-locking spindle. In that
|
||||
case you should not activate this.
|
||||
|
||||
This option has no effect on controllers with a common stepper enable pin.
|
||||
*/
|
||||
//#define Z_AUTODISABLE
|
||||
|
||||
/** \def TEMP_HYSTERESIS
|
||||
Actual temperature must be target +/- this hysteresis before target
|
||||
temperature is considered to be achieved. Also, BANG_BANG tries to stay
|
||||
within half of this hysteresis.
|
||||
|
||||
Unit: degree Celsius
|
||||
*/
|
||||
#define TEMP_HYSTERESIS 10
|
||||
|
||||
/** \def TEMP_RESIDENCY_TIME
|
||||
Actual temperature must be close to target (within set temperature
|
||||
+- TEMP_HYSTERESIS) for this long before target is achieved (and a M116
|
||||
succeeds).
|
||||
|
||||
Unit: seconds
|
||||
*/
|
||||
#define TEMP_RESIDENCY_TIME 60
|
||||
|
||||
/** \def TEMP_EWMA
|
||||
|
||||
Smooth noisy temperature sensors. Good hardware shouldn't be noisy. Set to
|
||||
1000 for unfiltered data (and a 140 bytes smaller binary).
|
||||
|
||||
Instrument Engineer's Handbook, 4th ed, Vol 2 p126 says values of
|
||||
50 to 100 are typical. Smaller is smoother but slower adjusting, larger is
|
||||
quicker but rougher. If you need to use this, set the PID parameter to zero
|
||||
(M132 S0) to make the PID loop insensitive to noise.
|
||||
|
||||
Valid range: 1 to 1000
|
||||
*/
|
||||
#define TEMP_EWMA 1000
|
||||
|
||||
/** \def REPORT_TARGET_TEMPS
|
||||
With this enabled, M105 commands will return the current temperatures along
|
||||
with the target temps, separated by a slash: ok T:xxx.x/xxx.x B:xxx.x/xxx.x
|
||||
With this disabled, only temps will be returned: ok T:xxx.x B:xxx.x
|
||||
Enabling adds 78 bytes to the image.
|
||||
*/
|
||||
#define REPORT_TARGET_TEMPS
|
||||
|
||||
/** \def HEATER_SANITY_CHECK
|
||||
Check if heater responds to changes in target temperature, disable and spit
|
||||
errors if not largely untested, please comment in forum if this works, or
|
||||
doesn't work for you!
|
||||
*/
|
||||
//#define HEATER_SANITY_CHECK
|
||||
|
||||
/** \def EECONFIG
|
||||
Enable EEPROM configuration storage.
|
||||
|
||||
Enabled by default. Commenting this out makes the binary several hundred
|
||||
bytes smaller, so you might want to disable EEPROM storage on small MCUs,
|
||||
like the ATmega168.
|
||||
*/
|
||||
#define EECONFIG
|
||||
|
||||
/** \def BANG_BANG
|
||||
Drops PID loop from heater control, reduces code size significantly
|
||||
(1300 bytes!).
|
||||
*/
|
||||
//#define BANG_BANG
|
||||
|
||||
/** \def BANG_BANG_ON
|
||||
PWM value for Bang Bang 'on'.
|
||||
*/
|
||||
//#define BANG_BANG_ON 200
|
||||
|
||||
/** \def BANG_BANG_OFF
|
||||
PWM value for Bang Bang 'off'.
|
||||
*/
|
||||
//#define BANG_BANG_OFF 45
|
||||
|
||||
/** \def MOVEBUFFER_SIZE
|
||||
Move buffer size, in number of moves.
|
||||
|
||||
Note that each move takes a fair chunk of ram (107 bytes as of this writing),
|
||||
so don't make the buffer too big. However, a larger movebuffer will probably
|
||||
help with lots of short consecutive moves, as each move takes a bunch of
|
||||
math (hence time) to set up so a longer buffer allows more of the math to
|
||||
be done during preceding longer moves.
|
||||
*/
|
||||
#define MOVEBUFFER_SIZE 8
|
||||
|
||||
/** \def DC_EXTRUDER DC_EXTRUDER_PWM
|
||||
If you have a DC motor extruder, configure it as a "heater" above and define
|
||||
this value as the index or name. You probably also want to comment out
|
||||
E_STEP_PIN and E_DIR_PIN in the Pinouts section above.
|
||||
*/
|
||||
//#define DC_EXTRUDER HEATER_motor
|
||||
//#define DC_EXTRUDER_PWM 180
|
||||
|
||||
/** \def USE_WATCHDOG
|
||||
Teacup implements a watchdog, which has to be reset every 250ms or it will
|
||||
reboot the controller. As rebooting (and letting the GCode sending
|
||||
application trying to continue the build with a then different Home point)
|
||||
is probably even worse than just hanging, and there is no better restore
|
||||
code in place, this is disabled for now.
|
||||
*/
|
||||
//#define USE_WATCHDOG
|
||||
|
||||
/** \def TH_COUNT
|
||||
Temperature history count. This is how many temperature readings to keep in
|
||||
order to calculate derivative in PID loop higher values make PID derivative
|
||||
term more stable at the expense of reaction time.
|
||||
*/
|
||||
#define TH_COUNT 8
|
||||
|
||||
/** \def FAST_PWM
|
||||
Teacup offers two PWM frequencies, 76(61) Hz and 78000(62500) Hz on a
|
||||
20(16) MHz electronics. The slower one is the default, as it's the safer
|
||||
choice and reduces MOSFET heating. Drawback is, in a quiet environment you
|
||||
might notice the heaters and your power supply humming.
|
||||
|
||||
Uncomment this option if you want to get rid of this humming and can afford
|
||||
a hotter MOSFET or want faster PWM for other reasons.
|
||||
|
||||
See also: http://reprap.org/wiki/Gen7_Research#MOSFET_heat_and_PWM
|
||||
*/
|
||||
//#define FAST_PWM
|
||||
|
||||
/** \def PID_SCALE
|
||||
This is the scaling of internally stored PID values. 1024L is a good value.
|
||||
*/
|
||||
#define PID_SCALE 1024L
|
||||
|
||||
/** \def ENDSTOP_STEPS
|
||||
Number of steps to run into the endstops intentionally. As endstops trigger
|
||||
false alarm sometimes, Teacup debounces them by counting a number of
|
||||
consecutive positives.
|
||||
|
||||
Use 4 or less for reliable endstops, 8 or even more for flaky ones.
|
||||
|
||||
Valid range: 1...255.
|
||||
*/
|
||||
#define ENDSTOP_STEPS 4
|
||||
|
||||
/** \def CANNED_CYCLE
|
||||
G-code commands in this string will be executed over and over again, without
|
||||
user interaction or even a serial connection. It's purpose is e.g. for
|
||||
exhibitions or when using Teacup for other purposes than printing. You can
|
||||
add any G-code supported by Teacup.
|
||||
|
||||
Note: don't miss these newlines (\n) and backslashes (\).
|
||||
*/
|
||||
/*
|
||||
#define CANNED_CYCLE "G1 X100 F3000\n" \
|
||||
"G4 P500\n" \
|
||||
"G1 X0\n" \
|
||||
"G4 P500\n"
|
||||
*/
|
||||
|
|
@ -0,0 +1,357 @@
|
|||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 6. MECHANICAL/HARDWARE *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def KINEMATICS_STRAIGHT KINEMATICS_COREXY
|
||||
|
||||
This defines the type of kinematics your printer uses. That's essential!
|
||||
|
||||
Valid values (see dda_kinematics.h):
|
||||
|
||||
KINEMATICS_STRAIGHT
|
||||
Motors move axis directions directly. This is the
|
||||
traditional type, found in many printers, including
|
||||
Mendel, Prusa i3, Mendel90, Ormerod, Mantis.
|
||||
|
||||
KINEMATICS_COREXY
|
||||
A bot using CoreXY kinematics. Typical for CoreXY
|
||||
are long and crossing toothed belts and a print head
|
||||
moving on the X-Y-plane.
|
||||
*/
|
||||
#define KINEMATICS_STRAIGHT
|
||||
//#define KINEMATICS_COREXY
|
||||
|
||||
/** \def STEPS_PER_M_X STEPS_PER_M_Y STEPS_PER_M_Z STEPS_PER_M_E
|
||||
Steps per meter ( = steps per mm * 1000 ), calculate these values
|
||||
appropriate for your machine.
|
||||
|
||||
All numbers are integers, so no decimal point, please :-)
|
||||
|
||||
Valid range: 20 to 4'0960'000 (0.02 to 40960 steps/mm)
|
||||
*/
|
||||
#define STEPS_PER_M_X 283464
|
||||
#define STEPS_PER_M_Y 283464
|
||||
#define STEPS_PER_M_Z 283464
|
||||
#define STEPS_PER_M_E 96271
|
||||
|
||||
/** \def MAXIMUM_FEEDRATE_X MAXIMUM_FEEDRATE_Y MAXIMUM_FEEDRATE_Z MAXIMUM_FEEDRATE_E
|
||||
Used for G0 rapid moves and as a cap for all other feedrates.
|
||||
*/
|
||||
#define MAXIMUM_FEEDRATE_X 600
|
||||
#define MAXIMUM_FEEDRATE_Y 600
|
||||
#define MAXIMUM_FEEDRATE_Z 600
|
||||
#define MAXIMUM_FEEDRATE_E 2000
|
||||
|
||||
/** \def SEARCH_FEEDRATE_X SEARCH_FEEDRATE_Y SEARCH_FEEDRATE_Z
|
||||
Used when doing precision endstop search and as default feedrate. No
|
||||
SEARCH_FEEDRATE_E, as E can't be searched.
|
||||
*/
|
||||
#define SEARCH_FEEDRATE_X 50
|
||||
#define SEARCH_FEEDRATE_Y 50
|
||||
#define SEARCH_FEEDRATE_Z 50
|
||||
|
||||
/** \def ENDSTOP_CLEARANCE_X ENDSTOP_CLEARANCE_Y ENDSTOP_CLEARANCE_Z
|
||||
|
||||
When hitting an endstop, Teacup properly decelerates instead of doing an
|
||||
aprupt stop to save your mechanics. Ineviteably, this means it overshoots
|
||||
the endstop trigger point by some distance.
|
||||
|
||||
To deal with this, Teacup adapts homing movement speeds to what your
|
||||
endstops can deal with. The higher the allowed acceleration ( = deceleration,
|
||||
see #define ACCELERATION) and the more clearance the endstop comes with,
|
||||
the faster Teacup will do homing movements.
|
||||
|
||||
Set here how many micrometers (mm * 1000) your endstop allows the carriage
|
||||
to overshoot the trigger point. Typically 1000 or 2000 for mechanical
|
||||
endstops, more for optical ones. You can set it to zero, in which case
|
||||
SEARCH_FEEDRATE_{XYZ} is used, but expect very slow homing movements.
|
||||
|
||||
Units: micrometers
|
||||
Sane values: 0 to 20000 (0 to 20 mm)
|
||||
Valid range: 0 to 1000000
|
||||
*/
|
||||
#define ENDSTOP_CLEARANCE_X 1000
|
||||
#define ENDSTOP_CLEARANCE_Y 1000
|
||||
#define ENDSTOP_CLEARANCE_Z 100
|
||||
|
||||
/** \def X_MIN X_MAX Y_MIN Y_MAX Z_MIN Z_MAX
|
||||
Soft axis limits. Define them to your machine's size relative to what your
|
||||
G-code considers to be the origin (typically the bed's center or the bed's
|
||||
front left corner).
|
||||
|
||||
Note that relocating the origin at runtime with G92 will also relocate these
|
||||
limits.
|
||||
|
||||
Not defining them at all will disable limits checking and make the binary
|
||||
about 250 bytes smaller. Enabling only some of them is perfectly fine.
|
||||
|
||||
Units: millimeters
|
||||
Sane values: according to printer build room size
|
||||
Valid range: -1000.0 to 1000.0
|
||||
*/
|
||||
//#define X_MIN 0.0
|
||||
//#define X_MAX 200.0
|
||||
|
||||
//#define Y_MIN 0.0
|
||||
//#define Y_MAX 200.0
|
||||
|
||||
//#define Z_MIN 0.0
|
||||
//#define Z_MAX 140.0
|
||||
|
||||
/** \def E_ABSOLUTE
|
||||
Some G-code creators produce relative length commands for the extruder,
|
||||
others absolute ones. G-code using absolute lengths can be recognized when
|
||||
there are G92 E0 commands from time to time. If you have G92 E0 in your
|
||||
G-code, define this flag.
|
||||
|
||||
This is the startup default and can be changed with M82/M83 while running.
|
||||
*/
|
||||
#define E_ABSOLUTE
|
||||
|
||||
/** \def ACCELERATION_REPRAP ACCELERATION_RAMPING ACCELERATION_TEMPORAL
|
||||
Choose optionally one of ACCELERATION_REPRAP, ACCELERATION_RAMPING or
|
||||
ACCELERATION_TEMPORAL. With none of them defined, movements are done
|
||||
without acceleration. Recommended is ACCELERATION_RAMPING.
|
||||
*/
|
||||
//#define ACCELERATION_REPRAP
|
||||
#define ACCELERATION_RAMPING
|
||||
//#define ACCELERATION_TEMPORAL
|
||||
|
||||
/** \def ACCELERATION
|
||||
How fast to accelerate when using ACCELERATION_RAMPING. Start with 10 for
|
||||
milling (high precision) or 1000 for printing.
|
||||
|
||||
Units: mm/s^2
|
||||
Useful range: 1 to 10'000
|
||||
*/
|
||||
#define ACCELERATION 100
|
||||
|
||||
/** \def LOOKAHEAD
|
||||
Define this to enable look-ahead during *ramping* acceleration to smoothly
|
||||
transition between moves instead of performing a dead stop every move.
|
||||
Enabling look-ahead requires about 3600 bytes of flash memory.
|
||||
*/
|
||||
#define LOOKAHEAD
|
||||
|
||||
/** \def MAX_JERK_X MAX_JERK_Y MAX_JERK_Z MAX_JERK_E
|
||||
When performing look-ahead, we need to decide what an acceptable jerk to the
|
||||
mechanics is. Look-ahead attempts to instantly change direction at movement
|
||||
crossings, which means instant changes in the speed of the axes participating
|
||||
in the movement. Define here how big the speed bumps on each of the axes is
|
||||
allowed to be.
|
||||
|
||||
If you want a full stop before and after moving a specific axis, define
|
||||
MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want
|
||||
to ignore jerk on an axis, define it to twice the maximum feedrate of this
|
||||
axis.
|
||||
|
||||
Having these values too low results in more than neccessary slowdown at
|
||||
movement crossings, but is otherwise harmless. Too high values can result
|
||||
in stepper motors suddenly stalling. If angles between movements in your
|
||||
G-code are small and your printer runs through entire curves full speed,
|
||||
there's no point in raising the values.
|
||||
|
||||
Units: mm/min
|
||||
Sane values: 0 to 400
|
||||
Valid range: 0 to 65535
|
||||
*/
|
||||
#define MAX_JERK_X 20
|
||||
#define MAX_JERK_Y 20
|
||||
#define MAX_JERK_Z 0
|
||||
#define MAX_JERK_E 200
|
||||
|
||||
|
||||
/***************************************************************************\
|
||||
* *
|
||||
* 7. MISCELLANEOUS OPTIONS *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
/** \def USE_INTERNAL_PULLUPS
|
||||
|
||||
Most controller chips feature internal pullup resistors on their input pins,
|
||||
which get used for endstops by turning on this switch. Don't turn it on when
|
||||
using endstops which need no pull resistor, e.g. optical endstops, because
|
||||
pull resistors are counterproductive there.
|
||||
|
||||
One can't use USE_INTERNAL_PULLUPS and USE_INTERNAL_PULLDOWNS at the same
|
||||
time, of course.
|
||||
*/
|
||||
//#define USE_INTERNAL_PULLUPS
|
||||
|
||||
/** \def USE_INTERNAL_PULLDOWNS
|
||||
|
||||
Some controller chips feature internal pulldown resistors on their input
|
||||
pins, which get used for endstops by turning on this switch. Don't turn it
|
||||
on when using endstops which need no pull resistor, e.g. optical endstops,
|
||||
because pull resistors are counterproductive there.
|
||||
|
||||
One can't use USE_INTERNAL_PULLDOWNS and USE_INTERNAL_PULLUPS at the same
|
||||
time, of course.
|
||||
*/
|
||||
//#define USE_INTERNAL_PULLDOWNS
|
||||
|
||||
/** \def Z_AUTODISABLE
|
||||
Automatically disable Z axis when not in use. This is useful for printers
|
||||
with a self-locking Z axis, e.g. the various Mendel derivates.
|
||||
|
||||
Other printers have a heavy Z axis or a not self-locking spindle. In that
|
||||
case you should not activate this.
|
||||
|
||||
This option has no effect on controllers with a common stepper enable pin.
|
||||
*/
|
||||
//#define Z_AUTODISABLE
|
||||
|
||||
/** \def TEMP_HYSTERESIS
|
||||
Actual temperature must be target +/- this hysteresis before target
|
||||
temperature is considered to be achieved. Also, BANG_BANG tries to stay
|
||||
within half of this hysteresis.
|
||||
|
||||
Unit: degree Celsius
|
||||
*/
|
||||
#define TEMP_HYSTERESIS 10
|
||||
|
||||
/** \def TEMP_RESIDENCY_TIME
|
||||
Actual temperature must be close to target (within set temperature
|
||||
+- TEMP_HYSTERESIS) for this long before target is achieved (and a M116
|
||||
succeeds).
|
||||
|
||||
Unit: seconds
|
||||
*/
|
||||
#define TEMP_RESIDENCY_TIME 60
|
||||
|
||||
/** \def TEMP_EWMA
|
||||
|
||||
Smooth noisy temperature sensors. Good hardware shouldn't be noisy. Set to
|
||||
1000 for unfiltered data (and a 140 bytes smaller binary).
|
||||
|
||||
Instrument Engineer's Handbook, 4th ed, Vol 2 p126 says values of
|
||||
50 to 100 are typical. Smaller is smoother but slower adjusting, larger is
|
||||
quicker but rougher. If you need to use this, set the PID parameter to zero
|
||||
(M132 S0) to make the PID loop insensitive to noise.
|
||||
|
||||
Valid range: 1 to 1000
|
||||
*/
|
||||
#define TEMP_EWMA 1000
|
||||
|
||||
/** \def REPORT_TARGET_TEMPS
|
||||
With this enabled, M105 commands will return the current temperatures along
|
||||
with the target temps, separated by a slash: ok T:xxx.x/xxx.x B:xxx.x/xxx.x
|
||||
With this disabled, only temps will be returned: ok T:xxx.x B:xxx.x
|
||||
Enabling adds 78 bytes to the image.
|
||||
*/
|
||||
#define REPORT_TARGET_TEMPS
|
||||
|
||||
/** \def HEATER_SANITY_CHECK
|
||||
Check if heater responds to changes in target temperature, disable and spit
|
||||
errors if not largely untested, please comment in forum if this works, or
|
||||
doesn't work for you!
|
||||
*/
|
||||
//#define HEATER_SANITY_CHECK
|
||||
|
||||
/** \def EECONFIG
|
||||
Enable EEPROM configuration storage.
|
||||
|
||||
Enabled by default. Commenting this out makes the binary several hundred
|
||||
bytes smaller, so you might want to disable EEPROM storage on small MCUs,
|
||||
like the ATmega168.
|
||||
*/
|
||||
#define EECONFIG
|
||||
|
||||
/** \def BANG_BANG
|
||||
Drops PID loop from heater control, reduces code size significantly
|
||||
(1300 bytes!).
|
||||
*/
|
||||
//#define BANG_BANG
|
||||
|
||||
/** \def BANG_BANG_ON
|
||||
PWM value for Bang Bang 'on'.
|
||||
*/
|
||||
//#define BANG_BANG_ON 200
|
||||
|
||||
/** \def BANG_BANG_OFF
|
||||
PWM value for Bang Bang 'off'.
|
||||
*/
|
||||
//#define BANG_BANG_OFF 45
|
||||
|
||||
/** \def MOVEBUFFER_SIZE
|
||||
Move buffer size, in number of moves.
|
||||
|
||||
Note that each move takes a fair chunk of ram (107 bytes as of this writing),
|
||||
so don't make the buffer too big. However, a larger movebuffer will probably
|
||||
help with lots of short consecutive moves, as each move takes a bunch of
|
||||
math (hence time) to set up so a longer buffer allows more of the math to
|
||||
be done during preceding longer moves.
|
||||
*/
|
||||
#define MOVEBUFFER_SIZE 8
|
||||
|
||||
/** \def DC_EXTRUDER DC_EXTRUDER_PWM
|
||||
If you have a DC motor extruder, configure it as a "heater" above and define
|
||||
this value as the index or name. You probably also want to comment out
|
||||
E_STEP_PIN and E_DIR_PIN in the Pinouts section above.
|
||||
*/
|
||||
//#define DC_EXTRUDER HEATER_motor
|
||||
//#define DC_EXTRUDER_PWM 180
|
||||
|
||||
/** \def USE_WATCHDOG
|
||||
Teacup implements a watchdog, which has to be reset every 250ms or it will
|
||||
reboot the controller. As rebooting (and letting the GCode sending
|
||||
application trying to continue the build with a then different Home point)
|
||||
is probably even worse than just hanging, and there is no better restore
|
||||
code in place, this is disabled for now.
|
||||
*/
|
||||
//#define USE_WATCHDOG
|
||||
|
||||
/** \def TH_COUNT
|
||||
Temperature history count. This is how many temperature readings to keep in
|
||||
order to calculate derivative in PID loop higher values make PID derivative
|
||||
term more stable at the expense of reaction time.
|
||||
*/
|
||||
#define TH_COUNT 8
|
||||
|
||||
/** \def FAST_PWM
|
||||
Teacup offers two PWM frequencies, 76(61) Hz and 78000(62500) Hz on a
|
||||
20(16) MHz electronics. The slower one is the default, as it's the safer
|
||||
choice and reduces MOSFET heating. Drawback is, in a quiet environment you
|
||||
might notice the heaters and your power supply humming.
|
||||
|
||||
Uncomment this option if you want to get rid of this humming and can afford
|
||||
a hotter MOSFET or want faster PWM for other reasons.
|
||||
|
||||
See also: http://reprap.org/wiki/Gen7_Research#MOSFET_heat_and_PWM
|
||||
*/
|
||||
//#define FAST_PWM
|
||||
|
||||
/** \def PID_SCALE
|
||||
This is the scaling of internally stored PID values. 1024L is a good value.
|
||||
*/
|
||||
#define PID_SCALE 1024L
|
||||
|
||||
/** \def ENDSTOP_STEPS
|
||||
Number of steps to run into the endstops intentionally. As endstops trigger
|
||||
false alarm sometimes, Teacup debounces them by counting a number of
|
||||
consecutive positives.
|
||||
|
||||
Use 4 or less for reliable endstops, 8 or even more for flaky ones.
|
||||
|
||||
Valid range: 1...255.
|
||||
*/
|
||||
#define ENDSTOP_STEPS 4
|
||||
|
||||
/** \def CANNED_CYCLE
|
||||
G-code commands in this string will be executed over and over again, without
|
||||
user interaction or even a serial connection. It's purpose is e.g. for
|
||||
exhibitions or when using Teacup for other purposes than printing. You can
|
||||
add any G-code supported by Teacup.
|
||||
|
||||
Note: don't miss these newlines (\n) and backslashes (\).
|
||||
*/
|
||||
/*
|
||||
#define CANNED_CYCLE "G1 X100 F3000\n" \
|
||||
"G4 P500\n" \
|
||||
"G1 X0\n" \
|
||||
"G4 P500\n"
|
||||
*/
|
||||
Loading…
Reference in New Issue