Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marlin 115 tried to burn my house down during PID tuning #8103

Closed
jarrodasmith opened this issue Oct 26, 2017 · 38 comments
Closed

Marlin 115 tried to burn my house down during PID tuning #8103

jarrodasmith opened this issue Oct 26, 2017 · 38 comments

Comments

@jarrodasmith
Copy link

Bug Report

  • Description: I started a PID tune from Octoprint's terminal. My thermistor went out during the PID tune (or maybe before I started it, not sure on this detail). Heater turned on and just never shut off until I intervened.

  • Expected behaviour: Firmware should detect mintemp before/during PID tuning and shut the heat off (it was reading -14C at the time).

  • Actual behaviour: Smoking PLA and scorched hotend parts.

  • Steps to reproduce:

    • Install TH3D115 hex binary firmware (th3dstudio.com) on CR-10
    • Install Octopi 0.14 and Octoprint 1.3.5
    • Disable the thermistor
    • Issue M303 from octoprint

Attach a ZIP of Configuration.h and Configuration_adv.h by dropping here.
config.zip

@guiseco
Copy link

guiseco commented Oct 26, 2017

AUTOTUNE does not respect MAXTEMP. If you set 500C ... KABUUUM !!!!

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 26, 2017 via email

@ghost
Copy link

ghost commented Oct 26, 2017

Say ' THANK YOU ' to marlin
Now you know , what is the maker life that have thermistors and these eternal wiring short circuit between nude wires or on the hotend
Some material on the wires is enough to make a crash , a direction changes , or your finger that want to clean the nozzle and touch the wires etccc
Or when you change the nozzle , you move all with force a BOUM , forced to remade all wires ..

Buy thermocouple type k or pt100 ; i suggest PT100 because all hotend have the 3 mm holes for it , volcano , or normal , and no limits of temp
and ....... NO PROBLEMS OF ETERNAL MIN TEMP BRUTAL CRASHES

I love thermistors but not on a machine that can shake while 30 hours a pair of nude wires !!!!!!!!!!

@Grogyan
Copy link
Contributor

Grogyan commented Oct 26, 2017

I agree, just get a thermocouple, or PT100, these are sensors designed for high temperature, and are resilient to vibration.
Those cheap thermistors, break.

Or get an E3D V6 hotend, which have temperature cartridges

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 26, 2017 via email

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 26, 2017 via email

@Roxy-3D
Copy link
Member

Roxy-3D commented Oct 26, 2017

So... It is impossible to please everybody. The thermal protections numbers for THERMAL_PROTECTION_HOTENDS and THERMAL_PROTECTION_BED are much too tight for me. I always end up relaxing them significantly for my printers. But the people that did the work want them that tight and I respect their opinions. They know a lot more about the subject than I do.

If you are worried about burning your house down, you probably should only use the printer while you are watching it. And you should probably only use it with the printer placed outside in the middle of a concrete driveway. Maybe that isn't enough. Maybe you should stack some concrete blocks around it to make sure that if anything catches fire it is isolated and the fire can't spread. Also, it might be wise to put a 5 amp fuse on the circuit where you are plugging in the printer to help limit what can go wrong.

While you are doing those things we can continue to discuss other ways the firmware can help you have confidence in the safety of using your new AliExpress printer!

@Spawn32
Copy link
Contributor

Spawn32 commented Oct 26, 2017

or use dual thermistors on the hotend... not sure Marlin has support for it ?

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 26, 2017 via email

@Roxy-3D
Copy link
Member

Roxy-3D commented Oct 26, 2017

Why the hostility? I think a request to obey Max Temp and Min Temp during PID tuning is reasonable.

Did M303 REALLY try to burn your house down? You are basically accusing the author (and everybody that has contributed to the M303 code) of intentionally trying to cause you harm. Perhaps it would make sense to change the title to something like "Suggested improvement for M303's thermal behavior"

@ghost
Copy link

ghost commented Oct 27, 2017

STOP !
The only thing we want to say , is our experience of marlin and the brutality of the temperature alarm algorithms
If temps make shit , print stop
And all here knows enough marlin to say , that it's possible there is an issue about this , but , we are all sure that , before to bug , we have a hardware that don't give enough stable value
Here , we are all sure that if you haven't theses thermistors 'sorry ' these nude wires that touch the hotend and receive your 3G/4G cell phone waves and more lolllllllll , you never had this issue

Yes , we must work on several wiring problems and your issue will be seriously explored

Give us , all , the circonstances , to make this crash
repeat at your home to verify the issue works each times your make the scenario , give us the exact things , to create this issue at home
Give all detail as possible , to recreate the same situation and we quickly see if marlin have a disease

M303 is a child of alarm function and use the temp alarm that all use in print and preheating
If M303 make shit , it's all marlin that makes shit , and it's difficult to believe this , you understand ?
and to finish , it's totally impossible to heat something if an anormal behavior happens on the sensors , you can trust me , just a little difference and marlin stops !!!

The only possibility is , the wiring diagram , you have connected the heater right to the left and the left to the right , and all without THERMAL PROTECTION
in this case , Marlin heat the right , and measure the left sensor , if no thermal protection , the heater can reach 28000 degres approx lollll

No war here , the only war , is to have the first perfect layer with UBL loll

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 27, 2017 via email

@Roxy-3D
Copy link
Member

Roxy-3D commented Oct 27, 2017

From another perspective.... Everybody here has spent countless hours trying to make things better for the generic user. My biggest contribution is the UBL Bed Leveling. I did EVERYTHING possible to make it SAFE so it doesn't needlessly hurt anybody's machine. There are 1000 different ways the bed leveling and mesh editing software can drive a nozzle into the bed and damage the user's machine. That still does happen occasionally. But I've done everything in my power to make it not happen. The people that work on the thermal code are at least that contentious.

If people are volunteering their time (and expertise)... It is best to proceed gently and make them want to help you.

With that understanding... I suspect somebody is going to find the problem interesting and be willing to add some safety checks to M303.

@RowanMeara
Copy link
Contributor

I know that everyone who has contributed has put in many hours to make Marlin better and safe and I appreciate their effort. However, I found the pid auto-tuning code and it seems to be a little rough (one confusing 200+ line function). I'm interested in contributing and will look around and see if I can find the issue.

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 27, 2017 via email

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 27, 2017 via email

@ghost
Copy link

ghost commented Oct 27, 2017

@Roxy-3D
Fuckkkkkkkkkkkkkkkkkkkkkkk !!!! UBL is your child ?
Damned !!!!
RESPECT FOR YOU !!!!!
All menus, <---<<< Roxy Edit: I had help. @Tannoo did all the LCD work Bob did all the documentation. And @oldmcg made it work with Delta's
EEPROM storing , G26 unit ,
Fuck it's great !!!!!!!!!!!!!!!!!!!!!!

Note : ThinkyHead added my FwRetract revision PR 😄 , if you know how to make an UBL/FW issue , try it now please , and keep the gcode file , and see , if there are some unwanted G10/G11/G10S1 somewhere
But with my update , impossible to break FwRetractation even though the slicer make shit , the print will never crash now

@ghost
Copy link

ghost commented Oct 27, 2017

I have tried M303 with bed ' STATERELAY and 600w bed ' , i have tried with thermocouple 1 et 2 , with my ' turbo hotends = Volcano + E3V6 + Flexxion holder + 60w cartridge ' , and all works
60 w cartridges 20mm , are sold on REPRAPME , the only 20 mm 60w12v or 80w24v
These high power cartridges are made for diamond hotend , and it's the only one that have 20mm , and have the exact size for volcano...

Note : with my cartridge , It's not easy to reach 400 degrees , it takes time , and risk of fire is very long on my config and i'm sure , it's not your chinese 40w hotend that can reach more than 300 degrees lolllllllllllll

Works perfect

Contributing to marlin ,or other sofware is a big donation of time , every line of code generate 1500 mistakes and errors
But , in robotics like 3d printer , it's the worst !!!! Upload are long , Heating too , you write line ' one minute ' and to test this line ' 30 min ' , each bad writting cost 30 min
You can waste a days , or a night just for a forgotten ' { ' , or bad writting of some conditionnals and more
Sometimes , just to understand something in this jungle can cost you 4 night and days , and no written line yet ...

@RowanMeara
Copy link
Contributor

RowanMeara commented Oct 27, 2017

This might be wrong because I've never really looked at this code base before.

I believe your problem occurred because pid_autotune directly sets the PWM values while setting everything else to indicate that the heaters are off (it calls disable_all_heaters when it starts so no outside error checking occurs). Also, pid_autotune has a 2 minute timeout but just returns from the function when that timeout is hit which means that the heaters are not disabled and an error is not thrown.

I believe that the thermal runaway issues could be partially fixed by adding a line to pid_autotune's timeout behavior that throws a temperature error. The downside of this approach is that it only takes effect after two minutes.

Edit: After looking at the code some more, it seems that fixing the sanity checking errors would be difficult because it would require significantly changing the sanity checking in Temperature::ISR (interrupt method). The changes would break the conditional compilation. Another option is essentially to have duplicated error checking code in the pid_autotune but that would increase the binary size and separate the error checking logic.

@Tannoo
Copy link
Contributor

Tannoo commented Oct 27, 2017

I run my printer near an open can of gasoline... is that an issue?

@ghost
Copy link

ghost commented Oct 27, 2017

Oh !!! No temp alarm on M303 😲 ....
It's not important because the user is here and close.... but ... if a m303 appears by mistake. ..or anything else ... and no human presence ..... it's dramatic.
Tonight i make a test to unconnect my sensors to be sure there's no thermal protection

@ghost
Copy link

ghost commented Oct 27, 2017

If you're right .. this must be quickly fixed

@RowanMeara
Copy link
Contributor

I think I found a pretty noninvasive fix so I will probably submit a pull request tomorrow.

@AnHardt
Copy link
Contributor

AnHardt commented Oct 27, 2017

Steps to reproduce:

Install TH3D115 hex binary firmware (th3dstudio.com) on CR-10
Install Octopi 0.14 and Octoprint 1.3.5
Disable the thermistor
Issue M303 from octoprint

If the problem is reproducible in this order, it's not M303s fault. Min temp error should kill the machine in the moment the sensor is disconnected.

Are you sure this downloaded binary is produced with the appended config?

There is one way to disable min temp errors - setting mintemp to a value lower than the lowest value in the thermistor table.

@ghost
Copy link

ghost commented Oct 27, 2017

hex ? Or marlin 1.1.5 ?

@ghost
Copy link

ghost commented Oct 27, 2017

@RowanMeara , do you really have identified M303 is not under thermal prot ?
but may be , M303 need total freedom to make calculation and disable all thermal protection feature , to never be disturbed when a large bed need time to heat
Because when not tuned , impossible to have an idea of the setting of the alarm... and i think if marlin want to make calculation in all situations , the alarm must be disable
If you make a PR , what will be your thermal settings to run ALL PRINTERS/Heaters/Buildplate , and don't forget it's not dynamic datas and you will have to make on FIRMWARE for tuning , and another one with the new pid

I think , the only pr to make is to show a warning message about the needed presence of human during this tuning , and it's all

@AnHardt
Copy link
Contributor

AnHardt commented Oct 27, 2017

Think i got it.
Since the introduction of the high temperature thermistors we check for min/max temp errors only when the heater is on. We detect that by checking if the target temp. is > 0. target temp. is not used by M303.

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 27, 2017 via email

@guiseco
Copy link

guiseco commented Oct 27, 2017

I did this:

#define HEATER_0_MAXTEMP 275

After that, I ran the autotune:

M303 E0 S2750 C10

Autotune does not respect HEATER_0_MAXTEMP and will attempt to reach 2750 C.

@ruggb
Copy link

ruggb commented Oct 27, 2017

IMHO, this sounds like a real problem. So why are all the developers defending themselves instead of looking for a solution. It only makes a long thread that gets nothing done.
Max temp is defined in the config file. If one enters 2750 instead of 275, or any number > Max, marlin should produce an error.
If the temp stays at -14 or for that matter is there in the first place, marlin should error.
sounds easy to me, but what do I know?

@Tannoo
Copy link
Contributor

Tannoo commented Oct 28, 2017

My low temp is set for -15. I don't need an error when the ambient temp is that low.

But, I'm not usually starting a print when it's that cold.

@jarrodasmith
Copy link
Author

jarrodasmith commented Oct 28, 2017 via email

@ghost
Copy link

ghost commented Oct 28, 2017

My safety thermal settings are 120 seconds and 10 degrees for bed , and 120 seconds and 4 degree for hotends
Under this setting the risk to crash MY PRINTER is too high
The problem is the default setting too low , and all users are afraid to set stronger values ,
For me a serious Safety settings for thermal must be ' SERIOUS ' and not too short
To make a fire 120 seconds is really too short , and 120 is risk free for normal printing temp curves in all situations

@bobc
Copy link

bobc commented Oct 28, 2017

You should never rely on software for safety. You have heated surfaces, and plastic that burns really well, a recipe for disaster. Commercial plastic products must use flame retardant additives by law*, filament used for 3DP does not contain retardants. (* depending on national laws I guess).

The safety of home 3d printers is very poor, and although a known issue is often overlooked. Personally, I always regard printing as a "attendance required" activity. Now I know a lot of folks do long unattended prints and say "its fine", but those are all accidents waiting to happen. Unfortunately people take a binary approach to risk:

  • it never happened to me , therefore risk is <0.001%, i.e. not worth thinking about
  • it happened to me, therefore risk is 99%.

Fire services here are concerned about a rise in house fires due to domestic appliances, such as fridges and washing machines. Those are appliances that are supposed to have passed safety regs. Home builds or cheap machines imported from China won't even have been tested against safety standards.

We can add all the features we like to Marlin, but it will never be "safe" to an official standard - it requires hardware support. I would rather people recognize that 3d printing is inherently risky, rather than be complacent and falsely rely on "safety features" in the software.

