GTI Limiter / Diverter for wind and solar

hi robert i could install timerone libary and change it to a much faster freg or to what ever frequency one needs … I was using it to turn pin 9 to a 10 bit but does seam to work for me . I will try other pins as perhaps my clone has it somewhere else other then 9 or 10

I was curious if the triac would work still if I put a low pass filter on the PWM to to give it a smoother sine . as my triac has a heat sink I installed a small fan and on it opticouler I put a lowpass filter to get rid of the “chirp” from motor driver that was coming from the motor at low rpm

I think there’s a big misunderstanding going on here. I’m not sure whether it is at my end or yours, or both. I don’t understand how your triac can possibly be working as I think you want it to work, but from what you’ve just written, I think you want it to work in a way that triacs simply cannot and do not work.

Your opto-isolator device, a MOC3041, is a “Zero-Cross Optoisolator Triac Driver”. If you read the data sheet very carefully (and I can understand people missing this because it is fairly well hidden), the way it works is you give it a trigger signal, which is a purely digital signal, either on or off. There’s nothing analogue about it, it’s either there, and the LED inside is lit, or it’s not, and the LED is dark. When it sees that signal, it waits for a zero crossing of the mains voltage, then it fires the triac and the triac turns on. The triac will inherently remain conducting until the next zero crossing. If meanwhile you take the control signal away, nothing happens until the triac turns off of its own accord at the end of that half-cycle. If you leave the control signal on, the triac will turn on again at the start of each successive half cycle until the end of the half-cycle after you turn the control signal off. (Remember what I wrote above about the need to have whole cycles on and off.)

When you are using a triac to control a dump load, both MartinR’s and Robin Emley’s diverters work in ‘burst-fire mode’, which is explained here.
In the animated illustration on that page, the pwm frequency is one fifth mains frequency (10 Hz to us, 12 Hz to you). The trigger signal is drawn underneath the mains wave, if you didn’t notice it. Look carefully and you can see the triac starts to conduct after the trigger is applied, and it stops after the trigger is taken away.

but it IS working . ( just trying to get it work better hopefully at 10 bit over 8 bit )

as the ardino is pulsing the signal on and off at a high freq . well not really on and off more switching positive to negative you can easily observe this hook the ardino up to an arbitrary pwm pin ie pin 9 to pin 2 on moc403X and 5vdc to VCC and pulse at say 190 steps on the adrino the triac will run at ~75% load . now switch it around and put pin 9 on VCC and pin 2 to gnd the it will fire again but run only at 65 step or~25% load…

and it is working reasonably well at 120 volt around 20 watts average Pos or Neg. to the grid if i can get it to work at 10 bit i think i should be able to trim that down to 5-10 watts + or - to the grid … though at the lower the step the accuracy is off more closer to 50 watts which suggest to me the triac does not fire linearly for me a bit of a bell curve to it near the lower edge . it relatively accurate anywhere after 50 steps. the most accurate when it passes the middle

i am still using my heat pump buffer supplement heater. that normally runs at 240 volt. . , it’s relay had two extra isolated contacts that controls it , that are Normally closed. so when it in that position it provides 120 volt to my buffer tanks and my diverter. and if for some reason if I need 240volt on the supplement heat on the buffer tank it will automatically switch back to 240 and run the element at 4500 watts … and for safety sake I put a fusible link on the 120volt side at 15 amp .

hey Robert - I investigated what you where talking about and the triac., I see what you mean now, as I am not firing at a specific zero crossing. I am firing a random pulse. at specific frequency with out any timing involved with the sine wave. perhaps this explains why it is working and why that long pulse the accuracy was much better while at very slow pulse the the accuracy declined. - I suspect I could change pulse frequencies for the PWM that will have the least amount of errors to something divisible by 60/120 ( for 60 hz) . , I think ardino default pwm pulse is 465 which is pretty close to 480 . so what basically happing is sure I have it set to fire at 50% load but what happening is the first pulse might fire at ~3/4 of the sine next one fires at ~1/4 sine but the average over the entire cycle is 50% of load. which also explains why at lower end I have a flicker when hooked up to a lamp (or I could figure out how to determine the zero cross and fire at the appropriate timing - :slight_smile: ) .

