3DUK => 3DUK Firmware => Topic started by: CdRsKuLL on April 18, 2019, 01:14:57 PM

Title: Firmware modification
Post by: CdRsKuLL on April 18, 2019, 01:14:57 PM
Sometimes a few tweaks will be required to the standard firmware to get your Pretend Prusa to function correctly. Things like motor currents, heights and PWM bed frequency.

You will need to compile the firmware yourself using the Arduino IDE and below are a few locations to help you get started.

Motor Currents

Depending what motors you are using you will might need to alter the current. The values are held in two places I've found so far in the firmware.

In Configuration_prusa.h (I've changed them to support some standard motors from an old i3 printer)
#define TMC2130_CURRENTS_H {30, 30, 55, 50}  // default holding currents for all axes
#define TMC2130_CURRENTS_R {30, 30, 55, 50}  // default running currents for all axes

And also in tmc2130.cpp (here they are changed for the homing routine, so if yours fails to home correctly, then up these abit)
//running currents for homing
//uint8_t tmc2130_current_r_home[4] = {8, 10, 20, 18}; //old
uint8_t tmc2130_current_r_home[4] = {30, 30, 55, 50};

You might also need to change your motor steps. This is normally done after configuration but it will fail the XYZ if not correct to start with as it will be searching in the wrong place. These are in..
#define DEFAULT_AXIS_STEPS_PER_UNIT   {100,100,3200/8,280}

The other thing you might need to change is the height of the machine to pass the XYZ calibration routine. I've had to increase the height to 214. This is held in...
#define Z_MAX_POS 214 // old 212

Since version 3.7.0 I have seen a TMC overheating error come up, this is because of the extra heat caused by the PWM bed heating change. This is not just on Pretend Prusas but also on the original ones too.  As a temp fix in firmware v3.70 you can comment out the following in..
#include "Arduino.h"
//#define SYSTEM_TIMER_2

This should stop the TMC overheat error but you might then hear clicking when your bed is heating up, this is normal.

Please post other findings here.