Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 00:29 27 Nov 2024 Privacy Policy
Jump to

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 17 of 48    
Author Message
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 02:16am 13 Nov 2018
Copy link to clipboard 
Print this post

what he said ^^^
wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 02:18am 13 Nov 2018
Copy link to clipboard 
Print this post

  tinyt said   Hi poida, when you have the time, will appreciate if you can post changes for 60Hz. Thanks


Huge changes required:
change one #define statement from
#define PPWM 800
to
#define PPWM 665

there's yer 60Hz right there.
wronger than a phone book full of wrong phone numbers
 
gaspo
Regular Member

Joined: 25/06/2018
Location: Australia
Posts: 65
Posted: 02:20am 13 Nov 2018
Copy link to clipboard 
Print this post

  poida said  

if (analogRead(4) < minvolts)
{
oen = 0;
lcd.message("DC LV cutoff. Inverter stop");
}



If you have control board on the isolated power supply how would you read battery voltage, or any analog signal on the "other" side?

Using analog opto-couplers? There are few on the market, never worked with one. Which would be the most suitable for this application?

IL300 , LOC111 , H11F1, others?
 
wiseguy

Guru

Joined: 21/06/2018
Location: Australia
Posts: 1156
Posted: 03:06am 13 Nov 2018
Copy link to clipboard 
Print this post

I have used a HCPL 7825 in the past but a AMC1100 seems like an equivalent now and is available here Isolation Amp Aliexpress
Typically they are used for isolated inverter current shunt sensing but also work well with isolated voltage measurement - we used one for AC mains power measuring in a previous product & it worked well.

I only ever used them differentially but have a feeling you can read just one output side for single ended.

They are a bit pricey from digikey (~USD3.60 ea) but can be found cheap enough as per the above link.
If at first you dont succeed, I suggest you avoid sky diving....
Cheers Mike
 
wiseguy

Guru

Joined: 21/06/2018
Location: Australia
Posts: 1156
Posted: 03:20am 13 Nov 2018
Copy link to clipboard 
Print this post

Poida, not sure how you plan to calibrate for voltage current etc but maybe its the right time to tell you how we solved this issue for a power supply.
We had a single pcb push button and 1 diagnostic led that flashed off as data for each step was stored.

If you powered up whilst pressing the button it enters setup

Now adjust the DC power supply (simulating battery) to Vin Lo say 45V and press the button - this stores Vlo value.

You may not want the next step.
Now adjust the Power supply to Vin Hi and press the button - stores Vhi value

Now with no current flowing press the button to store I zero
Now either with current or simulated equal voltage injection to the current measure press the button for I Hi value.

Maybe you have already thought this stuff through and there may well be better & other ways, just thought I would throw this in if it helps.
If at first you dont succeed, I suggest you avoid sky diving....
Cheers Mike
 
tinyt
Guru

Joined: 12/11/2017
Location: United States
Posts: 438
Posted: 04:19am 13 Nov 2018
Copy link to clipboard 
Print this post

  poida said  
  tinyt said   Hi poida, when you have the time, will appreciate if you can post changes for 60Hz. Thanks


Huge changes required:
change one #define statement from
#define PPWM 800
to
#define PPWM 665

there's yer 60Hz right there.


Thanks poida. Looks like what I did matches your number.

#define FundHz 60 // Inverter frequency
#define FundFx2 (FundHz*2) // Inverter frequency x2
#define ClockF 16000000 // System Clock
#define NPWM 200 // number of pulses for half sine wave
#define PPWM ((ClockF/FundFx2)/NPWM) // clocks per pulse

Edited by tinyt 2018-11-14
 
gaspo
Regular Member

Joined: 25/06/2018
Location: Australia
Posts: 65
Posted: 04:22am 13 Nov 2018
Copy link to clipboard 
Print this post

Thanks Wiseguy for info about AMC1100, seems like a good device for measuring isolated voltage and current.

The way I would go about setting up the control board parameters is to take advantage of having the micro-controller and talk to it via serial port or better USB.

The micro would implement simple set of commands for displaying and configuring the operational parameters.

When in stop mode the software would monitor the serial port and respond to user commands:
? - show all commands
0 - display configured parameters
1 - set battery low V
2 - set battery high V
3 - set over current shutdown
4 - set fan temperature
5 - set over temperature shutdown
6 - read battery V
7 - read temperature
8 - read current
etc.
 
wiseguy

Guru

Joined: 21/06/2018
Location: Australia
Posts: 1156
Posted: 05:03am 13 Nov 2018
Copy link to clipboard 
Print this post

Hi Gaspo, nothing wrong at all with your scheme thanks for the input.
I was just using the clockman principle of keep it simple.
My scheme just needs a DVM and a finger :) no PC & cable
I am entirely unfussed which way is chosen - I can do either.
If at first you dont succeed, I suggest you avoid sky diving....
Cheers Mike
 
tinyt
Guru

Joined: 12/11/2017
Location: United States
Posts: 438
Posted: 05:15am 13 Nov 2018
Copy link to clipboard 
Print this post

Hi poida,
I don't have a breadboard to setup real analog inputs for the arduino nano, I remember you shared a version I can use for testing with analog 0 read value fixed at 0 and analog 2 read value fixed at 512. Just to scope the signals, can I use the same approach like:

/*
ch2 = 0.99*ch2 + 0.01 * (float)analogRead(2)/1024.0; // get AC output setpoint, LP filter
fch0 = analogRead(0)/1024.0; // get sample of AC output
*/

ch2 = 0.99*ch2 + 0.01 * 512; // get AC output setpoint, LP filter
fch0 = 0; // get sample of AC output
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 05:39am 13 Nov 2018
Copy link to clipboard 
Print this post

  tinyt said   Hi poida,
I don't have a breadboard to setup real analog inputs for the arduino nano, I remember you shared a version I can use for testing with analog 0 read value fixed at 0 and analog 2 read value fixed at 512. Just to scope the signals, can I use the same approach like:

/*
ch2 = 0.99*ch2 + 0.01 * (float)analogRead(2)/1024.0; // get AC output setpoint, LP filter
fch0 = analogRead(0)/1024.0; // get sample of AC output
*/

ch2 = 0.99*ch2 + 0.01 * 512; // get AC output setpoint, LP filter
fch0 = 0; // get sample of AC output


Oh for sure.
set ch2 = 0.5 and ch0 = 0.4, i.e. less than set point.
Do this AFTER the Bessel filtering, to make sure the following code
gets the hacked values.
wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 05:43am 13 Nov 2018
Copy link to clipboard 
Print this post

I looks like I am on a journey.

I will do a menu with seudo code such as

oen = 0:
if and only if sst = 0 then:
enable serial port
receive "?" do menu

(why wait for sst = 0? cos inverter still powered, but slow stopping. I want smooth MOSFET gate control
not interrupted drive due to serial port processing)

menu

0 - show uC status (e2prom setup or not - looks for magic number. 42.4242 stored at e2prom location 42)
1 - set offset DC volts (nnn.nV)
2 - set gain DC volts (nnn.vV) (input voltage in text and drive ADC ch to suit)
3 - set offset DC current (nnn.nA)
4 - set gain DC current (nnn.nA) (input voltage in text, will be called AMPS, drive ADC ch to suit)
4.5 set offset AC volts (nnn.nV AC)
4.6 set gain AC volts (nnn.nV AC)
4.7 set AC setpoint offset (nnn.nV AC)
4.8 set AC setpoint gain (nnn.nV AC)
4.9 set AC output frequency (ff Hz) (only choose 50 or 60 for now)
5 - define NTC type for temp sense
6 - define Cal factor for temp sense (know sensor temp and give it in text)

7 - set fan ON temp (ddd degC)
8 - set fan OFF temp (ddd degC)
9 - set overtemp temp (ddd deg C)
A - set AC low limit percentage (ppp %)
B - set LV cutoff voltage(nnn.nV)
C - set over current (nnn.nA)

D - enable/disable DC supply LV cutoff (ON)
E - enable/disable over current (OFF)
F - enable AC under volt cutoff (OFF)
G - enable over temp cutoff (ON)

H - INIT E2PROM (will store magic number, if not present, then not initialised)
I - password protect menu (OFF) (to keep the kids out?)

? - show menu


oen = 1:
do this from within the on/off button press block
disable serial port
i.e. Serial.end()
slow start inverter


This way you can see all settings just by turning off the inverter, connecting to it via usb cable and pressing "?" <return>

whatevs..
I am sure we will want to sort this out to the satisfaction of all.
Your ideas?

wronger than a phone book full of wrong phone numbers
 
wiseguy

Guru

Joined: 21/06/2018
Location: Australia
Posts: 1156
Posted: 06:18am 13 Nov 2018
Copy link to clipboard 
Print this post

Hi Poida et al, what is the future of what we are doing & the direction we are heading?

Should we try to make this retro-fittable so anyone wanting to upgrade from the EG8010 PCB module & can use it with the mad/clockman PCB's.

This would mean:

1) Buying & using the Arduino nano as is and having an interface PCB to allow it to function in existing inverters.

2) The other choice is to make a new PCB using the AtMega chip and roll our own nano that plugs directly into existing inverters.

3) Dont try to be everything to every one and just make something as simple as possible - but most likely not to be backwards compatible?

4) ??? Please add other thoughts

I hope others will chime in with their thoughts - I am wanting to finish creating my control PCB - I have made the decision that I will be using a nano but not sure which version to accommodate for so currently stalling.
If at first you dont succeed, I suggest you avoid sky diving....
Cheers Mike
 
tinyt
Guru

Joined: 12/11/2017
Location: United States
Posts: 438
Posted: 06:29am 13 Nov 2018
Copy link to clipboard 
Print this post

  poida said  ...
Oh for sure.
set ch2 = 0.5 and ch0 = 0.4, i.e. less than set point.
Do this AFTER the Bessel filtering, to make sure the following code
gets the hacked values.

So I did this:

ch0 = yv[4];
ch2=0.5; ch0=0.4;

And I was able to see the pwm on a scope.
I then scope'd the PD5 port which I assume to be the IR2184 SD. Push button operation works. When I pressed and held the button continuously, I sometimes see PD5 going low for about half cycle every 1.63 seconds. I know it is supposed to be a momentary switch and not a toggle switch so I am not sure if this will be an issue. Maybe my setup is also incorrect.Edited by tinyt 2018-11-14
 
gaspo
Regular Member

Joined: 25/06/2018
Location: Australia
Posts: 65
Posted: 06:37am 13 Nov 2018
Copy link to clipboard 
Print this post

  wiseguy said  
My scheme just needs a DVM and a finger :) no PC & cable


Yeah, who is using PC & cable these days?
We can go wireless and mobile. Connect Rx/Tx to ESP8266 module running tiny web service acting as intermediary for Poida's commands so we can check status on a phone.
Just kidding.

There is plenty of memory for both schemes could be implemented. Basic settings via push button/LED and further fine adjustments (if needed) via USB commands.
As the configuration occurs in the stop mode there is no need to worry about the clock cycles needed to run this.
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 06:42am 13 Nov 2018
Copy link to clipboard 
Print this post

Tinyt:

the on/off function is written to expect a momentary switch to pull pin 8 down
to go from OFF to ON or ON to OFF.
I expect a toggle switch will deliver strange results like yours.
It's likely slow starting, then slow stopping continuously with the toggle switch
closed.
wronger than a phone book full of wrong phone numbers
 
gaspo
Regular Member

Joined: 25/06/2018
Location: Australia
Posts: 65
Posted: 06:52am 13 Nov 2018
Copy link to clipboard 
Print this post

  tinyt said  
I then scope'd the PD5 port which I assume to be the IR2184 SD. Push button operation works. When I pressed and held the button continuously, I sometimes see PD5 going low for about half cycle every 1.63 seconds. I know it is supposed to be a momentary switch and not a toggle switch so I am not sure if this will be an issue. Maybe my setup is also incorrect.


That push button debounce routine needs some improvements. It should register next down event only after button has been released for some time (1 sec or so).
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 06:54am 13 Nov 2018
Copy link to clipboard 
Print this post

  wiseguy said   Hi Poida et al, what is the future of what we are doing & the direction we are heading?


I don't know. I think the best thing to aim for is a retro fit to allow
people to use existing work.

That means a new control board, taking a Nano, AC sample, current sense, with gate drive (via IR IC's or totem pole or logic or opto couplers or pulse transformers or..)
that then is plugged into Madness's power board, or PowerJack power board.
Clockman's power board compatible with the above 2? Not sure.

This thing is to be open source and anyone deviating from the group effort could find themselves with problems nobody wants to help solve.
But open source means anyone can customise it to suit their needs.

I will only use DC under voltage cutoff.
Others may want bells and whistles which I can't be bothered with.

So:
- use existing work (power board interfaces)
- extend functionality if desired
- improve magnetics performance (no flux walk)
- open source
- cheap
- transparent system, we will know what is going on. Great for learning.
- use basic resources (any laptop or PC, a USB cable. Download Arduino IDE)
- avoid SMD soldering. Not everyone has this capability at home.


wronger than a phone book full of wrong phone numbers
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1418
Posted: 06:55am 13 Nov 2018
Copy link to clipboard 
Print this post

  gaspo said  
That push button debounce routine needs some improvements. It should register next down event only after button has been released for some time (1 sec or so).


Of course it can. You know I am just a hacker.

wronger than a phone book full of wrong phone numbers
 
wiseguy

Guru

Joined: 21/06/2018
Location: Australia
Posts: 1156
Posted: 07:35am 13 Nov 2018
Copy link to clipboard 
Print this post

Gaspo, thats not as silly as it first sounds....... I always carry a phone but try to avoid lugging a laptop.

I vote you to create the GUI & interface app for it (Iphone & Android - Ill let you off Nokia) lol
If at first you dont succeed, I suggest you avoid sky diving....
Cheers Mike
 
gaspo
Regular Member

Joined: 25/06/2018
Location: Australia
Posts: 65
Posted: 07:54am 13 Nov 2018
Copy link to clipboard 
Print this post

  wiseguy said   Gaspo, thats not as silly as it first sounds....... I always carry a phone but try to avoid lugging a laptop.

I vote you to create the GUI & interface app for it (Iphone & Android - Ill let you off Nokia) lol


I have written few Android apps but never used or owned iPhone. So, if I do it (in far distant future) it will only be Android.
 
     Page 17 of 48    
Print this page
© JAQ Software 2024