sn4k3 / UVtools

MSLA/DLP, file analysis, calibration, repair, conversion and manipulation
GNU Affero General Public License v3.0
1.22k stars 104 forks source link

[BUG] Exposure time finder LiftHeight Layer Logic is wrong #261

Closed human890209 closed 3 years ago

human890209 commented 3 years ago

Solved. The bug is mine!

System

Describe the bug

Example File Settings: Bottom Layers Number: 4 Bottom/Normal LiftHeight: 6mm Normal 0mm LiftHeight: 0.1mm Sample Number: 6

Current Output File: Layer0 (Bottom 1) Z+ LiftHeight 6mm Layer1 (Bottom 2) Z+ LiftHeight 6mm Layer2 (Bottom 3) Z+ LiftHeight 6mm Layer3 (Bottom 4) Z+ LiftHeight 6mm Layer4 (Sample 1) Z+ LiftHeight 6mm Layer5 (Sample 2) Z LiftHeight 0.1mm Layer6 (Sample 3) Z LiftHeight 0.1mm Layer7 (Sample 4) Z LiftHeight 0.1mm Layer8 (Sample 5) Z LiftHeight 0.1mm Layer9 (Sample 6) Z LiftHeight 0.1mm Layer10 (Sample 1) Z+ LiftHeight 6mm Layer11 (Sample 2) Z LiftHeight 0.1mm Layer12 (Sample 3) Z LiftHeight 0.1mm Layer13 (Sample 4) Z LiftHeight 0.1mm Layer14 (Sample 5) Z LiftHeight 0.1mm Layer15 (Sample 6) Z LiftHeight 0.1mm ....

Notice Layer4, Layer10, Layer16... LiftHeight is 6mm. This logic is wrong. The LiftHeight should be added for the Last Sample, not the First Sample. Layer9, Layer15, Layer21... should get 6mm LiftHeight.

The settings file and the ctb file: EXPO_Test.zip

I kinda doubt if the Lift&Retract Index Mistake in my QIDI firmware is a bug or a fix... The file I uploaded here is not fixed by my script...

And I notice the LightOffDelay is also added to Layer4, Layer10, Layer16... It must be a logic flaw.

sn4k3 commented 3 years ago

I dont see the problem, for me seens correct. Printer should lift whatever a diferent Z position is found for the first time

Layer3 (Bottom 4) Z+ LiftHeight 6mm PositionZ=0.220mm [Different position] -> Lift Layer4 (Sample 1) Z+ LiftHeight 6mm PositionZ=0.275mm [Different position] -> Lift Layer5 (Sample 2) Z LiftHeight 0.1mm PositionZ=0.275mm [Same position] -> No lift ... Layer8 (Sample 5) Z LiftHeight 0.1mm PositionZ=0.275mm [Same position] -> No lift Layer9 (Sample 6) Z LiftHeight 0.1mm PositionZ=0.275mm [Same position] -> No lift Layer10 (Sample 1) Z+ LiftHeight 6mm PositionZ=0.330mm [Different position] -> Lift Layer11 (Sample 2) Z LiftHeight 0.1mm PositionZ=0.330mm [Same position] -> No lift

The rule is: If you are already on the layer position Z then try to not lift. Otherwise it must lift

I don't own a ctb printer to test, but i guess the lift sequence is executed before cure the image, and not after... So the layer0 lift height apply before cure the image - this is my guess

human890209 commented 3 years ago

Your guess is reasonable. If the Lift&Retract are done before the layer, everything is right. But I think the slicer gives Bottom layer BottomLiftSpeed and BottomLiftHeight. Why does the empty first bottom layer need a more careful lift? Nothing sticks to the FEP. I'm new to Resin 3D Printing, I never thought the Lift&Retract phase is before the curing :>

human890209 commented 3 years ago

I think this is not a BUG, please move it into Discussion.

sn4k3 commented 3 years ago

Bottom layers need other setting because they are often larger and more solid as they get more cure time and also to make sure first layer stick to build plate it need more care lift

I think this is not a BUG, please move it into Discussion.

Let's keep it here until we figure out if is bug or not. NovaMaker for example uses lift after cure on thier gcode so layer0 will lift after cure. This require testing and can be different depending on shitty firmwares. I will ask to someone test this out

