all home built solar system
| Author | Message | ||||
| poida Guru Joined: 02/02/2017 Location: AustraliaPosts: 1459 |
latest code for nanoverter. two nanos need two firmwares. nano1 does the heavy lifting, that is, run the inverter. This code has not changed for a long time. nano2 code oversees things and shows stuff on the LCD. I have many variations of nano2 code that is for I2C LCD, serial LCD, a AC curent sensor (that needs a simple hack on the nanoverter board) and others. so, nano1 code is nano_1_v7_no_bessel.ino.zip This works very well with the standard nanoverter build with the opamp based Vfb low pass filter. I use this code in my home inverter and its running this code for years now. nano2 code. Now it gets interesting. If you want AC current display, then try nano2_5_ac_current_sensor_continuous_on_off_control_softserial.zip AC current calibration is very tricky..if you don't want it just ignore it and let it display rubbish. You need to hack the nanoverter board a little to get the AC current display. I find it not very useful anyway so maybe pass on this one. This code uses a on/off switch that needs to be on continuously to run the inverter. This is what I use at home. It lets me control the inverter via a simple 5V signal from another microcontroller. Pull it down to ground = run, let it be 5V, stop inverter. It also needs a serial LCD (20 x 4 with a small firmware loaded into yet another nano that drives the LCD) A version that instead uses I2C for the LCD. No AC current sensor. I think it uses a momentary push button switch to start and stop the inverter. To change to continuously on/off switch is trival. nano2_4.ino.zip here is a version that uses one fan only, directed at the heatsink. I have the fan also blowing air past the toroid. I built an inverter with one fan so this code is for that. If either HS or toroid exceeds "fan on" temp, then the fan will run. (this version is used in the inverter that I started the air compressor, drawing 11kW during motor start up. The inverter build is a small enclosure so I did not have space for the second fan.) nano2_5_sserial_ac_I_sensor_on_off_cont_one_fan.ino.zip I have found that I2C interface to the LCD is very susceptible to interference. Once I changed over to serial - 9600 baud - LCD things got very stable. Sometimes even then I needed a inline ferrite choke on the 3 wires. The LCD is useful for me only to show if the inverter is running and what voltage in input and output. Maybe also to show if a fan is commanded to run. Serial LCD code: 2 flavours, one with a nano driving the LCD directly, the other driving an I2C equipped LCD. Since I had a few of both types, I made two versions. This code is for the third nano, which is connected to the LCD. IT then is connected to ground, 5V and A4 via the I2C 4 pin connector. This is the first 3 pins. The 4th pin is not used with the serial port code. for direct connection to LCD with 4 bit wide data, RS and Enable pins.. nano_serial_to_parallel_LCD_2.ino.zip and when using I2C type LCDs (note: your LCD might have a different I2C address than what is programmed in the code. So you must change it to suit if needed) nano_serial_to_i2c_LCD.ino.zip PM me with any issues with loading and running these firmwares. It's not very hard once you do it a few times. Important: note well which is nano1 and which is nano2 on the nanoverter board. confusing the two is not fun. Over the past year or so I have added a few extra things to the nano2 code. The latest code is something like: nano2_5_ac_current_sensor_continuous_on_off_control_softserial.ino.zip This uses the serial LCD. It has a timeout for low voltage cutout, I use 5 minutes. This means DC voltage has to be below LV cutout for 5 minutes continuously for the LV cutoff to trigger. It has the usual fan start, stop and inverter stop for heatsink and toroid over temp. This is the code I use to run the home inverter. The LV timeout is important, when a fridge switches on, DC voltage will momentarily drop rather low while the motor starts up. But then then battery voltage will return to something like "OK". I did not want the inverter to stop just because a fridge started. I want it stop when the battery really is lower than the limit when running under a smaller load that is what it delivers for hours on end. |
||||