Expressions in Conditional Code in Layer Change
 
Notifications
Clear all

Expressions in Conditional Code in Layer Change  

  RSS
galex314159
(@galex314159)
New Member
Expressions in Conditional Code in Layer Change

The forum has suggested to use

M104 S{if layer_z < 10}265{elsif layer_z > 45}240{else}265+(240-265)*(layer_z-10.0)/(45-10){endif}

This produces

M104 S265+(240-265)*(layer_z-10.0)/(45-10)

Putting square brackets [layer_z] helps

M104 S265+(240-265)*(10.16-10.0)/(45-10) but still does not evaluate. My Firmware does not like this !!!!

Slc3r documentation says to use { } for evaluation  eg {(240-265)*(layer_z-10.0)/(45-10) }

This fails in conditional code.

My objective is something like

M572 D0 S{if layer_z < 1}0.030{elsif layer_z < (40/3)}(0.030+(0.080-0.030)*[layer_z]/(40/3)){elsif layer_z < (40*2/3)}(0.030+(0.080-0.030)*([layer_z]-(40*1/3))/(40/3)){else}0.030+(0.080-0.030)*([layer_z]-40*2/3)/(40/3){endif}

Clearly I can not understand the Syntax properly 

Posted : 13/04/2020 9:45 pm
Share: