Browse Source

Merge pull request #3131 from thinkyhead/pwm_motor_current_config

PWM_MOTOR_CURRENT Flag
Scott Lahteine 8 years ago
parent
commit
7326d63ce0

+ 3
- 0
Marlin/Configuration_adv.h View File

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -279,6 +279,9 @@
279 279
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
280 280
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
281 281
 
282
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
283
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
284
+   
282 285
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
283 286
 //#define DIGIPOT_I2C
284 287
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -282,6 +282,9 @@
282 282
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
283 283
 #define DIGIPOT_MOTOR_CURRENT {175,175,240,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
284 284
 
285
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
286
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
287
+   
285 288
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
286 289
 //#define DIGIPOT_I2C
287 290
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

+ 3
- 0
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -276,6 +276,9 @@
276 276
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
277 277
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
278 278
 
279
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
280
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
281
+   
279 282
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280 283
 //#define DIGIPOT_I2C
281 284
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -276,6 +276,9 @@
276 276
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
277 277
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
278 278
 
279
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
280
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
281
+   
279 282
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280 283
 //#define DIGIPOT_I2C
281 284
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -275,6 +275,9 @@
275 275
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
276 276
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
277 277
 
278
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
279
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
280
+   
278 281
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
279 282
 //#define DIGIPOT_I2C
280 283
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -279,6 +279,9 @@
279 279
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
280 280
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
281 281
 
282
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
283
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
284
+   
282 285
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
283 286
 //#define DIGIPOT_I2C
284 287
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

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

@@ -274,6 +274,9 @@
274 274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275 275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
276 276
 
277
+// Motor Current controlled via PWM (Overridable on supported boards with PWM-driven motor driver current)
278
+//#define PWM_MOTOR_CURRENT {1300, 1300, 1250} // Values in milliamps
279
+   
277 280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278 281
 //#define DIGIPOT_I2C
279 282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

+ 4
- 1
Marlin/stepper.cpp View File

@@ -88,7 +88,10 @@ static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_
88 88
 #endif
89 89
 
90 90
 #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
91
-  int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT;
91
+  #ifndef PWM_MOTOR_CURRENT
92
+    #define PWM_MOTOR_CURRENT DEFAULT_PWM_MOTOR_CURRENT
93
+  #endif
94
+  const int motor_current_setting[3] = PWM_MOTOR_CURRENT;
92 95
 #endif
93 96
 
94 97
 static bool check_endstops = true;

Loading…
Cancel
Save