Commit 05976ad2 authored by MagoKimbra's avatar MagoKimbra

Add printer CNC LASER

parent 7b686baf
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
//#define COREXY //#define COREXY
//#define DELTA //#define DELTA
//#define SCARA //#define SCARA
//#define CNCLASER
#if defined(CARTESIAN) #if defined(CARTESIAN)
#include "Configuration_Cartesian.h" #include "Configuration_Cartesian.h"
...@@ -57,6 +58,8 @@ ...@@ -57,6 +58,8 @@
#include "Configuration_Delta.h" #include "Configuration_Delta.h"
#elif defined(SCARA) #elif defined(SCARA)
#include "Configuration_Scara.h" #include "Configuration_Scara.h"
#elif defined(CNCLASER)
#include "Configuration_CNC_laser.h"
#endif #endif
/***********************************************************************/ /***********************************************************************/
...@@ -109,8 +112,6 @@ ...@@ -109,8 +112,6 @@
#define MOTHERBOARD 33 #define MOTHERBOARD 33
#endif #endif
// This defines the number of Driver extruders
#define DRIVER_EXTRUDERS 1
// This defines the number of extruder real or virtual // This defines the number of extruder real or virtual
#define EXTRUDERS 1 #define EXTRUDERS 1
...@@ -132,10 +133,13 @@ ...@@ -132,10 +133,13 @@
//#define MKR4 //#define MKR4
#ifdef MKR4 #ifdef MKR4
#define DELAY_R 500 // Delay for switch rele #define DELAY_R 500 // Delay for switch rele
#define DRIVER_EXTRUDERS 1 // This defines the number of Driver extruders
#endif // END MKR4 #endif // END MKR4
//********************************************************************** //**********************************************************************
#if !defined(MKR4)
#define DRIVER_EXTRUDERS EXTRUDERS // This defines the number of Driver extruders
#endif
// Setting firmware for FILAMENT END SWITCH // Setting firmware for FILAMENT END SWITCH
// #define FILAMENT_END_SWITCH // #define FILAMENT_END_SWITCH
......
...@@ -44,6 +44,8 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) ...@@ -44,6 +44,8 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
#define EEPROM_VERSION "V12" #define EEPROM_VERSION "V12"
#elif defined(SCARA) #elif defined(SCARA)
#define EEPROM_VERSION "V13" #define EEPROM_VERSION "V13"
#elif defined(CNCLASER)
#define EEPROM_VERSION "V14"
#endif #endif
#ifdef EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
......
This diff is collapsed.
...@@ -89,6 +89,8 @@ ...@@ -89,6 +89,8 @@
// M Codes // M Codes
// M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) // M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
// M1 - Same as M0 // M1 - Same as M0
// M03 - Put S<value> in laser beam control
// M05 - Turn off laser beam
// M17 - Enable/Power all stepper motors // M17 - Enable/Power all stepper motors
// M18 - Disable all stepper motors; same as M84 // M18 - Disable all stepper motors; same as M84
// M20 - List SD card // M20 - List SD card
...@@ -209,10 +211,6 @@ CardReader card; ...@@ -209,10 +211,6 @@ CardReader card;
float homing_feedrate[] = HOMING_FEEDRATE; float homing_feedrate[] = HOMING_FEEDRATE;
bool axis_known_position[3] = {false, false, false}; bool axis_known_position[3] = {false, false, false};
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA)
float zprobe_zoffset;
#endif
#ifdef DELTA #ifdef DELTA
float probing_feedrate = PROBING_FEEDRATE; float probing_feedrate = PROBING_FEEDRATE;
float default_z_probe_offset[] = Z_PROBE_OFFSET; float default_z_probe_offset[] = Z_PROBE_OFFSET;
...@@ -221,7 +219,9 @@ float z_probe_deploy_start_location[] = Z_PROBE_DEPLOY_START_LOCATION; ...@@ -221,7 +219,9 @@ float z_probe_deploy_start_location[] = Z_PROBE_DEPLOY_START_LOCATION;
float z_probe_deploy_end_location[] = Z_PROBE_DEPLOY_END_LOCATION; float z_probe_deploy_end_location[] = Z_PROBE_DEPLOY_END_LOCATION;
float z_probe_retract_start_location[] = Z_PROBE_RETRACT_START_LOCATION; float z_probe_retract_start_location[] = Z_PROBE_RETRACT_START_LOCATION;
float z_probe_retract_end_location[] = Z_PROBE_RETRACT_END_LOCATION; float z_probe_retract_end_location[] = Z_PROBE_RETRACT_END_LOCATION;
#endif // Delta #else // No Delta
float zprobe_zoffset;
#endif // No Delta
bool axis_relative_modes[] = AXIS_RELATIVE_MODES; bool axis_relative_modes[] = AXIS_RELATIVE_MODES;
int feedmultiply=100; //100->1 200->2 int feedmultiply=100; //100->1 200->2
...@@ -387,10 +387,6 @@ static float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0}; ...@@ -387,10 +387,6 @@ static float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0};
static float offset[3] = {0.0, 0.0, 0.0}; static float offset[3] = {0.0, 0.0, 0.0};
static bool home_all_axis = true; static bool home_all_axis = true;
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA)
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
#endif
#ifdef DELTA #ifdef DELTA
const float SIN_60 = 0.8660254037844386; const float SIN_60 = 0.8660254037844386;
const float COS_60 = 0.5; const float COS_60 = 0.5;
...@@ -408,7 +404,9 @@ static float bed_level_x, bed_level_y, bed_level_z; ...@@ -408,7 +404,9 @@ static float bed_level_x, bed_level_y, bed_level_z;
static float bed_level_c = 20; //used for inital bed probe safe distance (to avoid crashing into bed) static float bed_level_c = 20; //used for inital bed probe safe distance (to avoid crashing into bed)
static float bed_level_ox, bed_level_oy, bed_level_oz; static float bed_level_ox, bed_level_oy, bed_level_oz;
static int loopcount; static int loopcount;
#endif // DELTA #else // No DELTA
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
#endif // No DELTA
static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0; static long gcode_N, gcode_LastN, Stopped_gcode_LastN = 0;
static bool relative_mode = false; //Determines Absolute or Relative Coordinates static bool relative_mode = false; //Determines Absolute or Relative Coordinates
...@@ -661,6 +659,10 @@ void setup() ...@@ -661,6 +659,10 @@ void setup()
#if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1 #if defined(PHOTOGRAPH_PIN) && PHOTOGRAPH_PIN > -1
setup_photpin(); setup_photpin();
#endif #endif
#if defined(LASERBEAM_PIN) && LASERBEAM_PIN > -1
pinMode(LASERBEAM_PIN, OUTPUT);
digitalWrite(LASERBEAM_PIN, LOW); // turn it off
#endif
#if defined(NUM_SERVOS) #if defined(NUM_SERVOS)
servo_init(); servo_init();
#endif #endif
...@@ -938,7 +940,7 @@ static inline type array(int axis) \ ...@@ -938,7 +940,7 @@ static inline type array(int axis) \
{ return pgm_read_any(&array##_P[axis]); } { return pgm_read_any(&array##_P[axis]); }
XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS); XYZ_CONSTS_FROM_CONFIG(float, base_min_pos, MIN_POS);
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA) #if defined(CARTESIAN) || defined(COREXY) || defined(SCARA) || defined(CNCLASER)
XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS); XYZ_CONSTS_FROM_CONFIG(float, base_max_pos, MAX_POS);
XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS); XYZ_CONSTS_FROM_CONFIG(float, base_home_pos, HOME_POS);
XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH); XYZ_CONSTS_FROM_CONFIG(float, max_length, MAX_LENGTH);
...@@ -985,7 +987,7 @@ static float duplicate_extruder_temp_offset = 0; // used in mode 2 ...@@ -985,7 +987,7 @@ static float duplicate_extruder_temp_offset = 0; // used in mode 2
bool extruder_duplication_enabled = false; // used in mode 2 bool extruder_duplication_enabled = false; // used in mode 2
#endif //DUAL_X_CARRIAGE #endif //DUAL_X_CARRIAGE
#if defined(CARTESIAN) || defined(COREXY) || defined(SCARA) #if defined(CARTESIAN) || defined(COREXY) || defined(SCARA) || defined(CNCLASER)
static void axis_is_at_home(int axis) { static void axis_is_at_home(int axis) {
#ifdef DUAL_X_CARRIAGE #ifdef DUAL_X_CARRIAGE
if (axis == X_AXIS) { if (axis == X_AXIS) {
...@@ -2947,6 +2949,20 @@ void process_commands() ...@@ -2947,6 +2949,20 @@ void process_commands()
} }
break; break;
#endif #endif
#ifdef CNCLASER
case 03: // M03 S - Setting laser beam
{
if(code_seen('S')) {
digitalWrite(LASERBEAM_PIN, code_value());
}
}
break;
case 05: // M05 - Setting laser beam off
digitalWrite(LASERBEAM_PIN, 0);
break;
#endif // CNCLASER
case 17: case 17:
LCD_MESSAGEPGM(MSG_NO_MOVE); LCD_MESSAGEPGM(MSG_NO_MOVE);
enable_x(); enable_x();
......
...@@ -2920,6 +2920,10 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a ...@@ -2920,6 +2920,10 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif // END DELTA #endif // END DELTA
#endif // END NPR2 #endif // END NPR2
#ifdef CNCLASER
#define LASERBEAM_PIN 6
#endif
#ifdef FILAMENT_END_SWITCH #ifdef FILAMENT_END_SWITCH
#define PAUSE_PIN 5 #define PAUSE_PIN 5
#endif #endif
......
...@@ -73,6 +73,7 @@ I put in a single firmware all the firmware that I found online for the various ...@@ -73,6 +73,7 @@ I put in a single firmware all the firmware that I found online for the various
* \#define COREXY * \#define COREXY
* \#define DELTA * \#define DELTA
* \#define SCARA * \#define SCARA
* \#define CNCLASER
Different axis step per unit for all extruder Different axis step per unit for all extruder
----------------- -----------------
...@@ -131,6 +132,8 @@ Implemented G Codes: ...@@ -131,6 +132,8 @@ Implemented G Codes:
M Codes M Codes
* M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled) * M0 - Unconditional stop - Wait for user to press a button on the LCD (Only if ULTRA_LCD is enabled)
* M1 - Same as M0 * M1 - Same as M0
* M03 - Put S<value> in laser beam control
* M05 - Turn off laser beam
* M17 - Enable/Power all stepper motors * M17 - Enable/Power all stepper motors
* M18 - Disable all stepper motors; same as M84 * M18 - Disable all stepper motors; same as M84
* M20 - List SD card * M20 - List SD card
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment