Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Electronics : Various aspects of home brew inverters
Page 19 of 47 | |||||
Author | Message | ||||
tinyt Guru Joined: 12/11/2017 Location: United StatesPosts: 438 |
@poida. Wow, what a big leap in code development. The only part I can understand so far is: /* inverter program, bring your own 1/2 bridge gate drivers. Outputs are pin 9 and pin 10 Gate drive enable pin 5, logic HIGH Fan control, pin 6 AC voltage set point ADC ch2 AC output sample, Ch0 DC volts in, ch5 Heat sink temp, ch4 DC current sense, ch3 */ Been thinking about that setpoint trimpot when I was doing the schematic, I agree it can be eliminated. Will update the schematic including support for latest code usage. So, ch2 will now be freed up? I notice that you are using ch4 and ch5 which shares SDA and SCL, your code is doing this alternate function sharing? Way back I think you also did syncing with utility power frequency. I tried it also and used INT0. Can this sync function be added also? |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
I just used ch4 and ch5 when doing a brain dump of putting stuff here and there at the beginning. With ch2 free, move Heat sink to ch2, move DC volts in to ch1. I think we could do mains sync via INT0 which is Pin32 of the 328p or Nano's D2 pin. This is not used at the moment. Why use two values for DC V in? I first thought to get a useful but fast to calculate scheme of a calibrated voltage I would need a known value at the bottom end of the range and a known value at the top end. eg. With DC V IN at maybe 0.0V input into ch1 need to get the ADC value which is likely to be a small number, 2 counts or something. We have a resistor divider that gives 4.0V out for 50.0V in. Then we put a high voltage, say 4.0V which is like 50V DC input would correspond to when applied to ch1. We read the ADC for ch1 again. We get maybe 860 counts. So we know 0.0V = 2 counts = 0.0 DC V IN 4.0V = 860 counts = 50.0 DC V IN With linear interpolation, I can determine the DC V IN for any ADC ch1 reading. It will be quite accurate. This is rather excessive accuracy to my mind now. Maybe we could assume the low end is always going to be 0.0 V DC, (and 0V AC, 0 Amps DC) from the ADC value of 0 counts? It would simplify calibration. If we need only the LCD to display volts & amps to the nearest integer then the small offset errors can be ignored. We only need to ensure a good calibration point near to typical operating values. The more I think about this while writing this post, the more I think no more offset cal points. Today here at "work" I will remove the low calibration points from the menu. Tinker: the serial console is just what is says on the can. The Arduino system supports serial data transfer from all it's boards. We are using one based on a certain chip (328p) in a device called a "Nano". To program a Nano, get a USB cable to micro USB connector, same one that fits into a Samsung phone. Download the Arduino program, install. plug in the Nano, via cable to the PC. Load and run a program. When ever the program has statements to print to the serial console, data is sent out of the Nano, via the cable to the PC. For you to see this data, you open the serial console from the Arduino program menu. It will look just like the image I last posted This function permits us to send and receive a little data as needed while a program is running on the Nano. whoops, bad news: I was just told we have an issue with an important automated sewing machine here. I might need to do some "work" now. wronger than a phone book full of wrong phone numbers |
||||
wiseguy Guru Joined: 21/06/2018 Location: AustraliaPosts: 1156 |
Coming along great Poida TinyT & Gaspo. One thought for the DC current, some may want to use a hall effect type current sensor others a shunt with some op-amp gain. Both usually have an offset at zero which can change/drift & be annoying, seeing a current when there should be none or vice versa. A hall effect sensor is worst as its offset often changes with temperature/time. One possible scheme for current calibration. Run the A/D with no current and store the reading as zero. Calibrate the high current end, for hall effect either lower current more turns -ie 5A and 10 turns or 50A and 1 turn. Now we have a straight line for current reading. Then every time before the inverter is enabled to run or restarted, first an A/D conversion could be carried out once, the result can be re-stored as a "refreshed" zero & compensate for any offset change. Maybe I'm over thinking this and you already have another solution..... If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
||||
Tinker Guru Joined: 07/11/2007 Location: AustraliaPosts: 1904 |
Thank you poida, for that explanation - I'm with you there. What I was asking - in a roundabout way , do we need an USB socket on the *outside* of a finished inverter or can we just plug in the programmed nano into the control board and the inverter can be closed up to run thereafter without requiring to access the nano? Klaus |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
I am struggling with this at home with my existing system. I use a 50A bipolar Allegro sensor which has drift that seems to be controlled by the alignment of the planets. I view the current measurement as needing to be only about 5% accurate to meet the requirement of giving a repeatable and consistent signal of the operating DC current. The analog inputs can take 0 to 5V, giving a reading of 0 to 1023. Let's say we set the over current limit to 100A. It might be a poor choice to design the current sense circuit to give 0.2V at 100A. It would be much better to have it produce 4.5V at 100A, and never more than 5V. If drift and uncertainty is 5%, then we will have a reasonable chance of running the system near 100A but not false triggering the shutdown. Is designing a current sense system meeting the above easy? Have you looked at the LEM current sensors? What do you think? wronger than a phone book full of wrong phone numbers |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
I think we only need to access the Nano during setup and later tuning. Once it's all good, I would just leave it closed up in the enclosure. I think the LCD display will give all we need to know anyway. wronger than a phone book full of wrong phone numbers |
||||
Tinker Guru Joined: 07/11/2007 Location: AustraliaPosts: 1904 |
With AC output over currents we should consider how they are treated. Those hypotetical 100A might only occur for a millisecond when a big motor turns on. For a 6KW inverter, lets say 30A continuous could be expected until the over temp or low battery voltage shuts it down. So might it not be better to ignore peak current (100A) for just 500ms or so - the EG8010 uses 600ms - and set a considerable lower current limit for longer time periods. There is an AC circuit breaker (I use 32A) anyway but I'm not sure about its peak current trip and associated time period. So far I have not had it trip. Klaus |
||||
wiseguy Guru Joined: 21/06/2018 Location: AustraliaPosts: 1156 |
That is both witty and unfortunately very close to the truth. What model sensor are you using ? We were using LEM sensors when we used the "refresh offset" feature on power on - it was a bipolar unit running from 5V its output was ~ 2.5V (+/- planet alignment) at zero current. Later we used the Allegro ACS715 which has a chopper stabilised offset correction and performed quite well. It only had a max current of 30A & resistance a bit high at 1.25mOhms. The ACS770 appears a much better unit & would be my suggestion to use, it is a much beefier unit, has reasonable performance similar to the ACS715 and good bandwidth (120kHz) and 100uOhm impedance. Voltage drop at 100A is a mere 10mV. At 100A output voltage is ~4.1V for the unidirectional part. Total error is ~ 1.5% for 25 - 150degC. Aliexpress has them here for a reasonable price. At Digikey they are ~ $10ea for 10 off. Is 100A enough ? The ACS770 range has 50,100,150 & 200A units unidirectional and bi-directional Should it be bidirectional to show back-feed charging ? Remember the higher the max current of the sensor used the lower the output at normal or lower loads so there is a tradeoff. If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
||||
tinyt Guru Joined: 12/11/2017 Location: United StatesPosts: 438 |
Here is updated schematic for review/comments/etc. 2018-11-16_182745_TBS-PGWdraft3.zip For the mains sync, there are two options. Option 1 needs an external isolation transformer. Option 2 uses an opto-isolator and if all components are installed on the control pcb, the opto, caps, resistors, and connectors will have mains live voltage. Option 2, I just copied from a google'd site. I have used option 1 in a different application. The 10K resistor is high enough not to damage the on chip clamping diodes. You have to make sure that the on chip pull up resistor is dis-abled for INT0 to function reliably. For both options the leading edge of the sync pulse will occur earlier than the actual zero crossing. Not sure if compensation is needed in code. |
||||
wiseguy Guru Joined: 21/06/2018 Location: AustraliaPosts: 1156 |
Circuit is coming along well TinyT. The Option 2 circuit for the zero crossings doesn't feel right to me. I used a 680nF mains capacitor to achieve ~ 50mA at 240V. The two caps in your schematic (different values?) equate to ~ 8nF - that yields ~ 600uA of LED current (using XC value at 50Hz), from the transfer ratio of ~20% that is 120uA of collector current or about 500mV change from open circuit with 4K7 pullup. It all gets much worse as the waveform falls towards zero. If the caps were both 50nF it would be somewhat better with a resultant LED current ~ 2mA If it is an application circuit posted on someones site & it works - I have no idea how! If at first you dont succeed, I suggest you avoid sky diving.... Cheers Mike |
||||
tinyt Guru Joined: 12/11/2017 Location: United StatesPosts: 438 |
Hi wiseguy, thanks for the review. You are correct, I messed up my copy and edit of the option 2 circuit. I corrected it now using your value and connection. Here is the update and more additions, please review/comment/etc. 2018-11-17_033510_TBS-PGWdraft4.zip I have added power supplies, fan connection and current sensing connections. I have assumed that they will be through 3-pin connectors (ACS7xx). |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
Tinyt, thanks again for your involvement in this. I think I want to correct your circuit, at J7, tagged as "ACI" I believe we need DC volts sensed, and not AC current sensed. Maybe a voltage divider (ground and inverter DC supply), RC filter, then series resistor into ADC3, pin 22 on the Nano? I can not quite accept how much work you are putting into this. It is such a great help. I have got close to finialising the setup menu. It looks like this now: heat sink temp = 1 degC ch.2 2 - cal. DC volts 0.05 -> 11.7 V ch.1 4 - cal. DC current 0.20 -> 12.0 A ch.3 6 - cal. AC output 0.49 -> 0 V AC ch.0 7 - set AC set point 220 V AC 9 - set AC output freq. 50 Hz B - fan ON temp 50 degC C - fan OFF temp 40 degC D - shutdown temp 80 degC E - AC output low limit 90 % F - LV cutoff voltage 22.0 V A - Restart voltage 25.0 V G - over current limit 50.0 A H - enable/disable DC LV cutoff OFF I - enable/disable over current cutoff OFF J - enable/disable AC under volt cutoff OFF K - enable/disable over temp cutoff OFF Y - put defaults into E2PROM Z - zero E2PROM When you input a new calibration value for e.g. DC volts, you will immediately see the effect of the cal. value when the menu is displayed again. It's easy to use. I still don't have DC current, DC supply and temperature connected and giving real readings. Still dummy data. We might have to have an opamp or 2 to process the DC current sensor output and give offset control via a trim pot. "just do it in software" might be a good way too. Or an actual trimpot dedicated to DC current sense zero offset, fed into ADC7? I want to further discuss with Wiseguy the pros and cons. Since I removed the filtering of Vfb, I have had to rework the PID. Due to the small DC bulk caps on the test inverter and effective current limiting from the power supply, I have had many test runs where the PID goes insane but avoids blown MOSFETS. I had to change the PID scheme because I need a lot of time in the 100Hz block of code, running in loop(), so much time that it upset the original PID setup badly. The extra time used up is due to updating the LCD, mainly. Soon I will get some mains sync going for you. wronger than a phone book full of wrong phone numbers |
||||
tinyt Guru Joined: 12/11/2017 Location: United StatesPosts: 438 |
I did not label the net, but DC V is sensed by ch1. (pin 20 of the nano). Still reading/trying to understand the rest of your post. I do this only when I have some free time, so no problem. Also, your great code needs to reside in hardware, so we need to do this. |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
Sorry, I did not look closely enough. here is a video of it running through shutdown tests LV cut off is set to 22V it restarts when 25V appears permanent shutdown: if temp exceeds 80 degC if current exceeds 50A Latest code permits any frequency from 40 to 100Hz. I have a poor Vfb design on the bench which is letting too much noise into the signal. So the prototype is not producing the programmed AC output voltage. Something is going on... latest code:2018-11-17_104634_uno_inverter_wg_sine_i2c_1.ino.zip wronger than a phone book full of wrong phone numbers |
||||
Tinker Guru Joined: 07/11/2007 Location: AustraliaPosts: 1904 |
Poida, from a practical inverter user's point, I consider your permanent shutdown temperature of 80 deg C a bit high. If the fan comes on at 50 deg and the heatsink temp. keeps on rising past 60 deg. then the inverter is obviously overloaded as the fan(s) cannot cope any more. No point in letting it go hotter still. Keep in mind that with a decent size heat sink its temperature changes are gradual, not sudden. However, if the NTC senses the toroid temperature then, unless the fan blows onto that as well, this might get hotter than the heat sink. From my testing with inverter #4 (which has an undersized toroid for my test loads) I observed this: Once the fan comes on (EG8010 controlled) the heatsink temperature immediately reduces even if I have nearly twice the rated load on the toroid. This toroid kept on getting hotter while the heat sink got cooler from the fan. I turned it off when the toroid went past 80 degrees C. So you see, its quite a bit more complex with the temperature management. I was doing the testing with no case around the inverter, it will behave different still, when fully enclosed. So, lets assume all inverter builders do size the toroid windings for the expected load so excessive temperature rise should not be a problem there. Now, if we sense just the heatsink temperature, if this keeps on rising while the fan is on then a shut down at 60 degrees heatsink would be safer IMO. Klaus |
||||
poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1418 |
The shut down temp is not fixed. Anybody can change it to what they want. I chose some number at random just to test the function of the program. I think it highly likely the test values I showed in the video will be completely different in use. The advantage of doing our own code is it permits us to chose our own shut down conditions. Maybe we could use one of the ADC channels to sense and shutdown from high toriod temperatures? We can do this now, it's our code, not the EG8010 black box. wronger than a phone book full of wrong phone numbers |
||||
Tinker Guru Joined: 07/11/2007 Location: AustraliaPosts: 1904 |
Thanks poida, I thought that may be the case. I was just pointing out some real life figures. Toroid temperature sensing might be useful for some, for me if this being optional is fine. You and others involved with the development of this inverter driving method have done a great job, can't wait to see it working on my inverters. tinyt mentioned inverter syncing to mains frequency, I wonder if our inverters are legally allowed to do that here in OZ? What would interest me is if my two nano updated inverters could then be synced to each other? Would they then be able to connect to the same load? This could mean that one or the other could be switched on line with nil power interruption (nothing requires disconnection). Or is that too complicated? Klaus |
||||
renewableMark Guru Joined: 09/12/2017 Location: AustraliaPosts: 1678 |
Are you planning for a temp sensor on heatsink and torroid with individual fan controls? Cheers Caveman Mark Off grid eastern Melb |
||||
nickskethisniks Guru Joined: 17/10/2017 Location: BelgiumPosts: 458 |
Is there a way I can contribute to this interesting development? Maybe it's An idea to split the processor load between 2arduino's, one for the metering/interfaces and one for the main program? |
||||
tinyt Guru Joined: 12/11/2017 Location: United StatesPosts: 438 |
Since adc7 is free right now, we can use it for toroid temperature sensing. I think we still have un-used DIO pins on the nano for another fan control. The un-used uart nano pins 1 and 2 can be used for inter-processor communication to split processing load. I do this in some of my projects. Let me know if you want them before we commit to copper. |
||||
Page 19 of 47 |
Print this page |