Exposure time calibration


So Wes has been playing around with the user stuff (which will become really cool!) but for now you would like to disable this please follow the following steps after ssh-ing into your pi :

sudo nano /opt/cwh/config.properties

scroll down with the arrow keys untill you find :

and add an # before it like this :

after that press CTRL and X at the same time, press y and hit enter.
then run

sudo reboot

and your good to go!

I’m heading off to bed now so won’t reply for some hours ;)! (it’s 02:00 in the morning here ;P)


thank you very much! It works!
Have a good sleep :sleeping:


Sorry Guys! I didn’t mean to enable all of that!. All of those features are designed to be turned off by default. I’ll turn them off and rebuild!


Removed all of that in the latest release:


Hi Wes, lucky for me Robin was around and he was able to walk me through it!
Now that I have the Dev version runing, I´ve found the buttons for the three exposure time calibrations, but nothing seemps to happens when I clik them…
i don’t understand how to use them :see_no_evil:


Hmm it seems to work rather difficult currently. So the steps to make it work… :

  1. stop your printer in the printerlist menu
  2. set-up your 2d settings
  3. click one of the buttons which fills the script
  4. click save
  5. start your printer
  6. print a text file and this will be the bottom for your test file.


Since this is to calibrate a machine it doesn’t make much sense to use the platform calculator for our 2D printing. Maybe add an additional card in the printer configuration for testing resin settings. Than the user can choose between the H bridge and the peg exposure calculator, fill in the parameters he want to test with like minimal and maximal exposure time, than press print/test and evaluate the result. To make it this way we probably need some java re-work or can we just abuse the costumizers as is? Long story short I think this can be improved :slight_smile: please share your thoughts!

@all everybody else is welcome to share how they want to see this as well ofcourse!


So I follow all the steps…
first thing I notice is that when I click the buttons to fill the script, both buttons give me the same sript:

var extrusionX = printImage.getWidth();
var extrusionY = printImage.getHeight();
platformGraphics.fillRoundRect(centerX - (extrusionX / 2), centerY - (extrusionY / 2), extrusionX, extrusionY, 50, 50);

and when I try to print a text file (I understand that i´m suposed to print a .txt file) this is what I get in the print preview:

org.area515.resinprinter.job.JobManagerException: Failed to execute script

I think that the way you suggest to show this calibrations is much more user friendly, personaly I don´t have any experience coding, and I make my first aproach to photonic because it was pre installed in my chinese printer. I think you have a very nice pice of work here, but in some places I get confused because there are a lot of things I can´t interact with. for example, i just learned that to save any of the changes in the configuration first I have to stop the printer :sweat_smile:


First, let me explain Rigra’s question of why the calculator always shows the same formula. Your browser is caching the javascript from a previous version of Photonic3d. Clear your cache, and you should be good to go.

Second, I’d like to explain why the printer needs to be stopped before you can save the printer configuration. If we allowed saving the printer configuration during a print, or perhaps simply while it was already started, we would have individuals opening bugs against Photonic3D saying the printer behavior is erratic, or that it isn’t “taking” our changes after a print was saved, or that the diagnostic dump isn’t in sync with the saved copy of the current print. Instead, I’d rather people say the printer setup is “unfriendly”. However, it still doesn’t need to be unfriendly. Instead, friendliness is simply a matter of UI behavior that can easily be fixed. For example, if as a community we have come to the point that all of our users believe that a printer should be saved no matter what state(printing, paused, started, out-of-ink), then it’s the UI’s responsibility to stop the print, shut down the printer and save the configuration. Perhaps the UI should even restart the printer after the save(if everyone likes that idea.) Perhaps the UI should ask the user to perform any/all of those functions, before it executes them(I like that idea). All the while, we don’t have to expose the backend to crazy inconsistencies of 3 individuals spamming the save button simultaneously.

Finally to the question of the exposure calibration. For me, I like to create a printer configuration simply for the purpose of exposure calibration, that way it saves all of my settings in the event I want to perform another calibration. I can see why others may not want that printer configuration sitting out there for aesthetic reasons. We have lot’s of options…

If you are interested in making a dashboard page out of exposure calibrations, you really don’t need to do anything on the Java side. I think you are underestimating how much control that Javascript has. For example, you could…

  1. Copy an existing printer and save the calibration settings that the user wants in a new temporary printer.
  2. Stop the existing printer(if it’s already started).
  3. Start the newly created printer.
  4. Start a txt print with the new printer
  5. Stop the newly created printer.

If you are worried about others seeing the temporary printer while a calibration is in progress, I could add a ‘hide’ printer option to the printer setup page so that other users wouldn’t see it.

Or perhaps you’d simply like an option to enable/disable the platform calculator?


Nice, I´ll clear my cache.

for your second point, when Robin point that out for me is was totally understandable that the printer must be stopped before saving the configurations, but for a first time user, maybe a small message when you hover your mouse over the disabeled button, makes that easier to understand.

My main problem is that I don´t understand how is the workflow to use the exposure calibration tool. I´m not underestimating the javascript, I just don´t get it. I´m sorry if I don´t express myself correctly or if I make ignorant questions… I´m just trying to get the best results from my printer…

As I said before, your software is amazing, and i can see it has plenty of configurations all over the place, It´s just escape to me how to use them.

cheers, and thank you for your work


After clearing cache, and now I´m geting the correct codes. After some time figuring out how to use them, making some dry tests I notice this:
After I save the settings, and start the printer, I try to print the 2D file, and even if the Preview box in Printables show me the images, the scren on my printer never turns on. To fix this, I just need to start a normal CWS print, cancel, and then print the 2d file. Also, the z axis only make small increments, with no extra lifting between layers, this normal behaviour?

Then I have a problem with the position of the tests one being rotated and the other one too close to the borders.

And finally, I have a doubt with the text file, I’m trying to print. I understand that this Exposure an calibration test is done by modifying the base were the text is going to be print, but what I can see if that after 30 layers of the test, the actual Text starts to print. In the H-bridge test, it nevers get to the bridging layers. I try printing an empty .txt file but I get a script error.

Once again, sorry for my lack off knowledge…


Sorry about that Rigra, I wasn’t directing the Javascript response to you. I was actually suggesting that our UI could use some work and the problems could actually be solved in Javascript and not on the serverside Java.

These are good questions, not ignorant. This is a pretty advanced feature, it isn’t widely used yet so I expect tons of questions and suggestions for making it easier to use.

Before we get into this feature, I need to ask whether you’ve actually gotten your printer working and exposing images(dry of course). If not, we’ll need to work on that first and ease into this advanced feature…

Question: Also, the z axis only make small increments, with no extra lifting between layers, this normal behaviour?
The size of the increment it based upon the slice height setting here:

The same goes for all of the rest of the settings for the calibration come from that same location above; Exposure Time/NumberOfFirstLayers/NumberOfLayers etc.

The calibration simply starts from those settings and counts down from there.

Question: Then I have a problem with the position of the tests one being rotated and the other one too close to the borders.
As I mentioned above, you can customize those settings quite a bit with these parameters at the top of the code:
var hBridgeInMM = {

Question: In the H-bridge test, it nevers get to the bridging layers.
This is probably because you are printing with an extrusion height greater than 0. You don’t really want to print the text, so you don’t want to extrude anything like the following:

Question: I try printing an empty .txt file but I get a script error.
That seems like a bug, I’ll fix that…

You had quite a few questions there, let me know if I didn’t address them all.


Fixed the print bug you mentioned and sent off a new build. Should be ready in a few minutes…


Wow! Thank you for your comprehensive response!
Yes, I have my printer working. It’s a YHD-101 buyed in aliexpress, Jamesluis send it to me with photonic preinstalled an configured, so I can get succsesfull prints. I’m trying to improve the quality that’s why I want to use this feature, I also have a castable resin, and I know it needs longer exposure times, so I prefere to have a nice way to determine the best configuration before changing resins.

for the Z axis question, what I meant was if it is normal that in the calibration test there is no extra lift between layers, like in a normal print. I have my ink configuration with the same parameters i use in CW.

The 2D extrusion height now is perfectly clear :+1:

but the position of the tests, I´ve been playing arround with those code settings, and I can change the shape, but not the position… If we compare our screenshots of the H-Bridge Exposure calibration, your screen is horizontal and mine is vertical, thats wht the image won’t fit. I try changing my Build Platform X Width with Build Platform Y Width in Ink configuration, and even if the print preview box shows exactly like yours, when it starts to print I get this:

If it’s ok with you once i master this calibration tests, I would like to write down some kind of tutorial for the wiki

thank you again for your time and effort!


Yes please help us on the wiki :)! Since it is a wiki everyone can contribute whenever they want! And any help is welcomed :slight_smile: thanks!


Yes, it’s normal that there is no extra lift. The calibration is designed to test exposure time independently from slice height.

The screen is rotated? That’s odd. I won’t ask the obvious question as to whether you rotated the image with a Customizer. :slight_smile:

Which display are you using now? Do you get the same output when you try all of these:
Raspberry Pi Force TV
Simulated Print
Last Available Display


But if there is no extra lift, wouldn’t the print be stuck to the FEP?

I was using the display 0.0, I’ve just try out all the other displays getting the same result with all of them except with simulated print, were nothing happens.

In the process of testing diferent displays I realized, the answer of something I couldn’t get working before.
I’ve noticed that the Gcode generated by my CW has the comand M106 S255 and M106 S0 in every lift sequence. I belive it is because the UV LED is conected directly to the RAMPS where the layer fan is supposed to be. That’s why I wasn´t geting any image the other day when I was trying to print the text directly.

How can I rotate the image with a customizer?


Sorry for the late reply. I’m really not sure why this forum doesn’t notify me of new messages sometimes.

You can rotate Printables with the “Rotate” buttons on the printables page:


Just checked sidekiq, the forum doesn’t seem to have any issues but sparkpost has logged 6 rejects from gmail.com with the error : recipient address was suppressed due to customer policy

(See : https://www.sparkpost.com/docs/faq/recipient-address-was-suppressed-due-to-customer-policy/)
So not a lot I can do to help the mail issue I’m afraid… It’s weird though!


I would love to see this tutorial once you get it set! :grinning: