the circuits been running on the mill for a while now ......no other tweeking since...
the fan code plan did,nt quite work out .....using the pause command to pwm the heatsink fan was interfering with the rest of the code ....the pause in the code was interupting realtime voltage sensing.....not a good idea
so now the temp code is just a simple on/off aux signal .....
final full code.....
Start: setfreq m16
SYMBOL Volt = w0
symbol niall= w1
symbol temp = w2
init:
pwmout pwmdiv64,C.2,249,000 ;start pwm
Main:
readadc10 4,Volt ;sample input volt
readadc10 1,temp ;sample thermistor v on heatsink
if volt<430 then let volt=430 ;set up volt window
end if
if volt>508 then let volt=508
end if
niall=volt-430
;compensate volt to act as 0-1000 duty ish
niall=niall*13
pwmduty C.2,niall
if temp< 382 then high 0 ; have a feel of the heatsink
end if
if temp> 382 then low 0
end if
goto main
the pic has no " doomsday " option ....so playing with a simple transistor 60v peak voltage trip might be an option ....fun if nothing else
...and will run at hi dc without any v regulation ...cheap too
this is kind of a copy of one of " fc solar circuits " voltage switchs....a small pnp is fired when zener diodes in series on its base sense enough v to turn on ....
very experiential this bit all the mill power goes directly into a dc immersion element added in to the oil heater .