Splotbot firmware
This commit is contained in:
parent
67199da509
commit
465520c1ea
3 changed files with 132 additions and 14 deletions
|
|
@ -13,7 +13,7 @@
|
||||||
// Gen 3 Plus = 21
|
// Gen 3 Plus = 21
|
||||||
// gen 3 Monolithic Electronics = 22
|
// gen 3 Monolithic Electronics = 22
|
||||||
// Gen3 PLUS for TechZone Gen3 Remix Motherboard = 23
|
// Gen3 PLUS for TechZone Gen3 Remix Motherboard = 23
|
||||||
#define MOTHERBOARD 3
|
#define MOTHERBOARD 31
|
||||||
|
|
||||||
//// Thermistor settings:
|
//// Thermistor settings:
|
||||||
// 1 is 100k thermistor
|
// 1 is 100k thermistor
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "pins.h"
|
#include "pins.h"
|
||||||
#include "Sprinter.h"
|
#include "Sprinter.h"
|
||||||
|
#define SERVO 1
|
||||||
#ifdef SDSUPPORT
|
#ifdef SDSUPPORT
|
||||||
#include "SdFat.h"
|
#include "SdFat.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -202,7 +202,11 @@ unsigned long stepper_inactive_time = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SERVO
|
||||||
|
#define SERVOCOUNT 13
|
||||||
|
#include <Servo.h>
|
||||||
|
static Servo servos[SERVOCOUNT];
|
||||||
|
#endif
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(BAUDRATE);
|
Serial.begin(BAUDRATE);
|
||||||
|
|
@ -364,6 +368,28 @@ void setup()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef SERVO
|
||||||
|
servos[0].attach(23);
|
||||||
|
servos[1].attach(25);
|
||||||
|
servos[2].attach(27);
|
||||||
|
servos[3].attach(29);
|
||||||
|
servos[4].attach(31);
|
||||||
|
servos[5].attach(33);
|
||||||
|
servos[6].attach(35);
|
||||||
|
servos[7].attach(37);
|
||||||
|
servos[8].attach(39);
|
||||||
|
servos[9].attach(41);
|
||||||
|
servos[10].attach(43);
|
||||||
|
servos[11].attach(45);
|
||||||
|
servos[12].attach(47);
|
||||||
|
int i;
|
||||||
|
for(i=0;i<12;++i)
|
||||||
|
servos[i].write(180);
|
||||||
|
servos[12].write(90);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -771,6 +797,23 @@ inline void process_commands()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef SERVO
|
||||||
|
case 43:
|
||||||
|
if (code_seen('S'))
|
||||||
|
{
|
||||||
|
int pin_status = code_value();
|
||||||
|
if (code_seen('P') && pin_status >= 0 && pin_status <= 180)
|
||||||
|
{
|
||||||
|
|
||||||
|
int pin_number = code_value();
|
||||||
|
if (pin_number > -1 && pin_number<SERVOCOUNT)
|
||||||
|
{
|
||||||
|
servos[pin_number].write(pin_status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case 104: // M104
|
case 104: // M104
|
||||||
if (code_seen('S')) target_raw = temp2analogh(target_temp = code_value());
|
if (code_seen('S')) target_raw = temp2analogh(target_temp = code_value());
|
||||||
#ifdef WATCHPERIOD
|
#ifdef WATCHPERIOD
|
||||||
|
|
@ -1110,10 +1153,11 @@ inline void linear_move(unsigned long axis_steps_remaining[]) // make linear mov
|
||||||
else WRITE(X_DIR_PIN,INVERT_X_DIR);
|
else WRITE(X_DIR_PIN,INVERT_X_DIR);
|
||||||
if (destination[1] > current_position[1]) WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
|
if (destination[1] > current_position[1]) WRITE(Y_DIR_PIN,!INVERT_Y_DIR);
|
||||||
else WRITE(Y_DIR_PIN,INVERT_Y_DIR);
|
else WRITE(Y_DIR_PIN,INVERT_Y_DIR);
|
||||||
if (destination[2] > current_position[2]) WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
|
/* if (destination[2] > current_position[2]) WRITE(Z_DIR_PIN,!INVERT_Z_DIR);
|
||||||
else WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
else WRITE(Z_DIR_PIN,INVERT_Z_DIR);
|
||||||
if (destination[3] > current_position[3]) WRITE(E_DIR_PIN,!INVERT_E_DIR);
|
if (destination[3] > current_position[3]) WRITE(E_DIR_PIN,!INVERT_E_DIR);
|
||||||
else WRITE(E_DIR_PIN,INVERT_E_DIR);
|
else WRITE(E_DIR_PIN,INVERT_E_DIR);
|
||||||
|
*/
|
||||||
movereset:
|
movereset:
|
||||||
#if (X_MIN_PIN > -1)
|
#if (X_MIN_PIN > -1)
|
||||||
if(!move_direction[0]) if(READ(X_MIN_PIN) != X_ENDSTOP_INVERT) axis_steps_remaining[0]=0;
|
if(!move_direction[0]) if(READ(X_MIN_PIN) != X_ENDSTOP_INVERT) axis_steps_remaining[0]=0;
|
||||||
|
|
@ -1376,17 +1420,17 @@ void do_step(int axis) {
|
||||||
WRITE(Y_STEP_PIN, HIGH);
|
WRITE(Y_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
WRITE(Z_STEP_PIN, HIGH);
|
// WRITE(Z_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
WRITE(E_STEP_PIN, HIGH);
|
// WRITE(E_STEP_PIN, HIGH);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
steps_taken[axis]+=1;
|
steps_taken[axis]+=1;
|
||||||
WRITE(X_STEP_PIN, LOW);
|
WRITE(X_STEP_PIN, LOW);
|
||||||
WRITE(Y_STEP_PIN, LOW);
|
WRITE(Y_STEP_PIN, LOW);
|
||||||
WRITE(Z_STEP_PIN, LOW);
|
// WRITE(Z_STEP_PIN, LOW);
|
||||||
WRITE(E_STEP_PIN, LOW);
|
// WRITE(E_STEP_PIN, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HEAT_INTERVAL 250
|
#define HEAT_INTERVAL 250
|
||||||
|
|
@ -1552,16 +1596,16 @@ void manage_heater()
|
||||||
#else
|
#else
|
||||||
if(current_raw >= target_raw)
|
if(current_raw >= target_raw)
|
||||||
{
|
{
|
||||||
WRITE(HEATER_0_PIN,LOW);
|
//WRITE(HEATER_0_PIN,LOW);
|
||||||
analogWrite(HEATER_0_PIN, 0);
|
//analogWrite(HEATER_0_PIN, 0);
|
||||||
#if LED_PIN>-1
|
#if LED_PIN>-1
|
||||||
WRITE(LED_PIN,LOW);
|
WRITE(LED_PIN,LOW);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WRITE(HEATER_0_PIN,HIGH);
|
//WRITE(HEATER_0_PIN,HIGH);
|
||||||
analogWrite(HEATER_0_PIN, HEATER_CURRENT);
|
//analogWrite(HEATER_0_PIN, HEATER_CURRENT);
|
||||||
#if LED_PIN > -1
|
#if LED_PIN > -1
|
||||||
WRITE(LED_PIN,HIGH);
|
WRITE(LED_PIN,HIGH);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1695,11 +1739,11 @@ inline void kill()
|
||||||
{
|
{
|
||||||
#if TEMP_0_PIN > -1
|
#if TEMP_0_PIN > -1
|
||||||
target_raw=0;
|
target_raw=0;
|
||||||
WRITE(HEATER_0_PIN,LOW);
|
// WRITE(HEATER_0_PIN,LOW);
|
||||||
#endif
|
#endif
|
||||||
#if TEMP_1_PIN > -1
|
#if TEMP_1_PIN > -1
|
||||||
target_bed_raw=0;
|
target_bed_raw=0;
|
||||||
if(HEATER_1_PIN > -1) WRITE(HEATER_1_PIN,LOW);
|
//if(HEATER_1_PIN > -1) WRITE(HEATER_1_PIN,LOW);
|
||||||
#endif
|
#endif
|
||||||
disable_x();
|
disable_x();
|
||||||
disable_y();
|
disable_y();
|
||||||
|
|
|
||||||
|
|
@ -516,6 +516,80 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************************
|
||||||
|
* Splotbot pin assignment
|
||||||
|
*
|
||||||
|
****************************************************************************************/
|
||||||
|
|
||||||
|
#if MOTHERBOARD == 31
|
||||||
|
#define KNOWN_BOARD 1
|
||||||
|
|
||||||
|
//////////////////FIX THIS//////////////
|
||||||
|
#ifndef __AVR_ATmega1280__
|
||||||
|
#ifndef __AVR_ATmega2560__
|
||||||
|
#error Oops! Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// uncomment one of the following lines for RAMPS v1.3 or v1.0, comment both for v1.2 or 1.1
|
||||||
|
// #define RAMPS_V_1_3
|
||||||
|
// #define RAMPS_V_1_0
|
||||||
|
|
||||||
|
|
||||||
|
#define X_STEP_PIN 17//20
|
||||||
|
#define X_DIR_PIN 18//21
|
||||||
|
#define X_ENABLE_PIN 16//19
|
||||||
|
#define X_MIN_PIN 2
|
||||||
|
#define X_MAX_PIN -1 //2 //Max endstops default to disabled "-1", set to commented value to enable.
|
||||||
|
|
||||||
|
#define Y_STEP_PIN 20//17
|
||||||
|
#define Y_DIR_PIN 21//18
|
||||||
|
#define Y_ENABLE_PIN 19//16
|
||||||
|
#define Y_MIN_PIN 44
|
||||||
|
#define Y_MAX_PIN -1 //15
|
||||||
|
|
||||||
|
#define Z_STEP_PIN -1
|
||||||
|
#define Z_DIR_PIN -1
|
||||||
|
#define Z_ENABLE_PIN -1
|
||||||
|
#define Z_MIN_PIN -1
|
||||||
|
#define Z_MAX_PIN -1 //19
|
||||||
|
|
||||||
|
#define E_STEP_PIN -1
|
||||||
|
#define E_DIR_PIN -1
|
||||||
|
#define E_ENABLE_PIN -1
|
||||||
|
|
||||||
|
#define E_1_STEP_PIN -1
|
||||||
|
#define E_1_DIR_PIN -1
|
||||||
|
#define E_1_ENABLE_PIN -1
|
||||||
|
|
||||||
|
#define SDPOWER -1
|
||||||
|
#define SDSS -1
|
||||||
|
#define LED_PIN 13
|
||||||
|
#define FAN_PIN -1
|
||||||
|
#define PS_ON_PIN -1
|
||||||
|
#define KILL_PIN -1
|
||||||
|
#define ALARM_PIN -1
|
||||||
|
|
||||||
|
#define HEATER_0_PIN -1
|
||||||
|
#define HEATER_1_PIN -1
|
||||||
|
#define TEMP_0_PIN 0 // ANALOG NUMBERING
|
||||||
|
#define TEMP_1_PIN -1 // ANALOG NUMBERING
|
||||||
|
#define TEMP_2_PIN -1 // ANALOG NUMBERING
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef SDSUPPORT
|
||||||
|
// these pins are defined in the SD library if building with SD support
|
||||||
|
#define SCK_PIN -1
|
||||||
|
#define MISO_PIN -1
|
||||||
|
#define MOSI_PIN -1
|
||||||
|
#define MAX6675_SS -1
|
||||||
|
#else
|
||||||
|
#define MAX6675_SS -1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
* Duemilanove w/ ATMega328P pin assignment
|
* Duemilanove w/ ATMega328P pin assignment
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue