Inverter Generator

Background

So i bought a 1kW inverter generator, however a secondary coil was fried and i couldn't get the epoxy covered circuit board working which housed the throttle control circuit and inverter. This secondary coil powered the circuit board at a voltage i could not work out.

The engine still runs (although currently fixed throttle) and the primary coil produces +600V (depending on rpm). So my project is to get this inverter generator working using an arduino to control the engine and produce an adequate output as close to a sine wave as i can.

The generator part is a delta stator with a magnetic flywheel rotating outside of it, which i believe operates fine and i did not observe any damage to it. Off load testing has proven successful. I have ordered a 1000v 3 phase rectifier, which should be man enough to change this to varying d.c. output. A smoothing capacitor (size to be determined) should smooth out the signal which will then be voltage divided to provide a feedback to the arduino. This feedback circuit will then control the throttle on the engine, which utilises a stepper motor, hopefully keeping the dc voltage at a fairly stable 400V.

A high voltage transformerless H-bridge inverter controlled by an arduino which will convert the 400v d.c. into an approx 240v a.c., again complete values to be determined and hopefully a shapely pwm sine wave, as true to a sine wave as i can workout.

Questions

With my limited code writing skills (I usually bastardise other peoples codes), my main question is can a single arduino complete the two tasks of controlling the motor with feedback from the d.c. part of the circuit and control an inverter for the output of the inverter?

Is the arduino fast/competent enough to manipulate a sine wave output or do i need something else??

I have not included all the points of my plan and I am just ensuring i have enough equipment to complete my project in hand, rather than hitting my head against a wall.

All help is appreciated.

Ryan

You will have to do a better job of defining what you really want. What exactly do you want "control an inverter"? What inverter and how is it controlled? How do you want a sine wave manipulated? And how do you intend an arduino to do that?

You need to design the electronics needed before you ask if you have enough equipment. More homework!

Paul

How much experiance do you have with making hi power Sine Wave Inverters?
There is a lot that can go wrong, and you will need very good and fast protection circuitry to
stop the FETS in the H bridge from blowing up from problematic loads like motors or from anything that
creates a surge current when its plugged in.

nitropixie:
Background

The engine still runs (although currently fixed throttle) and the primary coil produces +600V (depending on rpm).

+600V from a coil, shouldn't it be AC?

Designing and programming an Inverter Power Supply is not an easy task, and the hardware involves more than a H-Bridge assembly.
Things like inductive and resistive loads produce out of phase and in phase currents that have to be dealt with.
Current sense and voltage sensing will have to be considered all while controlling PWM output.

Tom.. :slight_smile:

Thanks for the replies.

Paul,

The inverter generator was originally a Clarke ig1000 1KW 240V inverter generator. It has hardly been used, to good to throw away and the replacement parts are massively over priced. I am building a custom housing for it. However I like to tinker hence this project.

The arduino will operate the throttle of the engine (via the O.E. stepper motor which I am presently working on and making progress) in order to control the output voltage of the generator as measured post the rectification process.

For the 240V output sinewave, I will use examples which I have found using the search function within this forum.

Mauried,

Very little is the answer, hence this being a project for me to learn. I have been doing a lot of 'google' research and understand the fundamentals. But the working out and practical is out of my depth, at present.

TomGeorge,

You are correct and I should of stated 600V a.c. between each of the three phases, I do not have a rectifier at present so I cannot turn it into varying d.c.

The inductive and resistive loads will need to be a consideration of mine.

All,

My plan would be to use it (if successful) as an emergency generator to power a light load in the house to keep fridges, freezer, lighting and some home I.T. alive.

So to reiterate my original question, will a single arduino be able to control the stepper motor and control the output H-bridge (240V) at the same time? From my point of view I will be asking the arduino to complete 2 tasks at the same time or am I better utilising a separate arduino for each task?? This is probably a basic question and I think the answer will be yes, however I am still asking the question.

I am sure I will have further questions in the future for the different parts of this inverter generator. I am just sourcing some hardware first.

Yes, but it is a relatively advanced project. Doing both of those tasks at one time is very complex to program even though the hardware is capable.

You could focus on making a modified sin wave. That will be 50 times easier to program. It is also less demanding on the high current switching hardware but of course you would build that hardware to cope with full sin waves later when the software gets upgraded.

Making this as a modular as I can, I.E. not making my own circuit boards, I have just purchased a 'pure' sinewave inverter board from an auction site which requires a 380V d.c input that my generator should be able to provide (once rectified), although may need to smooth it more adequately. Not sure on the quality of it but it is rated at 2000W so should be suitable for what I require. It uses 47n60 MOSFET's rated to 450V, so as long as I do not get runaway from the generator I should be ok-ish. Lots of "should's". Might be worth placing another higher rated MOSFET in the supply to the inverter to protect against any over voltage, any thoughts?? A bit like a H5 bridge, where the 5th MOSFET is located on the supply line.

So I only really need to concentrate on making the engine supply a regular 380V d.c. to the bought inverter and I can concentrate my efforts towards making the engine run as stable as possible. So I am thinking of introducing some hysteresis to slow the operation of the throttle and make fine adjustments as necessary.

The ignition is a fixed advance Capacitive Discharge Ignition and the flywheel is suitably balanced. The engine does run surprisingly smooth without a load. I just need to ensure the engine operates as stable as possible with a smooth increase in throttle as the load changes and a suitable protection circuit is available to protect the inverter circuitry should there be an overload.

Many thanks for all your input, it is appreciated. Although I may not have been totally clear on what I wanted to achieve. Maybe I should of mentioned I wanted to keep it as modular as possible.

So i am making progress with my inverter generator.

The issue i have at the moment is the engine hunting. A quick recap, the generator is to produce approx 380V DC after a 3 phase rectifier. I am using a potential divider (250K and 2K, with a 4.8V zener in parallel with the 2K) across the 380V DC which enables the arduino to sample for feed back. Throttle is controlled by a stepper motor. I have created a serial print in order to view readings, which has been handy

I have killed 4 x 450v 120uF caps (on the inverter) due to over run, as i jumped right in. So now trying to take it in smaller stages and using a lower voltage to iron out issues first to save components.

Not sure if the hunting is fuel/carb related i have just cleaned/stripped it to ensure it is clean, which it is. However it could be fuel related as it is a bit old, so i will change this.

In the mean time would some be so polite as to review my code. I have setup a safety feature where a relay is activated when the arduino is turned on to ground the ignition, should the arduino lose power, which could also be used to cut ignition if voltage was too high.

/*
 Throttle control of an inverter generator.
 
 The generator uses a stepper motor to control the throttle via feedback 
 from a voltage divider post rectification of the 3 phase generator to 
 380V D.C.

 The throttle will not operate until 100V is reached (aka start mode). The 
 throttle can be manually operated via  2 x push buttons (open/close 
 respectively) whilst in start mode to aid starting. Once the generator is 
 running it will maintain a 380v dc, post rectification of the 3 phase
 generator, using an averaging algorithim to smooth throttle response.

 When the generator stops and generates below 100v it will prevent the 
 stepper motor from actuating the throttle.

 A relay circuit will isolate 240V post the inverter below or above 220v 
 and 260v respectively to prevent circuit/load damage via a relay.

 

 */

#include <Stepper.h>

const int stepsPerRevolution = 525;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 2 through 5:
Stepper myStepper(stepsPerRevolution, 2, 3, 4 ,5);

int stepCount = 0;         // number of steps the motor has taken
int sensorPin = A0;        //measures dc 380v with pot. divider.
const int threshold = 500; //output required (which works out to be 380v d.c.
const int startup = 200;   //throttle will start to operate once output has reached 100v-ish
//const int maxRPM = 900;    //igntion cut at this output level
const int numReadings = 2; //number of averaging readings
int readings[numReadings];      // the readings from the analog input
int readIndex = 0;              // the index of the current reading
int total = 0;                  // the running total
int average = 0;                // the average
const int openThrottle = 7;    //manually open the throttle using a push button whilst engine is not running
const int closeThrottle = 9;   //manually close the button using a push button whilst engine is not running
const int ignitionCut = 10;    //digital ouput to relay to cut ignition if arduino turns off and engine runaway
int buttonState1 = 0;          //manually adjust engine speed push button
int buttonState2 = 0;          //manually adjust engine speed push button

void setup() {
 Serial.begin(9600);
 for (int thisReading = 0; thisReading < numReadings; thisReading++) {
    readings[thisReading] = 0;
 pinMode(openThrottle, INPUT);
 pinMode(closeThrottle, INPUT);
 pinMode(ignitionCut, OUTPUT);
}}

