Browse Source

Adding PWM_MOTOR_CURRENT flag to help expose PWM_MOTOR_CURRENTS in Configuration_adv.h similar to DIGIPOT_MOTOR_CURRENT

Elijah Snyder 9 years ago
parent
commit
e8b10d2836
2 changed files with 7 additions and 1 deletions
  1. 3
    0
      Marlin/Configuration_adv.h
  2. 4
    1
      Marlin/stepper.cpp

+ 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 (Only functional when motor driver current is driven by PWM on supported boards)
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
+  int motor_current_setting[3] = PWM_MOTOR_CURRENT;
92 95
 #endif
93 96
 
94 97
 static bool check_endstops = true;

Loading…
Cancel
Save