But the LiftOffDelay logic on Sample1 is not reasonable. LiftOffDelay is executed after the curing...

LightOffDelay is always performed after retract / before cure https://www.facebook.com/Phrozen3D/posts/3895582137190125

human890209 commented 3 years ago

But the LiftOffDelay logic on Sample1 is not reasonable. LiftOffDelay is executed after the curing...

human890209 commented 3 years ago

LightOffDelay is always performed after retract / before cure

WOW, everything cleared for me. Got my first Resin Printing Process Lesson today. Thanks a lot.

sn4k3 commented 3 years ago

LightOffDelay is a mess and should never existed in first place... Chitu fixed that with ctb v4/v1.9.0 with the rest time new fields

human890209 commented 3 years ago

It should be called LiftOffDelay, the name is so misleading for the first layer. What light? Haha, it ruined my whole process understanding.

sn4k3 commented 3 years ago

Not only you but almost everyone... Chitu really ruin this part. They should have call it LiftSequenceDelayTime because it what is, is a calculation of how much time motors take to complete the sequence + your desired extra time, now you see no one using this correctly without proper calculators. I dont really know why they introduce that mess. In any case set it to 0 or use UVtools global WaitTimeBeforeCure property, it will set LightOffDelay accordingly

human890209 commented 3 years ago

I think the LightOffDelay's purpose is waiting for the resin to stop flooding. Retract Speed, resin's viscosity, build plate‘s size, and plate design(with holes or not) are the main factors. And the perfect result should be tested similar to the ExposureTime. But of course, the WaitTimeBeforeCure is much easier to understand and predict.

By the way, is the ctb v4 supported by UVTools? Many new fields there.

sn4k3 commented 3 years ago

I think the LightOffDelay's purpose is waiting for the resin to stop flooding. Retract Speed, resin's viscosity, build plate‘s size, and plate design(with holes or not) are the main factors. And the perfect result should be tested similar to the ExposureTime. But of course, the WaitTimeBeforeCure is much easier to understand and predict.

It is, but you must calculate the motor movement time to get the value right
"Light-off Delay = Building Plate Up and Down Time + Additional Delay Time"
read here: https://phrozen3d.com/apps/help-center/getting-started/what-does-light-off-delay-mean-when-i'm-setting-print-parameters

By the way, is the ctb v4 supported by UVTools? Many new fields there.

Yes, only TSMC is out of UVtools but that should not be used anyway. Your printer if not included on list of chitubox v1.9.0 firmwares, can't use v4

human890209 commented 3 years ago

QIDI 6.08 Mono is supported by chitubox V4. But I think I will stick to the current firmware for now. The only new feature I like is the delay after UV curing before Lift. Light-off Delay's best value is from experiments. Increase or decrease 0.5s to make the resin stable. The calculation is just for guessing a start value.

sn4k3 commented 3 years ago

You should use it, because of the rest times. Older files will still print fine on new firmware. Good values for common resins:

Wait before cure = 2.5s
Wait after cure = 1s

Wait after lift is useless/time waster

human890209 commented 3 years ago

Yes. I can't understand the purpose of a delay before retraction.

sn4k3 commented 3 years ago

Yes. I can't understand the purpose of a delay before retraction.

Worst part is chitu release something and people blind use that stuff, i have seen people using a larger delay there than on before cure... TSMC is also useless the way is implemented

human890209 commented 3 years ago

The reason I stick to the current firmware is TSMC is not supported for now:> TSMC actually let those Firmware Consts I mentioned about Lift&Retract in the QIDI 6.08 Mono discussion tweakable. Which indeed saves a lot of time.

sn4k3 commented 3 years ago

I don't think that's the case everywhere, saturn for example only have 1 lift sequence, no 2nd sequence on firmware. See this saturn video on ctbv3 using UVtools multiple exposures: https://www.facebook.com/groups/uvtools/posts/499511711158337/ As you can observe a lift of 0.1mm have no visible lift, if firmware does have a 2nd sequence you would see a additional lift there.

Anyway i'm glad to have gcode printer that end all this nightmares

human890209 commented 3 years ago

I'm pleased with my printer's 2mm LiftHeight_A and RetractHeight_B and 120mm/min LiftSpeed_B and 60mm/min RetractSpeed_B. I'm worried if I upgrade to ctb v4 I would lose it.

human890209 commented 3 years ago

I think I may create a script to add a virtual layer before each layer to get the Wait after cure delay!

human890209 commented 3 years ago

In any case set it to 0 or use UVtools global WaitTimeBeforeCure property, it will set LightOffDelay accordingly

How to set the global property? Script?

sn4k3 commented 3 years ago

I think I may create a script to add a virtual layer before each layer to get the Wait after cure delay!

Not the best thing, but may work

How to set the global property? Script?

The WaitTimeBeforeCure ?

// Example
SlicerFile.BottomWaitTimeBeforeCure = 3f;
SlicerFile.WaitTimeBeforeCure = 2.5f;

This will happen: https://github.com/sn4k3/UVtools/blob/master/UVtools.Core/FileFormats/ChituboxFile.cs#L1349

human890209 commented 3 years ago

image Here I found everything. TSMC and the best delays. Could these values be edited by UVTools' script?

sn4k3 commented 3 years ago

They can, but that will only work if you update your firmware with ctbV4

human890209 commented 3 years ago

Because my firmware got a TSMC-like motion, I will try those before heading towards the virtual layer method.

human890209 commented 3 years ago

How to change SlicerInfo in the script? SlicerFile.BottomLiftDistance2 doesn't exist.

uint EncryptionMode ; // 0/8 for cbddlp files, 0xF (15) for ctb files, 0x2000000F (536870927) for v3 ctb and 1073741839 for v4 ctb files to allow per layer parameters

Does Encryption Mode the one that the FullEncode override to enable ctb file's per-layer settings?

sn4k3 commented 3 years ago

Because my firmware got a TSMC-like motion, I will try those before heading towards the virtual layer method.

They will not work, those are only introduced on ctb v4. They are only here because UVtools follow the most recent ctb field naming. For ctb v3 that would be padding fields (Useless fields)

How to change SlicerInfo in the script? SlicerFile.BottomLiftDistance2 doesn't exist.

var ctbSlicerFile = SlicerFile as ChituboxFile;
ctbSlicerFile.SlicerInfoSettings.BottomLiftDistance2 = 10;

Does Encryption Mode the one that the FullEncode override to enable ctb file's per-layer settings?

Yes

human890209 commented 3 years ago

RestTimeAfterLift RestTimeAfterLift2 Confusing name. Which one is the rest time after Curing before Lifting?

sn4k3 commented 3 years ago

yup, chitubox like confusing names xD

RestTimeAfterLift = Wait time after lift RestTimeAfterRetract = Wait time before cure RestTimeBeforeLift = Wait time after cure

human890209 commented 3 years ago

I got RestTimeAfterLift and RestTimeAfterLift2 in UVTools image

sn4k3 commented 3 years ago

Yes, i dont know why, but they repeat rest time after lift on my findings, maybe a bug on chitubox

human890209 commented 3 years ago

I didn't find RestTimeBeforeLift. Is RestTimeAfterLift2 = RestTimeBeforeLift?

sn4k3 commented 3 years ago

I didn't find RestTimeBeforeLift. Is RestTimeAfterLift2 = RestTimeBeforeLift?

No.

Again you need CTBv4 for that. Those are on new table: PrintParametersV4 ctbSlicerFile.PrintParametersV4 (Only present on ctb v4)

human890209 commented 3 years ago

I see. I notice I should not shift the LiftRetract into the next layer for my printer. I should shift the LightOffDelay into the previous layer :>

human890209 commented 3 years ago

I confirmed that my firmware support TSMC! image

human890209 commented 3 years ago

I upgrade my firmware to ctb v4. A self-made fix script is still needed.

sn4k3 commented 3 years ago

I upgrade my firmware to ctb v4. A self-made fix script is still needed.

For which case?

human890209 commented 3 years ago

The Rest Time system's per-layer settings are better than the virtual layer method. I upgrade to V4. RestTimeAfterRetract(Wait Before Cure) is wrong if TSMC is used. The firmware starts timer after Retract2 but the slicer thinks the timer is started after Retract1.

Is there a way to not Cure a layer at all? I tried to set PWM down but it doesn't work. And Exposure time can't be set to 0s just like LiftHeight.

human890209 commented 3 years ago

Exposure time could be set to 0.001s by a script that works.