Commit bd2c245c authored by Simone Primarosa's avatar Simone Primarosa

Update 4.2.x

parent 305e2c45
//============================================================================
//==================== Change PIN width Configurator Tool ====================
//============================================================================
#ifndef CONFIGURATION_PINS_H
#define CONFIGURATION_PINS_H
//=========================== BASIC ==============================
//X axis pins
#define X_STEP_PIN ORIG_X_STEP_PIN
......@@ -59,10 +60,73 @@
//FAN pin
#define FAN_PIN ORIG_FAN_PIN
//=========================== START YOUR CHANGE ==============================
// Example for change X_MIN_PIN
// #undef X_MIN_PIN
// #define X_MIN_PIN newpin
//============================================================================
//=========================== FEATURE ==============================
#if ENABLED(MKR4)
#if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and two extruder
#define E0E1_CHOICE_PIN 5
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 3 extruder
#define E0E1_CHOICE_PIN 5
#define E0E2_CHOICE_PIN 6
#elif (EXTRUDERS == 4) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 4 extruder
#define E0E1_CHOICE_PIN 4
#define E0E2_CHOICE_PIN 5
#define E0E3_CHOICE_PIN 6
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 2) // Use this for two driver and 3 extruder
#define E0E2_CHOICE_PIN 5
#elif (EXTRUDERS == 4) && (DRIVER_EXTRUDERS == 2) // Use this for two driver and 4 extruder
#define E0E2_CHOICE_PIN 5
#define E1E3_CHOICE_PIN 6
#endif //EXTRUDERS
#endif //MKR4
#if ENABLED(NPR2)
#define E_MIN_PIN -1
#endif
#if ENABLED(LASERBEAM)
#define LASER_PWR_PIN 41
#define LASER_TTL_PIN 42
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FILRUNOUT_PIN -1
#endif
#if ENABLED(FILAMENT_SENSOR)
#define FILWIDTH_PIN -1 // ANALOG NUMBERING
#endif
#if ENABLED(POWER_CONSUMPTION)
#define POWER_CONSUMPTION_PIN -1 // ANALOG NUMBERING
#endif
#if ENABLED(PHOTOGRAPH)
#define PHOTOGRAPH_PIN -1
#endif
#if ENABLED(CHDK)
#define CHDK_PIN -1
#endif
#if ENABLED(CONTROLLERFAN)
#define CONTROLLERFAN_PIN -1
#endif
#if ENABLED(EXTRUDER_AUTO_FAN)
#define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#endif
#if ENABLED(X2_IS_TMC)
#define X2_ENABLE_PIN -1
#define X2_STEP_PIN -1
#define X2_DIR_PIN -1
#endif
//============================================================================
#endif
\ No newline at end of file
......@@ -38,22 +38,18 @@
// Uncomment to use Morgan scara mode
#define SCARA_SEGMENTS_PER_SECOND 200 // If movement is choppy try lowering this value
// Length of inner support arm
#define Linkage_1 150 //mm Preprocessor cannot handle decimal point...
#define LINKAGE_1 150 //mm Preprocessor cannot handle decimal point...
// Length of outer support arm Measure arm lengths precisely and enter
#define Linkage_2 150 //mm
#define LINKAGE_2 150 //mm
// SCARA tower offset (position of Tower relative to bed zero position)
// This needs to be reasonably accurate as it defines the printbed position in the SCARA space.
#define SCARA_offset_x 100 //mm
#define SCARA_offset_y -56 //mm
#define SCARA_OFFSET_X 100 //mm
#define SCARA_OFFSET_Y -56 //mm
#define SCARA_RAD2DEG 57.2957795 // to convert RAD to degrees
#define THETA_HOMING_OFFSET 0 //calculatated from Calibration Guide and command M360 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
#define PSI_HOMING_OFFSET 0 // calculatated from Calibration Guide and command M364 / M114 see picture in http://reprap.harleystudio.co.za/?page_id=1073
//some helper variables to make kinematics faster
#define L1_2 sq(Linkage_1) // do not change
#define L2_2 sq(Linkage_2) // do not change
/*****************************************************************************************/
......
......@@ -7498,18 +7498,18 @@ void plan_arc(
//ECHO_SMV(DB, "f_delta x=", f_scara[X_AXIS]);
//ECHO_MV(" y=", f_scara[Y_AXIS]);
x_sin = sin(f_scara[X_AXIS]/SCARA_RAD2DEG) * Linkage_1;
x_cos = cos(f_scara[X_AXIS]/SCARA_RAD2DEG) * Linkage_1;
y_sin = sin(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2;
y_cos = cos(f_scara[Y_AXIS]/SCARA_RAD2DEG) * Linkage_2;
x_sin = sin(f_scara[X_AXIS]/SCARA_RAD2DEG) * LINKAGE_1;
x_cos = cos(f_scara[X_AXIS]/SCARA_RAD2DEG) * LINKAGE_1;
y_sin = sin(f_scara[Y_AXIS]/SCARA_RAD2DEG) * LINKAGE_2;
y_cos = cos(f_scara[Y_AXIS]/SCARA_RAD2DEG) * LINKAGE_2;
//ECHO_MV(" x_sin=", x_sin);
//ECHO_MV(" x_cos=", x_cos);
//ECHO_MV(" y_sin=", y_sin);
//ECHO_MV(" y_cos=", y_cos);
delta[X_AXIS] = x_cos + y_cos + SCARA_offset_x; //theta
delta[Y_AXIS] = x_sin + y_sin + SCARA_offset_y; //theta+phi
delta[X_AXIS] = x_cos + y_cos + SCARA_OFFSET_X; //theta
delta[Y_AXIS] = x_sin + y_sin + SCARA_OFFSET_Y; //theta+phi
//ECHO_MV(" delta[X_AXIS]=", delta[X_AXIS]);
//ECHO_EMV(" delta[Y_AXIS]=", delta[Y_AXIS]);
......@@ -7523,19 +7523,19 @@ void plan_arc(
float SCARA_pos[2];
static float SCARA_C2, SCARA_S2, SCARA_K1, SCARA_K2, SCARA_theta, SCARA_psi;
SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_offset_x; //Translate SCARA to standard X Y
SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_offset_y; // With scaling factor.
SCARA_pos[X_AXIS] = cartesian[X_AXIS] * axis_scaling[X_AXIS] - SCARA_OFFSET_X; //Translate SCARA to standard X Y
SCARA_pos[Y_AXIS] = cartesian[Y_AXIS] * axis_scaling[Y_AXIS] - SCARA_OFFSET_Y; // With scaling factor.
#if (Linkage_1 == Linkage_2)
SCARA_C2 = ( ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) ) / (2 * (float)L1_2) ) - 1;
#if (LINKAGE_1 == LINKAGE_2)
SCARA_C2 = ( ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) ) / (2 * (float)sq(LINKAGE_1)) ) - 1;
#else
SCARA_C2 = ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) - (float)L1_2 - (float)L2_2 ) / 45000;
SCARA_C2 = ( sq(SCARA_pos[X_AXIS]) + sq(SCARA_pos[Y_AXIS]) - (float)sq(LINKAGE_1) - (float)sq(LINKAGE_2) ) / 45000;
#endif
SCARA_S2 = sqrt( 1 - sq(SCARA_C2) );
SCARA_K1 = Linkage_1 + Linkage_2 * SCARA_C2;
SCARA_K2 = Linkage_2 * SCARA_S2;
SCARA_K1 = LINKAGE_1 + LINKAGE_2 * SCARA_C2;
SCARA_K2 = LINKAGE_2 * SCARA_S2;
SCARA_theta = ( atan2(SCARA_pos[X_AXIS],SCARA_pos[Y_AXIS])-atan2(SCARA_K1, SCARA_K2) ) * -1;
SCARA_psi = atan2(SCARA_S2,SCARA_C2);
......
......@@ -623,7 +623,7 @@
#define HAS_E0E4 (PIN_EXISTS(E0E4_CHOICE))
#define HAS_E1E3 (PIN_EXISTS(E1E3_CHOICE))
#define HAS_BTN_BACK (PIN_EXISTS(BTN_BACK))
#define HAS_POWER_SWITCH (POWER_SUPPLY > 0 && PIN_EXISTS(PS_ON))
#define HAS_DIGIPOTSS (DIGIPOTSS_PIN >= 0)
......
......@@ -257,6 +257,8 @@
#include "thermistortables.h"
#include "conditionals.h"
#include "sanitycheck.h"
#include "pins.h"
#include "dependencies.h"
#include "conflicts.h"
/***********************************************************************/
#endif //__CONFIGURATION_H
......@@ -5217,12 +5217,6 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#endif
/****************************************************************************************/
/****************************************************************************************
************************************* FEATURE *******************************************
****************************************************************************************/
#if HOTENDS == 1
#undef ORIG_HEATER_1_PIN
#undef ORIG_HEATER_2_PIN
......@@ -5252,67 +5246,9 @@ DaveX plan for Teensylu/printrboard-type pinouts (ref teensylu & sprinter) for a
#define ORIG_TEMP_3_PIN -1
#endif
#if ENABLED(MKR4)
#if (EXTRUDERS == 2) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and two extruder
#define E0E1_CHOICE_PIN 5
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 3 extruder
#define E0E1_CHOICE_PIN 5
#define E0E2_CHOICE_PIN 6
#elif (EXTRUDERS == 4) && (DRIVER_EXTRUDERS == 1) // Use this for one driver and 4 extruder
#define E0E1_CHOICE_PIN 4
#define E0E2_CHOICE_PIN 5
#define E0E3_CHOICE_PIN 6
#elif (EXTRUDERS == 3) && (DRIVER_EXTRUDERS == 2) // Use this for two driver and 3 extruder
#define E0E2_CHOICE_PIN 5
#elif (EXTRUDERS == 4) && (DRIVER_EXTRUDERS == 2) // Use this for two driver and 4 extruder
#define E0E2_CHOICE_PIN 5
#define E1E3_CHOICE_PIN 6
#endif //EXTRUDERS
#endif //MKR4
#if ENABLED(NPR2)
#define E_MIN_PIN -1
#endif
#if ENABLED(LASERBEAM)
#define LASER_PWR_PIN 41
#define LASER_TTL_PIN 42
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FILRUNOUT_PIN -1
#endif
#if ENABLED(FILAMENT_SENSOR)
#define FILWIDTH_PIN -1 // ANALOG NUMBERING
#endif
#if ENABLED(POWER_CONSUMPTION)
#define POWER_CONSUMPTION_PIN -1 // ANALOG NUMBERING
#endif
#if ENABLED(PHOTOGRAPH)
#define PHOTOGRAPH_PIN -1
#endif
#if ENABLED(CHDK)
#define CHDK_PIN -1
#endif
#if ENABLED(CONTROLLERFAN)
#define CONTROLLERFAN_PIN -1
#endif
#if ENABLED(EXTRUDER_AUTO_FAN)
#define EXTRUDER_0_AUTO_FAN_PIN -1
#define EXTRUDER_1_AUTO_FAN_PIN -1
#define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#endif
/****************************************************************************************/
#include "pins2tool.h"
#include "Configuration_Pins.h"
/****************************************************************************************/
//List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN, analogInputToDigitalPin(TEMP_0_PIN),
......
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