Skip to content

Commit

Permalink
Merge pull request MarlinFirmware#897 from Makible/5DPrint_D8_Board_S…
Browse files Browse the repository at this point in the history
…upport

5DPrint D8 Controller Board Support
  • Loading branch information
nothinman committed Apr 28, 2014
2 parents b9126ab + ad5c8cb commit ce76843
Show file tree
Hide file tree
Showing 9 changed files with 1,375 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
// 91 = Final OMCA board
// 301= Rambo
// 21 = Elefu Ra Board (v3)
// 88 = 5DPrint D8 Driver Board

#ifndef MOTHERBOARD
#define MOTHERBOARD 7
Expand Down Expand Up @@ -116,6 +117,7 @@
// 9 is 100k GE Sensing AL03006-58.2K-97-G1 (4.7k pullup)
// 10 is 100k RS thermistor 198-961 (4.7k pullup)
// 11 is 100k beta 3950 1% thermistor (4.7k pullup)
// 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
// 20 is the PT100 circuit found in the Ultimainboard V2.x
// 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
//
Expand Down
5 changes: 5 additions & 0 deletions Marlin/digipot_mcp4451.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
#include "Wire.h"

// Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro
#if MOTHERBOARD == 88
#define DIGIPOT_I2C_FACTOR 117.96
#define DIGIPOT_I2C_MAX_CURRENT 1.736
#else
#define DIGIPOT_I2C_FACTOR 106.7
#define DIGIPOT_I2C_MAX_CURRENT 2.5
#endif

static byte current_to_wiper( float current ){
return byte(ceil(float((DIGIPOT_I2C_FACTOR*current))));
Expand Down
725 changes: 725 additions & 0 deletions Marlin/example_configurations/makibox/Configuration.h

Large diffs are not rendered by default.

498 changes: 498 additions & 0 deletions Marlin/example_configurations/makibox/Configuration_adv.h

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Marlin/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#elif MOTHERBOARD == 77
#define MACHINE_NAME "3Drag"
#define FIRMWARE_URL "http://3dprint.elettronicain.it/"
#elif MOTHERBOARD == 88
#define MACHINE_NAME "Makibox"
#define FIRMWARE_URL "https://github.com/ErikZalm/Marlin/"
#else
#ifdef CUSTOM_MENDEL_NAME
#define MACHINE_NAME CUSTOM_MENDEL_NAME
Expand Down
86 changes: 86 additions & 0 deletions Marlin/pins.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef PINS_H
#define PINS_H

#if MOTHERBOARD != 88
#define X_MS1_PIN -1
#define X_MS2_PIN -1
#define Y_MS1_PIN -1
Expand All @@ -12,6 +13,91 @@
#define E1_MS1_PIN -1
#define E1_MS2_PIN -1
#define DIGIPOTSS_PIN -1
#endif

/****************************************************************************************
* 5DPrint D8 Driver board
* https://bitbucket.org/makible/5dprint-d8-controller-board
****************************************************************************************/

#if MOTHERBOARD == 88

#define KNOWN_BOARD 1
#define AT90USB 1286 // Disable MarlinSerial etc.

#ifndef __AVR_AT90USB1286__
#error Oops! Make sure you have 'Teensy++ 2.0' selected from the 'Tools -> Boards' menu.
#endif

#define LARGE_FLASH true

#define X_STEP_PIN 0
#define X_DIR_PIN 1
#define X_ENABLE_PIN 23
#define X_STOP_PIN 37

#define Y_STEP_PIN 2
#define Y_DIR_PIN 3
#define Y_ENABLE_PIN 19
#define Y_STOP_PIN 36

#define Z_STEP_PIN 4
#define Z_DIR_PIN 5
#define Z_ENABLE_PIN 18
#define Z_STOP_PIN 39

#define E0_STEP_PIN 6
#define E0_DIR_PIN 7
#define E0_ENABLE_PIN 17

#define HEATER_0_PIN 21 // Extruder
#define HEATER_1_PIN -1
#define HEATER_2_PIN -1
#define HEATER_BED_PIN 20 // Bed
// You may need to change FAN_PIN to 16 because Marlin isn't using fastio.h
// for the fan and Teensyduino uses a different pin mapping.
#define FAN_PIN 16 // Fan

#define TEMP_0_PIN 1 // Extruder / Analog pin numbering
#define TEMP_BED_PIN 0 // Bed / Analog pin numbering

#define TEMP_1_PIN -1
#define TEMP_2_PIN -1

#define SDPOWER -1
#define LED_PIN -1
#define PS_ON_PIN -1
#define KILL_PIN -1
#define ALARM_PIN -1

// The SDSS pin uses a different pin mapping from file Sd2PinMap.h
#define SDSS 20

#ifndef SDSUPPORT
// these pins are defined in the SD library if building with SD support
#define SCK_PIN 9
#define MISO_PIN 11
#define MOSI_PIN 10
#endif

// Microstepping pins
// Note that the pin mapping is not from fastio.h
// See Sd2PinMap.h for the pin configurations
#define X_MS1_PIN 25
#define X_MS2_PIN 26
#define Y_MS1_PIN 9
#define Y_MS2_PIN 8
#define Z_MS1_PIN 7
#define Z_MS2_PIN 6
#define E0_MS1_PIN 5
#define E0_MS2_PIN 4

#endif /* 88 */

/****************************************************************************************
*
*
****************************************************************************************/

#if MOTHERBOARD == 99
#define KNOWN_BOARD 1
Expand Down
23 changes: 19 additions & 4 deletions Marlin/stepper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,13 +1228,22 @@ void digipot_current(uint8_t driver, int current)

void microstep_init()
{
#if defined(X_MS1_PIN) && X_MS1_PIN > -1
const uint8_t microstep_modes[] = MICROSTEP_MODES;
pinMode(X_MS2_PIN,OUTPUT);

#if defined(E1_MS1_PIN) && E1_MS1_PIN > -1
pinMode(E1_MS1_PIN,OUTPUT);
pinMode(E1_MS2_PIN,OUTPUT);
#endif

#if defined(X_MS1_PIN) && X_MS1_PIN > -1
pinMode(X_MS1_PIN,OUTPUT);
pinMode(X_MS2_PIN,OUTPUT);
pinMode(Y_MS1_PIN,OUTPUT);
pinMode(Y_MS2_PIN,OUTPUT);
pinMode(Z_MS2_PIN,OUTPUT);
pinMode(Z_MS1_PIN,OUTPUT);
pinMode(Z_MS2_PIN,OUTPUT);
pinMode(E0_MS1_PIN,OUTPUT);
pinMode(E0_MS2_PIN,OUTPUT);
pinMode(E1_MS2_PIN,OUTPUT);
for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]);
#endif
}
Expand All @@ -1247,15 +1256,19 @@ void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2)
case 1: digitalWrite( Y_MS1_PIN,ms1); break;
case 2: digitalWrite( Z_MS1_PIN,ms1); break;
case 3: digitalWrite(E0_MS1_PIN,ms1); break;
#if defined(E1_MS1_PIN) && E1_MS1_PIN > -1
case 4: digitalWrite(E1_MS1_PIN,ms1); break;
#endif
}
if(ms2 > -1) switch(driver)
{
case 0: digitalWrite( X_MS2_PIN,ms2); break;
case 1: digitalWrite( Y_MS2_PIN,ms2); break;
case 2: digitalWrite( Z_MS2_PIN,ms2); break;
case 3: digitalWrite(E0_MS2_PIN,ms2); break;
#if defined(E1_MS2_PIN) && E1_MS2_PIN > -1
case 4: digitalWrite(E1_MS2_PIN,ms2); break;
#endif
}
}

Expand Down Expand Up @@ -1286,8 +1299,10 @@ void microstep_readings()
SERIAL_PROTOCOLPGM("E0: ");
SERIAL_PROTOCOL( digitalRead(E0_MS1_PIN));
SERIAL_PROTOCOLLN( digitalRead(E0_MS2_PIN));
#if defined(E1_MS1_PIN) && E1_MS1_PIN > -1
SERIAL_PROTOCOLPGM("E1: ");
SERIAL_PROTOCOL( digitalRead(E1_MS1_PIN));
SERIAL_PROTOCOLLN( digitalRead(E1_MS2_PIN));
#endif
}

4 changes: 2 additions & 2 deletions Marlin/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ void PID_autotune(float temp, int extruder, int ncycles)
Kp = 0.33*Ku;
Ki = Kp/Tu;
Kd = Kp*Tu/3;
SERIAL_PROTOCOLLNPGM(" Some overshoot ")
SERIAL_PROTOCOLLNPGM(" Some overshoot ");
SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp);
SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki);
SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd);
Kp = 0.2*Ku;
Ki = 2*Kp/Tu;
Kd = Kp*Tu/3;
SERIAL_PROTOCOLLNPGM(" No overshoot ")
SERIAL_PROTOCOLLNPGM(" No overshoot ");
SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(Kp);
SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(Ki);
SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(Kd);
Expand Down
35 changes: 35 additions & 0 deletions Marlin/thermistortables.h
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,41 @@ const short temptable_60[][2] PROGMEM = {
{1008*OVERSAMPLENR, 0},
};
#endif
#if (THERMISTORBED == 12)
//100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
const short temptable_12[][2] PROGMEM = {
{35*OVERSAMPLENR, 180}, //top rating 180C
{211*OVERSAMPLENR, 140},
{233*OVERSAMPLENR, 135},
{261*OVERSAMPLENR, 130},
{290*OVERSAMPLENR, 125},
{328*OVERSAMPLENR, 120},
{362*OVERSAMPLENR, 115},
{406*OVERSAMPLENR, 110},
{446*OVERSAMPLENR, 105},
{496*OVERSAMPLENR, 100},
{539*OVERSAMPLENR, 95},
{585*OVERSAMPLENR, 90},
{629*OVERSAMPLENR, 85},
{675*OVERSAMPLENR, 80},
{718*OVERSAMPLENR, 75},
{758*OVERSAMPLENR, 70},
{793*OVERSAMPLENR, 65},
{822*OVERSAMPLENR, 60},
{841*OVERSAMPLENR, 55},
{875*OVERSAMPLENR, 50},
{899*OVERSAMPLENR, 45},
{926*OVERSAMPLENR, 40},
{946*OVERSAMPLENR, 35},
{962*OVERSAMPLENR, 30},
{977*OVERSAMPLENR, 25},
{987*OVERSAMPLENR, 20},
{995*OVERSAMPLENR, 15},
{1001*OVERSAMPLENR, 10},
{1010*OVERSAMPLENR, 0},
{1023*OVERSAMPLENR, -40},
};
#endif

// Pt1000 and Pt100 handling
//
Expand Down

0 comments on commit ce76843

Please sign in to comment.