Planning a DIY Data Acquisition/Engine Controller

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

Previous topic - Next topic

dubbleUJay

Bob, just for my own info, could you give me some suggestions on PLC controllers that your talking about?

I did look at them a long time ago and the ones I could get over-here in ZA were very expensive AND you then had to buy their software on top of that!  :( It might be that I'm in a 3rd world county though and we're just getting ripped off.  >:(
IIRC I could get modules and put it all together with a CAN-bus, but I had to have a NASA budget or be one of our Government Officials. (Which seems to have an endless supply of our money, but cannot subsidize my solar hot-water geyser) ;)

In my case, all the hardware in one place wont work:
My well is 300m away
Orchard about 50m
Engine room 20m
Future wind-generator 200m
Weather station 10m
Main DB of house 30m
To name a few just off the top of my head.

I'll be using the weather station and WVO engine data a lot I expect.

The idea with the Arduino is to have the same Master/Slave controllers/loggers hardware throughout, only the software in each one changes and all capable of running on their own and not influencing one another if breakdown should occur. If my engine controller smokes, I'll take the one from my weather station, download the controller software into it and there we go! Until I can get a new one.
There are instances were hardware might not be available commercially like the interconnection scheme we're working on now, but we should keep that down to a minimum if possible.

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

mobile_bob

DubJ:

the plc's are as you say very expensive even here in the USA, and yes most have very expensive propreitary software
to program them.

i bought the dl305 and all the related modules off ebay for pennies on the dollar, figureing i would eventually find the software
as well for a good price,

i had already gotten started with microcontrollers, and found that the input and output modules to be very interesting in that
they already were built using the same stuff we need anyway, things like opto isolation is standard fair as are solid state relays
multiplexers and demultiplexers etc, all in nice neat modules that plug into a chassis with a ready made backplane.

i then decided to reverse engineer an output module and then to integrate a daughter board so that i could take control of that
module and in doing so make it a slave, then came replaceing the oem processor module with another micro and make it my master

in the end i decided to move away from this approach not because of anything other than i wanted a bit more room to work, and
because you cannot get a schematic from "any" plc manufacture, it just made sense to take the daughterboard and attach it to a relay
board which could provide my relay isolated outputs and which were ttl logic driven and used a 8 x darlington pair driver to buffer between the relays and the micro controller basically useing the same basic methodology of the plc save for opto isolation.

now looking at what you have in mind and the distances envolved, perhaps you will need to do some other communication protocol
and have widely spaced slaves running off the master?  i guess that makes sense

to me it just made more sense to find a way to get all the processors (master and slaves) in one rack mount case, and then go from there to each remote site via cable running a higher voltage logic such as 12, 24 or now maybe 48volts.

i think i can sort out the logic over distance easier than using remote slaves and having to use wireless or some other communication protocol

the advantage to not having remote mounted processors makes a manual override centrally located much easier to accomplish in my thinking, certainly we can have manual overrides at each controlled component, but not having to walk out to take manual control might
make the difference in either my survival or that of the controlled piece of equipment.

i too have about 200 ft to get to my planned windgenerator location, everything else will be within a max of 25ft or so, and most
will be under 10 ft from the automation unit.

i am relatively new to programming, only having gotten into it about 2.5 years ago, but am no newbie to relay logic having had to use
that method for 35 or more years,   so my approach was probably based on my background, where i look to do things mechanically first, electrically second, and electronically third, with programmable only after i have thought out the system very well to start with.

this whole topic is quite fascinating to me, and very interesting to see the various methods different folks use or approaches taken
to get basically the same result.

i guess it all comes down to what your comfortable with?

as an example

in trucks much like cars, for the last 75 years or so the heater motor had maybe 3 speeds, it used a 3 position switch and a
resistor block in the heater duct to regulate and dc brush type motor. the cost of the motor might be 20 bucks

today, for some reason engineers think that drivers need an infinitely variable speed motor, in order to accomplish this they attach
a small puter box, microcontroller inside, generates a pwm and drives an H bridge or somesuch to give the driver ultimate control
over the blower motor,, cost for this motor is 250 bucks.

for me, all i need is the 20 dollar system, yes the 250 dollar system would be nice, but not something that is needed by me.

basically this is my design philosophy, use technology where it is a benefit, but use it sparingly.

bob g

dubbleUJay

Hi Bob, it seems that you have most of the stuff already to make your own controller so that will be the way to go IMHO.

I think I mentioned to you b4 that I'm also fond of electro-mechanical switching, I worked in an British MU telephone exchange for about 10 years, all the flavor of relays you would find, ie slow-to-operate, slow-to-release, high-speed, thermal, you name, the exchange had it. Also motor uni-selectors & stepper-switches.
I use to adjust this stuff, every relay had specific spring tension, armature air-gap exec. exec. One thing I regret is not keeping my toolbox as it had some very weird looking stuff in it for the uninformed. Great stuff to talk and show off! ;)
Fault finding was a blast, "Routiners" were equipment that made call during the night through the exchange and recorded faults it found.
There was a big mainframe computer, no screen, printout on paper only, that did some of the call routing! This thing was huge, used bead-memory!
When they were replaced by electronic exchanges I went over to the Access Control, Fire- & Security Alarm, CCTV department and then onto Microwave Construction, building outstations on mountain tops! ;)
Now me & my brother run a mobile crane business, what a change of scenery!
The good old days!
dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

