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

Potential fix for other layers bed temperature not applied #5546

Conversation

igiannakas
Copy link
Contributor

@igiannakas igiannakas commented Jun 1, 2024

Description

On occasion the second layer bed temperature was not set according to the filament preferences. This PR aims to introduce a fix for this. This issue seems to have been present since v1.6.4 or earlier.

This is a particularly difficult one to reproduce as it doesn't happen repeatably.

Requesting community testers to validate the fix.

Test needed:

  1. Slice a model with a filament that needs a different temperature for the second layer
  2. Change the brim setting to auto and slice - confirm that the second layer bed temperature is being emitted
  3. Change the brim setting back to none and confirm that the second layer bed temperature is emitted

To see the Gcode window press key "C" on your keyboard. Navigate using the sliders to the second layer and at the start of it as shown in the screenshots below.

Asking for testers as its been particularly difficult to a) replicate that the issue is happening as its sporadic and b) validate that the fix is working.

When testing please confirm with your existing installation that the issue is happening first before trying the PR build. Please comment back below on whether a) it happened to you in the current build you're using alongside the version number you're running and b) if this PR fixed it or not.

When it works it should look like the below (line 774)
image

If it doesn't work it will look like this (line 773 only, no set bed temperature present)
image

Tests performed
As above.
I think that this PR also causes the bed temperature to always be set on the second layer but this also needs testing... Whether this is an issue or not remains open for discussion as its an extra Gcode command that is not needed but not harmful as the printer is already operating at that bed temperature so it will be just ignored.

Fixes #5485
Fixes #4676
Fixes #3015
Fixes #1853

@SoftFever SoftFever added the Community testers wanted Looking for community testers and feedback label Jun 3, 2024
@buzzhuzz
Copy link
Contributor

buzzhuzz commented Jun 3, 2024

Looking at the change I see why it is hard to reproduce: m_last_bed_temperature has random value unless explicitly initialized to the given value.

That is due to C++ standards https://en.cppreference.com/w/cpp/language/default_initialization

The effects of default-initialization are:

  • if T is a (possibly cv-qualified) non-POD(until C++11) class type, the constructors are considered and subjected to overload resolution against the empty argument list. The constructor selected (which is one of the default constructors) is called to provide the initial value for the new object;
  • if T is an array type, every element of the array is default-initialized;
  • otherwise, no initialization is performed (see notes).

@igiannakas
Copy link
Contributor Author

igiannakas commented Jun 3, 2024

Exactly this. Which puzzles me as to why the constructor for this variable was commented out - this change was introduced in Bambu studio when porting prusa slicer since its first release and inherited over by orca. However I cannot understand why Bambu would remove the constructor initialisation for this 🤔

Copy link
Owner

@SoftFever SoftFever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this issue.
I merge it s omore people can test it.

@SoftFever SoftFever merged commit 99544f9 into SoftFever:main Jun 4, 2024
12 of 13 checks passed
@igiannakas igiannakas deleted the Potential-fix-for-other-layers-bed-temperature-not-applied branch June 4, 2024 12:06
@igiannakas
Copy link
Contributor Author

Thanks for taking care of this issue. I merge it s omore people can test it.

thx! its a trivial change, shouldn't break anything :) :P (famous last words :P )

@fabio-s-franco
Copy link

This one have been driving me crazy. I am not sure where this is coming from, but for some reason it keeps bumping my bed temperature on second layer, causing the print to warp:

image

I tried already changing the filament's other layers temperature, but still, this stubborn gcode keeps showing up:
image

There is no filament gcode and the only override is retraction length.

My print start gcode is:

PRINT_START BED_TEMP={hot_plate_temp_initial_layer[0]} EXTRUDER_TEMP={nozzle_temperature_initial_layer[0]} RETRACT_LENGTH={(is_nil(filament_retraction_length[0]) ? retraction_length[0] : filament_retraction_length[0])} RETRACT_SPEED={(is_nil(filament_retraction_speed[0]) ? retraction_speed[0] : filament_retraction_speed[0])} UNRETRACT_EXTRA_LENGTH={(is_nil(filament_retract_restart_extra[0]) ? retract_restart_extra[0] 

I have just moved from PrusaSlicer and not off to a good start. So some of the parameters above may not be needed (like pressure advance I no longer put in filament gcode, which is a nice one).
There is nothing on layer change gcode that could cause this.

I don't have that temperature set anywhere.

If this is something else completely, I can create another issue. Or maybe I just don't know how to find whatever is setting that temperature.

@igiannakas
Copy link
Contributor Author

Can you attach a project file so we can see/replicate the issue please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community testers wanted Looking for community testers and feedback
Projects
None yet
4 participants