MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.03k stars 19.12k forks source link

[FR] Hotend Cooling Fan Curve? #18295

Open Power3DPrinting opened 4 years ago

Power3DPrinting commented 4 years ago

Description

Hotend cooling fan does not need to spin as fast when heated to 350 degrees celsius as it does at 150 degrees celsius for example. I thought it might be more convenient to have an automatic fan curve rather than using a written table to manually set the fan speed with M106 at the start of every print.

Feature Workflow

  1. Set hotend fan cooling pin.
  2. Define the number of points on the curve like 5 or 10.
  3. Set PWM/fan speeds relative to the nozzle temperature or seperate thermistor.
  4. Firmware interpolates linearly between the points the relative fan speeds (honestly, if this is too difficult, I don't mind manually setting 100 or more points for a fan curve).
  5. Upload firmware.

Additional Information

I have a lot of trouble understanding programming and I really appreciate the time all of you put into adding new features. Sorry if this already exists, I could not find it in config_adv.h.

AnHardt commented 4 years ago

Hotend cooling fan does not need to spin as fast when heated to 350 degrees celsius as it does at 150 degrees celsius for example.

Really? That direction?

ellensp commented 4 years ago

users wont be happy till the printer can actually lower the ambient noise in a room... This would be yet another way users would stuff up their setting and cause clogs...

Power3DPrinting commented 4 years ago

Hotend cooling fan does not need to spin as fast when heated to 350 degrees celsius as it does at 150 degrees celsius for example.

Really? That direction?

users wont be happy till the printer can actually lower the ambient noise in a room... This would be yet another way users would stuff up their setting and cause clogs...

Sorry I made a bullying request... The obvious benefit is sound but I also wanted to extend the lifespan of the fan and save some electricity especially for a battery powered printer... Clogging is not an issue when done right like many things otherwise you're in the wrong community...

Marlor commented 4 years ago

How would you even calibrate the fan curve? Turn the Speed down until it clogs and 10% up again? I cant imagen the small difference in power consumption and lifespan would be worth such a calibration (which cost Power and lifespan)

You are talking about M106, do you mean the hotend cooling fan or the part cooling fan?

Power3DPrinting commented 4 years ago

How would you even calibrate the fan curve? Turn the Speed down until it clogs and 10% up again?

A crude solution with the right idea of trial and error and a margin for error. Calibration should be done with a thermistor attatched to the hotend heat sink. Either the bed or second extruder thermistor or external device will work (accuracy improved with thermal paste). Then adjust fan speed and hotend temperature keeping the hotend heatsink below 40,60,80 for hotend temps 180-215 PLA, 220-245 PETG, 260-300 Other respectively. Record fan speed values. Test with actual filament. Adjust from there. Tedious, but I have 5 printers with the same hotend and another 5 to be built in the next few months so it spreads the time cost.

I cant imagen the small difference in power consumption and lifespan would be worth such a calibration (which cost Power and lifespan)

You're not wrong, for one printer running a one or two hour print once or twice a month, it is not that much. A small print farm is perhaps the most practical savings where the cost in power and life span are multiplied significantly with non stop prints. Even a few hundred fan revolutions per minute saved add up really fast over a week or month and even more so with more printers.

Battery power is more of a distant dream than a reality but the principal of saving battery power the same as how laptops disable rgb or limit their fan speeds to extend battery life still holds true with all electronics.

And super side topic, I actually despise small single fans on hotends. The future really should be larger fans on radiators and water pumps for better cooling and lower inertia especially inside enclosures. Being able to better regulate water pump and radiator cooling fan speeds can be useful to extend their service life from a maybe a year or two to reliable for years. Idk, just stuff I learned from computer building.

You are talking about M106, do you mean the hotend cooling fan or the part cooling fan?

I have to apologize, I really don't understand the coding that well. I am very mechanical minded. Both the hotend cooling fan and part cooling fan have their own controlling pin and if M106 does not work, calling out the individual pin like for on ramps and setting the frequency between 0-255 will work. I do this for fans and LED's and seems reliable enough. Just varies from hardware and setup of different machines.

Thanks for the really good questions. Really made me think about the idea and request a lot more.

AnHardt commented 4 years ago

Energy transfer over the heatbreak is about linear to the temperature difference temperature between heater-block and heatsink. Energy transfer from the heatsink to the surrounding air depends not only upon the airspeed but also on the temperature of the surrounding air (heated chamber). For that a system trying to hold the heatsinks temperature constant, only based on the heaterblocks temperature, and setting the fan-speed will fail when the environments temperature is not constant. The temperature of the air surrounding the fins of the heatsink is the more important part of the equation. The air-stream just helps to move away the heated air near the surface of the fins.

Making the cold-end-fan adjustable makes perfect sense but not when based only on the heaterblocks temperature - it needs the heatsinks temperature and a pid, or the heatsinks temperature, the environments temperature and a guessing table.

Hotend cooling fan does not need to spin as fast when heated to 350 degrees celsius as it does at 150 degrees celsius for example.

To get at least the direction right it needs a faster spinning fan at higher temperatures and a slower spinning fan at low temperatures. What you told us is counterproductive.


Up to now Marlins heater subsystem is not really object oriented. For every kind of heater (nozzle, bed, chamber, ...) there is(are) its own function(s) for controling heat/cool, protection, ... . This is unmaintainable since a long time. Any extension of that system reduces the probability this system will be structurally improved sometime (if its not already to late).

Power3DPrinting commented 4 years ago

Sorry, the close button was right next to the post comment button and I tapped the wrong one. That is why I closed and reopened this request.

Energy transfer over the heatbreak is about linear to the temperature difference temperature between heater-block and heatsink. Energy transfer from the heatsink to the surrounding air depends not only upon the airspeed but also on the temperature of the surrounding air (heated chamber). For that a system trying to hold the heatsinks temperature constant, only based on the heaterblocks temperature, and setting the fan-speed will fail when the environments temperature is not constant. The temperature of the air surrounding the fins of the heatsink is the more important part of the equation. The air-stream just helps to move away the heated air near the surface of the fins.

You're absolutely right. Ambient air temperature plays a big role in air cooling. Hopefully with water cooling increasing in popularity it solves the dilemma alltogether. I would need to conduct some more testing. Ideally the margin of error of 20 degrees celsius on the heatsink would be sufficient to compensate for environment changes but this can be increased. The most controlling solution would be permanently fixing a second extruder thermistor to the heat sink for constant temperature monitoring and automatic adjustment by the printer's mainboard.

Making the cold-end-fan adjustable makes perfect sense but not when based only on the heaterblocks temperature - it needs the heatsinks temperature and a pid, or the heatsinks temperature, the environments temperature and a guessing table.

You're very right, this is a fairly complex feature request with pid. However based on how pid works, there would not be a need for a guessing table or environment adjustment or much else otherwise the pid on the hotend(s) and bed would not be working as well. I was originally hoping a blind adjustment relative to the temperature of the hotend with a healthy margin of error would be sufficient but a thermistor mounted to the cold end seems to be the most optimal mobile solution.

Hotend cooling fan does not need to spin as fast when heated to 350 degrees celsius as it does at 150 degrees celsius for example.

To get at least the direction right it needs a faster spinning fan at higher temperatures and a slower spinning fan at low temperatures. What you told us is counterproductive.

Sorry about that, I mixed the two numbers up so thank you very much for pointing it out. If it is fine with you, I will correct the comment. I hope the idea was clear enough that a fixed fan speed leaves a lot to be desired from a wide temperature range.

Up to now Marlins heater subsystem is not really object oriented. For every kind of heater (nozzle, bed, chamber, ...) there is(are) its own function(s) for controling heat/cool, protection, ... . This is unmaintainable since a long time. Any extension of that system reduces the probability this system will be structurally improved sometime (if its not already to late).

The complexity of marlin is certainly immense. I wish I understood coding better to really understand. The addition of the heated chamber was relatively recent because I could not find it a few years ago so I suppose marlin still has room for new additions? Are there other heaters or environments than the hotend, bed, and chamber in marlin?

Really tough and thoughtful questions. Thank you.

AnHardt commented 4 years ago

20°C span (+-10°C) could be achievable without further measurement only in my living room (f.E. 10°C - 30°C) but not in the workshop (5°C - 35°C) and even less in a heated chamber (20°C - 80°C or more).

Power3DPrinting commented 4 years ago

20°C span (+-10°C) could be achievable without further measurement only in my living room (f.E. 10°C - 30°C) but not in the workshop (5°C - 35°C) and even less in a heated chamber (20°C - 80°C or more).

You're right, both a blind and thermistor monitored system would need to be calibrated within its heated chamber the same as the hotend and heated bed with the benefit of the fan curve unlikely to make a difference especially at 80 for the ambient. Those are some very important numbers to keep in mind, thank you.

Power3DPrinting commented 4 years ago

Heated chambers really make a good argument for remote cooling either by water and an external radiator or air compressor. Particularly with compressors which are most practical for both hotend cooling and part cooling, noise, life span, and power consumption are a fairly larger concern to optimize them than a traditional fan.