In Design Phase of Generator Controller - Page 1
Forum section: electronics / projects

author: kolbep
author_rank: Frequent Contributor
timestamp: January 21, 2015, 08:09:06 pm
content: Hi All.I am in the process of designing my own Generator Controller (With AutoLoad Transfer)I am loosely basing it on a similar system that I had to repair the other day. (The PIC in that one had died, and manufacturer still hasn't gotten back to me with a hex file, So I wrote my own code for it).So I have the code, and the basic operation of the system, Now I want to start making my own controller PC Boards.Attached is a PDF of an Eagle Schematic I am working on.The Inputs are:A test Button Input (N/O, when closed applies 12v to the TEST Terminal)A Mains Input (230vac) that goes through an opto into the uCA Generator Input (240vac) that goes through an opto into the uCA 12v Input from the Generator's BatterySome buttons, and an analogue Pout.The Outputs are:2 x Status LED's1 x Ignition Relay (12v)1 x Starter Relay (12v)1 x Alarm Relay (12v)1 x 230v Mains Relay (to pull in the Mains Contactor)1 x 230v Gens Relay (to pull in the Generator Contactor)The Relays all have an LED across them to Indicate operationOther Stuff :ICSP HeaderThe Mains and Generator Contactors themselves are Electrically Interlocked using their N/C Contacts, as well as a mechanical InterlockI am planning on using as much SMD as possible (except for the Caps, Connectors, and anthing that is on the 230v Side of things).Please feel free to look at the schematic, and tell me if you spot anything wrong.BTW, The controller I am basing this on is on my sitehttp://plus.org.zaif you want to see picturesThanksPeter

author: kolbep
author_rank: Frequent Contributor
timestamp: January 24, 2015, 01:20:42 pm
content: Hmm?Just bumping this to the top of the list,I cannot believe that with all the pro's on this forum,that nobody has any comment on this?P

author: SeanB
author_rank: Super Contributor
timestamp: January 24, 2015, 01:45:09 pm
content: C4, 5 are shown with wrong polarity.Those AMF units are selling for around R3500 at the moment, which is a lot to pay for a simple collection of relays and sensors. you probably could build a few boards and sell them as replacements if the original ones are dead. Generally the electric start gensets all come with an AMF option available at an extra cost, and that is something you probably could make up and sell, and add extra code to make it more reliable.

author: Phoenix
author_rank: Frequent Contributor
timestamp: January 25, 2015, 09:59:31 am
content: Quote from: kolbep on January 24, 2015, 01:20:42 pmOK, I'll bite. Your optocouplers have the wrong net labels. I.e. GENS -> MIN and MAINS->GIN. They should be swapped.What's the purpose of D6 and D7?Perhaps you should have some relay interlocking mechanism on K4 and K5 (using 2 pole relays instead). The main change over contactors would/should be interlocked anyway, but that's beyond your control if you only make this card and others make the box.

author: kolbep
author_rank: Frequent Contributor
timestamp: January 25, 2015, 03:06:43 pm
content: QuoteD'oh. Thanks, I fixed that now.Quote

author: Yansi
author_rank: Super Contributor
timestamp: January 25, 2015, 03:42:39 pm
content: The diodes are reverese voltage protection for teh optocouplers LED. Nothin' more or less.You can't put 300V in reverse to the LED. So the current is passed through the external antiparallel diode. But that makes twice the power dissipation in the 220k resistors. Better to use 1N4007 in series.

author: Phoenix
author_rank: Frequent Contributor
timestamp: January 25, 2015, 11:10:01 pm
content: Quote from: Yansi on January 25, 2015, 03:42:39 pmAh, that makes sense.

author: ajb
author_rank: Super Contributor
timestamp: January 26, 2015, 12:00:11 am
content: I'd make the relay that controls the utility power contactor a double pole, and place the spare NC terminals in series with the NO terminals of the relay for the generator contactor. That gives you an interlock that prevents both contactors from being energized at the same time should your PIC lose its mind for some reason. Even better would be to use a set of auxiliary contacts on the utility contactor as the generator contactor interlock. Better still would be to do both.You're going to want some serious protection on the 12V input. Look to automotive appnotes for hints.

author: VintageTekFan
author_rank: Regular Contributor
timestamp: January 26, 2015, 02:54:55 pm
content: I would definatly look at including some engine status back to the controller - and figure out what to do in case of an engineoverheatlow oillow fuel

author: kolbep
author_rank: Frequent Contributor
timestamp: January 26, 2015, 04:01:18 pm
content: This controller is more for the smaller (6KVA Single phase and under) gensets.These are normally keyswitch operated. The circuit basically gets paralelled with the switch, so that the genset can still be operated manually.As I understand it, there is an oil pressure switch on the genset, that kills the ignition if there is low oil anyway.They do not have fuel level sensors, temp sensors, etc.I am also trying to design it, so that the installer does not need to hack more sensors, etc, into it. Because most of the installers down here are not too clued up.P

author: kolbep
author_rank: Frequent Contributor
timestamp: February 01, 2015, 09:32:32 am
content: Just Checking on this, as it confused me a bit last night.Take my Input Circuitry :Does this mean that I have to enable Pullups on PORTB, in order for it to float high, until the Opto conducts, then it goes low.What I would Ideally like is for the pin to be held low, until there is a voltage coming into the opto...Would this work :

author: SL4P
author_rank: Super Contributor
timestamp: February 01, 2015, 01:10:23 pm
content: Quote from: kolbep on January 21, 2015, 08:09:06 pmSorry OP for not seeing this earlier...!I did a superset of what you're looking for about five years ago, with a stack of control and monitoring options including an onboard RTC and scheduling. At the time it was PIC16F887 based - and worked beautifully.It may have more functionality than you need, but I'm happy to work through with you offline.There are many factors you may want to consider for failsafe operation and other situations - along with multiple start attempts etc. One variation in mine was use of a third-party transfer switch... that just worked (and was type approved).The controller included other plug-in options:-RS485 external buss (support one or more LCD keypad for local operation)Wireless keychain remote start/stopAC load sense & auto start / stopSMS/GPRS operation and reporting (text & email) + web & telnet operation and configuration (also on RS485)--- and more.

author: SeanB
author_rank: Super Contributor
timestamp: February 01, 2015, 06:28:12 pm
content: Whichever one you do ( and I lean to the second one as it has a better defined logic level ) add a series resistor between the capacitor and the optocoupler transistor. 100R will do, to limit the transient current in the switch as the opto transistor turns on after it has been off and the capacitor has charged to 5V. The transistors are only rated for 100mA max, and a few hundred cycles of the capacitor discharging through it will at best lead to parameter shift and at worst to it going open circuit.

author: kolbep
author_rank: Frequent Contributor
timestamp: May 18, 2015, 06:54:33 pm
content: Let me bring this topic back from the dead.My 1st Prototype Generator controller has been running since February at a clients house (although they do not know that it was a prototype). It was built on Single Sided board that I used the Toner Transfer method to produce. Almost all through hole components, except for the SMD transistors, some resistors and decoupling caps, as well as a lot of bodge wires, which are all on the underside of the board.I had a few problems (with a lot of trips out to the customer during Loadshedding times).1) Software did not account for the generator stopping unexpectedly (stalling for dirty / no fuel, etc). So basically it would stop, and that would be it. the software sounded an alarm but did not restore mains, or anything (oops)Fixed that by changing the code so that the Mains Contactor only drops out just before it transfers load to the generator contactor (and yes, they are mechanically and electrically interlocked).If there is any stall, or anything, it immediately changes back to the mains contactor, and shuts off the engine relay, and sounds the alarm.Then after 10 minutes, it tries to restart the generator. After 3 times with it failing, it then locks out (silencing the alarm so they do not get annoyed, keeps the mains relay in (so that when mains is back they have power), and it stops the generator from restarting.A power cycle then resets this.Then the next time2) MCLR pin Pullup was too weak, randomly causes it not to work.Changed it.Then the next time2) the LVP Pin decided to keep on jumping into LVP programming mode (even though that fuse was turned off). This caused it to not start the program several times, or as soon as a contactor pulls in, or there is the slightest change in the field in the enclosure, it resets and locks up.It did have the LVP pin on a header for the Pickit 3 programmer, and I think that acted like an antenna.Pulling LVP low with a resistor sorted that out.Then the next time3) Exhaust had come uncoupled and was pointing right at the steel enclosure. It had melted the LED pilot lights on the enclosure. The Slotted Trunking inside was also melted, and the 85degree caps were rippling like crazy. Replaced the caps and LED's. Tightened the exhaust and all was fine again.Then the next time4) The customer did not know that her generator does not run when it has gone through all its fuel. I sent her to get the fuel, and then it was fine again.Then the next time5) Corrosion on the battery terminal caused the charger's negative wire to corrode off.This genset does not have a 12v output to charge its battery when running, so eventually it got too low for the controller, which caused the PIC to keep resetting each time it tried to crank.And her battery was had it.Sorted that out, and it was all fine again.So the MCLR and LVP, and Software were the only hickups with the controller itself, the rest were lack of maintenance (and not understanding that if your generator has already done 95 Hours, that it will need some petrol, even if it does not have a fancy controller).My Father in Law is an electrician, and his company has just ordered 2 of the controllers (complete with Contactors, Chargers, etc for his customers - Basically the whole panel), so I finished my Double Sided PCB design on Sunday, and have sent it to ITEAD to be made up (10 Prototype PCB's, and DHL'ed to me (total of about ZAR750 / 63USD) Most of that cost being the DHL).So I thought I would update you,and once I have this version up and running, I will post some pics of it....PSo hopefully this newer version will be better

author: SL4P
author_rank: Super Contributor
timestamp: May 18, 2015, 07:19:35 pm
content: Great workIt sounds like we had the same customers!The LVP issue was interesting.Good luck, I'm looking forward to the build pics.

author: kolbep
author_rank: Frequent Contributor
timestamp: May 25, 2015, 07:08:20 pm
content: Well, My boards from ITEAD arrived today.Damn! I forgot to order the Darlington Array SMD chips the other day.Glad RS does next day delivery....

author: kolbep
author_rank: Frequent Contributor
timestamp: June 10, 2015, 07:03:00 pm
content: Ok, Here are the pics of the assembled control unit.I have installed 1 yesterday (at a local car Dealership showroom), and will be installing another 2 next week (one at a house, and one at another car Dealership.They are run with a PIC micro, and (so far) the software is only 170 lines of C code.

author: SeanB
author_rank: Super Contributor
timestamp: June 10, 2015, 07:11:17 pm
content: Nice, and almost idiot proof........

author: kolbep
author_rank: Frequent Contributor
timestamp: June 11, 2015, 03:35:47 pm
content: Well, No matter how idiot proof you make something,you will always get a more resourceful idiot....I do have electrical Interlocking with the NC Auxiliaries on the contactors,and also the Mechanical interlock between them.Also, the fact that my clients are scared of touching anything electrical, means that it should be fairly ok.....

author: SeanB
author_rank: Super Contributor
timestamp: June 11, 2015, 06:07:53 pm
content: Just need labels now and an extra one with your contact details for when they break it.