makerbase-mks / Klipper-for-MKS-Boards

GNU General Public License v3.0
237 stars 166 forks source link

MKS Robin Mini, VREF is generated in SW #34

Open PSLLSP opened 1 year ago

PSLLSP commented 1 year ago

Board MKS Robin Mini has stepper drivers A4988 soldered on board but there are no trimmers to set VREF voltage for these drivers. VREF is generated with PWM by CPU. I cannot see any reference to VREF voltage in clipper configuration file generic-mks-robin-mini-v2.cfg. I assume that VREF will be just some random value, it could be too low or too high. Do I miss something?


MKS Robin mini generates 3 voltages for VREF:

https://github.com/makerbase-mks/MKS-Robin-mini/tree/master/hardware

This is in Marlin configuration pins_MKS_ROBIN_MINI.h

// Motor current PWM pins
#define MOTOR_CURRENT_PWM_XY_PIN   PA6
#define MOTOR_CURRENT_PWM_Z_PIN    PA7
#define MOTOR_CURRENT_PWM_E_PIN    PB0
#define MOTOR_CURRENT_PWM_RANGE    1500 // (255 * (1000mA / 65535)) * 257 = 1000 is equal 1.6v Vref in turn equal 1Amp
#define DEFAULT_PWM_MOTOR_CURRENT  { 1030, 1030, 1030 } // 1.05Amp per driver, here is XY, Z and E. This values determined empirically.

One more note/issue

Why README has instruction to rename firmware to Robin_nano35.bin? It is board Robin mini...

Rename as Robin_nano35.bin
Copy Robin_nano35.bin klipper firmware to TF card and insert board

One more note to README. Please update it with information if touch screen (2.4", connected with flat ribbon cable to MKS Robin Mini) will work with Klipper. I assume that it will not work. Please, update README with this important information...

ad1789 commented 1 year ago

Try it

[output_pin xy_pin] pin: PA6 pwm: True cycle_time: 0.001 hardware_pwm: True value:0.5

[output_pin z_pin] pin: PA7 pwm: True cycle_time: 0.001 hardware_pwm: True value:0.7

[output_pin E_pin] pin: PB0 pwm: True cycle_time: 0.001 hardware_pwm: True value:0.8