Crumpite

Folks,

Moble_bob,
My background in in industrial automation - chemical plants, water plants, waste treatment, etc, etc, etc.
So I know where you're coming from !
I've worked with relay logic, PLC's and industrial automation computers of many different flavors.
I started out as an engineering tech, became a journeyman instrument man, and finally an engineer.
So I've got experience all the way from an operator of the equipment, to maintaining it, to designing it.
(not trying to brag, just trying to show my history...)
I've been programing since early collage days and built my first S-100 buss computer from a kit.

As for data logging - I personally don't need much, I'm just looking for things like Kw-hours, total run time, water temps, simple stuff like that.
And I likely won't need most of it after I learn how the system operates - but I will need at least some.
There does seem to be a mania about logging everything under the sun these days.
But if I need to do some logging, it makes sense to make the whole system extensible so folks can add to it and log whatever they want.
Nothing is set in stone at the moment - if you have ideas let us know !

I agree wholeheartedly about keeping logging and control totally separate and making the controller as robust as possible.
That's one of the reasons I've been thinking about using a Picaxe for control - they are just big enough to do the job and are proven to be very hearty.
From what I've read on different forums, not many folks know or implement fail-safe design and practice.  :(
On the other hand, I just noticed an Adrundo for sale that has been hardened for industrial use.  :)

I also agree with the idiot light idea - I included it in my origional list of possible I/O's for the controller.
They sure make troubleshooting a *lot* easier.

"basically what i am saying is in my opinion any successful system should not integrate both data aquisition/logging and automation
they should be as seperate as is practical, the automation system should be rock solid, simple, redundant where possible, and fail to safe
mode, with an operator override capability or manual control system overlay."


Now here you've hit the nail on the head - This is what I'm trying to design into the system !
And that's why all of this theoretical stuff right now.
I've found that if you get the top layer of the system design down pat first, the actual hardware and programming fall into place a lot easier.
On the largest project I ever worked on, I spent the better part of a summer just wandering around in my back yard muttering to my self, when I wasn't sitting at my desk doodling little flowcharts.
Ordering the hardware and the actual programming went pretty easy after that.  :)

its hard for me to want to have pc boards made, source all the discrete components, learn more languages to program different
processors, and basically have to reinvent every wheel on this project along with the spare wheel in the trunk.  when just about ever
bit of the hardware is available for a very low cost, one just has to think seriously what he wants to accomplish, lay out a flowchart, then
assemble the hardware to enable control, leaving programming to tie it all together.


Again, that's what we're trying to do.  :)
The problem is the overabundance of platforms, shields, boards, languages, etc... so much to sort through !
We're trying to design a "system" that can accommodate a lot of different approaches to hardware but still have as much in common as possible.
That's whats so difficult !

Please excuse the debris from the construction project - well get all of this mess cleaned up as soon as possible.  :)

Hope this clears up a few points.

Now where was the last book I was reading on interactive programming...
Daryl

Crumpite

Quote from: dubbleUJay on December 07, 2009, 08:33:34 PM
Daryl, on the master hardware side, Bruce has given me a sort of thumbs-up on using my multiplexer idea to switch between the various slaves. He made a suggestion on IC's to use, although he said he's still looking for one that might work better.
I'll draw up something "alpha" 2day to look at.
Do you have any cct from him about his opto-RS232 links? I need to see how many "wires" needs to be switched for each slave?

No, I haven't seen his circuit yet, but might be able to reconstruct it from his description and suggested parts.

You *should* be able to do it with one I/O pin, but I'll need to think on it for a while - two pin's would be easier on the hardware.
We need to drive an LED to transmit and use a phototransistor or photomosfet changing conductive state for receiving.

I'm a bit overloaded with stuff to do at the moment, but will get it it "real soon now"...  :)
Daryl

dubbleUJay

Guys, its been a while since I've givin' any update on this project, but believe me we're busy in the background with some awesome stuff!
It's just that this thread is getting sooo looong and we decided to do a bit of the nitty-gritty work "behind your back!" ;)

As soon as I have something interesting to post or report I'll do so immediately!

In the meantime, its stuff like this in the link that keeps me going!
http://www.windmillsoft.com/acatalog/A000_1.html

What the h*** were they thinking when they slapped the price tags on those! ??? At least for that cost they could have put it in a box that does not look like a nice DIY job and upgrade the software cosmetically so it doesn't represent a win95 app while recommending it for WinXP IMHO!

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

mobile_bob

DubJ:

i gotta agree with you on this one, why build something that costs that much and not make it look at least
presentable?

this is where manufactures could take a que from "outback" wherein they have that nice art deco thing going on.

you have a nice case and a product that just works, and folks will never question much else.

this was a part of system design that held me up for over a year on my thinking, there were certainly more expedient
means to house all the electronics, but i wanted something presentable when complete.

however, a comeplete system based on "steampunk" as a theme would be fantastic.

lots of huge bakelite meters with ornate scrolled needles old english numbering for starters would be pretty cool.

or go to the other end of the spectrum and make the engine room like Scotty's engine room on the enterprise?

just seems like "why not have some fun with it"?

bob g

dubbleUJay

Insidently Jens, the same guys I shot down in my post above claims the free version of their software, (its actually their old version 4, the new version is 6) can monitor almost any RS-232 data sent to the port and represent it to an Excel spreadsheet.
I downloaded the software, but haven't played with it at all. I presume if they say Excel, they mean a comma delimiter file?? (They want your email before you can DL though!)  >:(
Once you have that, I can maybe help you to display it as graphs in Kst or Excel for that matter, in real-time and I'm sure Open Office's flavor of spreadsheets can do it as well, I just haven't tried it.

So, the first thing to do is to try and write the RS232 data to file on the PC, that's the difficult part to get setup IMHO.
One tip from me, if you get funny characters in your file, make sure the Baud-rates are the same for the PC-port, your recorder and software.

I hope this might be of help, its so nice to be able to see data on a graph, being it in real-time or not!
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

Jens, as I understand it, the software reads the incoming data from the RS232 port and write it to a file on the PC.
The port driver is also important and the same guys have a driver for download as well if I read it correctly.
I've got no means of testing it at the moment, but this is how I got the Arduino to work:
Obviously the monitor/controller must sent the data to the 232 port in a readable manner.
My Arduino use a USB port, but the driver for the port "fools" the PC into thinking it has a extra Serial Port installed. Your monitor probably has a straight serial connection I presume.
I've got a 3rd party program that write the data coming from the port, to file. I can chose a file and format and its actually just a TXT file.
The software looks for a pre-programmed string from the controller(Arduino in this case) that tells it to log that specific data. (This is why this program wouldn't work for you as I don't think you can program your monitor to send specific string to the serial port, but I think the Windmill 4 software can as it should prind all data to file)
That data in the file I then link or import to graphing software, also 3rd party and nothing to do with Arduino itself.
You'll have to 1st try and establish a connection with your monitor and look at the data it sends, then take it from there how you're going to represent it.
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

#174
Jens, some good news, I quickly installed the Windmill 4 software and after playing around a bit, I was able to monitor the data from my Arduino via the USB port and print it to file!!
Its a bit confusing to set it up, looks like Win95 applications and you have to setup various modules of the program itself, but it works.
I suggest reading the manual to find the correct way to set it up. I was just poking around with it.
If it can do this for me, it surely can log your data???
I see a lot of help files on the site itself.

dubbleUJay
PS- I might still swallow my words in my 1st post 2day, but still, its very expensive 134 Pounds IIRC for the software alone and the ver6 doesn't look much different!
Foegot to say I'm using WinXP SP3!
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

dubbleUJay

Quote from: Jens on December 12, 2009, 01:01:09 PM
Holy cow, I just looked at the windmill software ... talk about nickle and diming you to death. That is absurd !
What software do you use that just writes the data to a txt file?

Edit: Are you using the gobetwieno (or whatever) software you mentioned at the beginning of this thread ?

Jens
Jens, I didn't know it runs your own code, then Gobetwino would work.

It monitors for a start string like this:(In this case the "LM35TEMPS" is the name of the Gobetwino command you setup in the program itself)
Serial.print("#S|LM35TEMPS|["); The ASCII between the two "  "
and it prints to file whatever is between that string and the following "end" string.
Serial.println("]#");
You can also chose to time stamp it.

My LOG file then looks like this:
2009/12/03 19:08:40; 17; 0; 0; 0; 0; 0;
2009/12/03 19:08:41; 17; 0; 0; 0; 0; 0;
2009/12/03 19:08:42; 17; 0; 0; 0; 0; 0;
2009/12/03 19:08:43; 17; 0; 0; 0; 0; 0;

exec., exec.!
This is 6x LM35 temperatures that it monitored, only one connected to the 1st channel at 17degC, the rest are pulled down to "zero"
I've used semi-colons for separators, but you can use TAB or whatever.
Again, the Gobetweno Help file or more so the examples in it, is of great help. It can also email and "print" to a web server, but I haven't used those yet!
This file you then  link to graphing software.
Kst seems very nice and widely used, but it crashes on me occasionally, a bad one too, my PC freezes and I've got to hard reboot!  :'( I think its something with my PC though, just haven't pinpointed it yet!
That's how I discovered Excel2007 works just as well.  ;D

Now I'm sure you'll come right! ;)
Its nice to discover with just a bit of free software that one can do something that you could have done a long time ago, I surely was, I just didn't know how to do it.
dubbleUJay
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

Crumpite

Folks,

I'm starting to look at programming a GUI (graphical user interface) for this project.

The big question is: what to you want to be able to do ?

Get you needs and wants together now before I decide to start designing the whole mess !!!  :)
It might be too late after I nail the design down.

I can see data logging and graphing, but what else ??

Daryl

BruceM

My controlling embedded processor system is already built, and I am doing that software myself, but I would like to steal this project's PC GUI for interacting with my Battery Bank Charge Controller/power management.  It will have an modest speed serial data link to the PC. 

I need to be able to display specific data, and set different control parameters, and download for display my logged battery charge tracking info. (So I can watch for a battery that is getting weak.)  An example would be to send a 5 day weather forecast to the BBCC, a simplified form so that it can minimize generator use, by anticipating a sunny day or wind. And monitor net power from wind, PV, generator, load.   Or other special modes of operation, like top off the battery bank with generator, now. 

dubbleUJay

Daryl, the ability to switch digital outputs on/off and maybe to control an analog output for PWM like a slide or knob.
If there's an option to store incoming data in a log-file as its coming in, it might be used for something else at a later stage if the UI cannot do something we didn't think of now? Kind of like what gobetwino is doing.
Digital & Analog "meter" display would be a great attraction, but only cosmetically though.

Maybe the things BruceM wants can be sent to the controller via small "scripts" ???

I'll have to think some more on this ;)
dubbleUJay
Lister  - AK - CS6/1 - D - G1 - LR1 -
http://tinyurl.com/My-Listers

BruceM

Don't worry about my requirements much,  I can just hard code my PC display/control code;  it's often easier than trying to learn someone else's software that does "all the work for you".  I'm happy to keep it simple, no fancy graphics or GUI is important for me, I'm happy to just have something simple and functional.

If I find that I can rip off a bunch of the project GUI software, that would be icing on the cake.

BruceM