ESP8266 Tig torch pulser

Place your projects here
Post Reply
Zim
Posts: 280
Joined: Mon Feb 08, 2021 9:15 pm
Has thanked: 253 times
Been thanked: 128 times

ESP8266 Tig torch pulser

Post by Zim »

Allows single or multi low level pulses for delicate welds. "cold weld"
Output from ESP turns on a opto coupler.


Untitled-1.jpg
Untitled-2.jpg

Code: [Local Link Removed for Guests]

'tig pulser
'cold weld
'shuts wifi off once pulse engaged allows wifi when powered up for debug
D0=16:D1=5:D2=4:D5=14:D6=12:D7=13:D9=3:D10=1
seeif = FILE.EXISTS("/durset.txt") 'checks for memory file
if seeif = 0 then file.save "/durset.txt", str$(80) 'creates last settings file if absent
count = val(file.read$("/durset.txt")) ' sets to last saved setting
PIN.MODE D10, INPUT  ' set pin 1 (TX) as input for display
PIN.MODE D9, input ' set pin 3 (RX) as input  for display
TM1637.SETUP D9, D10 'setup for display Tm1637
PIN.MODE D5, INPUT 'encoder s1
interrupt D5, encoder
PIN.MODE D6, INPUT 'encoder s2
PIN.MODE D7, INPUT  ' encoder key button saves setting to memory
interrupt D7, tomem  'saves count to memory
pin.mode D1, input   ' from torch switch pulldown with external 10k 
interrupt D1, engage  ' for torch switch
pin.mode D2, output  ' optocoupler with 300 ohm resistor in line
pin(D2) = 0
dur = 100  'milliseconds of on time
repeat = 1000    'milliseconds to auto repeat  if tig switch held on  <<<<<<<<<<<<<adjust if needed>>>>>>>>>>>>>>>>>>>
TM1637.PRINT "hold" 'when in hold wifi is alive
'wlog "waiting"
autorefresh 500
wait

encoder:
pause 5
if pin(D6) = 1 then return   ' if the pin is high, returns back (prevent double hit)
pause 5 
if pin(D5) = pin(D6) then count = count + 10 else count = count - 10 '10 milliseconds per click on encoder
if count < 50 then count = 50  'limit short duration  to 50mS
if count > 200 then count = 200 'limit long duration  to 200mS
TM1637.PRINT str$(count)
return

engage:
if WIFI.MODE = 2 then wifi.sleep
TM1637.PRINT str$(count)
pause 100
'timer0 repeat, engage ' timer for auto pulse
if pin(D1) = 0 then return   ' if the pin is low, returns back
'wlog "weld"
pin(D2) = 1 'arc on
pause count 'sets duration of arc
pin(D2) = 0 ' arc off 
timer0 repeat, engage ' timer for auto pulse
if pin(D2) = 1 timer0 0
Return

tomem:
if pin(D7) = 1 then return 'prevent double click
if (count <> val(file.read$("/durset.txt"))) then file.save "/durset.txt", str$(count)  'writes last count to memory
return
end


example.mp4
You do not have the required permissions to view the files attached to this post.
Post Reply