it seams that some are not too convinced it working and its working relatively fine at that . … here a movie sample. one is using a TED whole house monitor, the does not tell which direction the current going ( though if you use my hack it does ie: using an ardino or mywebpage script to plot usage it does "ted 1001 hack " ) …
test1.avi.zip (1.3 MB)

and a snap shot of my diverter, I have the sensors on the solar panel as it gives consistent power to the grid ( over wind) . and I am not using the GTI limiter function only the the diverter for this testing purpose …

movies were downsized using a linux computer (and your webpage does not like any mp4 format I used so I zipped them) - if problems playing vlc should play them fine on windows or other os

If you look at either Robin’s or MartinR’s sketches, you’ll see exactly how to fire the triac and synchronise to mains. Both do it completely differently, but achieve the same result.

hi Robert- i figured out how to synchronize to the main, i choose and easiest method of a bridge rectifier, 4n25 and interrupt on 3 rising. using the 9volt ac current to emonshield as the base line and a little daughter board attached . is then it only a 20 extra line to my current sketch to get it to work … as my triac module it is about 30 feet away from where my gti limiter/diverter module is , as i use a simple bnc cable to operate the module as it is attached to the hotwater buffer tank directly

as to my current method it works fine I figured out why it works and how to edit to get better accuracy . timerone. and set the timing of the firing pin to +/- 65- though it will work if you use a value, 1/2 value double or quadruple value ( if you want it to work on 50zh then you use +/-78 as the base but I can not test that assumption ) --the default pwm freg is a dividable by 65 roughly for 254 steps ( 244 and 122 pin dependent so that why it works for me from the get go ) - it overal accuracy is +/- 20 watts ( though it way out at the bottom but if you chop the first 5 steps or so and start around there, it much more accurate near the bottom. if you leave it on a particular step if fires within an 1/4 amp either this side or that side of the desired setting and with the overall randomness of GTI anyways 20 - 30 watts it pretty much balances it self out anyway… ( and with wind probably even more so)

here a test sketch if any wants to try –

#include <TimerOne.h>
int ACLOAD = 3;
int dim = 0;

int freqStep = 63; // change here 65 for 60hz 78 for 50 hz using a moc3043. it works as it sense the lower voltage. where moc3041 does not

void setup() {
Serial.begin(9600);
Serial.print(“begin”);
Timer1.initialize(freqStep);

}

void loop() {
for (int i=0; i <= 254; i++)
{
dim=(i);
Serial.println(dim);
analogWrite(ACLOAD, dim);
delay(1000);
}
}

I rather doubt that anyone will be very interested in your sketch, because there are two sketches published here that have been proven many times, in many different situations, and they have been looked at, analysed, modified and extended by very many people, most of whom know what they’re doing. So I am reasonably certain that both work, and work well.

You clearly haven’t bothered to read the advice I’ve freely given you, which I think will be obvious to anyone reading this thread. I wish you well with your project.

humm, not sure what in your bonnet, because I choose a different method, a simple hardware method of determining a zero crossing . over decrypting someone else’s sketch to do the same - which I figure it out before you offered your advice of two for mentioned sketches --( i looked at them long ago by the way but they did not work for my purpose and so much stuff I would have cut out that was useless to me )… i have no worries if anyone uses my sketch.
but then again not everyone wants to simply divert solar power to a hot water tank. as that not why i wrote mine-- I wrote mine to turn down the GTI output as it reduces wear and tear on the gti unit.but since i have also I wind generator, I can not simply turn it down it GTI out put as the blades will run wild. I have to shunt or divert its out put that the only reason i have the diverter module included in my sketch …

to which i am quite proud that it work reasonably well at ~30 watt accuracy even with the non standard method of firing the triac, or even the standard method ( which really only giving me a little better performance at the bottom end of diverter module - so I am not seeing that great a benefit to the extra work --as I am not sitting near the bottom end that much, maybe an accumulated 100 - watts extra to the grid per day combine total 400watts a day over uploading with out the diverter or GTI limiter 7 - 10 kws extra to the grid if the winds blowing ).

but since you do not seam to know what gti limiter is here are a couple examples ;

http://www.exsolar.co.za/products/grid-tie-limiter/ or the Sun GTIL which would of cost 2500 to buy or swap out existing GTI. and I built mine for $100 and much more more scalable and configurable if I want

and if no one cares about it then simply get your mod to delete my thread and i will move the info else where…

not that some people care on this forum- but a small update- i added a cheap esp8266 to my device. above the one I am using is capable of handling 5v, all i connect to the uno is positive and negative, and tx to the rx of the esp8266
edit these line to include this
if (CT2) { …

Serial.print("cmd_1("); Serial.print(invert); Serial.println(")");

}

if (CT3) { …

 Serial.print ("cmd_2("); Serial.print(grid); Serial.println(")");

}

if (CT4) { …

Serial.print ("cmd_3("); Serial.print(wind); Serial.println(")");

then upload lua firmware to esp8266
and for the init.lua
used this
– load credentials, ‘SSID’ and ‘PASSWORD’ declared and initialize in there

function startup()
    if file.open("init.lua") == nil then
        print("init.lua deleted or renamed")
    else
        print("Running")
        file.close("init.lua")
        -- the actual application is stored in 'application.lua'
        -- dofile("application.lua")
    end
end

print("Connecting to WiFi access point...")
wifi.setmode(wifi.STATION)
wifi.sta.config("wifi","1234567890")  --SSID and password 
-- wifi.sta.connect() not necessary because config() uses auto-connect=true by default
tmr.alarm(1, 1000, 1, function()
    if wifi.sta.getip() == nil then
        print("Waiting for IP address...")
    else
        tmr.stop(1)
        print("WiFi connection established, IP address: " .. wifi.sta.getip())
        print("You have 3 seconds to abort")
        print("Waiting...")
        tmr.alarm(0, 3000, 0, startup)
    end
end)
dofile("serial3.lua")

and created another script called serial3.lua up load it to esp8266 that includes this

uart.setup(0,9600,8,0,1)
port = 80
print ("uart.setup(0,9600,8,0,1) finished")
print ("waiting for serial data....")


function cmd_1(value)

  i= value

end

function cmd_2(value_2)

  g=value_2

end

function cmd_3(value_3)

  w=value_3
 
end

srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
  conn:on("receive",function(conn, payload)
    print(payload)
    conn:send("HTTP/1.1 200 OK\nContent-Type: text/html\nRefresh: 10\n\n" ..
              "<!DOCTYPE HTML>" ..
              "<html><body>" ..
              "<h1>GTI LIMITER</h1>" ..
              "<b>Solar Output : " ..i.. " watts </b><br>" ..
              "<b>Grid Level : " ..g.. " watts </b><br>" ..
              "<b>Wind Output : " ..w.. " watts </b><br>" ..
              "</html></body>")
  end)
  conn:on("sent",function(conn)
    conn:close()
  end)
end)

this creates a simple webpage that is accessible from anywhere. an orange pi ( similar to a raspberry pi) with a 7 tinch touch screen - connect to these simple web page and displays info from 10 different esp8266 modules , that display gti limiter status. sun luminosity, evacuated solar tube status and temps green house temps, boiler temps, heat pump information, and much more . cataloguing into a databases
I used the esp8266 on my gti limiter as it has it own processor it simply reads serial data and creates visual data from it with out impacting the performance of the uno. and really I need significant distance as some of my monitoring outpost are pretty far away over a 1000 metres … and i have the option to easily include data from other esp8266 modules that are on completely different networks

good luck have fun …

init.lua.zip (1.3 KB)

forgot to say if you do not want to use a a pi device you can use a android tv box ( cost $25 and up) that what i was originally was using. just install androphp from mobile1 repository ( google does not have it) it will install all php addins , webserver and mysql if you want. and run the webserver off that to process and data log all info for all the remote esp8266 and ardunio devices. – but really if you want a interactive display mount use the pi if you want a webserver backend only use a android tv box… cheaper easier and already in a nice looking box