Initial commit.

master
Marcio Teixeira 7 years ago
parent 6766c273cc
commit 86d1912ea2

@ -13,10 +13,11 @@
* got disabled.
*/
#define LULZBOT_FW_VERSION ".16" // Change this with each update
#define LULZBOT_FW_VERSION ".17" // Change this with each update
#if ( \
!defined(LULZBOT_Gladiola_Mini) && \
!defined(LULZBOT_Gladiola_MiniEinsy) && \
!defined(LULZBOT_Hibiscus_Mini2) && \
!defined(LULZBOT_Gladiola_MiniLCD) && \
!defined(LULZBOT_Hibiscus_Mini2LCD) && \
@ -52,6 +53,19 @@
#define LULZBOT_UUID "351487b6-ca9a-4c1a-8765-d668b1da6585"
#endif
#if defined(LULZBOT_Gladiola_MiniEinsy)
#define LULZBOT_CUSTOM_MACHINE_NAME "LulzBot Mini"
#define LULZBOT_LCD_MACHINE_NAME "Mini Einsy"
#define LULZBOT_IS_MINI
#define LULZBOT_MINI_BED
#define LULZBOT_USE_EINSYRAMBO
#define LULZBOT_USE_LCD_DISPLAY
#define LULZBOT_USE_AUTOLEVELING
#define LULZBOT_SENSORLESS_HOMING
#define LULZBOT_BAUDRATE 115200
#define LULZBOT_UUID "4479bf92-7e47-4c2c-be95-64dd01bd413b"
#endif
#if defined(LULZBOT_Hibiscus_Mini2)
#define LULZBOT_CUSTOM_MACHINE_NAME "LulzBot Mini 2"
#define LULZBOT_LCD_MACHINE_NAME "Mini 2"
@ -178,7 +192,79 @@
#undef LULZBOT_USE_HOME_BUTTON
#endif
#if defined(LULZBOT_IS_MINI)
#if defined(LULZBOT_IS_MINI) && defined(LULZBOT_USE_EINSYRAMBO)
// Experimental Mini retrofitted with EinsyRambo from UltiMachine
#define LULZBOT_MOTHERBOARD BOARD_EINSYRAMBO
#define LULZBOT_CONTROLLER_FAN_PIN FAN1_PIN // Digital pin 6
#define LULZBOT_HAVE_TMC2130
// EinsyRambo uses a 220 mOhm sense resistor
#define LULZBOT_R_SENSE 0.22
//#define LULZBOT_STEALTHCHOP
// According to Jason at UltiMachine, setting the lower the
// stealth freq the cooler the motor drivers will operate.
#define LULZBOT_STEALTH_FREQ 0
// Make the diag pin active low so because diag0 and diag1 are
// connected to the same pin in the processor.
#define LULZBOT_TMC_DIAG_ACTIVE_LOW
#define LULZBOT_TMC_INIT(st) \
/* The EinsyRambo connects both diag pins to the same */ \
/* microcontroller pin and provides a pull up resistor, */ \
/* so configure the pin as active low. */ \
st.diag0_active_high(0); \
st.diag1_active_high(0); \
st.diag1_stall(1); \
#define LULZBOT_STALLGUARD_REPORT \
static int nextSgReport = 100; \
if(planner.blocks_queued()) { \
if(nextSgReport-- == 0) { \
nextSgReport = 100; \
uint32_t DRVSTATUS = stepperX.DRV_STATUS(); \
uint16_t SG_RESULT = DRVSTATUS & 0b111111111; \
bool stst = (DRVSTATUS >> 31) & 0b1; \
bool olb = (DRVSTATUS >> 30) & 0b1; \
bool ola = (DRVSTATUS >> 29) & 0b1; \
bool s2gb = (DRVSTATUS >> 28) & 0b1; \
bool s2ga = (DRVSTATUS >> 27) & 0b1; \
bool otpw = (DRVSTATUS >> 26) & 0b1; \
bool ot = (DRVSTATUS >> 25) & 0b1; \
bool fsactive = (DRVSTATUS >> 15) & 0b1; \
SERIAL_PROTOCOLPGM("Stepper X: "); \
SERIAL_PROTOCOLPGM("SG_RESULT:"); \
SERIAL_PROTOCOLLN(SG_RESULT); \
if(stst) SERIAL_PROTOCOLPGM("standstill "); \
if(olb) SERIAL_PROTOCOLPGM("olb "); \
if(ola) SERIAL_PROTOCOLPGM("ola "); \
if(s2gb) SERIAL_PROTOCOLPGM("s2gb "); \
if(s2ga) SERIAL_PROTOCOLPGM("s2ga "); \
if(otpw) SERIAL_PROTOCOLPGM("otpw "); \
if(ot) SERIAL_PROTOCOLPGM("ot "); \
if(fsactive) SERIAL_PROTOCOLPGM("fsactive "); \
} \
}
/*
X_DIR_WRITE(0); \
uint32_t IOIN = stepperX.IOIN(); \
uint16_t DIR = (IOIN >> 1) & 0b1; \
uint16_t ALWAYS_1 = (IOIN >> 6) & 0b1; \
if(!ALWAYS_1) SERIAL_PROTOCOLPGM("always_1 not 1! "); \
SERIAL_PROTOCOLPGM("Expected DIR 0:"); \
SERIAL_PROTOCOLLN(DIR); \
X_DIR_WRITE(1); \
IOIN = stepperX.IOIN(); \
DIR = (IOIN >> 1) & 0b1; \
SERIAL_PROTOCOLPGM("Expected DIR 1:"); \
SERIAL_PROTOCOLLN(DIR); \
SERIAL_PROTOCOLPGM("DRVSTATUS:"); \
SERIAL_PROTOCOLLN(DRVSTATUS); \
*/
#elif defined(LULZBOT_IS_MINI)
#define LULZBOT_MOTHERBOARD BOARD_MINIRAMBO
#define LULZBOT_CONTROLLER_FAN_PIN FAN1_PIN // Digital pin 6
@ -202,11 +288,20 @@
/*********************** HOMING & AXIS DIRECTIONS ******************************/
#define LULZBOT_INVERT_X_DIR false
#define LULZBOT_INVERT_Y_DIR true
#define LULZBOT_INVERT_Z_DIR false
#define LULZBOT_INVERT_E0_DIR true
#define LULZBOT_INVERT_E1_DIR true
#if defined(LULZBOT_USE_EINSYRAMBO)
// The axis connectors seem to be reversed on the EinsyRambo.
#define LULZBOT_INVERT_X_DIR true
#define LULZBOT_INVERT_Y_DIR false
#define LULZBOT_INVERT_Z_DIR true
#define LULZBOT_INVERT_E0_DIR false
#define LULZBOT_INVERT_E1_DIR false
#else
#define LULZBOT_INVERT_X_DIR false
#define LULZBOT_INVERT_Y_DIR true
#define LULZBOT_INVERT_Z_DIR false
#define LULZBOT_INVERT_E0_DIR true
#define LULZBOT_INVERT_E1_DIR true
#endif
#if defined(LULZBOT_IS_MINI)
#define LULZBOT_HOMING_Z_WITH_PROBE false
@ -374,7 +469,10 @@
* Z_MIN_PIN corresponds to the Z-Home push button.
* Z_MIN_PROBE_PIN are the bed washers.
*/
#if defined(LULZBOT_USE_AUTOLEVELING) && defined(LULZBOT_MINI_BED)
#if defined(LULZBOT_Gladiola_MiniEinsy)
#define LULZBOT_ENABLE_PROBE_PINS(enable)
#elif defined(LULZBOT_USE_AUTOLEVELING) && defined(LULZBOT_MINI_BED)
#define LULZBOT_ENABLE_PROBE_PINS(enable) { \
if(enable) { \
/* Set as inputs with pull-up resistor */ \
@ -867,9 +965,18 @@
/**************************** ENDSTOP CONFIGURATION ****************************/
#define LULZBOT_USE_XMIN_PLUG
#define LULZBOT_USE_YMIN_PLUG
#define LULZBOT_USE_ZMIN_PLUG
#if defined(LULZBOT_SENSORLESS_HOMING)
#define LULZBOT_USE_XMIN_PLUG // Uses Stallguard
//#define LULZBOT_USE_XMAX_PLUG // Uses Stallguard
//#define LULZBOT_USE_YMIN_PLUG // Uses Stallguard
#define LULZBOT_USE_YMAX_PLUG // Uses Stallguard
#define LULZBOT_USE_ZMIN_PLUG
#define LULZBOT_USE_ZMAX_PLUG
#else
#define LULZBOT_USE_XMIN_PLUG
#define LULZBOT_USE_YMIN_PLUG
#define LULZBOT_USE_ZMIN_PLUG
#endif
// Z-Max Endstops were introduced on the Mini and TAZ 6
#if defined(LULZBOT_USE_MAX_ENDSTOPS)
@ -892,7 +999,27 @@
/* Endstop settings are determined by printer model, except for the
* X_MAX which varies by toolhead. */
#if defined(LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS)
#if defined(LULZBOT_SENSORLESS_HOMING)
#define LULZBOT_X_MIN_ENDSTOP_INVERTING true
#define LULZBOT_X_MAX_ENDSTOP_INVERTING true
#define LULZBOT_Y_MAX_ENDSTOP_INVERTING true
#define LULZBOT_Y_MIN_ENDSTOP_INVERTING true
#define LULZBOT_Z_MAX_ENDSTOP_INVERTING true
#define LULZBOT_Z_MIN_ENDSTOP_INVERTING true
#define LULZBOT_Z_MIN_PROBE_ENDSTOP_INVERTING true
// The following does not seem to work when both
// MAX and MIN are using Stallguard:
#define LULZBOT_ENDSTOP_INTERRUPTS_FEATURE
// For some reason, Quickhome is not reliable with sensorless homing
#undef LULZBOT_QUICKHOME
#define LULZBOT_X_HOMING_SENSITIVITY 5
#define LULZBOT_Y_HOMING_SENSITIVITY 5
#elif defined(LULZBOT_USE_NORMALLY_CLOSED_ENDSTOPS)
// TAZ 6+ and Huerfano Mini onwards use normally closed endstops.
// This is safer, as a loose connector or broken wire will halt
// the axis
@ -1052,7 +1179,10 @@
#define LULZBOT_Z_STEPS 1790.08264463
#endif
#if defined(LULZBOT_IS_MINI)
#if defined(LULZBOT_USE_EINSYRAMBO)
// Neither define LULZBOT_PWM_MOTOR_CURRENT nor LULZBOT_DIGIPOT_MOTOR_CURRENT
#elif defined(LULZBOT_IS_MINI)
#define LULZBOT_PWM_MOTOR_CURRENT { \
LULZBOT_MOTOR_CURRENT_XY, \
LULZBOT_MOTOR_CURRENT_Z, \

@ -348,11 +348,13 @@
// @section homing
//homing hits the endstop, then retracts by this distance, before it tries to slowly bump again:
#define X_HOME_BUMP_MM 5
#define Y_HOME_BUMP_MM 5
#define X_HOME_BUMP_MM LULZBOT_X_HOME_BUMP_MM
#define Y_HOME_BUMP_MM LULZBOT_Y_HOME_BUMP_MM
#define Z_HOME_BUMP_MM 2
#define HOMING_BUMP_DIVISOR {2, 2, 4} // Re-Bump Speed Divisor (Divides the Homing Feedrate)
#if defined(LULZBOT_QUICKHOME)
#define QUICK_HOME LULZBOT_QUICKHOME //if this is defined, if both x and y are to be homed, a diagonal move will be performed initially.
#endif
// When G28 is called, this option will make Y home before X
//#define HOME_Y_BEFORE_X
@ -432,8 +434,12 @@
* M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
* M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
*/
#if defined(LULZBOT_PWM_MOTOR_CURRENT)
#define PWM_MOTOR_CURRENT LULZBOT_PWM_MOTOR_CURRENT // Values in milliamps
#endif
#if defined(LULZBOT_DIGIPOT_MOTOR_CURRENT)
#define DIGIPOT_MOTOR_CURRENT LULZBOT_DIGIPOT_MOTOR_CURRENT // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
#endif
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
// Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
@ -946,7 +952,7 @@
* Stepper driver settings
*/
#define R_SENSE 0.11 // R_sense resistor for SilentStepStick2130
#define R_SENSE LULZBOT_R_SENSE // R_sense resistor for SilentStepStick2130
#define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current
#define INTERPOLATE 1 // Interpolate X/Y/Z_MICROSTEPS to 256
@ -987,7 +993,9 @@
* Use Trinamic's ultra quiet stepping mode.
* When disabled, Marlin will use spreadCycle stepping mode.
*/
#if defined(LULZBOT_STEALTHCHOP)
#define STEALTHCHOP
#endif
/**
* Let Marlin automatically control stepper current.
@ -1042,11 +1050,13 @@
* It is advised to set X/Y_HOME_BUMP_MM to 0.
* M914 X/Y to live tune the setting
*/
//#define SENSORLESS_HOMING
#if defined(LULZBOT_SENSORLESS_HOMING)
#define SENSORLESS_HOMING
#endif
#if ENABLED(SENSORLESS_HOMING)
#define X_HOMING_SENSITIVITY 19
#define Y_HOMING_SENSITIVITY 19
#define X_HOMING_SENSITIVITY LULZBOT_X_HOMING_SENSITIVITY
#define Y_HOMING_SENSITIVITY LULZBOT_Y_HOMING_SENSITIVITY
#endif
/**

@ -89,6 +89,9 @@ U8GLIB ?= 1
# https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround
RELOC_WORKAROUND ?= 1
# this defines whether to include the Trinamic TMC2630Stepper
TMC2630 ?= 1
############
# The following added by AlephObjects for adjusting the name of the output
# hex file
@ -293,6 +296,10 @@ ifeq ($(U8GLIB), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/utility
endif
ifeq ($(TMC2630), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMC2130Stepper
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMC2130Stepper/source
endif
ifeq ($(HARDWARE_VARIANT), arduino)
HARDWARE_SUB_VARIANT ?= mega
@ -319,7 +326,7 @@ CXXSRC = WMath.cpp WString.cpp Print.cpp Marlin_main.cpp \
temperature.cpp cardreader.cpp configuration_store.cpp \
watchdog.cpp SPI.cpp servo.cpp Tone.cpp ultralcd.cpp digipot_mcp4451.cpp \
dac_mcp4728.cpp vector_3.cpp least_squares_fit.cpp endstops.cpp stopwatch.cpp utility.cpp \
printcounter.cpp nozzle.cpp serial.cpp gcode.cpp Max7219_Debug_LEDs.cpp
printcounter.cpp nozzle.cpp serial.cpp gcode.cpp Max7219_Debug_LEDs.cpp stepper_indirection.cpp
ifeq ($(NEOPIXEL), 1)
CXXSRC += Adafruit_NeoPixel.cpp
endif
@ -344,6 +351,10 @@ LD_PREFIX=-nodefaultlibs
LD_SUFFIX=-lm -lgcc -lc -lgcc
endif
ifeq ($(TMC2630), 1)
CXXSRC += TMC2130Stepper.cpp TMC2130Stepper_CHOPCONF.cpp TMC2130Stepper_COOLCONF.cpp TMC2130Stepper_DRV_STATUS.cpp TMC2130Stepper_GCONF.cpp TMC2130Stepper_IHOLD_IRUN.cpp TMC2130Stepper_PWMCONF.cpp
endif
#Check for Arduino 1.0.0 or higher and use the correct source files for that version
ifeq ($(shell [ $(ARDUINO_VERSION) -ge 100 ] && echo true), true)
CXXSRC += main.cpp

@ -29,8 +29,8 @@
#include "Version.h"
#include "Configuration.h"
#include "Conditionals_LCD.h"
#include "Configuration_adv.h"
#include "pins.h"
#include "Configuration_adv.h"
#ifndef USBCON
#define HardwareSerial_h // trick to disable the standard HWserial
#endif

@ -89,6 +89,7 @@
#define BOARD_RAMBO 301 // Rambo
#define BOARD_MINIRAMBO 302 // Mini-Rambo
#define BOARD_SCOOVO_X9H 303 // abee Scoovo X9H
#define BOARD_EINSYRAMBO 304 // Einsy-Rambo
#define BOARD_MEGACONTROLLER 310 // Mega controller
#define BOARD_ELEFU_3 21 // Elefu Ra Board (v3)
#define BOARD_5DPRINT 88 // 5DPrint D8 Driver Board

@ -181,6 +181,7 @@ void Endstops::report_state() {
}
#endif
}
LULZBOT_STALLGUARD_REPORT
} // Endstops::report_state
void Endstops::M119() {

@ -142,6 +142,8 @@
#include "pins_RAMBO.h" // ATmega2560
#elif MB(MINIRAMBO)
#include "pins_MINIRAMBO.h" // ATmega2560
#elif MB(EINSYRAMBO)
#include "pins_EINSYRAMBO.h" // ATmega2560
#elif MB(ELEFU_3)
#include "pins_ELEFU_3.h" // ATmega2560
#elif MB(LEAPFROG)

@ -0,0 +1,171 @@
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* Einsy-Rambo pin assignments
*/
#ifndef __AVR_ATmega2560__
#error "Oops! Make sure you have 'Arduino Mega 2560 or Rambo' selected from the 'Tools -> Boards' menu."
#endif
#define BOARD_NAME "Einsy Rambo"
#define LARGE_FLASH true
// Enable use of TMC2130
#define HAVE_TMC2130
#define X_IS_TMC2130
#define Y_IS_TMC2130
#define Z_IS_TMC2130
#define E0_IS_TMC2130
#define BOARD_Z_THRES_PIN 57 // PF3 as defined in "fastio_1280.h"
#define BOARD_X_DIAG_PIN 64 // PK2 as defined in "fastio_1280.h"
#define BOARD_Y_DIAG_PIN 69 // PK7 as defined in "fastio_1280.h"
#define BOARD_Z_DIAG_PIN 68 // PK6 as defined in "fastio_1280.h"
#define BOARD_E0_DIAG_PIN 65 // PK3 as defined in "fastio_1280.h"
#define BOARD_X_MIN_PIN 12
#define BOARD_Y_MIN_PIN 11
#define BOARD_Z_MIN_PIN 10
//
// Limit Switches
//
#if defined(LULZBOT_SENSORLESS_HOMING)
#define X_MIN_PIN BOARD_X_DIAG_PIN
#define Y_MIN_PIN -1
#define Z_MIN_PIN BOARD_Y_MIN_PIN
#define X_MAX_PIN -1
#define Y_MAX_PIN BOARD_Y_DIAG_PIN
#define Z_MAX_PIN BOARD_X_MIN_PIN
#else
#define X_MIN_PIN BOARD_X_MIN_PIN
#define Y_MIN_PIN BOARD_Y_MIN_PIN
#define Z_MIN_PIN BOARD_Z_MIN_PIN
#define X_MAX_PIN -1 // 30
#define Y_MAX_PIN -1 // 24
#define Z_MAX_PIN BOARD_Z_THRES_PIN
#endif
//
// Steppers
//
#define X_STEP_PIN 37
#define X_DIR_PIN 49
#define X_ENABLE_PIN 29
#define Y_STEP_PIN 36
#define Y_DIR_PIN 48
#define Y_ENABLE_PIN 28
#define Z_STEP_PIN 35
#define Z_DIR_PIN 47
#define Z_ENABLE_PIN 27
#define E0_STEP_PIN 34
#define E0_DIR_PIN 43
#define E0_ENABLE_PIN 26
#define E1_STEP_PIN -1
#define E1_DIR_PIN -1
#define E1_ENABLE_PIN -1
// Microstepping pins - Mapping not from fastio.h (?)
#define X_MS1_PIN -1
#define X_MS2_PIN -1
#define X_CS_PIN 41
#define Y_MS1_PIN -1
#define Y_MS2_PIN -1
#define Y_CS_PIN 39
#define Z_MS1_PIN -1
#define Z_MS2_PIN -1
#define Z_CS_PIN 67
#define E0_MS1_PIN -1
#define E0_MS2_PIN -1
#define E0_CS_PIN 66
#define MOTOR_CURRENT_PWM_XY_PIN 46
#define MOTOR_CURRENT_PWM_Z_PIN 45
#define MOTOR_CURRENT_PWM_E_PIN 44
// Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range
#ifndef MOTOR_CURRENT_PWM_RANGE
#define MOTOR_CURRENT_PWM_RANGE 2000
#endif
#define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1300}
//
// Temperature Sensors
//
#define TEMP_0_PIN 0 // Analog Input
#define TEMP_1_PIN 1 // Analog Input
#define TEMP_BED_PIN 2 // Analog Input
//
// Heaters / Fans
//
#define HEATER_0_PIN 3
#define HEATER_1_PIN 7
#define HEATER_2_PIN 6
#define HEATER_BED_PIN 4
#define FAN_PIN 8
#define FAN1_PIN 6
//
// Misc. Functions
//
//#define SDSS 53 // EINY 0-.1 - EINSY 0.3
#define SDSS 77 // EINSY 0.4
#define LED_PIN 13
//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD)
#define KILL_PIN 32
#if ENABLED(NEWPANEL)
// Beeper on AUX-4
#define BEEPER_PIN 84
#define LCD_PINS_RS 82
// EINY 0.1- EINSY-0.3
//#define LCD_PINS_ENABLE 18
//#define LCD_PINS_D4 19
// EINSY 0.4+
#define LCD_PINS_ENABLE 61
#define LCD_PINS_D4 59
#define LCD_PINS_D5 70
#define LCD_PINS_D6 85
#define LCD_PINS_D7 71
// buttons are directly attached using AUX-2
#define BTN_EN1 14
#define BTN_EN2 72
#define BTN_ENC 9 // the click
#define SD_DETECT_PIN 15
#endif // NEWPANEL
#endif // ULTRA_LCD

@ -181,9 +181,13 @@
st.power_down_delay(128); // ~2s until driver lowers to hold current
st.hysterisis_start(0); // HSTRT = 1
st.hysterisis_low(1); // HEND = -2
#if defined(LULZBOT_TMC_INIT)
LULZBOT_TMC_INIT(st);
#else
st.diag1_active_high(1); // For sensorless homing
#endif
#if ENABLED(STEALTHCHOP)
st.stealth_freq(1); // f_pwm = 2/683 f_clk
st.stealth_freq(LULZBOT_STEALTH_FREQ); // f_pwm = 2/683 f_clk
st.stealth_autoscale(1);
st.stealth_gradient(5);
st.stealth_amplitude(255);

Loading…
Cancel
Save