If you are concerned about your house burning down, do not print unattended. If you are not concerned, you should be!

@fiveangle
Copy link
Contributor

fiveangle commented Oct 28, 2017

If anything this would make a great clickbait YouTube video title…

Guy starts PID autotune with a defective thermistor.
YOU'LL NEVER GUESS WHAT HAPPENS NEXT !!!

thinkyhead pushed a commit that referenced this issue Oct 29, 2017
* Fixed M303 thermal protection

The temperature sanity checking logic was not being applied during M303
(pid autotuning) because instead of setting a target temperature, it
directly manipulated the pwm values.  When PIDTEMP/PIDTEMPBED is
enabled, PWM values rather than the target temperature determine whether
the heater is on.  I changed this to look directly at the PWM amount
when pid is enabled.

* Turn off heaters on M303 error

Currently, PID autotuning stops if it overshoots the temperature by 20C
or if if the temperature does not change for 20 minutes and it times
out.  I added calls to disable the heaters in these scenarios.

* Removed unnecessary if statement.

Added changes suggested by GMagician.

* Update temperature.cpp

* Update temperature.cpp

* Update temperature.cpp
@thinkyhead
Copy link
Member

obey Max Temp and Min Temp during PID tuning

Very much appreciate the addition! Safety is vital, especially around the heaters. I think up to now this hasn't been looked at because M303 is usually done once and forgotten. You've patched a pretty big hole, and Marlin is better for it!

MoellerDi added a commit to MoellerDi/Marlin that referenced this issue Nov 27, 2017
… into bugfix-1.1.x-HD-CR10

* 'bugfix-1.1.x' of https://github.com/MarlinFirmware/Marlin: (94 commits)
  [1.1.x] Fix M303 thermal protection MarlinFirmware#8103 (MarlinFirmware#8126)
  Implement support for Dual X and Y endstops
  Add Dual Steppers / Endstops to configs
  Cleanup for DIGIPOTS settings
  (1.1.x) serious bug G33
  Add scripts for .travis.yml to append config options
  Revert default BABYSTEP_MULTIPLICATOR to 1
  Added MKS GEN L board (MarlinFirmware#8088)
  Concise SD_REPRINT_LAST_SELECTED_FILE description
  Clean up trailing whitespace
  (1.1.x) auto tune calibration parameters (MarlinFirmware#8031)
  Tweak neopixel self-test
  Add some Polish translations
  Fix FWRETRACT logic, apply common sense
  give this language an unique name
  Initial conflict resolution of SD_REPRINT_LAST_SELECTED_FILE (MarlinFirmware#8104)
  1.1.x - save 1400 bytes of FLASH by using reduced font for some languages (MarlinFirmware#8095)
  More specific M100 description
  Fix spacing, use single instances of similar pins
  Encourage users to re-examine their configs
  ...

# Conflicts:
#	Marlin/Configuration.h
#	Marlin/Configuration_adv.h
mtm88001 pushed a commit to mtm88001/Marlin that referenced this issue Dec 9, 2017
…re#8126)

* Fixed M303 thermal protection

The temperature sanity checking logic was not being applied during M303
(pid autotuning) because instead of setting a target temperature, it
directly manipulated the pwm values.  When PIDTEMP/PIDTEMPBED is
enabled, PWM values rather than the target temperature determine whether
the heater is on.  I changed this to look directly at the PWM amount
when pid is enabled.

* Turn off heaters on M303 error

Currently, PID autotuning stops if it overshoots the temperature by 20C
or if if the temperature does not change for 20 minutes and it times
out.  I added calls to disable the heaters in these scenarios.

* Removed unnecessary if statement.

Added changes suggested by GMagician.

* Update temperature.cpp

* Update temperature.cpp

* Update temperature.cpp
@marcio-ao
Copy link
Contributor

marcio-ao commented Dec 11, 2017

There is only so much software can do. Has anyone considered using a thermal cutoff fuse in the hotend and/or heated bed?

damicreabox pushed a commit to damicreabox/Marlin that referenced this issue Sep 14, 2018
…re#8126)

* Fixed M303 thermal protection

The temperature sanity checking logic was not being applied during M303
(pid autotuning) because instead of setting a target temperature, it
directly manipulated the pwm values.  When PIDTEMP/PIDTEMPBED is
enabled, PWM values rather than the target temperature determine whether
the heater is on.  I changed this to look directly at the PWM amount
when pid is enabled.

* Turn off heaters on M303 error

Currently, PID autotuning stops if it overshoots the temperature by 20C
or if if the temperature does not change for 20 minutes and it times
out.  I added calls to disable the heaters in these scenarios.

* Removed unnecessary if statement.

Added changes suggested by GMagician.

* Update temperature.cpp

* Update temperature.cpp

* Update temperature.cpp
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests