Browse Source

Merge pull request #7060 from bgort/i2cpefix

I2C Position Encoders Example Configs
Scott Lahteine 7 years ago
parent
commit
42f7f9e013
24 changed files with 1911 additions and 2 deletions
  1. 2
    2
      Marlin/Configuration_adv.h
  2. 83
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  3. 83
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  4. 83
    0
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  5. 83
    0
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  6. 83
    0
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  7. 83
    0
      Marlin/example_configurations/K8200/Configuration_adv.h
  8. 83
    0
      Marlin/example_configurations/K8400/Configuration_adv.h
  9. 83
    0
      Marlin/example_configurations/M150/Configuration_adv.h
  10. 83
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  11. 83
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  12. 83
    0
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  13. 83
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  14. 83
    0
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  15. 83
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  16. 83
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  17. 83
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  18. 83
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  19. 83
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  20. 83
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  21. 83
    0
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  22. 83
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  23. 83
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  24. 83
    0
      Marlin/example_configurations/wt150/Configuration_adv.h

+ 2
- 2
Marlin/Configuration_adv.h View File

@@ -1263,7 +1263,7 @@
1263 1263
 #endif
1264 1264
 
1265 1265
 //===========================================================================
1266
-//============================ I2C Encoder Settings =========================
1266
+//====================== I2C Position Encoder Settings ======================
1267 1267
 //===========================================================================
1268 1268
 /**
1269 1269
  *  I2C position encoders for closed loop control.
@@ -1343,6 +1343,6 @@
1343 1343
   // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1344 1344
   #define I2CPE_ERR_ROLLING_AVERAGE
1345 1345
 
1346
-#endif
1346
+#endif // I2C_POSITION_ENCODERS
1347 1347
 
1348 1348
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   #define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h View File

@@ -1268,4 +1268,87 @@
1268 1268
   //#define USER_GCODE_5 "G28\nM503"
1269 1269
 #endif
1270 1270
 
1271
+//===========================================================================
1272
+//====================== I2C Position Encoder Settings ======================
1273
+//===========================================================================
1274
+/**
1275
+ *  I2C position encoders for closed loop control.
1276
+ *  Developed by Chris Barr at Aus3D.
1277
+ *
1278
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1279
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1280
+ *
1281
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1282
+ *  Alternative Supplier: http://reliabuild3d.com/
1283
+ *
1284
+ *  Reilabuild encoders have been modified to improve reliability.
1285
+ */
1286
+
1287
+//#define I2C_POSITION_ENCODERS
1288
+#if ENABLED(I2C_POSITION_ENCODERS)
1289
+
1290
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1291
+                                                            // encoders supported currently.
1292
+
1293
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1294
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1295
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1296
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1297
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1298
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1299
+                                                            // for rotary encoders this is ticks / revolution.
1300
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1301
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1302
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1303
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1304
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1305
+                                                            // printer will attempt to correct the error; errors
1306
+                                                            // smaller than this are ignored to minimize effects of
1307
+                                                            // measurement noise / latency (filter).
1308
+
1309
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1310
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1311
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1312
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1313
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1314
+  //#define I2CPE_ENC_2_INVERT
1315
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1316
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1317
+
1318
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1319
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1320
+
1321
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1322
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1323
+
1324
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1325
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1326
+
1327
+  // Default settings for encoders which are enabled, but without settings configured above.
1328
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1329
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1330
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1331
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1332
+  #define I2CPE_DEF_EC_THRESH       0.1
1333
+
1334
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1335
+                                                            // axis after which the printer will abort. Comment out to
1336
+                                                            // disable abort behaviour.
1337
+
1338
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1339
+                                                            // for this amount of time (in ms) before the encoder
1340
+                                                            // is trusted again.
1341
+
1342
+  /**
1343
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1344
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1345
+   * error rolling average when attempting to correct only for skips and not for vibration.
1346
+   */
1347
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1348
+
1349
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1350
+  #define I2CPE_ERR_ROLLING_AVERAGE
1351
+
1352
+#endif // I2C_POSITION_ENCODERS
1353
+
1271 1354
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -1238,4 +1238,87 @@
1238 1238
   //#define USER_GCODE_5 "G28\nM503"
1239 1239
 #endif
1240 1240
 
