Planning a DIY Data Acquisition/Engine Controller

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

Previous topic - Next topic

dubbleUJay

Quote from: BruceM on November 10, 2009, 11:02:33 AM
At 650 rpm with 6 spokes it works out just fine, there is just enough resolution for monitoring the starter spin up processes and adequate run time resolution.

Thanks Bruce, that's whats so nice about talking to someone that's already done it, I didn't foreseen that the speed might be to slow on start-up to monitor it and would've learned this the hard way, once I've built a prototype already!

Can you tell me if/how you monitor your generator AC output i.e., Volts & Amps? I found a cct and modified it a bit as the original had problems with frying the isolation chips. It seems that they didn't build any protection into the cct as described in the application notes of the components.
I was thinking that these readings should be quite accurate, considering I want to work out real power generated with a set amount of fuel in the future.

Do you think that the way I want to generate the floating 5V supply will work if you look at the cct below?

I didn't want to go the Current Transformer way to monitor the generator as I thought it will be to involved, but now my cct is getting more & more complicated!
Its difficult to decide between cost, availability and simplicity at the same time, I can use and old "probe cct" I've got lying around here somewhere from years back for myself, but no one would be able to build one like it and that's defeating the object of this project. :(
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

#31
My hand built AVR (not the simplified PCB version) does AC voltage monitoring, and the schematics have been posted below (see page eight).  It's easiest to just use a tiny step down transformer (pcb mount), rectify, scale via resistor divider and RC filter.  Or you can pay for a sensor $$

With my "fancy" AVR, voltage is either right on, or the AVR will disconnect power within an adjustable few seconds.  So I only monitor the presence of AC power via 220V relay in my battery charge controller design.  (Still in progress.)

For AC current monitoring , I'm using a NK self powered model A 100-1 AC current sensor which I found on ebay for $20.  It's a current transformer that powers a 5V DC output.  It can be jumpered for 10,20 or 50 amp scale, BUT the lowest current measurable is always 10%, thus 2 amps for 20 amp scale.  This is fine for my needs- the battery charge controller just needs to see if there is enough "headroom" for the AC charger to operate.

There are other powered AC current sensors which provide full range measurement, and DC output.  Or you can "roll your own" via CCT, with output rectified and filtered to get a DC signal which you can then scale as needed with a simple op amp.

The isolated op amps you show in your circuit are intended for measurement of DC current across a shunt, or for isolated DC measurement, not for measurement of AC.  

Best Wishes,
Bruce M




dubbleUJay

Quote from: BruceM on November 11, 2009, 07:59:13 AM
My hand built AVR (not the simplified PCB version) does AC voltage monitoring, and the schematics have been posted.  It's easiest to just use a tiny step down transformer (pcb mount), rectify, scale via resistor divider and RC filter.  Or you can pay for a sensor $$

With my "fancy" AVR, voltage is either right on, or the AVR will disconnect power within an adjustable few seconds.  So I only monitor the presence of AC power via 220V relay in my battery charge controller design.  (Still in progress.)

For AC current monitoring , I'm using a NK self powered model A 100-1 AC current sensor which I found on ebay for $20.  It's a current transformer that powers a 5V DC output.  It can be jumpered for 10,20 or 50 amp scale, BUT the lowest current measurable is always 10%, thus 2 amps for 20 amp scale.  This is fine for my needs- the battery charge controller just needs to see if there is enough "headroom" for the AC charger to operate.

There are other powered AC current sensors which provide full range measurement, and DC output.  Or you can "roll your own" via CCT, with output rectified and filtered to get a DC signal which you can then scale as needed with a simple op amp.

The isolated op amps you show in your circuit are intended for measurement of DC current across a shunt, or for isolated DC measurement, not for measurement of AC. 

Bruce M

Thanks Bruce.
I want to read the Vac from a scale say 150-250Vac and I also thought the easy way will be a transformer. Its just that I read about Vrms exec. and all the calculations involved from this site that originally designed the cct.
http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/s2008/cj72_xg37/cj72_xg37/index.html
I saw that its intended for DC, but they manage to use it for AC as it doesn't use the negative half of the AC signal.
Most of the code for the Micro is also already done on another site.

The same goes for the AC current, its one circuit monitoring both with the same type of IC.
I wont put this thing in line with my Mains utility power, but I recon for measuring my 3kW gen-head (220Vac 13A) it should be OK ??? (If it works, but as you can see from the site, apparently it does)

I can only stress again my intentions with this thing, I want someone else that want one, to be able to build it themselves from parts readily available from known suppliers.
It must also be modular, if you want to measure say 3 temps and DC volts, you can leave out the AC probe, or if you want 1x exhaust temp, 1x water temp and AC, you leave 2x temps and the DC probe exec.

I had an old auto engine controller before that connected to PC via RS232, which has burned out a while back. When I started shopping around for a new one, I was appalled at the costs and limited functionality.
I think that even if it costs as much as a commercial one to build (which I'm sure it wont) with all the probes and stuff, it would be 10x better in the functions it could do and one can change the programming at will as the Micro is a kit board well known everywhere.

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

BruceM

#33
WJ- I didn't realize you were attempting to do real time RMS calculation by sampling the rectified AC waveform.

This approach will pretty much require a dedicated processor just for the RMS voltage.  The circuit from Cornell was set up for 120VAC, so some re-valuing of resistors (R1 in the original schematic) will be needed. Or your prototype has some wiring errors. I didn't check your schematic against the original, that would be a place to start.

I'm way too lazy to build one of such a thing when commercial devices to do it are available.  My further advice- don't bother to "build for others"- in my experience there just aren't very many people capable of advanced hobby level electronics that will also want your gadget.  I got very, very little response on the Basic AVR PCB.




mike90045

Quote from: BruceM on November 11, 2009, 10:10:29 AM
I got very, very little response on the Basic AVR PCB.

I get my rig in December.  Then I may need a "real AVR"   Do you still have the PCB's and plans ?

BruceM

You can order the PCBs from expresspcb.com with the file I can send you.  It's $53/3.  I don't have any.

dubbleUJay

Thanks again Bruce, it looks like I'm going to say those words a lot still in the future!  ;) I hope I'm not bothering you to much with all the questions. (BTW, I was thinking of taking it to an Electronics forum somewhere, but I doubt if those guys will have the hands-on experience for Micro-Co-gen like this group ??? )

Comming back to the task at hand, the guy on the following site has taken Cornell's cct and converted it to 220Vac, his formulas are shown when you click on the links just below the circuit diagram on the site:
http://openenergymonitor.org/emon/node/2
He has the code for the ATmega as well on his site and this will save me a lot of hassles as I'm still learning the stuff. So even if no one is interested in it, at least I would have learned something that I should have done a long time ago.  ;)

I looked at the suppliers application notes  for the IC's and added the recommended protection to it and want to use an isolated DC to DC converter for the floating voltage as I didn't want an extra Wall-wart PSU. I figured that I will need a decent PSU at the end as the PC USB power wont cope with all the current when its finished, with all the probes and stuff connected, so I modified an old AT PC power supply to run everything in the end. I've got some decent 12 & 5V rails now and it plugs right into an old 400VA PC UPS!

I'll look at the wiring of my cct again, I could have easily made a mistake somewhere.

I get what your saying about others interests in building something like this, but I figured that we need something to do data logging with for our generators running on whatever. The controller side is more of a bonus if it can be done reliably with this board BTW.
A lot of the figures quoted everywhere are up in the air and the only way for me to proof it is to have reliable numbers.
For instance, if I can time-stamp plot my Load and Temp for a particular amount/type of fuel to PC, it makes it so much easier and accurate than fiddling with a meter and temp gauge, trying to write it all down at the same time at set intervals.
Anyway, that's how I see it, a lot of work now, but less in the future. I've got a saying around here: "Don't give me a hand-planer if you have an electric one in the cupboard, I did that at school and know how to use it, but there is an easier way"  ;)
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

Quote from: BruceM on November 11, 2009, 11:27:05 AM
You can order the PCBs from expresspcb.com with the file I can send you.  It's $53/3.  I don't have any.
You guys probably know about printing the layout onto glossy paper with a laser printer and transferring it with an iron on to copper board before etching ??? (heat toner transfer) Saves all the hassles with Pos20 and UV light and such.
http://www.instructables.com/id/5pcb/

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

BruceM

WJ, I just want to make sure you understand that one processor will be dedicated to the RMS voltage computation.  You'll have to interface (serial data) that to another processor which is doing the monitoring and logging.  The alternate approach of building your own using a tiny transformer and RC filter will give you a good RMS approximation and way less complication, or you can buy and AC voltage to DC level sensor.

With the advent of cheap PCB fabrication for prototypes (no silk screen or solder mask), I wouldn't recommend etching and drilling, old school.  As you suggest, use the better tool.

The use of DC-DC converters around analog circuits where you were hoping for accuracy is perilous for the novice.  You will be less frustrated using a linear supply, unless you understand well what you're doing EMC-wise.




dubbleUJay

Hi Bruce, no I'm not going to have a dedicated processor for the RMS, what I meant is that this probe should be good enough to do it if the Cornell guys used it in there application. I should have been more clear on that, sorry.
The way the guy from FreeEnergyMonitor is using it, he can read the Volts, Amps & Freq with it by using only 2 analog inputs on the processor. From those figures he then gets the power computations.
I don't know of a commercial sensor that can interface all 3 values to a micro with just 2 A-log inputs.
On the other hand, the Arduino board supports I2C which I might find a commercial sensor using that to the board, I don't know.

About the PCB's, over here we pay an arm and a leg for them and the min. quantities are ridicules! We have a "new guy in town" that does smaller quantities, I still need to check him out. In the meantime "old School"is my only option.  :'( The same goes for availability of electronic components, it seems that I have to import those HDPL-7520 IC's from you guys, no one has them here in ZA.
On the subject of buying/selling, I cannot sell something on eBay from here, our Reserve Bank rules don't allow for it! It just P-ses me off!

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

dubbleUJay

Quote from: Jens on November 11, 2009, 09:02:44 PM

Could you explain a bit more on this? What is the reason behind that? How does the reserve bank come into the picture of a private transaction?  How can they stop an ebay transaction? What is different about buying something from ebay vs buying from any other place out of the country? Very curious .....

Jens

Jens, they somehow have legislation to stop the local banks from receiving money from PayPal for there customers!
Bottom line, seems they are afraid I might bring money into the country and not give them "their" share of things!
Here's some people asking them the questions:
http://imod.co.za/2008/02/13/i-called-paypalcom-today-from-south-africa-and-asked-wasssup/
and here:
http://www.greenman.co.za/blog/?p=45

I can have a credit card and pay PayPal with it, but I cannot get PayPal to transfer money into my bank account!
People here have sailed around it by having an overseas banking account, but you need a physical address outside my country to be able to open one.
There's other ways to kill the cat, but I'm still just p!$$ed about it!
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

#41
WJ, In looking at the "open project" page, I see that the project was stopped when the developer noted that his isolation op amps were frying.  Excessive differential voltage is what I'd look for.  Classic internet project- posted something that did not actually work, another triumph of form over function.

Regarding the Cornell project which developed the circuit you are copying- note that their software is sampling every 1ms (only 8 samples per half wave), and had to avoid floating point calculations in the fast loop, (not the 1 second calc and report loop) because the processor couldn't do it fast enough.

So there isn't much hope for running engine controller/monitor software while simultaneously running RMS voltage and current calculation software.

Processors are cheap, and it makes software much less complex to just add another processor for engine control.  

Best Wishes,
Bruce






dubbleUJay

Bruce, maybe I should rethink this thing a bit ???
Right now I'm wanting/needing a Data Acquisition Unit. I want to measure:

4x Temperatures:
1x Coolant Temp
1x LP Fuel Line Temp (Between my coil around exhaust & Fuel Pump)
1x HP Fuel Line Temp (WVO)
1x Exhaust Temp

on engine side:
RPM
Oil Pressure/flow (Maybe!!!)

Alternator:
Volts 220Vac
Amps 15Aac
Frequency 40-60hz

From those I should be able to cover most of my engine's monitoring.

Now while I'm busy with those, I might as well incorporate some emergency shutdown output if things go outside there parameters and also an output to the assisting governor solenoid we spoke about in another thread, operating if the RPM goes below/above a certain value. I'm not going to worry about real RMS for now.
Maybe also an output to cut out the load if it draws to much current.
From what I've seen/read, these should be easy to implement and shouldn't need to much computing power for now.
I'm now just looking at getting all my "probes" in a row ;)

I know its nowhere near an auto engine controller, but those are the things I'm looking at right now to get working and if I can accomplish that, I would be happy and everything there after would be a bonus, to me anyway. (Then there's the UI on a PC thing as well, but I'll get to that when I'm more or less happy with the hardware)

What are your valuable and very much appreciated thoughts on this Bruce?

Maybe I should change the heading of this thread to:
"Planning a DIY Data Acquisition/Engine Controller Monitoring" for now!  ::)

