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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
279
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
280
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
285
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
283
 //#define DIGIPOT_I2C
286
 //#define DIGIPOT_I2C
284
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
282
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
283
 #define DIGIPOT_MOTOR_CURRENT {175,175,240,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
288
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
286
 //#define DIGIPOT_I2C
289
 //#define DIGIPOT_I2C
287
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
276
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
277
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
282
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 //#define DIGIPOT_I2C
283
 //#define DIGIPOT_I2C
281
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
276
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
277
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
282
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 //#define DIGIPOT_I2C
283
 //#define DIGIPOT_I2C
281
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
276
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
281
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
279
 //#define DIGIPOT_I2C
282
 //#define DIGIPOT_I2C
280
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
279
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
280
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
285
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
283
 //#define DIGIPOT_I2C
286
 //#define DIGIPOT_I2C
284
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
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
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
274
 // Motor Current setting (Only functional when motor driver current ref pins are connected to a digital trimpot on supported boards)
275
 #define DIGIPOT_MOTOR_CURRENT {135,135,135,135,135} // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
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
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
280
 // uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro
278
 //#define DIGIPOT_I2C
281
 //#define DIGIPOT_I2C
279
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8
282
 // Number of channels available for I2C digipot, For Azteeg X3 Pro we have 8

+ 4
- 1
Marlin/stepper.cpp View File

88
 #endif
88
 #endif
89
 
89
 
90
 #if PIN_EXISTS(MOTOR_CURRENT_PWM_XY)
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
 #endif
95
 #endif
93
 
96
 
94
 static bool check_endstops = true;
97
 static bool check_endstops = true;

Loading…
Cancel
Save