Commit 915f0239 authored by MagoKimbra's avatar MagoKimbra

Fix

parent 11ff6f80
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// User-specified version info of this build to display in [Pronterface, etc] terminal window during // User-specified version info of this build to display in [Pronterface, etc] terminal window during
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware. // build by the user have been successfully uploaded into firmware.
#define STRING_VERSION_CONFIG_H __DATE__ " 28/11/2014 " __TIME__ // build date and time #define STRING_VERSION_CONFIG_H __DATE__ " 08/12/2014 " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(MagoKimbra: magokimbra@hotmail.com, Version 4.0)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "(MagoKimbra: magokimbra@hotmail.com, Version 4.0)" // Who made the changes.
// SERIAL_PORT selects which serial port should be used for communication with the host. // SERIAL_PORT selects which serial port should be used for communication with the host.
...@@ -13,35 +13,18 @@ ...@@ -13,35 +13,18 @@
#define SERIAL_PORT 0 #define SERIAL_PORT 0
// This determines the communication speed of the printer // This determines the communication speed of the printer
// 115200 - 250000
#define BAUDRATE 115200 #define BAUDRATE 115200
//#define BAUDRATE 250000
// This enables the serial port associated to the Bluetooth interface // This enables the serial port associated to the Bluetooth interface
//#define BTENABLED // Enable BT interface on AT90USB devices //#define BTENABLED // Enable BT interface on AT90USB devices
/***********************************************************************\
****************** Firmware Marlin by MagoKimbra **********************\
***********************************************************************\
* Supporto quattro estrusori normali (con quattro Hotend, Marlin si ferma a tre)
* Quattro estrusori normali (4 driver) con singolo Hotend.
* Due estrusori con un driver (richiede blocco relè).
* Quattro estrusori con due driver (richiede blocco relè).
* Menù LCD per preriscaldamento GOMMA (o terzo tipo di materiale).
* Autobed level ripetibile per check meccanica comando M49.
* Autobed level con posizionamento dinamico della sonda.
* Add command G60, memory actual position.
* Add command G61 move x y z to memory position.
* Switch pause per mettere in pausa con uno switch esterno, tipo controllo filo finito o altro.
* Step per unit per singolo estrusore
* Deinizione configuration per tipo di stampante (Cartesian, Corexy, Delta, Scara)
*
*/
// This configuration file contains the basic settings. // This configuration file contains the basic settings.
// Advanced settings can be found in Configuration_adv.h // Advanced settings can be found in Configuration_adv.h
// BASIC SETTINGS: select your board type, temperature sensor type, axis scaling, and endstop configuration // BASIC SETTINGS: select your board type, temperature sensor type
// MECHANISM SETTING: Select your type printer and put it in file associated
// If you want test the firmware uncomment below. The command for run test is M998. Use Serial arduino monitor... // If you want test the firmware uncomment below. Use Serial arduino monitor...
//#define FIRMWARE_TEST //#define FIRMWARE_TEST
#ifdef FIRMWARE_TEST #ifdef FIRMWARE_TEST
#undef BAUDRATE #undef BAUDRATE
...@@ -120,8 +103,9 @@ ...@@ -120,8 +103,9 @@
// This defines the number of extruder real or virtual // This defines the number of extruder real or virtual
#define EXTRUDERS 1 #define EXTRUDERS 1
//This is used for singlenozzled multiple extrusion configuration
// Uncomment below to enable SINGLENOZZLE (One Hotend) // Uncomment below to enable SINGLENOZZLE (One Hotend)
//#define SINGLENOZZLE //This is used for singlenozzled multiple extrusion configuration //#define SINGLENOZZLE
/*********************************************************************** /***********************************************************************
*********************** Multiextruder MKR4 *************************** *********************** Multiextruder MKR4 ***************************
...@@ -148,11 +132,12 @@ ...@@ -148,11 +132,12 @@
// Setting firmware for FILAMENT END SWITCH // Setting firmware for FILAMENT END SWITCH
// #define FILAMENT_END_SWITCH // #define FILAMENT_END_SWITCH
//// The following define selects which power supply you have. Please choose the one that matches your setup // The following define selects which power supply you have. Please choose the one that matches your setup
// 0 = Normal power
// 1 = ATX // 1 = ATX
// 2 = X-Box 360 203Watts (the blue wire connected to PS_ON and the red wire to VCC) // 2 = X-Box 360 203 Watts (the blue wire connected to PS_ON and the red wire to VCC)
#define POWER_SUPPLY 1 #define POWER_SUPPLY 0
// Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it. // Define this to have the electronics keep the power supply off on startup. If you don't know what this is leave it.
// #define PS_DEFAULT_OFF // #define PS_DEFAULT_OFF
...@@ -180,7 +165,7 @@ ...@@ -180,7 +165,7 @@
* 10 is 100k RS thermistor 198-961 (4.7k pullup) * 10 is 100k RS thermistor 198-961 (4.7k pullup)
* 11 is 100k beta 3950 1% thermistor (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) * 12 is 100k 0603 SMD Vishay NTCS0603E3104FXT (4.7k pullup) (calibrated for Makibox hot bed)
* 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE" * 13 is 100k Hisens 3950 1% up to 300°C for hotend "Simple ONE " & "Hotend "All In ONE"
* 20 is the PT100 circuit found in the Ultimainboard V2.x * 20 is the PT100 circuit found in the Ultimainboard V2.x
* 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950 * 60 is 100k Maker's Tool Works Kapton Bed Thermistor beta=3950
* *
...@@ -572,6 +557,9 @@ ...@@ -572,6 +557,9 @@
// SF send wrong arc g-codes when using Arc Point as fillet procedure // SF send wrong arc g-codes when using Arc Point as fillet procedure
//#define SF_ARC_FIX //#define SF_ARC_FIX
// Support for STEPPERS TOSHIBA
//#define CONFIG_STEPPERS_TOSHIBA 1
// Support for the BariCUDA Paste Extruder. // Support for the BariCUDA Paste Extruder.
//#define BARICUDA //#define BARICUDA
......
...@@ -89,10 +89,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o ...@@ -89,10 +89,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS) #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
// set the rectangle in which to probe in manual or automatic // set the rectangle in which to probe in manual or automatic
#define LEFT_PROBE_BED_POSITION 15 #define LEFT_PROBE_BED_POSITION 20
#define RIGHT_PROBE_BED_POSITION 185 #define RIGHT_PROBE_BED_POSITION 180
#define BACK_PROBE_BED_POSITION 185 #define BACK_PROBE_BED_POSITION 180
#define FRONT_PROBE_BED_POSITION 15 #define FRONT_PROBE_BED_POSITION 20
#define XY_TRAVEL_SPEED 10000 // X and Y axis travel speed between probes, in mm/min #define XY_TRAVEL_SPEED 10000 // X and Y axis travel speed between probes, in mm/min
...@@ -142,7 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o ...@@ -142,7 +142,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe) // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
#define X_PROBE_OFFSET_FROM_EXTRUDER 0 #define X_PROBE_OFFSET_FROM_EXTRUDER 0
#define Y_PROBE_OFFSET_FROM_EXTRUDER 20 #define Y_PROBE_OFFSET_FROM_EXTRUDER 20
#define Z_PROBE_OFFSET_FROM_EXTRUDER -3.10 #define Z_PROBE_OFFSET_FROM_EXTRUDER -3.70
#define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance. #define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case // Be sure you have this distance over your Z_MAX_POS in case
...@@ -247,4 +247,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o ...@@ -247,4 +247,4 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500. // Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.
// //
//#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1 //#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1
//#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 70,0} // X,Y,Z Axis Extend and Retract angles //#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 90,0} // X,Y,Z Axis Extend and Retract angles
...@@ -372,12 +372,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st ...@@ -372,12 +372,12 @@ const unsigned int dropsegments=5; //everything with less than this number of st
#endif #endif
// Power Signal Control Definitions // Power Signal Control Definitions
// By default use ATX definition // By default use Normal definition
#ifndef POWER_SUPPLY #ifndef POWER_SUPPLY
#define POWER_SUPPLY 1 #define POWER_SUPPLY 0
#endif #endif
// 1 = ATX // 0 = Normal - 1 = ATX
#if (POWER_SUPPLY == 1) #if (POWER_SUPPLY <= 1)
#define PS_ON_AWAKE LOW #define PS_ON_AWAKE LOW
#define PS_ON_ASLEEP HIGH #define PS_ON_ASLEEP HIGH
#endif #endif
......
...@@ -1159,11 +1159,16 @@ static void run_z_probe() { ...@@ -1159,11 +1159,16 @@ static void run_z_probe() {
static void do_blocking_move_to(float x, float y, float z) { static void do_blocking_move_to(float x, float y, float z) {
float oldFeedRate = feedrate; float oldFeedRate = feedrate;
feedrate = homing_feedrate[Z_AXIS];
current_position[Z_AXIS] = z;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
st_synchronize();
feedrate = XY_TRAVEL_SPEED; feedrate = XY_TRAVEL_SPEED;
current_position[X_AXIS] = x; current_position[X_AXIS] = x;
current_position[Y_AXIS] = y; current_position[Y_AXIS] = y;
current_position[Z_AXIS] = z;
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver); plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], feedrate/60, active_extruder, active_driver);
st_synchronize(); st_synchronize();
...@@ -3793,7 +3798,7 @@ Sigma_Exit: ...@@ -3793,7 +3798,7 @@ Sigma_Exit:
#endif //HEATER_2_PIN #endif //HEATER_2_PIN
#endif #endif
#if defined(PS_ON_PIN) && PS_ON_PIN > -1 #if defined(POWER_SUPPLY) && POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN > -1
case 80: // M80 - Turn on Power Supply case 80: // M80 - Turn on Power Supply
SET_OUTPUT(PS_ON_PIN); //GND SET_OUTPUT(PS_ON_PIN); //GND
WRITE(PS_ON_PIN, PS_ON_AWAKE); WRITE(PS_ON_PIN, PS_ON_AWAKE);
...@@ -3804,15 +3809,15 @@ Sigma_Exit: ...@@ -3804,15 +3809,15 @@ Sigma_Exit:
#if defined SUICIDE_PIN && SUICIDE_PIN > -1 #if defined SUICIDE_PIN && SUICIDE_PIN > -1
SET_OUTPUT(SUICIDE_PIN); SET_OUTPUT(SUICIDE_PIN);
WRITE(SUICIDE_PIN, HIGH); WRITE(SUICIDE_PIN, HIGH);
#endif #endif // SUICIDE_PIN
#ifdef ULTIPANEL #ifdef ULTIPANEL
powersupply = true; powersupply = true;
LCD_MESSAGEPGM(WELCOME_MSG); LCD_MESSAGEPGM(WELCOME_MSG);
lcd_update(); lcd_update();
#endif #endif // ULTIPANEL
break; break;
#endif #endif // POWER_SUPPLY
case 81: // M81 - Turn off Power Supply case 81: // M81 - Turn off Power Supply
disable_heater(); disable_heater();
...@@ -3823,7 +3828,7 @@ Sigma_Exit: ...@@ -3823,7 +3828,7 @@ Sigma_Exit:
#if defined(SUICIDE_PIN) && SUICIDE_PIN > -1 #if defined(SUICIDE_PIN) && SUICIDE_PIN > -1
st_synchronize(); st_synchronize();
suicide(); suicide();
#elif defined(PS_ON_PIN) && PS_ON_PIN > -1 #elif defined(POWER_SUPPLY) && POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN > -1
SET_OUTPUT(PS_ON_PIN); SET_OUTPUT(PS_ON_PIN);
WRITE(PS_ON_PIN, PS_ON_ASLEEP); WRITE(PS_ON_PIN, PS_ON_ASLEEP);
#endif #endif
......
...@@ -763,7 +763,7 @@ static void lcd_prepare_menu() ...@@ -763,7 +763,7 @@ static void lcd_prepare_menu()
#endif #endif
#endif #endif
MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown); MENU_ITEM(function, MSG_COOLDOWN, lcd_cooldown);
#if PS_ON_PIN > -1 #if defined(POWER_SUPPLY) && POWER_SUPPLY > 0 && defined(PS_ON_PIN) && PS_ON_PIN > -1
if (powersupply) if (powersupply)
{ {
MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81")); MENU_ITEM(gcode, MSG_SWITCH_PS_OFF, PSTR("M81"));
...@@ -1756,6 +1756,21 @@ char *ftostr32(const float &x) ...@@ -1756,6 +1756,21 @@ char *ftostr32(const float &x)
return conv; return conv;
} }
// convert float to space-padded string with -_23.4_ format
char *ftostr32np(const float &x)
{
char *c = ftostr32(x);
if (c[0] == '0' || c[0] == '-') {
if (c[0] == '0') c[0] = ' ';
if (c[1] == '0') c[1] = ' ';
}
if (c[5] == '0') {
c[5] = ' ';
if (c[4] == '0') c[4] = c[3] = ' ';
}
return c;
}
char *itostr31(const int &xx) char *itostr31(const int &xx)
{ {
conv[0]=(xx>=0)?'+':'-'; conv[0]=(xx>=0)?'+':'-';
...@@ -1772,8 +1787,8 @@ char *itostr3(const int &x) ...@@ -1772,8 +1787,8 @@ char *itostr3(const int &x)
{ {
int xx = x; int xx = x;
if (xx < 0) { if (xx < 0) {
conv[0]='-'; conv[0]='-';
xx = -xx; xx = -xx;
} else if (xx >= 100) } else if (xx >= 100)
conv[0]=(xx/100)%10+'0'; conv[0]=(xx/100)%10+'0';
else else
...@@ -1863,14 +1878,14 @@ char *ltostr7(const long &xx) ...@@ -1863,14 +1878,14 @@ char *ltostr7(const long &xx)
// convert float to string with +123 format // convert float to string with +123 format
char *ftostr30(const float &x) char *ftostr30(const float &x)
{ {
int xx=x; int xx=x;
conv[0]=(xx>=0)?'+':'-'; conv[0]=(xx>=0)?'+':'-';
xx=abs(xx); xx=abs(xx);
conv[1]=(xx/100)%10+'0'; conv[1]=(xx/100)%10+'0';
conv[2]=(xx/10)%10+'0'; conv[2]=(xx/10)%10+'0';
conv[3]=(xx)%10+'0'; conv[3]=(xx)%10+'0';
conv[4]=0; conv[4]=0;
return conv; return conv;
} }
// convert float to string with 12345 format // convert float to string with 12345 format
......
...@@ -118,6 +118,7 @@ char *ftostr30(const float &x); ...@@ -118,6 +118,7 @@ char *ftostr30(const float &x);
char *ftostr31ns(const float &x); // float to string without sign character char *ftostr31ns(const float &x); // float to string without sign character
char *ftostr31(const float &x); char *ftostr31(const float &x);
char *ftostr32(const float &x); char *ftostr32(const float &x);
char *ftostr32np(const float &x); // remove zero-padding from ftostr32
char *ftostr5(const float &x); char *ftostr5(const float &x);
char *ftostr51(const float &x); char *ftostr51(const float &x);
char *ftostr52(const float &x); char *ftostr52(const float &x);
......
...@@ -488,7 +488,7 @@ static void lcd_implementation_status_screen() ...@@ -488,7 +488,7 @@ static void lcd_implementation_status_screen()
# endif//LCD_WIDTH > 19 # endif//LCD_WIDTH > 19
lcd.setCursor(LCD_WIDTH - 8, 1); lcd.setCursor(LCD_WIDTH - 8, 1);
lcd.print('Z'); lcd.print('Z');
lcd.print(ftostr32(current_position[Z_AXIS] + 0.00001)); lcd.print(ftostr32np(current_position[Z_AXIS] + 0.00001));
#endif//LCD_HEIGHT > 2 #endif//LCD_HEIGHT > 2
#if LCD_HEIGHT > 3 #if LCD_HEIGHT > 3
......
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