void loop() {

  //read A0 pin for 380V d.c.
  
  int potValue = analogRead(sensorPin); 
 digitalWrite(ignitionCut, LOW);
  Serial.print ("Volt(raw):"); 
  Serial.print (potValue);
  //if (potValue < maxRPM){
    //digitalWrite (ignitionCut, HIGH);
  
  //}

  
// if ouput voltage is below a theshold i.e. the engine hasn't 
// started, then do not move the throttle unless manually told 
// to do so by two push buttons to open/close 
if (potValue < startup){
  myStepper.step(0);

  int buttonState1 = digitalRead(openThrottle);
  int buttonState2 = digitalRead(closeThrottle);
  if (buttonState1 == HIGH){
  myStepper.step(1);}
  if (buttonState2 == HIGH){
  myStepper.step(-1);}
  delay(30);
  Serial.print ("  Open");
  Serial.print (buttonState1);
  Serial.print ("  Close");
  Serial.print (buttonState2);
}
   //once running, the engine should use this code to control the 
 // generator throttle using an averaging code to smooth any 
 // hunting of the engine
 else {
 // subtract the last reading:
  total = total - readings[readIndex];
  
  // read from the voltage divider of the varying dc:
  readings[readIndex] = analogRead(sensorPin);
  
  // add the reading to the total:
  total = total + readings[readIndex];
  
  // advance to the next position in the array:
  readIndex = readIndex + 1;

  // if we're at the end of the array...
  if (readIndex >= numReadings) {
    
    // ...wrap around to the beginning:
    readIndex = 0;
  }

  // calculate the average:
  average = total / numReadings;
    

  //close throttle to reduce voltage
  if (average > threshold) {
  myStepper.step(-1);}
delay(10);
if (average > threshold) {
  myStepper.step(-1);}
  //keep constant throttle
  if (average == threshold) {
  myStepper.step(0);}

  //open throttle to increase voltage  
  if (average < threshold) {
  myStepper.step(1);}
  }
 Serial.println("   Ave D.C. Volts: ");
 Serial.println(average);
  delay(10);
  }

A quick scan of your code reveals one thing that I would alter right away.
You are doing a lot of serial printing and with verbose headings.

First thing, increase the serial baud rate from the low 9600 to 115200 to reduce time spent sending characters out the serial port.

Next, reduce the verbosity of headings if you can. Better to use short form, for example, you print "buttoneState1", you could just print "Btn1: " followed by the state.

In fact, if it were I, I would not even print this out, once I proved that section of code to function, it just takes unnecessary time.

Then, you have a delay, people always use delay which often ends up totally destroying the performance of any code which is unnecessary in my opinion.

This is especially true since you will want for good response with your stepper motor.
Get rid of any unnecessary delays in your program.

Make sure your stepper driver, what ever you use is set up correctly.
I would not propose anyone use a small Arduino to do the actual stepper functionality these days, rather use a dedicated stepper driver such as a A4988 or 8825 board.

You can buy these board for a few dollars online at ebay and the code to drive them is so very simple and easy for the Arduino, simple select direction and then send step pulse. You can even set micro-stepping and do other things which you might find useful.

Anyhow, just my thoughts over morning café.


Paul - VK7KPA

Generator speed controls the output frequency not the voltage and I don't see how you think a 1kw generator will run frigs, freezer lighting and IT gear.

Hi,
This worries me ;
A 1Kw Inverter generator powering FRIDGE and FREEZER.

If either or both of them is of the typical compressor type, check their current or power rating.
Then multiply the current by at least 5 to get the surge of starting current for those devices.
This because they are inductive loads.

380Vdc sounds right for a DC bus to get 240Vac output, but inverting that voltage and current using H-Bridge and monitoring the output voltage and current as well is a huge job.

Your output will have to be AC sinewave, not modified AC, or 50% duty pulsed DC.
That requires PWM control at much higher then you output frequency.

Good luck...

Tom.... :slight_smile:

bluejets writes:

I don't see how you think a 1kw generator will run frigs, freezer lighting and IT gear.

Oh, maybe, though I live off grid, and have done so for the past twenty years now and it maybe quite possible.

To show you what is possible, until recently, my main inverter was a quality Australian built SEA 650VA, being powered by a 25.6 Volt LiFeYPO4 (Lithium) battery bank.

It was able to power the lights, the central heating circulation pump, my main computer, a laptop, router, sound system and washing machine and other things all simultaneously, that's right, all together.

Now with a 1200W inverter, I can include all of above together with vacuum cleaner.

Admittedly, my fridge is not a standard compressor as found in cheap white goods, but uses a Danfoss DC compressor.

The problem with some of these small inverter generators is that that are built quite cheaply and are not capable of high fault or surge currents into loads. Hence why I always use good quality inverters with a heavy toroidal transformer.


Paul - VK7KPA

Doesn't matter how you convert your interpretation, 1 kw is far short of requirements as you state.

True...even a house kettle could take up 1000 watt. Gas burner should sort that out.

rockwallaby:
Now with a 1200W inverter, I can include all of above together with vacuum cleaner.

A typical household vacuum cleaner takes 1400-1800W on its own, some even more.

wvmarle wrote:

A typical household vacuum cleaner takes 1400-1800W on its own, some even more.

Yes, in many case even more. I have always thought vacuum cleaner to be the most inefficient device these days. But the name plate on the Vax 20l unit I have is 1250W and it does suck quite well, and the Latronics LS1200 inverter doesn't even blink with this and the other loads on.

Anyhow, I wonder how the OP is going, I'll be interested to hear, hoping progress is being made.


Paul - VK7KPA

Hi,

Latronics LS1200 inverter 1/2 hour rating 1600W.

Tom.... :slight_smile: