dougk12
Posts: 5
Joined: Fri May 07, 2021 8:51 am

[SOLVED] Print to BFB injects end of script to beginning of print file

Hello, when save a print file as BFB file type S3D v5 is copying the last line of script and placing it at the beginning of the print file. This will result in an error unless you manually delete this line every time. I reported this to support email but did not receive a response and it is not fixed in the latest update.
S3d V5 issue.jpg
V5 issue 1.jpg
V5 issue 2.jpg
S3D-Jason
Posts: 1383
Joined: Sun May 31, 2015 6:01 am

Re: Print to BFB injects end of script to beginning of print file

I don't think that's related to your ending script. That's just one of a few commands that S3D usually puts at the start of each file (G90, M82, M106/M107, etc). Do you see something in your post-processing script that was removing the G90 and M82/M83 commands? Maybe you just need to add another command there to remove the M106/M107 commands as well.
dougk12
Posts: 5
Joined: Fri May 07, 2021 8:51 am

Re: Print to BFB injects end of script to beginning of print file

I don't think that is correct. M107 = turn fan off. Is there a need to issue this command at the beginning of a print file, when the fan hasn't bene turned on yet?

The following commands are stripped by the profile:

{STRIP ";"}
{STRIP "G90"}
{STRIP "M82"}
{STRIP "M102"}
{STRIP "T0"}
{STRIP "T1"}
{STRIP "T2"}

M107 being placed at the beginning of the print file is a bug, new to V5, and should be easy to resolve.
S3D-Jason
Posts: 1383
Joined: Sun May 31, 2015 6:01 am

Re: Print to BFB injects end of script to beginning of print file

The software will typically set the fan speed and extruder/bed temperatures at the beginning of the print file. That is intentional and it has been that way for a long time. I just exported some sample files from V4 and they have the exact same commands at the top of the file. The first few commands in the file were:

G90
M82
M107
M104 S190 T0

If you want to get rid of the M107, just add this to your post processing script:
{STRIP "M107"}
dougk12
Posts: 5
Joined: Fri May 07, 2021 8:51 am

Re: Print to BFB injects end of script to beginning of print file

So this bug, and it is a bug whether you choose to address it as such, changed when I reinstalled S3D on a new PC.

Now the M107 command is no longer being placed at the beginning of the file in V5 (does not happen with V4) - *STRIP made this an easy fix.
On my new device, the command injected at the beginning of the BFB file is P106 P100. *This can't be stripped out, I have to manually edit this every time I choose to use V5 over V4.

So clearly something is wrong with the way S3D handles BFB in V5 vs. V4. It's either adding a random line of code at the top or not stripping out everything above the 3DS header.

This should be easy to replicate and then correct because it worked without issue in V4.
Attachments
Screenshot 2023-08-02 090308.png
S3D-Jason
Posts: 1383
Joined: Sun May 31, 2015 6:01 am

Re: Print to BFB injects end of script to beginning of print file

I did already investigate this with V4 and it also adds lines at the top of the file. If it doesn't appear there in the final bfb file, then it just means that command was removed using something like {STRIP} in the post-processing section.

I also confirmed that V5 works the same way in this regard. It will also add default commands at the top of the file unless there is a change added to manually remove that command.

If you think you're seeing something different, please feel free to attach your factory file and confirm what exact version of S3D you are using. That way we can recreate your exact test scenario.
dougk12
Posts: 5
Joined: Fri May 07, 2021 8:51 am

Re: Print to BFB injects end of script to beginning of print file

S3D version is 5.1.1

Factory file and BFB file example attached.

Also attached screenshot of my post processing script. *Notice that STRIP {"M107"} is no longer need - the issue seen only in V5+ changed after reinstalling software on another device.
Screenshot 2023-08-11 084833.png
Attachments
20x20mm_Test_Box.bfb
(131.85 KiB) Downloaded 57 times
3DS Cube Profile.factory
(1.94 MiB) Downloaded 54 times
S3D-Jason
Posts: 1383
Joined: Sun May 31, 2015 6:01 am

Re: Print to BFB injects end of script to beginning of print file

I took a look at your factory file. You have a single cooling fan configured which used 100% speed at layer 1. This means that S3D will place a M106 P100 command at the top of the file (above where your starting script would go). That's the command to set the fan to 100% power. If you had instead set your cooling fan to use 0% speed on layer 1, then you would see a M107 command at the top of the file. So that explains why you were sometimes seeing M106 P100 and other times M107. It just depends on what cooling fan speed percentage you set for layer 1.

If you don't want that command to appear at the top of the file, then you need to use the variable [fan0_speed_percentage] in your starting script (don't forget the "0" character, otherwise it won't work). That tells S3D that you will handle controlling the fan on your own. If you add the following line to your starting script, then the command is no longer added at the top:

M106 P[fan0_speed_percentage]

Hope that helps!
dougk12
Posts: 5
Joined: Fri May 07, 2021 8:51 am

Re: Print to BFB injects end of script to beginning of print file

OK, that did it - thank you!

There was a M106 P[fan_speed_percentage] command in my starting script, I added the 0 and no more M107 or M106.

Return to “Troubleshooting and Bug Reports”