Planning a DIY Data Acquisition/Engine Controller

Started by dubbleUJay, October 21, 2009, 09:09:03 AM

Previous topic - Next topic

BruceM

#60
"Well, I have no experience with DC-DC converters but I don't understand why there would be an issue using them."

That's a common misconception.

Switchers have considerable ripple voltage and generate EMI on the power and grounds which can cause gremlins and frustrations in designs without proper ground and power distribution, filtering and design. This is particularly important in circuits with both analog and digital.  It is of less concern for digital circuits which are more tolerant.

It is easier to suggest to a novice to avoid them (SMPS or DC-DC converters) than to try and teach them how to use them.  This is the electrical engineering field of Electromagnetic Compatibility or EMC, and there are plenty of good books on the subject.  With linear supplies, as long as the circuit is wired properly it will work pretty well, even if layout and design is primative.

Keeping things simple makes prototypes or "one of a kind" projects more fun.

In WJ's situation, I suspect his whole setup could be run off a single 12V supply (later to become his 12V battery), with no isolation.  His ZA 220VAC has a neutral and one hot leg, plus safety ground.  If his generator has one leg tied to the neutral, then he has a common neutral/DC ground and isolation isn't necessary.  

A simpler, non-isolated design for voltage and current sensing is at:
http://enerjar.net/ 









dubbleUJay

#61
Ok guys, here goes, I hope the diagram makes sense.
As you can see from the drawing, stuff works a bit different here, I think they followed the Brit setup years ago. (More or less)

I'm still considering connecting my Neutral to Earth on the gen-head like the utility does. We don't like floating voltages around here ;) One more thing I should mention, a lot of our household appliances are wired wrong, (Not mine, but I see it all over at other places) ie the L & N switched around. This does not make a difference in the operation of the appliances though. (Or most of them anyway, some control gear, like my well pump does not work as it checks for the correct polarity to earth)
Also, I have not implement a battery bank yet, still waiting for the right deal ;) I just have 2x automotive batteries for starting and operating the controlling gear.
Everything will be 24V, so 12V or 5V will have to be regulated.
Although I have a few PC UPS's that run some stuff, mainly just for the change-over time until I start the generator.
I didn't draw the transfer switching gear as well.
O-yes, I should mention that I have a few solar panels and a wind generator in progress, so from there the ability to monitor them as well in the future.

Thanks,
dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

#62
That helps a lot, WJ.  It looks like you're going to need a transfer switch before your main distribution panel, if you plan on powering the house with the generator.  But it's easy, as you only need to switch the single hot leg.  Yes, you should bond the 24VDC ground to the genhead neutral, yes, a local ground rod at the generator  is a good idea, and you'll get a gold star if you bring that ground back to the distribution panel ground.

Now you should decide about the engine controller/data collector. If it's to be autonomous of utility power for engine operations, and I think it should be, then you will want to run a tiny 24 to 5 volt converter, with some extra LC filtering on both ends.  It could be a buck converter (most efficient and simple)  if you don't need isolation, and I don't see why you would.  My generator shed is 12V, so I don't buck, just down (linear) regulate.  The power consumption is very low (50 ma or less).

For hand built work with switching supplies, find some copper foil with adhesive to make ground planes with.  I will often lay out a full ground plane, then cut away for parts, etc.  I also often use copper tape strips on the other side for power distribution, before I put in the point to point wiring.  0.1uf ceramic caps at each component, to the ground plane.  This will get rid of most of the glitchies.

dubbleUJay

Quote from: BruceM on November 16, 2009, 01:57:53 AM
That helps a lot, WJ.  It looks like you're going to need a transfer switch before your main distribution panel, if you plan on powering the house with the generator.  But it's easy, as you only need to switch the single hot leg.  Yes, you should bond the 24VDC ground to the genhead neutral, yes, a local ground rod at the generator  is a good idea, and you'll get a gold star if you bring that ground back to the distribution panel ground.

OK Bruce, at the moment I'm using a very dangerous way of transferring the power with a multi-change-over contacted relay. When the utility falls away, the relay releases and connects the generator to the house. Obviously dangerous if the contacts should arc or bridge for some reason and the utility & generator runs at the same time. I'm in the process of getting 2 interlocking 3-pole contactors rated at 60Amps, the ones where only one of the two can be operated at a time. We don't have strict rules here or more correctly, they are not enforced, but I must still make it safe for myself and the utility workers.
I'll rather switch all three legs (L-N-E) as one never knows when a tree blows over on the poles and shorts out some supply leads exec.
All my power cables I run are 3 conductor armored cable in-between the various boards, so yes, my earth is connected all over.
I learned all this when I use to work at a Telco company, building outstations like microwave towers exec. We had to incorporate lightning divertors as well, so I believe in earthing everything possible! ;)
The only thing about the Telco stuff, all the positive battery terminals were earthed to ground, the opposite way around than the norm, apparently to do with rust in an airconditioned room, but I just took their word for it, 'cos I couldn't run tests ;)

Quote
Now you should decide about the engine controller/data collector. If it's to autonomous of utility power for engine operations, and I think it should be, then you will want to run a tiny 24 to 5 volt converter, with some extra LC filtering on both ends.  It could be a buck converter (most efficient and simple)  if you don't need isolation, and I don't see why you would.  My generator shed is 12V, so I don't buck, just down (linear) regulate.  The power consumption is very low (50 ma or less).

OK, I've understand that. The controller and for that matter all relays and contactors will/must run off the 24Vdc controller/starter battery which will be charged by the 5Amp DC generator charger and probably a trickle charger from the mains. This is all separate from my planned 24V storage batteries which will be charged with wind, solar and UPS charger.

Quote
For hand built work with switching supplies, find some copper foil with adhesive to make ground planes with.  I will often lay out a full ground plane, then cut away for parts, etc.  I also often use copper tape strips on the other side for power distribution, before I put in the point to point wiring.  0.1uf ceramic caps at each component, to the ground plane.  This will get rid of most of the glitchies.

I'll probably use strip-board (Vero-board ??) to build it. I found an article somewhere that reminded me of all the 5to9Vdc inverters on those old PC network cards, the 10base-T ones with RG-59 connector. They look quite robust and I'll try one of them 1st. The plan is to use a 5v reg on the output. I'll see how using ground planes underneath it will work.
I looked at the network cards and they are heavily "planed" top and bottom, probably all the sandwiched layers in-between as well!
I'm just a bit worried about the Arduino using the USB power to power it from PC when you connect it for monitoring! I'll have to wrap my head around that a bit more.

Thanks Bruce.

PS- I'm just about ready to build the analog multiplexer extender board with the 4067 you suggested, I'll probably run the cct past you this afternoon just to check before I build if you don't mind ??
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

Bruce, look what I found now:
http://interface.khm.de/index.php/lab/sensoraktor-shield/introducing-the-board/
It does a lot of interfacing to the Arduino board.
Pity there are still only 6 analog inputs, but I'm sure that can be extended.
I've emailed the guy to hear about availability and cost, it would be so much easier for anyone to just buy the stuff, at an affordable price obviously.
This will add stepper motor control as well.
What do you think ???
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

Good morning WJ, 

I don't see much appealing about the board- unless you need the small motor driver or something else. 

"all relays and contactors will/must run off the 24Vdc controller/starter battery"

Some could be 220VAC coil, with a small DC relay to control- this can take a load off of your 24VDC, and reduces the power requirement for your interface board's drivers (logic level mosfets with 1K ohm to gate from your DOs; switch the low voltage leg with N-CH mosfets).

Switching the Neutral and Earth between your mains and genshed  is not a good idea, they should be bonded.  Then you can never have a surprise.   Do you know if your power co. distribution lines are Wye (neutral jumped around transformer) or Delta (both distribution lines hot, the neutral derived at the customer side of the transformer)? 

You need to show how your PC is going to be powered, and this gets back to genshed neutral.  It really should be permanently connected or you will have to do some isolation.

Best Wishes
Bruce M




dubbleUJay

Mornin' Bruce, the time difference between us are about 8 hours I think, its 04h00 over here, busy with my 1st cup of coffee!

About the SensorAktor board, I meant that some of the cct's could be used. I'm sure somewhere in the future I'm going to try your stepper motor throttle. I was thinking that while I'm going to have to build an extension board for the extra analog inputs, I might as well put more things I will use on it and maybe a floating isolated 5v supply for the VA sensors as well if I'm going that way.

The guy that made the board are a student at a "media school" and the board are not commercially available. He has offered to send me the Eagle files which will save me a lot of work. I'm thinking of taking the stuff off I wont need like the pot, mic input, exec., and putting the multiplexer onto it.
I'm probably thinking to far ahead without actually building a prototype, but I think most of the work in such a project goes into the planning of it. The making of the board will be quick, but I'll hate to find out in a months time that I have to build another one because I left out a motor driver chip.
Don't get me wrong, it will happen, but maybe to a lesser extend if I "TRY" and think about most of the stuff now. ;) I'm now waiting for him to send me the Eagle files and will take it from there.
O-yes, one more thing about his stuff, he also developed a multiplexer board, using scalable CD4051 (8ch) for up to 24ch's. There are more components involved, but what I like is that he uses 3x digital outputs to address it and not 4 like with the 4067.
This means that I might do away with the 3 outputs on the SensorAktor board and run the multiplexer from there without interfering with the rest of the design.
Anyway, this is all still up in the air, I need to get the VA sensor going. ;)

I'm not sure which type of step-down transformer the utility use, but here is a picture of it. We can apply for 3-phase power and the poles down the road have 3-phase Live & Neutral on them. The phases gets distributed evenly between the dwellings around here. We have 220V between Neutral and any one Live phase or 480V between any 2 phases. The carrier voltage is probably a few thousand volts on the poles I presume, I'm not sure if they stepped it down before entering the area.
Looking at the picture, it seems they either have 2 phases to the Xformer or 1-phase and Neutral, but its probably the Delta configuration you asked about.
The PC is powered via a UPS, but to be safe, I would like to presume that it will be powered from the mains. I don't want to get any surprises if I do plug it into the utility mains one day!  ;)

Have a great day,
dubbleUJay

PS- I know what you said about others not want to build or acquire stuff like this, but I'm still leaning towards making it possible to do so. If I/we make this project available here and people see that it works or see what others are doing with it, maybe they will get one ???
If someone like yourself can get a few extender boards made for the guys in the US in the future, that might be a great incentive for them. I'll have all the cct & PCB layouts in Eagle ready for anyone to download.
It might just be a matter of getting an Arduino, Extension Board, a few sensors, download the UI and Bob's your uncle!
I suppose it all depends on the stuff one can do with it and the user interface on the PC.
Maybe I should take a poll on the forum and see who might be interested in such a thing, givin' the criteria above ???
Don't get me wrong, I don't want to make $$ out of this, I actually want to stick it to the commercial products available out there that's ridiculously over priced!  :(
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

Your secondary distribution line is odd- you have two hot legs and a neutral, apparently.  It's unclear what they're doing without a wiring diagram, but it's probably Wye.   Power co's do things differently the world around, many times (like Wye grounding practice), a knowledgeable EE will be in horror.

I'm sure if you make a nice expansion board for the Arduino that some folks will be glad for it. 

The time involved is significant-  I just spent the last week getting my PCB artwork and documentation up to snuff for my battery bank charge controller.  (Two boards.) My God, I can't believe how many days work on it!


dubbleUJay

Quote from: BruceM on November 17, 2009, 12:07:07 AM
The time involved is significant-  I just spent the last week getting my PCB artwork and documentation up to snuff for my battery bank charge controller.  (Two boards.) My God, I can't believe how many days work on it!
I'm lucky in that sense that I have a lot of time on my hand when I'm not running the financial side of this machine of ours in the picture!

The Tadano mobile crane that is, not the yacht  :'(
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

WJ- I forgot to respond to your suggestion of cleaning up the switching regulator output by linear regulation.  Yes, that would work in reducing ripple.  You'll need maybe 4 volts above the regulated voltage, less if you can live with the regulation of an LDO regulator (not as clean an output).

dubbleUJay

Hi Bruce, the 5to9v inverter with a 78L05 should work nicely then I presume. I will still apply the suggested filter caps from the app notes and see what the output looks like.
That reminds me to borrow my friend's scope! ;)
I'm STILL waiting for an answer from my supplier about the HCPL-7520, he told me today I should know by tomorrow afternoon. If they aren't available here, the whole VA sensor might fall flat and I'll have to try some of the other suggestions discussed previously in this thread.
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

ndavid79

Couple projects you might find interesting:

Edward Cheung's HA Power Monitor Node
I've been fascinated by this guys work for years. PIC software, schematic, and info about his DIY CTs provided.

And my own small foray into CTs, though I haven't done anything with it yet.
Whole-house power monitoring, need op-amp help
(The Ocelot is a consumer version of an Industrial PLC controller running Ladder Logic programing, for Home Automation / SECU-16 is an I/O expansion module for the Ocelot)

dubbleUJay

Great stuff to get ideas from ndavid, thanks! I've got some reading to do. ;)
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

Well guys, I've been sidetracked a bit with the fuel-flow meter while I was waiting for the electronic components to arrive for this project and I'm STILL waiting!
Well, sort of sidetracked, as my intention is to incorporate that meter into this project, but I didn't want to put it in this thread as it's already getting pretty long.

I got most of the goodies, but the IC's for the Volt/Amp probe I cannot find stock for in ZA, although I might have a change with the manufacturer of the IC as I've written them a motivation for some samples. (Yeh right! ;-)
Importing is now out of the question due to cost, just to give an example:
CD4067 16ch multiplexer $0.62
CD4053 8ch multiplexer $0.28
74HC595 shift register  $0.36
and then the HCPL-7520 at a whopping $21.08 !!!!!!!!!!
OK, I know its not a very good to compare between digital and analog IC, but still, I cant afford 2 of those for a developing project were I'm probably going to blow them up as Murphy would have it!

NOW, Bruce my main man!! (Some more flattering follows.... and more.... and some more ;) )
How "safe" would direct coupling be with resistors for the 220Vac voltage with maybe a AtoD converter with a 0-5Vdc scale and the same goes for reading the AC amps up to about 20Aac for my application anyway?
I priced 0-5V output Current Transformers and they cost a fortune as well by us!  :'(
I might consider turning my own or use an universal one (in my spare parts box), but then I need the circuitry to give me the correct output and also calibrate it.
Also, I need to either get the mains frequency from one of these two inputs or use a separate A-in pin for it.
The reason I "clinged" so much to the opto-cct is that I thought it might work in the other applications as well with minor resistor changes, but that's probably out the window now.  :'(
One more question, I reconsidered using the 16x multiplexer (4067) you suggested and I'm going to use that to extend the analog inputs. The ATmega328 has 6x digital and 6x digital (PWM) outputs on the Arduino board. Would you use the "just digital", digital PWM or a combination of the 2 to control the 4067?
It might sound like a stupid question, but the pins are mixed and all over the place, ie pins 2,4,7,8,12,13 are just digital & pins 3,5,6,9,10,11 are PWM. I would think using 4x pins in a row will make programming easier, but I don't want to run out of PWM's in the future as well ???

Anything I'm missing that you guys maybe see, please let me know.
Thanks,
dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

#74
WJ, As I suggested before, there is no need to use those pricey isolation op amps. The same design will work without them, if you are able to understand it well enough to adapt it.

If you want isolation, so that you can measure without having to tie your genset neutral to the mains neutral, then you need a tiny transformer with a fairly high output.  If you can live without the isolation, it's more hazardous to the experimenter, but you can just scale the half wave rectified AC with a resistor divider scaled so that your highest (max high voltage peak) AC voltage is just under 5V.  The zero cross can be used as an input to clock for frequency counting, and for syncing RMS sampling. (I'm not familiar with the AVR chip.)  The zero cross is most accurate with a higher voltage input such that diode loss near zero is insignificant.  

I would not bother with real time waveform sampling and RMS calculation. Why tie up the processor for a simple analog job.  I'd just integrate the half wave AC voltage with a capacitor, and buffer it with an op amp voltage follower. The range can be rescaled by op amp to give you better AC resolution, if you want to.  I have a circuit that converts 110 to 160VDC to 0 to 5V for your reference.   Pick an available RR micropower op amp.  You can then just read the voltage direct to an AD.  Just make sure to calibrate well using a variac and good AC voltmeter or other means.  

For current, you can do essentially the same circuit (half wave rectify and filter to DC), but feed it with the output of a homemade CCT.  

Again, if you want to run their software and dedicate and AVR to do it, you can also still use the same setup as the Cornell version, but without isolation.

Regarding the analog multiplexer, you will have to use 4 output bits and yes, they should be assigned to 4 bits in sequence, preferably the low order bits of some output byte.

The PWM outputs would  be of use for some analog control...and usually it will be to use them for RC servo control.  I can't imagine more than a couple.