Jump to content
Ultimaker Community of 3D Printing Experts
Sign in to follow this  

Heated bed issues with Marlin

Recommended Posts

Hi guys,

You are my last chance for any help.

1st: What I am trying to do: Getting a heated bed (the relais option) to work properly.

2nd: What is not working: First. 4.7k Resistor is too low (Thermistor NTC 100k B57560G104F). Ich checked the Signal line with the oscilloscope. It stays at about 5V. So the SW will return 0 Temp for Bed. Second, if i get the bed temp inside the min/max borders and set the bed temp, the output pin of the arduino board (in my case 4) stays at GND.

3rd: What have I done till now: I replaced the 4.7k resistor with a 20k. Now the SW is reading a value from the Thermistor (22°C will be shown as 45.7°C) I checked, if my motherboard is configured in Marlin source code. Output pin should for heated bed should be 4. The only thing, which i can think of preventing the Arduino to set the Output high is the following code:

I think, that pwm count is always higher than soft_pwm_b


 static unsigned char temp_count = 0; static unsigned long raw_temp_0_value = 0; static unsigned long raw_temp_1_value = 0; static unsigned long raw_temp_2_value = 0; static unsigned long raw_temp_bed_value = 0; static unsigned char temp_state = 0; static unsigned char pwm_count = 1; static unsigned char soft_pwm_0; #if EXTRUDERS > 1 static unsigned char soft_pwm_1; #endif #if EXTRUDERS > 2 static unsigned char soft_pwm_2; #endif #if HEATER_BED_PIN > -1 static unsigned char soft_pwm_b; #endif if(pwm_count == 0){   soft_pwm_0 = soft_pwm[0];   if(soft_pwm_0 > 0) WRITE(HEATER_0_PIN,1);   #if EXTRUDERS > 1   soft_pwm_1 = soft_pwm[1];   if(soft_pwm_1 > 0) WRITE(HEATER_1_PIN,1);   #endif   #if EXTRUDERS > 2   soft_pwm_2 = soft_pwm[2];   if(soft_pwm_2 > 0) WRITE(HEATER_2_PIN,1);   #endif   #if HEATER_BED_PIN > -1   soft_pwm_b = soft_pwm_bed;   if(soft_pwm_b > 0) WRITE(HEATER_BED_PIN,1);   #endif } if(soft_pwm_0 <= pwm_count) WRITE(HEATER_0_PIN,0); #if EXTRUDERS > 1 if(soft_pwm_1 <= pwm_count) WRITE(HEATER_1_PIN,0); #endif #if EXTRUDERS > 2 if(soft_pwm_2 <= pwm_count) WRITE(HEATER_2_PIN,0); #endif #if HEATER_BED_PIN > -1 if(soft_pwm_b <= pwm_count) WRITE(HEATER_BED_PIN,0); #endif pwm_count++; pwm_count &= 0x7f;


Is the creator of Marlin reacheable trough this forum, or had anybody the same problems? :?:

Please help.

Thank you!

Lukas :D

Share this post

Link to post
Share on other sites

The heated bed code on the ErikZalm branch was broken last week, the latest code is fixed. So first make sure you are using that.

How did you wire up your thermistor? As RepRaps have been using 4.7k like, forever, and that always works. So it being "wrong" would be odd.

Share this post

Link to post
Share on other sites

Hi Daid,

Got the newest code from Github and changed the configuration a bit. My Output works now, but i think PID Control of heated bed is still activated, because I got a switching frequency of my Relais of about 7Hz. The Attached file is my configuration.h may you can tell me, where I did the wrong configuration.

Thermistor is wired up like in the wiki.





-------------------- Signal





The pins of the thermistor are attached to the outer pins of the molex header.

My Thermistor has a Resistance of about 170K at 22 degrees. I dont know why the Signal doesnt change even when i heat up to about 80°C (Resistance about 75K). The signal should be 4.72V but it stays at 5V. If I change the 4.7k to a higher Value, the Signal changes. I checked the Routing and the schematic of the Ultimaker print to get sure, if there is a reason for the abnormal behavior. I couldnt find anything to explain it. But after some search I found other with the same problem. They also changed their top resistor to get things done. Also I am reading a higher Input Voltage (ca 5.3V) when main power is on. I dont have checked the schematics of the Arduino board, may this is the reason for wrong values.

Share this post

Link to post
Share on other sites

That wiring look right, but I have no real themistor experience. So I can only help you on the software side. In the software I see about a 20% change in ADC value between 0C and 80C, so at 80C I would expect around 4V

In the configuration.h, I recommend to disable PIDTEMPBED and enable BED_LIMIT_SWITCHING this should lower the switching frequency and thus protect your relais.

Share this post

Link to post
Share on other sites

hmm i disabled PIDTEMPBED but i still have about 7Hz Switching Frequenzy on the heated bed.

My Configuration:

// Bed Temperature Control
// Select PID or bang-bang with PIDTEMPBED.  If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
// uncomment this to enable PID on the bed.   It uses the same ferquency PWM as the extruder. 
// If your PID_dT above is the default, and correct for your hardware/configuration, that means 7.689Hz,
// which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
// This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater. 
// If your configuration is significantly different than this and you don't understand the issues involved, you proabaly 
// shouldn't use bed PID until someone else verifies your hardware works.
// If this is enabled, find your own PID constants below.
//#define PIDTEMPBED
// This sets the max power delived to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, argressive factor of .15 (vs .1, 1, 10)
   #define  DEFAULT_bedKp 10.00
   #define  DEFAULT_bedKi .023
   #define  DEFAULT_bedKd 305.4

About the Hardware: I re-checked everything, but I still cant figure out, why the Value is not changing. Only Solution from my side is, that I create my own thermistor table for this thermistor.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Our picks

    • Introducing Ultimaker Cura 3.6 | Beta
      Ultimaker Cura 3.6 | Beta is available. It comes with new features, bug fixes, and UX improvements. We would really like to have your feedback on it to make our stable release as good as it can be. As always, you can download the beta for free from our website, for Windows, MacOS, and Linux.
        • Like
      • 95 replies
    • Print Core CC | Red for Ruby
      Q: For some users, abrasive materials may be a new subject matter. Can you explain what it is that makes a material abrasive when you are not sure which print core to use?
      A: Materials which are hard in a solid piece (like metals, ceramics and carbon fibers) will generally also wear down the nozzle. In general one should assume...
        • Like
      • 30 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!