dubbleUJay
PS- Just for interest sake, can a thread's heading be changed?

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

BruceM

#43
WJ,
If you're just looking for analog data recording and analysis, a packaged hardware and software system to do just exactly that seems like a huge timesaver, though likely a bunch more money. (Not valuing your time.)

Because I could do the software, I'd design a uP engine controller with the extra analog inputs you need for your research data , and then squirt the data to a PC (if connected) once per second via 9600 baud RS232 or other serial link.  The engine controller would continue to be valuable, operationally, all the time you are not doing research (a small part of the time).  

I would not mess with developing my own AC voltage and current monitoring sensors unless I had to, and if forced to, then I'd keep it simple (not embedded uP).











dubbleUJay

Bruce, I think we're on the same "wavelength" now, its just that I'm starting on the opposite side of things than what your suggesting.
This is purely because I need to log data now and the controller side can wait a while.
I'm probably going the wrong way around as the Engine controller would be the main program and the Data Logging secondary, but on the other hand, I'm a south-paw  ;)
I presume the code for a data logger that I have now would easily be adaptable later into a final system ???

BTW, the guy on the FreeEnergyMonitor site has just changed over to use a CT method for measurement of the AC 'cos of the problems he was having with the IC's blowing.
My guess is that the Cornell guys were pushing the design with 110Vac and he changed it to 220Vac, from there his problems. It's probably high frequency spikes that caused the faulures as they also didnt incorporate any filtering as suggested in the App-notes of the components.
I'll probably use a diode to cut out the negative going pulses to the IC's and rework the formulas from there IF I'm going to go this way, do you know of a commercial probe that will read the Volt/Amp/Freq all in one that you will use then?

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