0

this is related to math and ideally I would like you to advice me the procedure or tool to find a proper input of the power (0-255) for a heating element in time to reach particular temperature.

The heating element power output is controlled by PWM and heat it produces is being read out by temperature meter. Even if heater is powered up with maximum power (255) it's temperature goes up slowly at the beginning and rapidly at it's maximum temperature reachable.

I need to find a way to reach a target temperature in most ordered fashion; I can set time intervals in which power can be adjusted and temperature is being read out as well.

I am developing this controller on NodeJs.

thank you for any constructive inputs; those who had a bad day today just go somewhere else, it's hard enough for me to even phrase it. thank you!

greengold
  • 1,184
  • 3
  • 18
  • 43
  • Remember that asking for library recommendations is [explicitly](/help/on-topic) one of the predefined reasons for a post to get closed, so you'll want to rewrite your question as a concrete programming problem: what do you need to do, what code did you already write to do that, and how did that code not live up to what you needed it to do. And most importantly, what did you already [search, and research](/help/how-to-ask) so far. – Mike 'Pomax' Kamermans Mar 23 '23 at 19:36
  • 'Even if heater is powered up with maximum power (255) it's temperature goes up slowly at the beginning and rapidly at it's maximum temperature reachable' Did you get this backwards? The temperature of the element should rise asymptotically to the maximum, no? Are you hoping to be given a thermodynamics equation to model in your program? If L(T) is the heat power lost by the element at temperature T, then dT/dt will be roughly proportional to (M*P_pwm/255) - L(T) where M is the maximum power in and P_pwm is your PWM value. This is a simple model of course... – Simon Goater Mar 23 '23 at 22:46
  • yes; that's what I ment. so that P_pwm is what I am looking for it seems – greengold Mar 23 '23 at 22:59

1 Answers1

1

Assuming the power to the heating element increases linearly with the P_pwm value, I came up with the following model and equations. If L(T) is the heat power lost by the element at temperature T, then dT/dt will be roughly proportional to (MP_pwm/255) - L(T) where M is the maximum power in and P_pwm is your PWM value. You could define L(T) = lambda(T - A) where A is ambient temperature and lambda a real 'constant'. If you know the T_max of the element when it is run at full power and has had time to get to the maximum temperature, then dT/dt = 0. This means

M = L(T_max) = lambda*(T_max - A)

so

lambda = M/(T_max - A)

To find P_pwm for T_target, you also can assume dT/dt = 0 when P_pwm is the correct value for T_target and the element has had time to stabilise at that temperature. So,

(M*P_pwm/255) = L(T_target) = lambda*(T_target - A)

giving

P_pwm = 255*lambda*(T_target - A)/M = 255*(T_target - A)/(T_max - A)
Simon Goater
  • 759
  • 1
  • 1
  • 7
  • amazing, thank you! I will need some time and maybe a consultancy to process it, appreciate you very much! – greengold Mar 24 '23 at 20:45