You are not logged in.

#1 2017-02-21 15:30:32

backXslash
Member
Registered: 2016-03-25
Posts: 143

Dynamic Formula Calculation Tool

Is it possible to add a small tool to help develop dynamic formulas (lift, cure, etc...) ?

I'm having trouble with my formula giving odd output, and it would be easier to enter a formula and then have NanoDLP show me the actual output rather than guessing mid-print.

Maybe just a text box for the actual formula, a few others to specify test values for whatever variables one may need and an output section? It would be SUPER helpful, and also help provide a useful documentation sort of deal for the dynamic calculation features as well as make it more user accessible / friendly.

Offline

#2 2017-02-21 19:59:42

backXslash
Member
Registered: 2016-03-25
Posts: 143

Re: Dynamic Formula Calculation Tool

Oh, and is there any explanation on the mathematical operators? I've got several prints where I need to set up "zones" for different cure times like this:


Layers            Cure Time

0 - 4                40 seconds
5 - 300             2 seconds
301 - 400         1.8 seconds
401 - 500         1.2 seconds
501 - 550         2 seconds


The formula I came up with is:

(  ([[LayerNumber]]<=4)*1+40) + (4 < [[LayerNumber]]<=300)*1+2) + (300 < [[LayerNumber]]<=400)*1+1.8) + (400 < [[LayerNumber]]<=500)*1+1.2) + (500 < [[LayerNumber]]<=550)*1+2) )

But NanoDLP doesn't seem to like the variable being in the middle of two math operators like that.

Offline

#3 2017-02-22 00:18:13

backXslash
Member
Registered: 2016-03-25
Posts: 143

Re: Dynamic Formula Calculation Tool

As an example, the following formula:


(([[LayerNumber]] <= 4) * 1 + 40 )
+
(( [[LayerNumber]] <= 91) * 1 + 3)
+
(([[LayerNumber]] <= 406) * 1 + 1.85)
+
(([[LayerNumber]] <= 423)* 1 + 1.6)
+
(([[LayerNumber]] <= 486) * 1 + 1.2)
+
(([[LayerNumber]] <= 494) * 1 + 1.8)
+
(([[LayerNumber]] <= 999) * 1 + 2.2)
)

Yields a cure time of 58.65 for the first 4 layers for some reason.

Offline

#4 2017-02-22 10:37:19

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

58.65 is the correct result, what did you expected?
(([[LayerNumber]] <= 4) * 1 + 40 ) will be equal to 1*1 + 40 => 41

Offline

#5 2017-02-22 14:22:49

backXslash
Member
Registered: 2016-03-25
Posts: 143

Re: Dynamic Formula Calculation Tool

Well, I was trying for just 40.

The notation is a little confusing. It would be easier to work with with some kind of calculation tool, hence the request. Is it doable?

Offline

#6 2017-02-22 20:09:46

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

I will try to add something to dry run formulas.

Offline

#7 2017-02-27 18:36:34

backXslash
Member
Registered: 2016-03-25
Posts: 143

Re: Dynamic Formula Calculation Tool

Shahin wrote:

I will try to add something to dry run formulas.

Just updated to 1362. I'm assuming there's been no addition for this?

Offline

#8 2017-02-27 19:05:14

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

No, there is a big obstacle to implement it. Usually you are free to use any of available variables in gcode boxes. But if we calculate the value when you edit box, it would not be possible to guess what we should put instead of variables. Another alternative is to show result of math on layer preview for each plate, but it is also not that useful.

Offline

#9 2017-02-28 04:56:46

backXslash
Member
Registered: 2016-03-25
Posts: 143

Re: Dynamic Formula Calculation Tool

Shahin wrote:

No, there is a big obstacle to implement it. Usually you are free to use any of available variables in gcode boxes. But if we calculate the value when you edit box, it would not be possible to guess what we should put instead of variables. Another alternative is to show result of math on layer preview for each plate, but it is also not that useful.

I was thinking of a literal separate page. Just a stand alone page like a "formula sandbox" that would help you develop formulas. Don't link it to anything, just have it spit out the results of the math operations given user input. One box for formula input, and several boxes to supply test values for variables. One box to display the output.

I know it sounds silly, but I promise it would be insanely useful.

Last edited by backXslash (2017-02-28 04:57:49)

Offline

#10 2017-03-08 10:14:16

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

You can check it out on the beta version.

Offline

#11 2017-03-14 03:04:28

backXslash
Member
Registered: 2016-03-25
Posts: 143

Re: Dynamic Formula Calculation Tool

Shahin wrote:

You can check it out on the beta version.

Love the new tool. I was hoping it would actually *solve* the formula and spit out whatever value NanoDLP is actually going to calculate though, rather than simply substitute the given variable.

The idea is that you can step through a formula and find any issues and fix them before attempting to use it. Sort of a guess-and-check kind of deal.

Offline

#12 2017-03-14 08:22:12

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

Put formula inside { } to see the result instead of replaced values. I have added a note for this one on the latest build.

Offline

#13 2017-06-22 22:28:14

1125lbs
Member
Registered: 2017-03-15
Posts: 81

Re: Dynamic Formula Calculation Tool

Shahin wrote:

Put formula inside { } to see the result instead of replaced values. I have added a note for this one on the latest build.

Would be possible to add a resource to verify the math error in the formula page? like a button that verify like a dry run to see whats returning, printing?
I would like to not start printing until theres no printing error and explorate maths possibilities befere fire it.

due to the fact when you have resin on tank you start print and it could fail at some level, than you have to remove the resin, filter...

its a straight delicate for me, becouse im research materials and i formulate small quantities like 1g 2g samples, so this math tool should be my companion in lab

I see on trello board that is aimed to prevent print failure, i consider to place some attention inside (F)ormula window

A lot of people that would be using nanodlp in future may have lacks in  math and it would become time consuming to  concatenate when you re working with nano as a research development tool.

Offline

#14 2017-06-23 05:44:12

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

Maybe we could have a box on preview page for each layer which shows all values including what will happens for each box, or what will be send as gcode during printing for individual layers.

Offline

#15 2017-06-23 05:59:10

1125lbs
Member
Registered: 2017-03-15
Posts: 81

Re: Dynamic Formula Calculation Tool

yes for shure, i think its a great ideia inside a preview page, we always need to open a separate tab to define the strategy layers , its clever to integrate it inside preview page.

group layers would be trickier too, as we have burn-in and normal layers we also would have add-sectors incremently added on demand just as plates.

Offline

#16 2017-06-23 06:02:04

1125lbs
Member
Registered: 2017-03-15
Posts: 81

Re: Dynamic Formula Calculation Tool

preview tab would be a layering strategy page smile

Offline

#17 2017-06-23 07:05:40

1125lbs
Member
Registered: 2017-03-15
Posts: 81

Re: Dynamic Formula Calculation Tool

Scipy library could handle diferential equations with the avaliable  [[variables]] as inputs?

Offline

#18 2017-06-23 07:39:34

NeelD
Member
Registered: 2017-06-02
Posts: 44

Re: Dynamic Formula Calculation Tool

Something like what Photonic3d does with Test button. It plots a graph for formula.

Offline

#19 2017-06-23 07:45:48

Shahin
Administrator
Registered: 2016-02-17
Posts: 1,834

Re: Dynamic Formula Calculation Tool

Same printing logic will convert every configurations to commands but instead of sending those to hardware, they will displayed on preview layer.

Offline

#20 2017-06-27 03:04:04

1125lbs
Member
Registered: 2017-03-15
Posts: 81

Re: Dynamic Formula Calculation Tool

it will be fancy

Last edited by 1125lbs (2017-06-27 03:04:14)

Offline

Board footer

Powered by FluxBB