Browse Source

Merge branch 'Development' into config_testing

Latest upstream commits
Scott Lahteine 9 years ago
parent
commit
0d81abe1c9

BIN
Documentation/Logo/marlinwiki.png View File


+ 15
- 64
Marlin/Marlin_main.cpp View File

@@ -4004,18 +4004,13 @@ inline void gcode_M303() {
4004 4004
 }
4005 4005
 
4006 4006
 #ifdef SCARA
4007
-
4008
-  /**
4009
-   * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
4010
-   */
4011
-  inline bool gcode_M360() {
4012
-    SERIAL_ECHOLN(" Cal: Theta 0 ");
4007
+  bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) {
4013 4008
     //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
4014 4009
     //SERIAL_ECHOLN(" Soft endstops disabled ");
4015 4010
     if (! Stopped) {
4016 4011
       //get_coordinates(); // For X Y Z E F
4017
-      delta[X_AXIS] = 0;
4018
-      delta[Y_AXIS] = 120;
4012
+      delta[X_AXIS] = delta_x;
4013
+      delta[Y_AXIS] = delta_y;
4019 4014
       calculate_SCARA_forward_Transform(delta);
4020 4015
       destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
4021 4016
       destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
@@ -4027,24 +4022,19 @@ inline void gcode_M303() {
4027 4022
   }
4028 4023
 
4029 4024
   /**
4025
+   * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration)
4026
+   */
4027
+  inline bool gcode_M360() {
4028
+    SERIAL_ECHOLN(" Cal: Theta 0 ");
4029
+    return SCARA_move_to_cal(0, 120);
4030
+  }
4031
+
4032
+  /**
4030 4033
    * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree)
4031 4034
    */
4032 4035
   inline bool gcode_M361() {
4033 4036
     SERIAL_ECHOLN(" Cal: Theta 90 ");
4034
-    //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
4035
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
4036
-    if (! Stopped) {
4037
-      //get_coordinates(); // For X Y Z E F
4038
-      delta[X_AXIS] = 90;
4039
-      delta[Y_AXIS] = 130;
4040
-      calculate_SCARA_forward_Transform(delta);
4041
-      destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
4042
-      destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
4043
-      prepare_move();
4044
-      //ClearToSend();
4045
-      return true;
4046
-    }
4047
-    return false;
4037
+    return SCARA_move_to_cal(90, 130);
4048 4038
   }
4049 4039
 
4050 4040
   /**
@@ -4052,20 +4042,7 @@ inline void gcode_M303() {
4052 4042
    */
4053 4043
   inline bool gcode_M362() {
4054 4044
     SERIAL_ECHOLN(" Cal: Psi 0 ");
4055
-    //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
4056
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
4057
-    if (! Stopped) {
4058
-      //get_coordinates(); // For X Y Z E F
4059
-      delta[X_AXIS] = 60;
4060
-      delta[Y_AXIS] = 180;
4061
-      calculate_SCARA_forward_Transform(delta);
4062
-      destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
4063
-      destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
4064
-      prepare_move();
4065
-      //ClearToSend();
4066
-      return true;
4067
-    }
4068
-    return false;
4045
+    return SCARA_move_to_cal(60, 180);
4069 4046
   }
4070 4047
 
4071 4048
   /**
@@ -4073,20 +4050,7 @@ inline void gcode_M303() {
4073 4050
    */
4074 4051
   inline bool gcode_M363() {
4075 4052
     SERIAL_ECHOLN(" Cal: Psi 90 ");
4076
-    //SoftEndsEnabled = false;              // Ignore soft endstops during calibration
4077
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
4078
-    if (! Stopped) {
4079
-      //get_coordinates(); // For X Y Z E F
4080
-      delta[X_AXIS] = 50;
4081
-      delta[Y_AXIS] = 90;
4082
-      calculate_SCARA_forward_Transform(delta);
4083
-      destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS];
4084
-      destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS];
4085
-      prepare_move();
4086
-      //ClearToSend();
4087
-      return true;
4088
-    }
4089
-    return false;
4053
+    return SCARA_move_to_cal(50, 90);
4090 4054
   }
4091 4055
 
4092 4056
   /**
@@ -4094,20 +4058,7 @@ inline void gcode_M303() {
4094 4058
    */
4095 4059
   inline bool gcode_M364() {
4096 4060
     SERIAL_ECHOLN(" Cal: Theta-Psi 90 ");
4097
-   // SoftEndsEnabled = false;              // Ignore soft endstops during calibration
4098
-    //SERIAL_ECHOLN(" Soft endstops disabled ");
4099
-    if (! Stopped) {
4100
-      //get_coordinates(); // For X Y Z E F
4101
-      delta[X_AXIS] = 45;
4102
-      delta[Y_AXIS] = 135;
4103
-      calculate_SCARA_forward_Transform(delta);
4104
-      destination[X_AXIS] = delta[X_AXIS] / axis_scaling[X_AXIS];
4105
-      destination[Y_AXIS] = delta[Y_AXIS] / axis_scaling[Y_AXIS];
4106
-      prepare_move();
4107
-      //ClearToSend();
4108
-      return true;
4109
-    }
4110
-    return false;
4061
+    return SCARA_move_to_cal(45, 135);
4111 4062
   }
4112 4063
 
4113 4064
   /**

+ 0
- 1
Marlin/example_configurations/Felix/Configuration.h View File

@@ -382,7 +382,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
382 382
   // Note: this feature occupies 10'206 byte
383 383
   #ifdef AUTO_BED_LEVELING_GRID
384 384
 
385
-home_offset    // set the rectangle in which to probe
386 385
     #define LEFT_PROBE_BED_POSITION 15
387 386
     #define RIGHT_PROBE_BED_POSITION 170
388 387
     #define BACK_PROBE_BED_POSITION 180

+ 0
- 1
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

@@ -382,7 +382,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
382 382
   // Note: this feature occupies 10'206 byte
383 383
   #ifdef AUTO_BED_LEVELING_GRID
384 384
 
385
-home_offset    // set the rectangle in which to probe
386 385
     #define LEFT_PROBE_BED_POSITION 15
387 386
     #define RIGHT_PROBE_BED_POSITION 170
388 387
     #define BACK_PROBE_BED_POSITION 180

+ 46
- 41
Marlin/temperature.cpp View File

@@ -141,7 +141,7 @@ static volatile bool temp_meas_ready = false;
141 141
 // Init min and max temp with extreme values to prevent false errors during startup
142 142
 static int minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP);
143 143
 static int maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP);
144
-static int minttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 0, 0, 0, 0 );
144
+static int minttemp[EXTRUDERS] = { 0 };
145 145
 static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 16383, 16383, 16383, 16383 );
146 146
 //static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; /* No bed mintemp error implemented?!? */
147 147
 #ifdef BED_MAXTEMP
@@ -161,8 +161,8 @@ static float analog2tempBed(int raw);
161 161
 static void updateTemperaturesFromRawValues();
162 162
 
163 163
 #ifdef WATCH_TEMP_PERIOD
164
-  int watch_start_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0,0);
165
-  unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0,0);
164
+  int watch_start_temp[EXTRUDERS] = { 0 };
165
+  unsigned long watchmillis[EXTRUDERS] = { 0 };
166 166
 #endif //WATCH_TEMP_PERIOD
167 167
 
168 168
 #ifndef SOFT_PWM_SCALE
@@ -576,12 +576,6 @@ void manage_heater() {
576 576
 
577 577
   updateTemperaturesFromRawValues();
578 578
 
579
-  #ifdef HEATER_0_USES_MAX6675
580
-    float ct = current_temperature[0];
581
-    if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
582
-    if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
583
-  #endif //HEATER_0_USES_MAX6675
584
-
585 579
   unsigned long ms = millis();
586 580
 
587 581
   // Loop through all extruders
@@ -1060,28 +1054,28 @@ void disable_heater() {
1060 1054
   for (int i=0; i<EXTRUDERS; i++) setTargetHotend(0, i);
1061 1055
   setTargetBed(0);
1062 1056
 
1057
+  #define DISABLE_HEATER(NR) { \
1058
+    target_temperature[NR] = 0; \
1059
+    soft_pwm[NR] = 0; \
1060
+    WRITE_HEATER_ ## NR (LOW); \
1061
+  }
1062
+
1063 1063
   #if HAS_TEMP_0
1064 1064
     target_temperature[0] = 0;
1065 1065
     soft_pwm[0] = 0;
1066
-    WRITE_HEATER_0P(LOW); // If HEATERS_PARALLEL should apply, change to WRITE_HEATER_0
1066
+    WRITE_HEATER_0P(LOW); // Should HEATERS_PARALLEL apply here? Then change to DISABLE_HEATER(0)
1067 1067
   #endif
1068 1068
 
1069 1069
   #if EXTRUDERS > 1 && HAS_TEMP_1
1070
-    target_temperature[1] = 0;
1071
-    soft_pwm[1] = 0;
1072
-    WRITE_HEATER_1(LOW);
1070
+    DISABLE_HEATER(1);
1073 1071
   #endif
1074 1072
 
1075 1073
   #if EXTRUDERS > 2 && HAS_TEMP_2
1076
-    target_temperature[2] = 0;
1077
-    soft_pwm[2] = 0;
1078
-    WRITE_HEATER_2(LOW);
1074
+    DISABLE_HEATER(2);
1079 1075
   #endif
1080 1076
 
1081 1077
   #if EXTRUDERS > 3 && HAS_TEMP_3
1082
-    target_temperature[3] = 0;
1083
-    soft_pwm[3] = 0;
1084
-    WRITE_HEATER_3(LOW);
1078
+    DISABLE_HEATER(3);
1085 1079
   #endif
1086 1080
 
1087 1081
   #if HAS_TEMP_BED
@@ -1172,9 +1166,15 @@ enum TempState {
1172 1166
 // Timer 0 is shared with millies
1173 1167
 //
1174 1168
 ISR(TIMER0_COMPB_vect) {
1169
+  #ifdef TEMP_SENSOR_1_AS_REDUNDANT
1170
+    #define TEMP_SENSOR_COUNT 2
1171
+  #else 
1172
+    #define TEMP_SENSOR_COUNT EXTRUDERS
1173
+  #endif
1174
+
1175 1175
   //these variables are only accesible from the ISR, but static, so they don't lose their value
1176 1176
   static unsigned char temp_count = 0;
1177
-  static unsigned long raw_temp_value[EXTRUDERS] = { 0 };
1177
+  static unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 };
1178 1178
   static unsigned long raw_temp_bed_value = 0;
1179 1179
   static TempState temp_state = StartupDelay;
1180 1180
   static unsigned char pwm_count = BIT(SOFT_PWM_SCALE);
@@ -1390,6 +1390,7 @@ ISR(TIMER0_COMPB_vect) {
1390 1390
       #endif
1391 1391
       temp_state = PrepareTemp_BED;
1392 1392
       break;
1393
+
1393 1394
     case PrepareTemp_BED:
1394 1395
       #if HAS_TEMP_BED
1395 1396
         START_ADC(TEMP_BED_PIN);
@@ -1403,6 +1404,7 @@ ISR(TIMER0_COMPB_vect) {
1403 1404
       #endif
1404 1405
       temp_state = PrepareTemp_1;
1405 1406
       break;
1407
+
1406 1408
     case PrepareTemp_1:
1407 1409
       #if HAS_TEMP_1
1408 1410
         START_ADC(TEMP_1_PIN);
@@ -1416,6 +1418,7 @@ ISR(TIMER0_COMPB_vect) {
1416 1418
       #endif
1417 1419
       temp_state = PrepareTemp_2;
1418 1420
       break;
1421
+
1419 1422
     case PrepareTemp_2:
1420 1423
       #if HAS_TEMP_2
1421 1424
         START_ADC(TEMP_2_PIN);
@@ -1429,6 +1432,7 @@ ISR(TIMER0_COMPB_vect) {
1429 1432
       #endif
1430 1433
       temp_state = PrepareTemp_3;
1431 1434
       break;
1435
+
1432 1436
     case PrepareTemp_3:
1433 1437
       #if HAS_TEMP_3
1434 1438
         START_ADC(TEMP_3_PIN);
@@ -1442,6 +1446,7 @@ ISR(TIMER0_COMPB_vect) {
1442 1446
       #endif
1443 1447
       temp_state = Prepare_FILWIDTH;
1444 1448
       break;
1449
+
1445 1450
     case Prepare_FILWIDTH:
1446 1451
       #if HAS_FILAMENT_SENSOR
1447 1452
         START_ADC(FILWIDTH_PIN);
@@ -1460,6 +1465,7 @@ ISR(TIMER0_COMPB_vect) {
1460 1465
       temp_state = PrepareTemp_0;
1461 1466
       temp_count++;
1462 1467
       break;
1468
+
1463 1469
     case StartupDelay:
1464 1470
       temp_state = PrepareTemp_0;
1465 1471
       break;
@@ -1469,7 +1475,7 @@ ISR(TIMER0_COMPB_vect) {
1469 1475
     //   SERIAL_ERRORLNPGM("Temp measurement error!");
1470 1476
     //   break;
1471 1477
   } // switch(temp_state)
1472
-    
1478
+
1473 1479
   if (temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256)  = 164ms.
1474 1480
     if (!temp_meas_ready) { //Only update the raw values if they have been read. Else we could be updating them during reading.
1475 1481
       #ifndef HEATER_0_USES_MAX6675
@@ -1494,52 +1500,53 @@ ISR(TIMER0_COMPB_vect) {
1494 1500
     #if HAS_FILAMENT_SENSOR
1495 1501
       current_raw_filwidth = raw_filwidth_value >> 10;  // Divide to get to 0-16384 range since we used 1/128 IIR filter approach
1496 1502
     #endif
1497
-    
1503
+
1498 1504
     temp_meas_ready = true;
1499 1505
     temp_count = 0;
1500
-    for (int i = 0; i < EXTRUDERS; i++) raw_temp_value[i] = 0;
1506
+    for (int i = 0; i < TEMP_SENSOR_COUNT; i++) raw_temp_value[i] = 0;
1501 1507
     raw_temp_bed_value = 0;
1502 1508
 
1503
-    #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
1504
-      #define GE0 <=
1505
-      #define LE0 >=
1509
+    #ifdef HEATER_0_USES_MAX6675
1510
+      float ct = current_temperature[0];
1511
+      if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0);
1512
+      if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0);
1506 1513
     #else
1507
-      #define GE0 >=
1508
-      #define LE0 <=
1514
+      #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP
1515
+        #define GE0 <=
1516
+      #else
1517
+        #define GE0 >=
1518
+      #endif
1519
+      if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0);
1520
+      if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0);
1509 1521
     #endif
1510
-    if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0);
1511
-    if (current_temperature_raw[0] LE0 minttemp_raw[0]) min_temp_error(0);
1512 1522
 
1513 1523
     #if EXTRUDERS > 1
1514 1524
       #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP
1515 1525
         #define GE1 <=
1516
-        #define LE1 >=
1517 1526
       #else
1518 1527
         #define GE1 >=
1519
-        #define LE1 <=
1520 1528
       #endif
1521 1529
       if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1);
1522
-      if (current_temperature_raw[1] LE1 minttemp_raw[1]) min_temp_error(1);
1530
+      if (minttemp_raw[1] GE0 current_temperature_raw[1]) min_temp_error(1);
1531
+
1523 1532
       #if EXTRUDERS > 2
1524 1533
         #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP
1525 1534
           #define GE2 <=
1526
-          #define LE2 >=
1527 1535
         #else
1528 1536
           #define GE2 >=
1529
-          #define LE2 <=
1530 1537
         #endif
1531 1538
         if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2);
1532
-        if (current_temperature_raw[2] LE2 minttemp_raw[2]) min_temp_error(2);
1539
+        if (minttemp_raw[2] GE0 current_temperature_raw[2]) min_temp_error(2);
1540
+
1533 1541
         #if EXTRUDERS > 3
1534 1542
           #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP
1535 1543
             #define GE3 <=
1536
-            #define LE3 >=
1537 1544
           #else
1538 1545
             #define GE3 >=
1539
-            #define LE3 <=
1540 1546
           #endif
1541 1547
           if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3);
1542
-          if (current_temperature_raw[3] LE3 minttemp_raw[3]) min_temp_error(3);
1548
+          if (minttemp_raw[3] GE0 current_temperature_raw[3]) min_temp_error(3);
1549
+
1543 1550
         #endif // EXTRUDERS > 3
1544 1551
       #endif // EXTRUDERS > 2
1545 1552
     #endif // EXTRUDERS > 1
@@ -1547,10 +1554,8 @@ ISR(TIMER0_COMPB_vect) {
1547 1554
     #if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0)
1548 1555
       #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP
1549 1556
         #define GEBED <=
1550
-        #define LEBED >=
1551 1557
       #else
1552 1558
         #define GEBED >=
1553
-        #define LEBED <=
1554 1559
       #endif
1555 1560
       if (current_temperature_bed_raw GEBED bed_maxttemp_raw) {
1556 1561
         target_temperature_bed = 0;

+ 3
- 3
Marlin/ultralcd.cpp View File

@@ -911,9 +911,9 @@ static void lcd_control_motion_menu() {
911 911
   START_MENU();
912 912
   MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
913 913
   #ifdef ENABLE_AUTO_BED_LEVELING
914
-    MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50);
914
+    MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.0, 50);
915 915
   #endif
916
-  MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000);
916
+  MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000);
917 917
   MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990);
918 918
   MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990);
919 919
   MENU_ITEM_EDIT(float3, MSG_VE_JERK, &max_e_jerk, 1, 990);
@@ -925,7 +925,7 @@ static void lcd_control_motion_menu() {
925 925
   MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &mintravelfeedrate, 0, 999);
926 926
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, reset_acceleration_rates);
927 927
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, reset_acceleration_rates);
928
-  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 100, 99000, reset_acceleration_rates);
928
+  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, reset_acceleration_rates);
929 929
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, reset_acceleration_rates);
930 930
   MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &retract_acceleration, 100, 99000);
931 931
   MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &travel_acceleration, 100, 99000);

Loading…
Cancel
Save