dot-bob / Marlin-Duplicator-6

Marlin firmware for the Duplicator 6
GNU General Public License v3.0
65 stars 33 forks source link

Unexpected value of MOTOR_CURRENT_PWM_RANGE? #12

Closed drewoprea closed 3 years ago

drewoprea commented 3 years ago

In your Configuration_adv.h you set: //Motor current PWM conversion, PWM value = MotorCurrentSetting * 255 / range

define MOTOR_CURRENT_PWM_RANGE 2782

define PWM_MOTOR_CURRENT { 1000, 900, 900 } // Values in milliamps

But I've noticed that you merged different values upstream in Marlin: https://github.com/MarlinFirmware/Marlin/pull/6943

ifndef MOTOR_CURRENT_PWM_RANGE

define MOTOR_CURRENT_PWM_RANGE 2000

endif

define DEFAULT_PWM_MOTOR_CURRENT {1300, 1300, 1250}

Was this an oversight, or could 2782 be a magic number who's significance is lost on me?

dot-bob commented 3 years ago

The printers hardware implementation determines this value. If I recall this value was used so the stepper current setting is scaled to match the stock firmware for the duplicator 6. The stock firmware is derived from Ultimakers ancient fork of Marlin and is calculated a bit differently.