Welcome! Log In Create A New Profile

Advanced

Heated Bed Overdrive

Posted by to-the-nth 
Heated Bed Overdrive
September 29, 2016 10:05PM
Moving a thread that was started on the MarlinFirmware forum so it can be viewed by a wider audience. Here is the first post...

For heated beds using copper heating elements, power falls off by ~30% by the time the bed reaches a final temperature of about 115C (which is typical for ABS). In some cases, a power supply with extra current capacity is needed to deliver the cold start up current (which adds cost - sometimes crazy amounts). Both of these can be addressed with a code hack.

Constant Power ~360W supply=25.5V 14.1A constant 160sec to 115C
bed 25 5v 14a 360w


Before a series of HW upgrades, my bed heat times were on the order of 10 minutes. On my printer, I've added a second 24V 15A 360W Mean Well style switching power supply to drive a custom sticky copper tape heated bed. The Mean Well style supplies are the eBay cheapy supplies commonly use to drive LED lighting. Most of them use the same core design. Here is a great link to the internal workings. With this overdrive hack, I get a power density of 0.45W/cm^2. Some mains powered heaters are running in the 0.5W/cm^2 range. Bed heat time dropped from 225sec to 160sec. This hack requires enabling bed PWM (#define PIDTEMPBED).

So the idea is to crank up the voltage adjust on the power supply so that the power supply CAN deliver full rated output power when the bed is near a max temp, as needed by the stock PID control loop. In my case, I chose a cross over temp of 110C. Above that temperature, the overdrive is off. Below that temperature, the firmware hack uses the Marlin software bed PWM to limit the max bed power. The MAX_BED_POWER configuration #define is turned into a variable that is a function of bed temperature. Copper has a temperature coefficient of about 0.0039/degC, so for lower temperatures we have to linearly reduce the amount of PWM and max bed power to stay within the rated limits of the supply. You can see in the pic above how the PWM bed power is initially limited to about 77% of max, and then gradually increases to 100% at 110C.

In practice, the measured values for the temperature coefficient were slightly different from the ideal for copper. So the hack uses measured values of resistance at room temperature and at the 110C number. Voltage and current measurements are easy, and are done at reduced supply voltage, then plugged into #defines. You probably don't want to try this with a stock RAMPs board power FET and polyfuse because of their huge power losses. My RAMPs board is driving a custom solid state relay.

One concern is that the stock firmware bed PWM cycle time on the order 131msec. At low temps the power supply doesn't get much in the way of averaging, but sees a train of relatively large current and power pulses. Setting #define SOFT_PWM_SCALE 3 helps somewhat by changing the PWM cycle time to 16.3msec at the loss of granularity. Does anyone know why bed hardware PWM would not be infeasible? and if it has been implemented somewhere in Marlin history?

Would there be enough general interest in this hack to create a branch? There are a handful of edits to cut and paste in if anyone wanted to try it. My current code base is seriously down rev from trunk.

Constant Voltage supply=21.4V 15A starting at room temp 225sec to 115C
This is the same hardware without the overdrive hack. Supply voltage had to be limited to keep from exceeding the max 15A current limit of the supply.
bed 21 4v 15a

Re: Heated Bed Overdrive
September 30, 2016 12:08AM
@AndyZuerich - Andy click on the schematic in the PSU link; there is a very nice pdf download

Correct. A FW or HW mechanism to impedance match the varying resistance of the bed to the PSU for maximum power transfer.

You are correct about the inductance concern, but my power N-channel FET is running with the source connected to ground, so any inductive kick is picked up by the clamp diode connected to the bypassed supply rail.

Abusing the PSU output filter caps is a concern with a 31kHz PWM. I found some cheap 0.01F 35V on eBay, but who knows what the ESR is....

@Rerouter - I think we want the PSU load current to be constant, not the bed current. Can you get there by adjusting the dimmer control on the LED constant current driver?

How about a Ćuk converter?
Re: Heated Bed Overdrive
September 30, 2016 10:50AM
Quote
You are correct about the inductance concern, but my power N-channel FET is running with the source connected to ground, so any inductive kick is picked up by the clamp diode connected to the bypassed supply rail.

I think this is not correct. I think what you have is (and this also is good and often necessary) a freewheeling diode. The freewheeling diode takes over the current which is enforced by your output (in your case purely parasitic) inductance. If you have a real output inductor, the freewheeling diode is mandatory. But the input parasitic inductance hurts always (only during switch turn-off) without the freewheeling diode helping, as described in this article: switching overvoltage

But maybe I understood your setup wrong? Then, please upload a circuit schematic of your setup.

Quote
Abusing the PSU output filter caps is a concern with a 31kHz PWM. I found some cheap 0.01F 35V on eBay, but who knows what the ESR is....

As first improvement, please use a SMD ceramic capacitor, just the one as large as you can find which is rated for the necessary voltage. Nowadays, you can get one with for instance 20-50 mu F for about 2-5 USD. Then, you can add in parallel a larger electrolytic cap. An electrolytic cap will not help here at all with the switching overvoltage. The work of the largest input bulk capacitor can still be done by the PSU output cap.