1241
+//===========================================================================
1242
+//====================== I2C Position Encoder Settings ======================
1243
+//===========================================================================
1244
+/**
1245
+ *  I2C position encoders for closed loop control.
1246
+ *  Developed by Chris Barr at Aus3D.
1247
+ *
1248
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1249
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1250
+ *
1251
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1252
+ *  Alternative Supplier: http://reliabuild3d.com/
1253
+ *
1254
+ *  Reilabuild encoders have been modified to improve reliability.
1255
+ */
1256
+
1257
+//#define I2C_POSITION_ENCODERS
1258
+#if ENABLED(I2C_POSITION_ENCODERS)
1259
+
1260
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1261
+                                                            // encoders supported currently.
1262
+
1263
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1264
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1265
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1266
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1267
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1268
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1269
+                                                            // for rotary encoders this is ticks / revolution.
1270
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1271
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1272
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1273
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1274
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1275
+                                                            // printer will attempt to correct the error; errors
1276
+                                                            // smaller than this are ignored to minimize effects of
1277
+                                                            // measurement noise / latency (filter).
1278
+
1279
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1280
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1281
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1282
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1283
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1284
+  //#define I2CPE_ENC_2_INVERT
1285
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1286
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1287
+
1288
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1289
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1290
+
1291
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1292
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1293
+
1294
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1295
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1296
+
1297
+  // Default settings for encoders which are enabled, but without settings configured above.
1298
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1300
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1301
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1302
+  #define I2CPE_DEF_EC_THRESH       0.1
1303
+
1304
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1305
+                                                            // axis after which the printer will abort. Comment out to
1306
+                                                            // disable abort behaviour.
1307
+
1308
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1309
+                                                            // for this amount of time (in ms) before the encoder
1310
+                                                            // is trusted again.
1311
+
1312
+  /**
1313
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1314
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1315
+   * error rolling average when attempting to correct only for skips and not for vibration.
1316
+   */
1317
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1318
+
1319
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1320
+  #define I2CPE_ERR_ROLLING_AVERAGE
1321
+
1322
+#endif // I2C_POSITION_ENCODERS
1323
+
1241 1324
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -1268,4 +1268,87 @@
1268 1268
   //#define USER_GCODE_5 "G28\nM503"
1269 1269
 #endif
1270 1270
 
1271
+//===========================================================================
1272
+//====================== I2C Position Encoder Settings ======================
1273
+//===========================================================================
1274
+/**
1275
+ *  I2C position encoders for closed loop control.
1276
+ *  Developed by Chris Barr at Aus3D.
1277
+ *
1278
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1279
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1280
+ *
1281
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1282
+ *  Alternative Supplier: http://reliabuild3d.com/
1283
+ *
1284
+ *  Reilabuild encoders have been modified to improve reliability.
1285
+ */
1286
+
1287
+//#define I2C_POSITION_ENCODERS
1288
+#if ENABLED(I2C_POSITION_ENCODERS)
1289
+
1290
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1291
+                                                            // encoders supported currently.
1292
+
1293
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1294
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1295
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1296
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1297
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1298
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1299
+                                                            // for rotary encoders this is ticks / revolution.
1300
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1301
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1302
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1303
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1304
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1305
+                                                            // printer will attempt to correct the error; errors
1306
+                                                            // smaller than this are ignored to minimize effects of
1307
+                                                            // measurement noise / latency (filter).
1308
+
1309
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1310
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1311
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1312
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1313
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1314
+  //#define I2CPE_ENC_2_INVERT
1315
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1316
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1317
+
1318
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1319
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1320
+
1321
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1322
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1323
+
1324
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1325
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1326
+
1327
+  // Default settings for encoders which are enabled, but without settings configured above.
1328
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1329
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1330
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1331
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1332
+  #define I2CPE_DEF_EC_THRESH       0.1
1333
+
1334
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1335
+                                                            // axis after which the printer will abort. Comment out to
1336
+                                                            // disable abort behaviour.
1337
+
1338
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1339
+                                                            // for this amount of time (in ms) before the encoder
1340
+                                                            // is trusted again.
1341
+
1342
+  /**
1343
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1344
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1345
+   * error rolling average when attempting to correct only for skips and not for vibration.
1346
+   */
1347
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1348
+
1349
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1350
+  #define I2CPE_ERR_ROLLING_AVERAGE
1351
+
1352
+#endif // I2C_POSITION_ENCODERS
1353
+
1271 1354
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/M150/Configuration_adv.h View File

@@ -1262,4 +1262,87 @@
1262 1262
   #define USER_GCODE_5 "G28\nM503"
1263 1263
 #endif
1264 1264
 
1265
+//===========================================================================
1266
+//====================== I2C Position Encoder Settings ======================
1267
+//===========================================================================
1268
+/**
1269
+ *  I2C position encoders for closed loop control.
1270
+ *  Developed by Chris Barr at Aus3D.
1271
+ *
1272
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1273
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1274
+ *
1275
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1276
+ *  Alternative Supplier: http://reliabuild3d.com/
1277
+ *
1278
+ *  Reilabuild encoders have been modified to improve reliability.
1279
+ */
1280
+
1281
+//#define I2C_POSITION_ENCODERS
1282
+#if ENABLED(I2C_POSITION_ENCODERS)
1283
+
1284
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1285
+                                                            // encoders supported currently.
1286
+
1287
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1288
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1289
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1290
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1291
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1292
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1293
+                                                            // for rotary encoders this is ticks / revolution.
1294
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1295
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1296
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1297
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1298
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1299
+                                                            // printer will attempt to correct the error; errors
1300
+                                                            // smaller than this are ignored to minimize effects of
1301
+                                                            // measurement noise / latency (filter).
1302
+
1303
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1304
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1305
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1306
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1307
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1308
+  //#define I2CPE_ENC_2_INVERT
1309
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1310
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1311
+
1312
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1313
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1314
+
1315
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1316
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1317
+
1318
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1319
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1320
+
1321
+  // Default settings for encoders which are enabled, but without settings configured above.
1322
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1323
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1324
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1325
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1326
+  #define I2CPE_DEF_EC_THRESH       0.1
1327
+
1328
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1329
+                                                            // axis after which the printer will abort. Comment out to
1330
+                                                            // disable abort behaviour.
1331
+
1332
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1333
+                                                            // for this amount of time (in ms) before the encoder
1334
+                                                            // is trusted again.
1335
+
1336
+  /**
1337
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1338
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1339
+   * error rolling average when attempting to correct only for skips and not for vibration.
1340
+   */
1341
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1342
+
1343
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1344
+  #define I2CPE_ERR_ROLLING_AVERAGE
1345
+
1346
+#endif // I2C_POSITION_ENCODERS
1347
+
1265 1348
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

@@ -1258,4 +1258,87 @@
1258 1258
   //#define USER_GCODE_5 "G28\nM503"
1259 1259
 #endif
1260 1260
 
1261
+//===========================================================================
1262
+//====================== I2C Position Encoder Settings ======================
1263
+//===========================================================================
1264
+/**
1265
+ *  I2C position encoders for closed loop control.
1266
+ *  Developed by Chris Barr at Aus3D.
1267
+ *
1268
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1269
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1270
+ *
1271
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1272
+ *  Alternative Supplier: http://reliabuild3d.com/
1273
+ *
1274
+ *  Reilabuild encoders have been modified to improve reliability.
1275
+ */
1276
+
1277
+//#define I2C_POSITION_ENCODERS
1278
+#if ENABLED(I2C_POSITION_ENCODERS)
1279
+
1280
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1281
+                                                            // encoders supported currently.
1282
+
1283
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1284
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1285
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1286
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1287
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1288
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1289
+                                                            // for rotary encoders this is ticks / revolution.
1290
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1291
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1292
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1293
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1294
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1295
+                                                            // printer will attempt to correct the error; errors
1296
+                                                            // smaller than this are ignored to minimize effects of
1297
+                                                            // measurement noise / latency (filter).
1298
+
1299
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1300
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1301
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1302
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1303
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1304
+  //#define I2CPE_ENC_2_INVERT
1305
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1306
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1307
+
1308
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1309
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1310
+
1311
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1312
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1313
+
1314
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1315
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1316
+
1317
+  // Default settings for encoders which are enabled, but without settings configured above.
1318
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1319
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1320
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1321
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1322
+  #define I2CPE_DEF_EC_THRESH       0.1
1323
+
1324
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1325
+                                                            // axis after which the printer will abort. Comment out to
1326
+                                                            // disable abort behaviour.
1327
+
1328
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1329
+                                                            // for this amount of time (in ms) before the encoder
1330
+                                                            // is trusted again.
1331
+
1332
+  /**
1333
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1334
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1335
+   * error rolling average when attempting to correct only for skips and not for vibration.
1336
+   */
1337
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1338
+
1339
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1340
+  #define I2CPE_ERR_ROLLING_AVERAGE
1341
+
1342
+#endif // I2C_POSITION_ENCODERS
1343
+
1261 1344
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -1260,4 +1260,87 @@
1260 1260
   #define USER_GCODE_5 "G28\nM503"
1261 1261
 #endif
1262 1262
 
1263
+//===========================================================================
1264
+//====================== I2C Position Encoder Settings ======================
1265
+//===========================================================================
1266
+/**
1267
+ *  I2C position encoders for closed loop control.
1268
+ *  Developed by Chris Barr at Aus3D.
1269
+ *
1270
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1271
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1272
+ *
1273
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1274
+ *  Alternative Supplier: http://reliabuild3d.com/
1275
+ *
1276
+ *  Reilabuild encoders have been modified to improve reliability.
1277
+ */
1278
+
1279
+//#define I2C_POSITION_ENCODERS
1280
+#if ENABLED(I2C_POSITION_ENCODERS)
1281
+
1282
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1283
+                                                            // encoders supported currently.
1284
+
1285
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1286
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1287
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1288
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1289
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1290
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1291
+                                                            // for rotary encoders this is ticks / revolution.
1292
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1293
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1294
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1295
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1296
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1297
+                                                            // printer will attempt to correct the error; errors
1298
+                                                            // smaller than this are ignored to minimize effects of
1299
+                                                            // measurement noise / latency (filter).
1300
+
1301
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1302
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1303
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1304
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1305
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1306
+  //#define I2CPE_ENC_2_INVERT
1307
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1308
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1309
+
1310
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1311
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1312
+
1313
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1314
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1315
+
1316
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1317
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1318
+
1319
+  // Default settings for encoders which are enabled, but without settings configured above.
1320
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1321
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1322
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1323
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1324
+  #define I2CPE_DEF_EC_THRESH       0.1
1325
+
1326
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1327
+                                                            // axis after which the printer will abort. Comment out to
1328
+                                                            // disable abort behaviour.
1329
+
1330
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1331
+                                                            // for this amount of time (in ms) before the encoder
1332
+                                                            // is trusted again.
1333
+
1334
+  /**
1335
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1336
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1337
+   * error rolling average when attempting to correct only for skips and not for vibration.
1338
+   */
1339
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1340
+
1341
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1342
+  #define I2CPE_ERR_ROLLING_AVERAGE
1343
+
1344
+#endif // I2C_POSITION_ENCODERS
1345
+
1263 1346
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -1259,4 +1259,87 @@
1259 1259
   #define USER_GCODE_5 "G28\nM503"
1260 1260
 #endif
1261 1261
 
1262
+//===========================================================================
1263
+//====================== I2C Position Encoder Settings ======================
1264
+//===========================================================================
1265
+/**
1266
+ *  I2C position encoders for closed loop control.
1267
+ *  Developed by Chris Barr at Aus3D.
1268
+ *
1269
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1270
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1271
+ *
1272
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1273
+ *  Alternative Supplier: http://reliabuild3d.com/
1274
+ *
1275
+ *  Reilabuild encoders have been modified to improve reliability.
1276
+ */
1277
+
1278
+//#define I2C_POSITION_ENCODERS
1279
+#if ENABLED(I2C_POSITION_ENCODERS)
1280
+
1281
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1282
+                                                            // encoders supported currently.
1283
+
1284
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1285
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1286
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1287
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1288
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1289
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1290
+                                                            // for rotary encoders this is ticks / revolution.
1291
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1292
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1293
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1294
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1295
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1296
+                                                            // printer will attempt to correct the error; errors
1297
+                                                            // smaller than this are ignored to minimize effects of
1298
+                                                            // measurement noise / latency (filter).
1299
+
1300
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1301
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1302
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1303
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1304
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1305
+  //#define I2CPE_ENC_2_INVERT
1306
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1307
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1308
+
1309
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1310
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1311
+
1312
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1313
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1314
+
1315
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1316
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1317
+
1318
+  // Default settings for encoders which are enabled, but without settings configured above.
1319
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1320
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1321
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1322
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1323
+  #define I2CPE_DEF_EC_THRESH       0.1
1324
+
1325
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1326
+                                                            // axis after which the printer will abort. Comment out to
1327
+                                                            // disable abort behaviour.
1328
+
1329
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1330
+                                                            // for this amount of time (in ms) before the encoder
1331
+                                                            // is trusted again.
1332
+
1333
+  /**
1334
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1335
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1336
+   * error rolling average when attempting to correct only for skips and not for vibration.
1337
+   */
1338
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1339
+
1340
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1341
+  #define I2CPE_ERR_ROLLING_AVERAGE
1342
+
1343
+#endif // I2C_POSITION_ENCODERS
1344
+
1262 1345
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -1257,4 +1257,87 @@
1257 1257
   #define USER_GCODE_5 "G28\nM503"
1258 1258
 #endif
1259 1259
 
1260
+//===========================================================================
1261
+//====================== I2C Position Encoder Settings ======================
1262
+//===========================================================================
1263
+/**
1264
+ *  I2C position encoders for closed loop control.
1265
+ *  Developed by Chris Barr at Aus3D.
1266
+ *
1267
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1268
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1269
+ *
1270
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1271
+ *  Alternative Supplier: http://reliabuild3d.com/
1272
+ *
1273
+ *  Reilabuild encoders have been modified to improve reliability.
1274
+ */
1275
+
1276
+//#define I2C_POSITION_ENCODERS
1277
+#if ENABLED(I2C_POSITION_ENCODERS)
1278
+
1279
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1280
+                                                            // encoders supported currently.
1281
+
1282
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1283
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1284
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1285
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1286
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1287
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1288
+                                                            // for rotary encoders this is ticks / revolution.
1289
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1290
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1291
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1292
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1293
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1294
+                                                            // printer will attempt to correct the error; errors
1295
+                                                            // smaller than this are ignored to minimize effects of
1296
+                                                            // measurement noise / latency (filter).
1297
+
1298
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1299
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1300
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1301
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1302
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1303
+  //#define I2CPE_ENC_2_INVERT
1304
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1305
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1306
+
1307
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1308
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1309
+
1310
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1311
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1312
+
1313
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1314
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1315
+
1316
+  // Default settings for encoders which are enabled, but without settings configured above.
1317
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1318
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1319
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1320
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1321
+  #define I2CPE_DEF_EC_THRESH       0.1
1322
+
1323
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1324
+                                                            // axis after which the printer will abort. Comment out to
1325
+                                                            // disable abort behaviour.
1326
+
1327
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1328
+                                                            // for this amount of time (in ms) before the encoder
1329
+                                                            // is trusted again.
1330
+
1331
+  /**
1332
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1333
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1334
+   * error rolling average when attempting to correct only for skips and not for vibration.
1335
+   */
1336
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1337
+
1338
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1339
+  #define I2CPE_ERR_ROLLING_AVERAGE
1340
+
1341
+#endif // I2C_POSITION_ENCODERS
1342
+
1260 1343
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -1257,4 +1257,87 @@
1257 1257
   #define USER_GCODE_5 "G28\nM503"
1258 1258
 #endif
1259 1259
 
1260
+//===========================================================================
1261
+//====================== I2C Position Encoder Settings ======================
1262
+//===========================================================================
1263
+/**
1264
+ *  I2C position encoders for closed loop control.
1265
+ *  Developed by Chris Barr at Aus3D.
1266
+ *
1267
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1268
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1269
+ *
1270
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1271
+ *  Alternative Supplier: http://reliabuild3d.com/
1272
+ *
1273
+ *  Reilabuild encoders have been modified to improve reliability.
1274
+ */
1275
+
1276
+//#define I2C_POSITION_ENCODERS
1277
+#if ENABLED(I2C_POSITION_ENCODERS)
1278
+
1279
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1280
+                                                            // encoders supported currently.
1281
+
1282
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1283
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1284
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1285
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1286
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1287
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1288
+                                                            // for rotary encoders this is ticks / revolution.
1289
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1290
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1291
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1292
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1293
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1294
+                                                            // printer will attempt to correct the error; errors
1295
+                                                            // smaller than this are ignored to minimize effects of
1296
+                                                            // measurement noise / latency (filter).
1297
+
1298
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1299
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1300
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1301
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1302
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1303
+  //#define I2CPE_ENC_2_INVERT
1304
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1305
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1306
+
1307
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1308
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1309
+
1310
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1311
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1312
+
1313
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1314
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1315
+
1316
+  // Default settings for encoders which are enabled, but without settings configured above.
1317
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1318
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1319
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1320
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1321
+  #define I2CPE_DEF_EC_THRESH       0.1
1322
+
1323
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1324
+                                                            // axis after which the printer will abort. Comment out to
1325
+                                                            // disable abort behaviour.
1326
+
1327
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1328
+                                                            // for this amount of time (in ms) before the encoder
1329
+                                                            // is trusted again.
1330
+
1331
+  /**
1332
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1333
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1334
+   * error rolling average when attempting to correct only for skips and not for vibration.
1335
+   */
1336
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1337
+
1338
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1339
+  #define I2CPE_ERR_ROLLING_AVERAGE
1340
+
1341
+#endif // I2C_POSITION_ENCODERS
1342
+
1260 1343
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -1262,4 +1262,87 @@
1262 1262
   #define USER_GCODE_5 "G28\nM503"
1263 1263
 #endif
1264 1264
 
1265
+//===========================================================================
1266
+//====================== I2C Position Encoder Settings ======================
1267
+//===========================================================================
1268
+/**
1269
+ *  I2C position encoders for closed loop control.
1270
+ *  Developed by Chris Barr at Aus3D.
1271
+ *
1272
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1273
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1274
+ *
1275
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1276
+ *  Alternative Supplier: http://reliabuild3d.com/
1277
+ *
1278
+ *  Reilabuild encoders have been modified to improve reliability.
1279
+ */
1280
+
1281
+//#define I2C_POSITION_ENCODERS
1282
+#if ENABLED(I2C_POSITION_ENCODERS)
1283
+
1284
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1285
+                                                            // encoders supported currently.
1286
+
1287
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1288
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1289
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1290
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1291
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1292
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1293
+                                                            // for rotary encoders this is ticks / revolution.
1294
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1295
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1296
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1297
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1298
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1299
+                                                            // printer will attempt to correct the error; errors
1300
+                                                            // smaller than this are ignored to minimize effects of
1301
+                                                            // measurement noise / latency (filter).
1302
+
1303
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1304
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1305
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1306
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1307
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1308
+  //#define I2CPE_ENC_2_INVERT
1309
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1310
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1311
+
1312
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1313
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1314
+
1315
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1316
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1317
+
1318
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1319
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1320
+
1321
+  // Default settings for encoders which are enabled, but without settings configured above.
1322
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1323
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1324
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1325
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1326
+  #define I2CPE_DEF_EC_THRESH       0.1
1327
+
1328
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1329
+                                                            // axis after which the printer will abort. Comment out to
1330
+                                                            // disable abort behaviour.
1331
+
1332
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1333
+                                                            // for this amount of time (in ms) before the encoder
1334
+                                                            // is trusted again.
1335
+
1336
+  /**
1337
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1338
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1339
+   * error rolling average when attempting to correct only for skips and not for vibration.
1340
+   */
1341
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1342
+
1343
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1344
+  #define I2CPE_ERR_ROLLING_AVERAGE
1345
+
1346
+#endif // I2C_POSITION_ENCODERS
1347
+
1265 1348
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -1257,4 +1257,87 @@
1257 1257
   //#define USER_GCODE_5 "G28\nM503"
1258 1258
 #endif
1259 1259
 
1260
+//===========================================================================
1261
+//====================== I2C Position Encoder Settings ======================
1262
+//===========================================================================
1263
+/**
1264
+ *  I2C position encoders for closed loop control.
1265
+ *  Developed by Chris Barr at Aus3D.
1266
+ *
1267
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1268
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1269
+ *
1270
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1271
+ *  Alternative Supplier: http://reliabuild3d.com/
1272
+ *
1273
+ *  Reilabuild encoders have been modified to improve reliability.
1274
+ */
1275
+
1276
+//#define I2C_POSITION_ENCODERS
1277
+#if ENABLED(I2C_POSITION_ENCODERS)
1278
+
1279
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1280
+                                                            // encoders supported currently.
1281
+
1282
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1283
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1284
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1285
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1286
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1287
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1288
+                                                            // for rotary encoders this is ticks / revolution.
1289
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1290
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1291
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1292
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1293
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1294
+                                                            // printer will attempt to correct the error; errors
1295
+                                                            // smaller than this are ignored to minimize effects of
1296
+                                                            // measurement noise / latency (filter).
1297
+
1298
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1299
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1300
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1301
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1302
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1303
+  //#define I2CPE_ENC_2_INVERT
1304
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1305
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1306
+
1307
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1308
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1309
+
1310
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1311
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1312
+
1313
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1314
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1315
+
1316
+  // Default settings for encoders which are enabled, but without settings configured above.
1317
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1318
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1319
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1320
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1321
+  #define I2CPE_DEF_EC_THRESH       0.1
1322
+
1323
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1324
+                                                            // axis after which the printer will abort. Comment out to
1325
+                                                            // disable abort behaviour.
1326
+
1327
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1328
+                                                            // for this amount of time (in ms) before the encoder
1329
+                                                            // is trusted again.
1330
+
1331
+  /**
1332
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1333
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1334
+   * error rolling average when attempting to correct only for skips and not for vibration.
1335
+   */
1336
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1337
+
1338
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1339
+  #define I2CPE_ERR_ROLLING_AVERAGE
1340
+
1341
+#endif // I2C_POSITION_ENCODERS
1342
+
1260 1343
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h View File

@@ -1264,4 +1264,87 @@
1264 1264
   //#define USER_GCODE_5 "G28\nM503"
1265 1265
 #endif
1266 1266
 
1267
+//===========================================================================
1268
+//====================== I2C Position Encoder Settings ======================
1269
+//===========================================================================
1270
+/**
1271
+ *  I2C position encoders for closed loop control.
1272
+ *  Developed by Chris Barr at Aus3D.
1273
+ *
1274
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1275
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1276
+ *
1277
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1278
+ *  Alternative Supplier: http://reliabuild3d.com/
1279
+ *
1280
+ *  Reilabuild encoders have been modified to improve reliability.
1281
+ */
1282
+
1283
+//#define I2C_POSITION_ENCODERS
1284
+#if ENABLED(I2C_POSITION_ENCODERS)
1285
+
1286
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1287
+                                                            // encoders supported currently.
1288
+
1289
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1290
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1291
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1292
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1293
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1294
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1295
+                                                            // for rotary encoders this is ticks / revolution.
1296
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1297
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1298
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1299
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1300
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1301
+                                                            // printer will attempt to correct the error; errors
1302
+                                                            // smaller than this are ignored to minimize effects of
1303
+                                                            // measurement noise / latency (filter).
1304
+
1305
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1306
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1307
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1308
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1309
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1310
+  //#define I2CPE_ENC_2_INVERT
1311
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1312
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1313
+
1314
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1315
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1316
+
1317
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1318
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1319
+
1320
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1321
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1322
+
1323
+  // Default settings for encoders which are enabled, but without settings configured above.
1324
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1325
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1326
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1327
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1328
+  #define I2CPE_DEF_EC_THRESH       0.1
1329
+
1330
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1331
+                                                            // axis after which the printer will abort. Comment out to
1332
+                                                            // disable abort behaviour.
1333
+
1334
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1335
+                                                            // for this amount of time (in ms) before the encoder
1336
+                                                            // is trusted again.
1337
+
1338
+  /**
1339
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1340
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1341
+   * error rolling average when attempting to correct only for skips and not for vibration.
1342
+   */
1343
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1344
+
1345
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1346
+  #define I2CPE_ERR_ROLLING_AVERAGE
1347
+
1348
+#endif // I2C_POSITION_ENCODERS
1349
+
1267 1350
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -1255,4 +1255,87 @@
1255 1255
   //#define USER_GCODE_5 "G28\nM503"
1256 1256
 #endif
1257 1257
 
1258
+//===========================================================================
1259
+//====================== I2C Position Encoder Settings ======================
1260
+//===========================================================================
1261
+/**
1262
+ *  I2C position encoders for closed loop control.
1263
+ *  Developed by Chris Barr at Aus3D.
1264
+ *
1265
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1266
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1267
+ *
1268
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1269
+ *  Alternative Supplier: http://reliabuild3d.com/
1270
+ *
1271
+ *  Reilabuild encoders have been modified to improve reliability.
1272
+ */
1273
+
1274
+//#define I2C_POSITION_ENCODERS
1275
+#if ENABLED(I2C_POSITION_ENCODERS)
1276
+
1277
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1278
+                                                            // encoders supported currently.
1279
+
1280
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1281
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1282
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1283
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1284
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1285
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1286
+                                                            // for rotary encoders this is ticks / revolution.
1287
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1288
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1289
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1290
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1291
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1292
+                                                            // printer will attempt to correct the error; errors
1293
+                                                            // smaller than this are ignored to minimize effects of
1294
+                                                            // measurement noise / latency (filter).
1295
+
1296
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1297
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1298
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1299
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1300
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1301
+  //#define I2CPE_ENC_2_INVERT
1302
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1303
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1304
+
1305
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1306
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1307
+
1308
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1309
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1310
+
1311
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1312
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1313
+
1314
+  // Default settings for encoders which are enabled, but without settings configured above.
1315
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1316
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1317
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1318
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1319
+  #define I2CPE_DEF_EC_THRESH       0.1
1320
+
1321
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1322
+                                                            // axis after which the printer will abort. Comment out to
1323
+                                                            // disable abort behaviour.
1324
+
1325
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1326
+                                                            // for this amount of time (in ms) before the encoder
1327
+                                                            // is trusted again.
1328
+
1329
+  /**
1330
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1331
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1332
+   * error rolling average when attempting to correct only for skips and not for vibration.
1333
+   */
1334
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1335
+
1336
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1337
+  #define I2CPE_ERR_ROLLING_AVERAGE
1338
+
1339
+#endif // I2C_POSITION_ENCODERS
1340
+
1258 1341
 #endif // CONFIGURATION_ADV_H

+ 83
- 0
Marlin/example_configurations/wt150/Configuration_adv.h View File

@@ -1258,4 +1258,87 @@
1258 1258
   //#define USER_GCODE_5 "G28\nM503"
1259 1259
 #endif
1260 1260
 
1261
+//===========================================================================
1262
+//====================== I2C Position Encoder Settings ======================
1263
+//===========================================================================
1264
+/**
1265
+ *  I2C position encoders for closed loop control.
1266
+ *  Developed by Chris Barr at Aus3D.
1267
+ *
1268
+ *  Wiki: http://wiki.aus3d.com.au/Magnetic_Encoder
1269
+ *  Github: https://github.com/Aus3D/MagneticEncoder
1270
+ *
1271
+ *  Supplier: http://aus3d.com.au/magnetic-encoder-module
1272
+ *  Alternative Supplier: http://reliabuild3d.com/
1273
+ *
1274
+ *  Reilabuild encoders have been modified to improve reliability.
1275
+ */
1276
+
1277
+//#define I2C_POSITION_ENCODERS
1278
+#if ENABLED(I2C_POSITION_ENCODERS)
1279
+
1280
+  #define I2CPE_ENCODER_CNT         1                       // The number of encoders installed; max of 5
1281
+                                                            // encoders supported currently.
1282
+
1283
+  #define I2CPE_ENC_1_ADDR          I2CPE_PRESET_ADDR_X     // I2C address of the encoder. 30-200.
1284
+  #define I2CPE_ENC_1_AXIS          X_AXIS                  // Axis the encoder module is installed on.  <X|Y|Z|E>_AXIS.
1285
+  #define I2CPE_ENC_1_TYPE          I2CPE_ENC_TYPE_LINEAR   // Type of encoder:  I2CPE_ENC_TYPE_LINEAR -or-
1286
+                                                            // I2CPE_ENC_TYPE_ROTARY.
1287
+  #define I2CPE_ENC_1_TICKS_UNIT    2048                    // 1024 for magnetic strips with 2mm poles; 2048 for
1288
+                                                            // 1mm poles. For linear encoders this is ticks / mm,
1289
+                                                            // for rotary encoders this is ticks / revolution.
1290
+  //#define I2CPE_ENC_1_TICKS_REV     (16 * 200)            // Only needed for rotary encoders; number of stepper
1291
+                                                            // steps per full revolution (motor steps/rev * microstepping)
1292
+  //#define I2CPE_ENC_1_INVERT                              // Invert the direction of axis travel.
1293
+  #define I2CPE_ENC_1_EC_METHOD     I2CPE_ECM_NONE          // Type of error error correction.
1294
+  #define I2CPE_ENC_1_EC_THRESH     0.10                    // Threshold size for error (in mm) above which the
1295
+                                                            // printer will attempt to correct the error; errors
1296
+                                                            // smaller than this are ignored to minimize effects of
1297
+                                                            // measurement noise / latency (filter).
1298
+
1299
+  #define I2CPE_ENC_2_ADDR          I2CPE_PRESET_ADDR_Y     // Same as above, but for encoder 2.
1300
+  #define I2CPE_ENC_2_AXIS          Y_AXIS
1301
+  #define I2CPE_ENC_2_TYPE          I2CPE_ENC_TYPE_LINEAR
1302
+  #define I2CPE_ENC_2_TICKS_UNIT    2048
1303
+  //#define I2CPE_ENC_2_TICKS_REV   (16 * 200)
1304
+  //#define I2CPE_ENC_2_INVERT
1305
+  #define I2CPE_ENC_2_EC_METHOD     I2CPE_ECM_NONE
1306
+  #define I2CPE_ENC_2_EC_THRESH     0.10
1307
+
1308
+  #define I2CPE_ENC_3_ADDR          I2CPE_PRESET_ADDR_Z     // Encoder 3.  Add additional configuration options
1309
+  #define I2CPE_ENC_3_AXIS          Z_AXIS                  // as above, or use defaults below.
1310
+
1311
+  #define I2CPE_ENC_4_ADDR          I2CPE_PRESET_ADDR_E     // Encoder 4.
1312
+  #define I2CPE_ENC_4_AXIS          E_AXIS
1313
+
1314
+  #define I2CPE_ENC_5_ADDR          34                      // Encoder 5.
1315
+  #define I2CPE_ENC_5_AXIS          E_AXIS
1316
+
1317
+  // Default settings for encoders which are enabled, but without settings configured above.
1318
+  #define I2CPE_DEF_TYPE            I2CPE_ENC_TYPE_LINEAR
1319
+  #define I2CPE_DEF_ENC_TICKS_UNIT  2048
1320
+  #define I2CPE_DEF_TICKS_REV       (16 * 200)
1321
+  #define I2CPE_DEF_EC_METHOD       I2CPE_ECM_NONE
1322
+  #define I2CPE_DEF_EC_THRESH       0.1
1323
+
1324
+  //#define I2CPE_ERR_THRESH_ABORT  100.0                   // Threshold size for error (in mm) error on any given
1325
+                                                            // axis after which the printer will abort. Comment out to
1326
+                                                            // disable abort behaviour.
1327
+
1328
+  #define I2CPE_TIME_TRUSTED        10000                   // After an encoder fault, there must be no further fault
1329
+                                                            // for this amount of time (in ms) before the encoder
1330
+                                                            // is trusted again.
1331
+
1332
+  /**
1333
+   * Position is checked every time a new command is executed from the buffer but during long moves,
1334
+   * this setting determines the minimum update time between checks. A value of 100 works well with
1335
+   * error rolling average when attempting to correct only for skips and not for vibration.
1336
+   */
1337
+  #define I2CPE_MIN_UPD_TIME_MS     100                     // Minimum time in miliseconds between encoder checks.
1338
+
1339
+  // Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
1340
+  #define I2CPE_ERR_ROLLING_AVERAGE
1341
+
1342
+#endif // I2C_POSITION_ENCODERS
1343
+
1261 1344
 #endif // CONFIGURATION_ADV_H

Loading…
Cancel
Save