Improvements for Mini 2.

- Added printer variant using non-geared direct-drive Z belts.
- Added experimental support for LED lighting.
master
Marcio Teixeira 7 years ago
parent 20ec0a64cb
commit 09f0413cf7

@ -0,0 +1,180 @@
/*--------------------------------------------------------------------
This file is part of the Adafruit NeoPixel library.
NeoPixel is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
NeoPixel 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with NeoPixel. If not, see
<http://www.gnu.org/licenses/>.
--------------------------------------------------------------------*/
#ifndef ADAFRUIT_NEOPIXEL_H
#define ADAFRUIT_NEOPIXEL_H
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#include <pins_arduino.h>
#endif
// The order of primary colors in the NeoPixel data stream can vary
// among device types, manufacturers and even different revisions of
// the same item. The third parameter to the Adafruit_NeoPixel
// constructor encodes the per-pixel byte offsets of the red, green
// and blue primaries (plus white, if present) in the data stream --
// the following #defines provide an easier-to-use named version for
// each permutation. e.g. NEO_GRB indicates a NeoPixel-compatible
// device expecting three bytes per pixel, with the first byte
// containing the green value, second containing red and third
// containing blue. The in-memory representation of a chain of
// NeoPixels is the same as the data-stream order; no re-ordering of
// bytes is required when issuing data to the chain.
// Bits 5,4 of this value are the offset (0-3) from the first byte of
// a pixel to the location of the red color byte. Bits 3,2 are the
// green offset and 1,0 are the blue offset. If it is an RGBW-type
// device (supporting a white primary in addition to R,G,B), bits 7,6
// are the offset to the white byte...otherwise, bits 7,6 are set to
// the same value as 5,4 (red) to indicate an RGB (not RGBW) device.
// i.e. binary representation:
// 0bWWRRGGBB for RGBW devices
// 0bRRRRGGBB for RGB
// RGB NeoPixel permutations; white and red offsets are always same
// Offset: W R G B
#define NEO_RGB ((0 << 6) | (0 << 4) | (1 << 2) | (2))
#define NEO_RBG ((0 << 6) | (0 << 4) | (2 << 2) | (1))
#define NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2))
#define NEO_GBR ((2 << 6) | (2 << 4) | (0 << 2) | (1))
#define NEO_BRG ((1 << 6) | (1 << 4) | (2 << 2) | (0))
#define NEO_BGR ((2 << 6) | (2 << 4) | (1 << 2) | (0))
// RGBW NeoPixel permutations; all 4 offsets are distinct
// Offset: W R G B
#define NEO_WRGB ((0 << 6) | (1 << 4) | (2 << 2) | (3))
#define NEO_WRBG ((0 << 6) | (1 << 4) | (3 << 2) | (2))
#define NEO_WGRB ((0 << 6) | (2 << 4) | (1 << 2) | (3))
#define NEO_WGBR ((0 << 6) | (3 << 4) | (1 << 2) | (2))
#define NEO_WBRG ((0 << 6) | (2 << 4) | (3 << 2) | (1))
#define NEO_WBGR ((0 << 6) | (3 << 4) | (2 << 2) | (1))
#define NEO_RWGB ((1 << 6) | (0 << 4) | (2 << 2) | (3))
#define NEO_RWBG ((1 << 6) | (0 << 4) | (3 << 2) | (2))
#define NEO_RGWB ((2 << 6) | (0 << 4) | (1 << 2) | (3))
#define NEO_RGBW ((3 << 6) | (0 << 4) | (1 << 2) | (2))
#define NEO_RBWG ((2 << 6) | (0 << 4) | (3 << 2) | (1))
#define NEO_RBGW ((3 << 6) | (0 << 4) | (2 << 2) | (1))
#define NEO_GWRB ((1 << 6) | (2 << 4) | (0 << 2) | (3))
#define NEO_GWBR ((1 << 6) | (3 << 4) | (0 << 2) | (2))
#define NEO_GRWB ((2 << 6) | (1 << 4) | (0 << 2) | (3))
#define NEO_GRBW ((3 << 6) | (1 << 4) | (0 << 2) | (2))
#define NEO_GBWR ((2 << 6) | (3 << 4) | (0 << 2) | (1))
#define NEO_GBRW ((3 << 6) | (2 << 4) | (0 << 2) | (1))
#define NEO_BWRG ((1 << 6) | (2 << 4) | (3 << 2) | (0))
#define NEO_BWGR ((1 << 6) | (3 << 4) | (2 << 2) | (0))
#define NEO_BRWG ((2 << 6) | (1 << 4) | (3 << 2) | (0))
#define NEO_BRGW ((3 << 6) | (1 << 4) | (2 << 2) | (0))
#define NEO_BGWR ((2 << 6) | (3 << 4) | (1 << 2) | (0))
#define NEO_BGRW ((3 << 6) | (2 << 4) | (1 << 2) | (0))
// Add NEO_KHZ400 to the color order value to indicate a 400 KHz
// device. All but the earliest v1 NeoPixels expect an 800 KHz data
// stream, this is the default if unspecified. Because flash space
// is very limited on ATtiny devices (e.g. Trinket, Gemma), v1
// NeoPixels aren't handled by default on those chips, though it can
// be enabled by removing the ifndef/endif below -- but code will be
// bigger. Conversely, can disable the NEO_KHZ400 line on other MCUs
// to remove v1 support and save a little space.
#define NEO_KHZ800 0x0000 // 800 KHz datastream
#ifndef __AVR_ATtiny85__
#define NEO_KHZ400 0x0100 // 400 KHz datastream
#endif
// If 400 KHz support is enabled, the third parameter to the constructor
// requires a 16-bit value (in order to select 400 vs 800 KHz speed).
// If only 800 KHz is enabled (as is default on ATtiny), an 8-bit value
// is sufficient to encode pixel color order, saving some space.
#ifdef NEO_KHZ400
typedef uint16_t neoPixelType;
#else
typedef uint8_t neoPixelType;
#endif
class Adafruit_NeoPixel {
public:
// Constructor: number of LEDs, pin number, LED type
Adafruit_NeoPixel(uint16_t n, uint8_t p=6, neoPixelType t=NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel(void);
~Adafruit_NeoPixel();
void
begin(void),
show(void),
setPin(uint8_t p),
setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b),
setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w),
setPixelColor(uint16_t n, uint32_t c),
setBrightness(uint8_t),
clear(),
updateLength(uint16_t n),
updateType(neoPixelType t);
uint8_t
*getPixels(void) const,
getBrightness(void) const;
int8_t
getPin(void) { return pin; };
uint16_t
numPixels(void) const;
static uint32_t
Color(uint8_t r, uint8_t g, uint8_t b),
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t w);
uint32_t
getPixelColor(uint16_t n) const;
inline bool
canShow(void) { return (micros() - endTime) >= 300L; }
protected:
boolean
#ifdef NEO_KHZ400 // If 400 KHz NeoPixel support enabled...
is800KHz, // ...true if 800 KHz pixels
#endif
begun; // true if begin() previously called
uint16_t
numLEDs, // Number of RGB LEDs in strip
numBytes; // Size of 'pixels' buffer below (3 or 4 bytes/pixel)
int8_t
pin; // Output pin number (-1 if not yet set)
uint8_t
brightness,
*pixels, // Holds LED color values (3 or 4 bytes each)
rOffset, // Index of red byte within each 3- or 4-byte pixel
gOffset, // Index of green byte
bOffset, // Index of blue byte
wOffset; // Index of white byte (same as rOffset if no white)
uint32_t
endTime; // Latch timing reference
#ifdef __AVR__
volatile uint8_t
*port; // Output PORT register
uint8_t
pinMask; // Output PORT bitmask
#endif
};
#endif // ADAFRUIT_NEOPIXEL_H