Quote
I think we want the PSU load current to be constant, not the bed current. Can you get there by adjusting the dimmer control on the LED constant current driver?

Yes, the optimization that can be done here is to set the PSU output current to exactly the value that the PSU is rated for, I agree. Then, the bed output power is optimized automatically. Well, I think this could also be done automatically by measuring the current through a shunt resistor, but this adds another complication. A simple measurement of the bed resistance would be much simpler.

Since my PSU is overdesigned, I don't have the need for doing this. I am just running it with the maximum voltage as long as necessary.

But the following might be interesting for you as well, to increase the heatup time:
Bang-Bang controllers are much faster to get into steady state. The heated bed step response is simply an exponential curve. When we tune our PID controllers, than we have the following issues:

  • a (small) dead time, since the temperature sensor is sometimes located some mm's away from the heater. This applies more to the hotend compared to the heater. Very often, the heated bed sensor is within the heating mat itself
  • A large time constant (e.g. 20-100 sec). The bad thing with PID controllers is: When you have dead-time plus a large time constant, then the PID controller always overshoots, when it is designed after Ziegler-Nichols. There are some Ziegler-Nichols modifications which state that there is no overshoot. But as far as I understood, this "no overshoot" still shows overshoot when there are large time constants + dead time. The consequence: Our PID parameters have to be selected so that it slows down the heating process even more.


The possible improvements that I am thinking about are therefore:

  • Use a Bang-Bang controller until the bed is at the target temperature. Then, switch to a PID controller. This method could even be extended. The bang-bang controller (with .e.g 2-3 cycles) could be used to automatically get the PID parameters for the subsequent PID contoller --> then, we (and other marlin users) would never need to tune the PID constants manually anymore.
  • Second improvement (or as alternative the the bang-bang startup): Use a Smith predictor to increase the PI(D) performance. The following article is quite nice to read, and it shows how a smith-predictor improves startup time, as well as PI(D) performance:
    Smith Predictor Matlab. Such an approach would increase code complexity in Marlin quite a bit. But the better startup time + the possibility of a much more agressive PID tuning are maybe worth the effort. Here, 2-3 additional parameters are required: The dead time (can be automatically measured), the gain (which control signal results in which steady-state temperature?) and the heated bed or hotend time constant. All off these parameters could be measured from a simple tuning experiment. The colleagues from "repetier" have implemented something similar in their software: repetier-deadtime
    In my case, I am using a deltaprintr mini hotend, which has quite a small thermal capacitance. Therefore, the extrusion speed is quite some load, since the extruded filament (which is heated from room temp to 200 C) is something like a power loss. I am at the moment not really happy with my PID performance.

Edited 1 time(s). Last edit at 09/30/2016 10:51AM by andreas_zh.
Re: Heated Bed Overdrive
October 01, 2016 02:36PM
The back ground motivation for this thread is to find a cost effective, ~$100, 500-600W heated bed solution for a 350-400mm diameter aluminum bed on a delta that does not use mains power, but has a power density approaching 0.5W/cm^2. The LED market has a 24V 25A 600W PSU price point of ~$45 that seems cost effective with multiple vendors. The difficulty is in finding a Kapton or PCB heater that has a good impedance match for optimal power transfer to a 24V supply at these power levels. I've had great success with DIY copper tape on glass heated beds at these power densities for over a half year. The advantage is being able to choose the bed impedance during the design process. My fall back is to extend the DIY to using a layer of Kapton tape as a substrate between the aluminum plate and copper foil tape. Even so, it would be great to find a suitable properly designed ~$45-$55 off the shelf bed heater. This leaves maybe $10 for the driver/impedance matching network to implement the Overdrive which shortens bed heat time by 30-40%. Because of poor impedance matching with off the shelf solutions, we're sometimes forced to the next larger PSU wattage, like 480W->600, or 600->720, just to satisfy output current requirements.

The solution space I'd like to explore is:
-Off the shelf heater solutions that meet the targets
-PSU Impedance/matching techniques to implement Overdrive -continuous full rated PSU power transferred to the bed as its resistance changes with temperature. This includes direct PWMing of the bed via Marlin/FW changes and driver implementation, including supplemental PSU capacitance. It also includes other cost effective matching solutions like buck or boost converters tacked onto the PSU.

@andreas
-Sorry, nomenclature I used wasn't the best; 0.01F = 10,000 uF, intended to cover RMS ripple current requirements over what is provided by the PSU. This is something we need to discuss further.
-don't have current schematic; really just implemented as a safety voltage clamp with a polyfuse in the return path. Didn't think the bed inductance would be that large; will add a proper wheeling diode across the bed. Need to measure bed inductance if it is going to be PWM'ed at a high frequency, EMI and noise can become an issue.
-with the Marlin autotune parameters, PID hasn't been in the way. Drive "immediately" goes to 100% full on and remains there until PID activation limit is hit like within 5-10 degrees of the target temp. The temp is ramping so rapidly, the PID error integrator don't have much time to wind up before reaching the target. Refer to the graph in the first post.
Re: Heated Bed Overdrive
October 01, 2016 06:10PM
A couple of comments:

- We recently added auto tuning to RepRapFirmware. We don't do ZN tuning, instead we measure the dead time, gain and time constant of the heater/thermistor system. Then we calculate two sets of PID parameters from that heater model. One is designed to heat up to the target temperature with minimal overshoot. The other is much more aggressive to give better response to load changes. We switch over to that one when the temperature is very close to target. In the future I plan to add feedforward terms to better handle fans being turned on and varying filament flow.

- IMO the best solution to heating a large bed on a delta is to use a mains voltage heater. But whether you use mains voltage or you insist on using 24V, you can get a silicone heater made to your own size, voltage and power specifications very cheaply from Ali Brother Technology via AliExpress. I think I paid $35 for my 300mm round one.

Edited 2 time(s). Last edit at 10/01/2016 06:13PM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Heated Bed Overdrive
October 02, 2016 02:18PM
@dc42 Fired off an email to Ali Brother Tech to see if they can help me. Do you know if your 300mm uses copper heating elements? Can you post a heat up graph? I can be talked into mains for a Delta since the wiring is fixed and the Mic6 bed plate can be grounded. Present development is being done on a printer where the bed moves on y rails, so I'd rule out mains drive for it. Also planning a corexy I'd have to think about for mains drive. On your 300mm, do you attempt to do any zero crossing or phase control on the SSR? I've got my Duet and Panel Due sitting in boxes waiting for the Delta build. Wish I had waited a few months and purchased the Duet WiFi instead. Next one I guess.

@andreas I am seeing about 4V of inductive spike from the power supply wiring. I have a single 100uf radial electrolytic as an input filter. I have the gate drive dialed back to give about a 300nsec rise time when the FET turns off. Added a 35A freewheeling diode. The ripple current on the PSU output filter caps should be the difference between the average PSU output inductor current and the peak current that is drawn when the FET is turned on. That difference should on be a few amps, so I am guessing I'll be ok directly PWM'ing the bed at 31kHz without additional supply bulk capacitance. If you hear a loud bang, you'll know it wasn't so. How did you design and size the inductor on your buck converter? What kind of input and output supply caps did you use?

Edited 1 time(s). Last edit at 10/02/2016 02:18PM by to-the-nth.
Re: Heated Bed Overdrive
October 03, 2016 10:36AM
Quote
to-the-nth
@dc42 Fired off an email to Ali Brother Tech to see if they can help me. Do you know if your 300mm uses copper heating elements? Can you post a heat up graph? I can be talked into mains for a Delta since the wiring is fixed and the Mic6 bed plate can be grounded. Present development is being done on a printer where the bed moves on y rails, so I'd rule out mains drive for it. Also planning a corexy I'd have to think about for mains drive. On your 300mm, do you attempt to do any zero crossing or phase control on the SSR? I've got my Duet and Panel Due sitting in boxes waiting for the Delta build. Wish I had waited a few months and purchased the Duet WiFi instead. Next one I guess.

Their site says they can use either etched foil or wire wound heating elements, and that the wire wound ones are nichrome. It sounds to me that the custom made ones are wire wound, but best check with them.

I use a cheap Fotek zero-crossing SSR to control the bed heater. The slow (10Hz) PWM used by RepRapFirmware for the bed heater was chosen to be compatible with all types of SSR.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Heated Bed Overdrive
October 04, 2016 06:03AM
Quote
How did you design and size the inductor on your buck converter? What kind of input and output supply caps did you use?

for the caps: I used the following SMD caps for my input and output, respectively:

Keramik-Kondensator 1210 22 µF 25 V 20 % (L x B x H) 3.2 x 2.5 x 2.5 mm Würth Elektronik WCAP-CSGP 885012109014 1 St. CHF 2.05 CHF 8.20
1280049 Keramik-Kondensator 1210 47 µF 16 V 20 % (L x B x H) 3.2 x 2.5 x 2.5 mm Würth Elektronik WCAP-CSGP 885012109011 1 St. CHF 1.60 CHF 9.60

The input caps are located as close as possible to the switch.
Additionally, I added some larger electrolytic caps in the range of 2000 mu F in parallel to the SMD caps. The SMD caps should take the high frequency voltage ripple, the electrolytic ones should then supply more constant voltage at lower frequencies.

For the inductors: I just had some in my spare part box which were appropriate. But sometimes it is difficult to find high current inductors, therefore you can wind them yourself. There is a tool called GeckoMAGNETICS which I recommend for the inductor design. Just write an email to the companies contact adress, then you can get a free license. The software also includes a power electronics circuit simulator, which might be quite useful for you.
Sorry, only registered users may post in this forum.

Click here to login