Browse Source

UltiMachine Archim 1 support (#12404)

pull/1/head
Ryan 6 years ago
committed by Scott Lahteine
parent
commit
052d102ded
  1. 8
      Marlin/Makefile
  2. 7
      Marlin/src/HAL/HAL_DUE/usb/conf_usb.h
  3. 2019
      Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h
  4. 1886
      Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h
  5. 3
      Marlin/src/core/boards.h
  6. 60
      Marlin/src/module/stepper.cpp
  7. 2
      Marlin/src/pins/pins.h
  8. 195
      Marlin/src/pins/pins_ARCHIM1.h
  9. 117
      Marlin/src/pins/pins_ARCHIM2.h

8
Marlin/Makefile

@ -404,8 +404,14 @@ else ifeq ($(HARDWARE_MOTHERBOARD),88)
HARDWARE_VARIANT ?= Teensy
MCU ?= at90usb1286
# UltiMachine Archim1 (with DRV8825 drivers)
else ifeq ($(HARDWARE_MOTHERBOARD),1591)
HARDWARE_VARIANT ?= archim
MCPU = cortex-m3
F_CPU = 84000000L
IS_MCU = 0
# UltiMachine Archim2 (with TMC2130 drivers)
else ifeq ($(HARDWARE_MOTHERBOARD),1590)
else ifeq ($(HARDWARE_MOTHERBOARD),1592)
HARDWARE_VARIANT ?= archim
MCPU = cortex-m3
F_CPU = 84000000L

7
Marlin/src/HAL/HAL_DUE/usb/conf_usb.h

@ -49,6 +49,7 @@
#undef UNUSED /* To avoid a macro clash as macros.h already defines it */
#include "../../../core/macros.h" /* For ENABLED()/DISABLED() */
#include "../../../core/boards.h" /* For MB() */
#include "../../../../Configuration.h" /* For CUSTOM_MACHINE_NAME definition - We just need the name, no C++ allowed! */
#include "compiler.h"
@ -88,7 +89,11 @@
//#define USB_DEVICE_LOW_SPEED
//! To define a Full speed device
//#define USB_DEVICE_FULL_SPEED
//#define USB_DEVICE_FULL_SPEED
#if MB(ARCHIM1)
#define USB_DEVICE_FULL_SPEED
#endif
//! To authorize the High speed
#ifndef USB_DEVICE_FULL_SPEED

2019
Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h

File diff suppressed because it is too large

1886
Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h

File diff suppressed because it is too large

3
Marlin/src/core/boards.h

@ -209,7 +209,8 @@
#define BOARD_RURAMPS4D_11 1550 // RuRAMPS4Duo v1.1 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed)
#define BOARD_RURAMPS4D_13 1551 // RuRAMPS4Duo v1.3 (Power outputs: Hotend0, Hotend1, Hotend2, Fan0, Fan1, Bed)
#define BOARD_ULTRATRONICS_PRO 1560 // ReprapWorld Ultratronics Pro V1.0
#define BOARD_ARCHIM2 1590 // UltiMachine Archim2 (with TMC2130 drivers)
#define BOARD_ARCHIM1 1591 // UltiMachine Archim1 (with DRV8825 drivers)
#define BOARD_ARCHIM2 1592 // UltiMachine Archim2 (with TMC2130 drivers)
#define BOARD_ALLIGATOR 1602 // Alligator Board R2
//

60
Marlin/src/module/stepper.cpp

@ -2407,13 +2407,13 @@ void Stepper::report_positions() {
void Stepper::refresh_motor_power() {
LOOP_L_N(i, COUNT(motor_current_setting)) {
switch (i) {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY) || PIN_EXISTS(MOTOR_CURRENT_PWM_X) || PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
case 0:
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
case 1:
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E) || PIN_EXISTS(MOTOR_CURRENT_PWM_E0) || PIN_EXISTS(MOTOR_CURRENT_PWM_E1)
case 2:
#endif
digipot_current(i, motor_current_setting[i]);
@ -2426,7 +2426,7 @@ void Stepper::report_positions() {
#if HAS_DIGIPOTSS || HAS_MOTOR_CURRENT_PWM
void Stepper::digipot_current(const uint8_t driver, const int current) {
void Stepper::digipot_current(const uint8_t driver, const int16_t current) {
#if HAS_DIGIPOTSS
@ -2440,15 +2440,33 @@ void Stepper::report_positions() {
#define _WRITE_CURRENT_PWM(P) analogWrite(MOTOR_CURRENT_PWM_## P ##_PIN, 255L * current / (MOTOR_CURRENT_PWM_RANGE))
switch (driver) {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
case 0: _WRITE_CURRENT_PWM(XY); break;
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
case 1: _WRITE_CURRENT_PWM(Z); break;
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
case 2: _WRITE_CURRENT_PWM(E); break;
#endif
case 0:
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
_WRITE_CURRENT_PWM(X);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
_WRITE_CURRENT_PWM(Y);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
_WRITE_CURRENT_PWM(XY);
#endif
break;
case 1:
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Z)
_WRITE_CURRENT_PWM(Z);
#endif
break;
case 2:
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
_WRITE_CURRENT_PWM(E);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E0)
_WRITE_CURRENT_PWM(E0);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E1)
_WRITE_CURRENT_PWM(E1);
#endif
break;
}
#endif
}
@ -2469,6 +2487,12 @@ void Stepper::report_positions() {
#elif HAS_MOTOR_CURRENT_PWM
#if PIN_EXISTS(MOTOR_CURRENT_PWM_X)
SET_OUTPUT(MOTOR_CURRENT_PWM_X_PIN);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_Y)
SET_OUTPUT(MOTOR_CURRENT_PWM_Y_PIN);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN);
#endif
@ -2478,12 +2502,19 @@ void Stepper::report_positions() {
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E)
SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E0)
SET_OUTPUT(MOTOR_CURRENT_PWM_E0_PIN);
#endif
#if PIN_EXISTS(MOTOR_CURRENT_PWM_E1)
SET_OUTPUT(MOTOR_CURRENT_PWM_E1_PIN);
#endif
refresh_motor_power();
// Set Timer5 to 31khz so the PWM of the motor power is as constant as possible. (removes a buzzing noise)
SET_CS5(PRESCALER_1);
#ifdef __AVR__
SET_CS5(PRESCALER_1);
#endif
#endif
}
@ -2587,6 +2618,7 @@ void Stepper::report_positions() {
SET_OUTPUT(E5_MS3_PIN);
#endif
#endif
static const uint8_t microstep_modes[] = MICROSTEP_MODES;
for (uint16_t i = 0; i < COUNT(microstep_modes); i++)
microstep_mode(i, microstep_modes[i]);

2
Marlin/src/pins/pins.h

@ -365,6 +365,8 @@
#include "pins_RAMPS4DUE.h" // SAM3X8E env:DUE env:DUE_USB env:DUE_debug
#elif MB(ULTRATRONICS_PRO)
#include "pins_ULTRATRONICS_PRO.h" // SAM3X8E env:DUE env:DUE_debug
#elif MB(ARCHIM1)
#include "pins_ARCHIM1.h" // SAM3X8E env:DUE env:DUE_debug
#elif MB(ARCHIM2)
#include "pins_ARCHIM2.h" // SAM3X8E env:DUE env:DUE_debug
#elif MB(ALLIGATOR)

195
Marlin/src/pins/pins_ARCHIM1.h

@ -0,0 +1,195 @@
/**
* 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/>.
*
*/
/**
* ARCHIM1 pin assignment
*
* The Archim 1.0 board requires Arduino Archim addons installed.
*
* - Add the following URL to Arduino IDE's Additional Board Manager URLs:
* https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json
*
* - In the Arduino IDE Board Manager search for Archim and install the package.
*
* - Change your target board to "Archim".
*
* Further information on the UltiMachine website...
* https://github.com/ultimachine/Archim/wiki
*/
#ifndef __SAM3X8E__
#error "Oops! Select 'Archim' in 'Tools > Board.'"
#endif
#define BOARD_NAME "Archim 1.0"
//
// Items marked * have been altered from Archim v1.0
//
//
// Servos
//
#define SERVO0_PIN 20 // D20 PB12 (Header J20 20)
#define SERVO1_PIN 21 // D21 PB13 (Header J20 19)
//
// Limit Switches
//
#define X_MIN_PIN 14 // PD4 MIN ES1
#define X_MAX_PIN 32 // PD10 MAX ES1
#define Y_MIN_PIN 29 // PD6 MIN ES2
#define Y_MAX_PIN 15 // PD5 MAX ES2
#define Z_MIN_PIN 31 // PA7 MIN ES3
#define Z_MAX_PIN 30 // PD9 MAX ES3
//
// Z Probe (when not Z_MIN_PIN)
//
#ifndef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN 32
#endif
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 66 // D66 PB15 (Header J20 15)
#endif
#ifndef FIL_RUNOUT2_PIN
#define FIL_RUNOUT2_PIN 67 // D67 PB16 (Header J20 16)
#endif
//
// Steppers
//
#define X_STEP_PIN 40 // PC8 STEP1 *
#define X_DIR_PIN 59 // PA4 DIR1 *
#define X_ENABLE_PIN 41 // PC9 EN1
#define Y_STEP_PIN 49 // PC14 STEP2 *
#define Y_DIR_PIN 47 // PC16 DIR2 *
#define Y_ENABLE_PIN 48 // PC15 EN2 *
#define Z_STEP_PIN 36 // PC4 STEP Z *
#define Z_DIR_PIN 107 // PB10 DIR Z *
#define Z_ENABLE_PIN 96 // PC10 EN Z -AddOns *
#define E0_STEP_PIN 78 // PB23 STEP3 *
#define E0_DIR_PIN 22 // PB26 DIR3 *
#define E0_ENABLE_PIN 97 // PB24 EN3 -Addons *
#define E1_STEP_PIN 26 // PD1 STEP4 *
#define E1_DIR_PIN 27 // PD2 DIR4 *
#define E1_ENABLE_PIN 28 // PD3 EN4 *
// Microstepping mode pins *
#define X_MS1_PIN 39 // PC7 MOD0E1 - As listed in schematic
#define X_MS2_PIN 38 // PC6 MOD1E1
#define X_MS3_PIN 37 // PC5 MOD2E1
#define Y_MS1_PIN 50 // PC13 MODE0E2
#define Y_MS2_PIN 51 // PC12 MODE1E2
#define Y_MS3_PIN 92 // PC11 MODE2E2 - AddOns
#define Z_MS1_PIN 44 // PC19 MOD0E Z
#define Z_MS2_PIN 45 // PC18 MOD1E Z
#define Z_MS3_PIN 46 // PC17 MOD2E Z
#define E0_MS1_PIN 105 // PB22 MOD0E3 - AddOns
#define E0_MS2_PIN 106 // PC27 MOD1E3 - AddOns
#define E0_MS3_PIN 104 // PC20 MOD2E3 - AddOns
#define E1_MS1_PIN 25 // PD0 MOD0E4
#define E1_MS2_PIN 18 // PA11 MOD1E4
#define E1_MS3_PIN 19 // PA10 MOD2E4
// Motor current PWM pins *
#define MOTOR_CURRENT_PWM_X_PIN 58 // PA6 X-REF TIOB2
#define MOTOR_CURRENT_PWM_Y_PIN 12 // PD8 Y-REF TIOB8
#define MOTOR_CURRENT_PWM_Z_PIN 10 // PC29 Z-REF TIOB7
#define MOTOR_CURRENT_PWM_E0_PIN 3 // PC28 E1-REF TIOA7
#define MOTOR_CURRENT_PWM_E1_PIN 11 // PD7 E2-REF TIOA8
#define MOTOR_CURRENT_PWM_RANGE 2750 // (3.3 Volts * 100000 Ohms) / (100000 Ohms + 20000 Ohms) = 2.75 Volts (max vref)
#define DEFAULT_PWM_MOTOR_CURRENT { 1000, 1000, 1000 } //, 1000, 1000} // X Y Z E0 E1, 1000 = 1000mAh
//
// Temperature Sensors
//
#define TEMP_0_PIN 10 // D10 PB19 THERM AN1 *
#define TEMP_1_PIN 9 // D9 PB18 THERM AN2 *
#define TEMP_2_PIN 8 // D8 PB17 THERM AN4 *
#define TEMP_BED_PIN 11 // D11 PB20 THERM AN3 *
//
// Heaters / Fans
//
#define HEATER_0_PIN 6 // D6 PC24 FET_PWM3
#define HEATER_1_PIN 7 // D7 PC23 FET_PWM4
#define HEATER_2_PIN 8 // D8 PC22 FET_PWM5
#define HEATER_BED_PIN 9 // D9 PC21 BED_PWM
#ifndef FAN_PIN
#define FAN_PIN 4 // D4 PC26 FET_PWM1
#endif
#define FAN1_PIN 5 // D5 PC25 FET_PWM2
//
// Misc. Functions
//
// Internal MicroSD card reader on the PCB
#define INT_SCK_PIN 42 // D42 PA19/MCCK
#define INT_MISO_PIN 43 // D43 PA20/MCCDA
#define INT_MOSI_PIN 73 // D73 PA21/MCDA0
#define INT_SDSS 55 // D55 PA24/MCDA3
// External SD card reader on SC2
#define SCK_PIN 76 // D76 PA27
#define MISO_PIN 74 // D74 PA25
#define MOSI_PIN 75 // D75 PA26
#define SDSS 87 // D87 PA29
// 2MB SPI Flash
#define SPI_FLASH_SS 52 // D52 PB21
//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD)
#define BEEPER_PIN 23 // D24 PA15_CTS1
#define LCD_PINS_RS 17 // D17 PA12_RXD1
#define LCD_PINS_ENABLE 24 // D23 PA14_RTS1
#define LCD_PINS_D4 69 // D69 PA0_CANTX0
#define LCD_PINS_D5 54 // D54 PA16_SCK1
#define LCD_PINS_D6 68 // D68 PA1_CANRX0
#define LCD_PINS_D7 34 // D34 PC2_PWML0
#define SD_DETECT_PIN 2 // D2 PB25_TIOA0
#if ENABLED(NEWPANEL)
// Buttons on AUX-2
#define BTN_EN1 60 // D60 PA3_TIOB1
#define BTN_EN2 13 // D13 PB27_TIOB0
#define BTN_ENC 16 // D16 PA13_TXD1
#endif // NEWPANEL
#endif // ULTRA_LCD

117
Marlin/src/pins/pins_ARCHIM2.h

@ -21,53 +21,53 @@
*/
/**
* ARCHIM2 pin assignment (pins_ARCHIM2.h)
* ARCHIM2 pin assignment
*
* The Archim2 board requires Arduino Archim addons installed.
* Add the following URL to Arduino IDE's Additional Board Manager URLs:
* https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json
* In the Arduino IDE Board Manager search for Archim and install the package.
* Change your target board to "Archim".
* The Archim 2.0 board requires Arduino Archim addons installed.
*
* Further information is provided by UltiMachine
* https://github.com/ultimachine/Archim/wiki/Archim-v2.0
* https://github.com/ultimachine/Archim/wiki
* - Add the following URL to Arduino IDE's Additional Board Manager URLs:
* https://raw.githubusercontent.com/ultimachine/ArduinoAddons/master/package_ultimachine_index.json
*
* - In the Arduino IDE Board Manager search for Archim and install the package.
*
* - Change your target board to "Archim".
*
* Further information on the UltiMachine website...
* https://github.com/ultimachine/Archim/wiki
*/
#ifndef __SAM3X8E__
#error "Oops! Select 'Archim' in 'Tools > Board.'"
#endif
#define BOARD_NAME "Archim 2.0"
//
// Items marked * have been altered from Archim v1.0
//
// TMC2130 Diag Pins (currently just for reference)
#define X_DIAG_PIN 59 // PA4 X_DIAG
#define Y_DIAG_PIN 48 // PC15 Y_DIAG
#define Z_DIAG_PIN 36 // PC4 Z_DIAG
#define E0_DIAG_PIN 78 // PB23 E1_DIAG
#define E1_DIAG_PIN 25 // PD0 E2_DIAG
//
// Servos
//
#define SERVO0_PIN 20 // D20 PB12 (Header J20 20)
#define SERVO1_PIN 21 // D21 PB13 (Header J20 19)
#define SERVO0_PIN 20 // D20 PB12 (Header J20 20)
#define SERVO1_PIN 21 // D21 PB13 (Header J20 19)
//
// Limit Switches
//
// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers.
// Otherwise use a physical endstop based configuration.
#if DISABLED(SENSORLESS_HOMING)
#define X_MIN_PIN 14 // PD4 MIN ES1
#define X_MAX_PIN 32 // PD10 MAX ES1
#define Y_MIN_PIN 29 // PD6 MIN ES2
#define Y_MAX_PIN 15 // PD5 MAX ES2
#else
#if ENABLED(SENSORLESS_HOMING)
// Only use Diag Pins when SENSORLESS_HOMING is enabled for the TMC2130 drivers.
// Otherwise use a physical endstop based configuration.
// TMC2130 Diag Pins
#define X_DIAG_PIN 59 // PA4
#define Y_DIAG_PIN 48 // PC15
#define Z_DIAG_PIN 36 // PC4
#define E0_DIAG_PIN 78 // PB23
#define E1_DIAG_PIN 25 // PD0
#if X_HOME_DIR == -1
#define X_MIN_PIN X_DIAG_PIN
#define X_MAX_PIN 32
@ -83,10 +83,18 @@
#define Y_MIN_PIN 29
#define Y_MAX_PIN Y_DIAG_PIN
#endif
#else
#define X_MIN_PIN 14 // PD4 MIN ES1
#define X_MAX_PIN 32 // PD10 MAX ES1
#define Y_MIN_PIN 29 // PD6 MIN ES2
#define Y_MAX_PIN 15 // PD5 MAX ES2
#endif
#define Z_MIN_PIN 31 // PA7 MIN ES3
#define Z_MAX_PIN 30 // PD9 MAX ES3
#define Z_MIN_PIN 31 // PA7 MIN ES3
#define Z_MAX_PIN 30 // PD9 MAX ES3
//
// Z Probe (when not Z_MIN_PIN)
@ -95,6 +103,13 @@
#define Z_MIN_PROBE_PIN 32
#endif
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 66 // D66 PB15 (Header J20 15)
#endif
#ifndef FIL_RUNOUT2_PIN
#define FIL_RUNOUT2_PIN 67 // D67 PB16 (Header J20 16)
#endif
//
// Steppers
//
@ -154,45 +169,39 @@
//
// Heaters / Fans
//
#ifndef FAN_PIN
#define FAN_PIN 4 // D4 PC26 FET_PWM1
#endif
#define FAN1_PIN 5 // D5 PC25 FET_PWM2
#define HEATER_0_PIN 6 // D6 PC24 FET_PWM3
#define HEATER_1_PIN 7 // D7 PC23 FET_PWM4
#define HEATER_2_PIN 8 // D8 PC22 FET_PWM5
#define HEATER_BED_PIN 9 // D9 PC21 BED_PWM
#ifndef FAN_PIN
#define FAN_PIN 4 // D4 PC26 FET_PWM1
#endif
#define FAN1_PIN 5 // D5 PC25 FET_PWM2
//
// Misc. Functions
//
// Internal MicroSD card reader on the PCB
#define INT_SCK_PIN 42 // D42 PA19/MCCK
#define INT_MISO_PIN 43 // D43 PA20/MCCDA
#define INT_MOSI_PIN 73 // D73 PA21/MCDA0
#define INT_SDSS 55 // D55 PA24/MCDA3
// The external SD card reader on SC2, as well as 2 Mbyte SPI Flash
#define SCK_PIN 76 // D76 PA27
#define MISO_PIN 74 // D74 PA25
#define MOSI_PIN 75 // D75 PA26
#define SDSS 87 // D87 PA29
#define SPI_FLASH_SS 52 // D52 PB21
// Filament runout sensor pins (or GPIO)
#ifndef FIL_RUNOUT_PIN
#define FIL_RUNOUT_PIN 66 // D66 PB15 (Header J20 15)
#endif
#ifndef FIL_RUNOUT2_PIN
#define FIL_RUNOUT2_PIN 67 // D67 PB16 (Header J20 16)
#endif
#define INT_SCK_PIN 42 // D42 PA19/MCCK
#define INT_MISO_PIN 43 // D43 PA20/MCCDA
#define INT_MOSI_PIN 73 // D73 PA21/MCDA0
#define INT_SDSS 55 // D55 PA24/MCDA3
// External SD card reader on SC2
#define SCK_PIN 76 // D76 PA27
#define MISO_PIN 74 // D74 PA25
#define MOSI_PIN 75 // D75 PA26
#define SDSS 87 // D87 PA29
// 2MB SPI Flash
#define SPI_FLASH_SS 52 // D52 PB21
//
// LCD / Controller
//
#if ENABLED(ULTRA_LCD) || ENABLED(EXTENSIBLE_UI)
#if ENABLED(ULTRA_LCD)
#define BEEPER_PIN 23 // D24 PA15_CTS1
#define LCD_PINS_RS 17 // D17 PA12_RXD1
#define LCD_PINS_ENABLE 24 // D23 PA14_RTS1
@ -209,4 +218,4 @@
#define BTN_EN2 13 // D13 PB27_TIOB0
#define BTN_ENC 16 // D16 PA13_TXD1 // the click
#endif // NEWPANEL
#endif // ULTRA_LCD || EXTENSIBLE_UI
#endif // ULTRA_LCD

Loading…
Cancel
Save