@ -13,7 +13,7 @@
* got disabled.
*/
#define LULZBOT_FW_VERSION ".36" // Change this with each update
#define LULZBOT_FW_VERSION ".37" // Change this with each update
#if ( \
!defined(LULZBOT_Gladiola_Mini) && \
@ -25,6 +25,7 @@
!defined(LULZBOT_Hibiscus_EinsyMini2) && \
!defined(LULZBOT_Hibiscus_EinsyMini2LCD) && \
!defined(LULZBOT_Hibiscus_SpeedyMini2) && \
!defined(LULZBOT_Hibiscus_SpeedyEinsyMini2) && \
!defined(LULZBOT_Quiver_TAZ7) \
) || ( \
!defined(TOOLHEAD_Gladiola_SingleExtruder) && \
@ -136,6 +137,23 @@
#define LULZBOT_UUID "1b8d32d3-0596-4335-8cd4-f3741a095087"
#endif
#if defined(LULZBOT_Hibiscus_SpeedyEinsyMini2)
#define LULZBOT_CUSTOM_MACHINE_NAME "LulzBot Mini 2"
#define LULZBOT_LCD_MACHINE_NAME "Mini Einsy 2"
#define LULZBOT_IS_MINI
#define LULZBOT_MINI_BED
#define LULZBOT_USE_EINSYRAMBO
#define LULZBOT_USE_EARLY_EINSY
#define LULZBOT_TWO_PIECE_BED
#define LULZBOT_USE_AUTOLEVELING
#define LULZBOT_SENSORLESS_HOMING
#define LULZBOT_USE_Z_BELT
#define LULZBOT_USE_SERIES_Z_MOTORS
#define LULZBOT_BAUDRATE 250000
#define LULZBOT_PRINTCOUNTER
#define LULZBOT_UUID "1b8d32d3-0596-4335-8cd4-f3741a095087"
#endif
#if defined(LULZBOT_Hibiscus_EinsyMini2)
#define LULZBOT_CUSTOM_MACHINE_NAME "LulzBot Mini 2"
#define LULZBOT_LCD_MACHINE_NAME "Mini Einsy 2"
@ -166,6 +184,7 @@
#define LULZBOT_SENSORLESS_HOMING
#define LULZBOT_USE_Z_BELT
#define LULZBOT_USE_Z_GEARBOX
#define LULZBOT_USE_STATUS_LED
#define LULZBOT_BAUDRATE 250000
#define LULZBOT_PRINTCOUNTER
#define LULZBOT_UUID "e5502411-d46d-421d-ba3a-a20126d7930f"
@ -1113,6 +1132,15 @@
#define LULZBOT_Z_MIN_ENDSTOP_INVERTING LULZBOT_NORMALLY_OPEN_ENDSTOP
#define LULZBOT_Z_MIN_PROBE_ENDSTOP_INVERTING LULZBOT_NORMALLY_OPEN_ENDSTOP
/********************************* STATUS LIGHTS ********************************/
#if defined(LULZBOT_USE_STATUS_LED)
#define LULZBOT_NEOPIXEL_RGBW_LED
#define LULZBOT_NEOPIXEL_PIN BOARD_X_MAX_PIN
#define LULZBOT_NEOPIXEL_PIXELS 8
#undef LULZBOT_USE_XMAX_PLUG
#endif
/******************************* SENSORLESS HOMING ******************************/
#if defined(LULZBOT_SENSORLESS_HOMING)
@ -1322,11 +1350,35 @@
st.coolstep_min_speed(0); \
st.stealthChop(1);
#if defined(LULZBOT_USE_SERIES_Z_MOTORS)
#define LULZBOT_Z_TOFF 1
#define LULZBOT_Z_HSTRT 0
#define LULZBOT_Z_HEND 0
#define LULZBOT_Z_TBL 1
#else
/* Marlin Defaults - Matches Quick Configuration Guide values*/
#define LULZBOT_Z_TOFF 5
#define LULZBOT_Z_HSTRT 0
#define LULZBOT_Z_HEND 0
#define LULZBOT_Z_TBL 2
#endif
#define LULZBOT_MOTOR_INIT_XY \
/* Set TOFF to reduce audible chopping noise */ \
stepperX.toff(3); \
stepperY.toff(3);
#define LULZBOT_MOTOR_INIT_Z \
/* Set TOFF to reduce audible chopping noise */ \
stepperZ.toff(LULZBOT_Z_TOFF); /* TOFF = [1..15] */ \
stepperZ.hstrt(LULZBOT_Z_HSTRT); /* HSTART = [0..7] */ \
stepperZ.hend(LULZBOT_Z_HEND); /* HEND = [0..15] */ \
stepperZ.tbl(LULZBOT_Z_TBL); /* TBL = [0..3] */ \
#define LULZBOT_TMC2130_ADV { \
LULZBOT_SENSORLESS_HOMING_Z_INIT \
/* Set TOFF to reduce audible chopping noise */ \
stepperX.toff(3); \
stepperY.toff(3); \
LULZBOT_MOTOR_INIT_XY \
LULZBOT_MOTOR_INIT_Z \
}
/* When STEALTHCHOP is disabled, sometimes the X axis refuses to
@ -1471,15 +1523,11 @@
// Values for XYZ vary by printer model, values for E vary by toolhead.
#if defined(LULZBOT_USE_EINSYRAMBO)
#define LULZBOT_MOTOR_CURRENT_XY 800 // mA
// This value will be ignored due to the automatic
// current regulation provided by COOLCONF
#define LULZBOT_MOTOR_CURRENT_XY 960 // mA
#define LULZBOT_MOTOR_CURRENT_Z 960 // mA
#if LULZBOT_MOTOR_CURRENT_E > 960
#warning This toolhead may not work properly with the EinsyRambo
#undef LULZBOT_MOTOR_CURRENT_E
#define LULZBOT_MOTOR_CURRENT_E 960 // mA
#endif
#elif defined(LULZBOT_IS_MINI) && defined(LULZBOT_USE_Z_SCREW)
#define LULZBOT_MOTOR_CURRENT_XY 1300 // mA
#define LULZBOT_MOTOR_CURRENT_Z 1630 // mA
@ -1540,9 +1588,11 @@
#if defined(LULZBOT_IS_MINI) && defined(LULZBOT_USE_Z_SCREW)
#define LULZBOT_Z_STEPS 1600
#define LULZBOT_Z_MICROSTEPS 16
#elif defined(LULZBOT_IS_MINI) && defined(LULZBOT_USE_Z_BELT) && !defined(LULZBOT_USE_Z_GEARBOX)
#define LULZBOT_Z_STEPS 100.5
#define LULZBOT_Z_STEPS 201
#define LULZBOT_Z_MICROSTEPS 32
#define LULZBOT_DEFAULT_MAX_FEEDRATE {300, 300, 300, 40} // (mm/sec)
#define LULZBOT_DEFAULT_MAX_ACCELERATION {9000,9000,9000,1000}
@ -1553,6 +1603,7 @@
#define Z_PULLEY_TEETH 24
#define Z_MOTOR_GEAR_REDUCTION 26.8512396694
#define LULZBOT_Z_STEPS (Z_FULL_STEPS_PER_ROTATION * Z_MICROSTEPS * Z_MOTOR_GEAR_REDUCTION / double(Z_BELT_PITCH) / double(Z_PULLEY_TEETH))
#define LULZBOT_Z_MICROSTEPS 16
#undef LULZBOT_DEFAULT_MAX_FEEDRATE
#define LULZBOT_DEFAULT_MAX_FEEDRATE {300, 300, 8, 25} // (mm/sec)
@ -1561,26 +1612,20 @@
#define LULZBOT_DEFAULT_MAX_FEEDRATE {300, 300, 3, 25} // (mm/sec)
#define LULZBOT_DEFAULT_MAX_ACCELERATION {9000,9000,100,10000}
#define LULZBOT_Z_STEPS 1600
#define LULZBOT_Z_MICROSTEPS 16
#elif defined(LULZBOT_IS_TAZ) && defined(LULZBOT_USE_Z_BELT)
// Prototype Z-belt driven TAZ 7
#define LULZBOT_DEFAULT_MAX_FEEDRATE {300, 300, 10, 25} // (mm/sec)
#define LULZBOT_DEFAULT_MAX_ACCELERATION {9000,9000,10,10000}
#define LULZBOT_Z_STEPS 1790.08264463
#define LULZBOT_Z_MICROSTEPS 16
#endif
#if defined(LULZBOT_USE_EINSYRAMBO)
// Neither define LULZBOT_PWM_MOTOR_CURRENT nor LULZBOT_DIGIPOT_MOTOR_CURRENT,
// as the current is set in Configuration_adv.h under the HAVE_TMC2130 block
// Make sure the current is in range, as setting it above this causes the
// value in irun to wrap around to zero, which fails silently!
#if LULZBOT_MOTOR_CURRENT_XY > 960 || \
LULZBOT_MOTOR_CURRENT_Z > 960 || \
LULZBOT_MOTOR_CURRENT_E > 960
#error Motor currents exceed the maximum values that can be set on the EinsyRambo
#endif
#define LULZBOT_X_CURRENT LULZBOT_MOTOR_CURRENT_XY
#define LULZBOT_Y_CURRENT LULZBOT_MOTOR_CURRENT_XY
#define LULZBOT_Z_CURRENT LULZBOT_MOTOR_CURRENT_Z

@ -1615,10 +1615,10 @@
#endif
// Support for Adafruit Neopixel LED driver
//#define NEOPIXEL_RGBW_LED
#define NEOPIXEL_RGBW_LED LULZBOT_NEOPIXEL_RGBW_LED
#if ENABLED(NEOPIXEL_RGBW_LED)
#define NEOPIXEL_PIN 4 // D4 (EXP2-5 on Printrboard)
#define NEOPIXEL_PIXELS 3
#define NEOPIXEL_PIN LULZBOT_NEOPIXEL_PIN // D4 (EXP2-5 on Printrboard)
#define NEOPIXEL_PIXELS LULZBOT_NEOPIXEL_PIXELS
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#endif

@ -967,7 +967,7 @@
#define Y_MICROSTEPS 16
#define Z_CURRENT LULZBOT_Z_CURRENT
#define Z_MICROSTEPS 16
#define Z_MICROSTEPS LULZBOT_Z_MICROSTEPS
//#define X2_CURRENT 1000
//#define X2_MICROSTEPS 16

@ -85,6 +85,9 @@ WIRE ?= 0
# this defines if U8GLIB is needed (may require RELOC_WORKAROUND)
U8GLIB ?= 1
# this defines if NEOPIXEL is needed
NEOPIXEL ?= 1
# this defines whether to add a workaround for the avr-gcc relocation bug
# https://www.stix.id.au/wiki/AVR_relocation_truncations_workaround
RELOC_WORKAROUND ?= 1

Loading…
Cancel
Save