PC based Controller

Well I guess the next big question is this going to be a group project?? Whose in charge and what is each of us going to do to make sure the project moves along to a practical finish?? I have some DIY sensors to contribute and experience with making X-10 devices smater using ladder logic and Bolean Logic. I would be willing to post the plans and schematics to a site for all to use.

What's the next step?? Thanks Bill
 
The following is more than 99% of you care to see, it is the code for my PLC. All the inputs and outputs were chosen randomly.

I have not included the program for the LEDs, as it is extensive and hard to follow. I have 50 LED's that simulate sunrise, sunset, moon phases and red for night viewing. Colors are amber, white, and red for sunup and down, and are stationary on both ends of the aquarium. There is a series of 10 4-up arrays spanning the length of the aquarium horizon that are blue and white for moon phases. The PLC times when each of the arrays come on and which bulbs are lit in each array. Phases are emulated by how many and what color are lit based on the date.

ORGANIZATION_BLOCK MAIN:OB1
TITLE=On_Off Aquarium Control
BEGIN
Network 1 // Check the time
// Read the clock on every scan and store the time starting at VB0. The hour:min:sec:msec start at VB3.

LD SM0.0
TODR VB0

Network 2 // Turn on Actinics @ 10:00 AM and 8:00 PM, and Turn Off @ 11:00 AM and 9:00 PM.
// If hour:min:sec:msec greater than or equal to 8 am and less than 8:30 am then turn lights on, else turn lights off. The 16# means the value is in hex. Time values are in BCD which is the same as hex for this app.

LDD>= VD3, 16#10000000
AD< VD3, 16#11000000
LDD>= VD3, 16#20000000
AD< VD3, 16#21000000
OLD
= Q0.0

Network 3 // Turn on Halide 1 at 11:00 AM and Turn off at 9:00 PM. Halides were separated due to power concerns on the outboard relays.

LDD>= VD3, 16#11000000
AD< VD3, 16#21000000
= Q0.1

Network 4 // Turn on Halide 2 at 11:00 AM and Turn off at 9:00 PM

LDD>= VD3, 16#11000000
AD< VD3, 16#21000000
= Q0.2

Network 5 // Calcium Reactor turns off if input at I2.7 goes high.
// If the pH level in the effluent goes below 6.8 the bubbler is shut off until the effluent pH reads 6.9.
LD I2.7
= Q0.3
Network 6 // The next three networks are the surge simulations, one powerhead on at a time from 7AM till 10PM.
// This network controls one of the three powerheads, on 8-9, 11-12, 2-3, 5-6, and 9-10. Off 10pm to 8am.

LDD>= VD3, 16#08000000
AD< VD3, 16#09000000
LDD>= VD3, 16#11000000
AD< VD3, 16#12000000
OLD
LDD>= VD3, 16#14000000
AD< VD3, 16#15000000
OLD
LDD>= VD3, 16#17000000
AD< VD3, 16#18000000
OLD
LDD>= VD3, 16#21000000
AD< VD3, 16#22000000
OLD
= Q0.6

Network 7 // This network controls another powerhead, on 7-8, 10-11, 1-2, 4-5, 8-9, off from 9PM till 7AM.

LDD>= VD3, 16#07000000
AD< VD3, 16#08000000
LDD>= VD3, 16#10000000
AD< VD3, 16#11000000
OLD
LDD>= VD3, 16#13000000
AD< VD3, 16#14000000
OLD
LDD>= VD3, 16#16000000
AD< VD3, 16#17000000
OLD
LDD>= VD3, 16#20000000
AD< VD3, 16#21000000
OLD
= Q0.5

Network 8 // This network on 9-10, 12-1, 3-4, 6-7, off 7PM ââ"šÂ¬Ã¢â‚¬Å“ 9AM.

LDD>= VD3, 16#09000000
AD< VD3, 16#10000000
LDD>= VD3, 16#12000000
AD< VD3, 16#13000000
OLD
LDD>= VD3, 16#15000000
AD< VD3, 16#16000000
OLD
LDD>= VD3, 16#18000000
AD< VD3, 16#19000000
OLD
= Q0.7

Network 9 // Thermometer turns off if input at I2.6 goes high. (See previous post for controlling circuit)
// If the temp in the tank is below 79degF the output Q0.9 is high, if above 79 degF I2.6 opens and shuts off output Q0.9 removing power from the heater(s).

LD I2.6
= Q0.9

Network 10 // Emergency main pump shutdown. When the moisture sensor outside the main tank senses any water the input to the PLC is driven low, diabling the pump. Simple circuit is available.

LD I2.5
= Q1.0

Network 11 // LED sequencing
.
END_ORGANIZATION_BLOCK
 
Well, I see this project evolving into two parts. One on the interface hardware side and the other the pc based software side. Both can be worked on separately so long as their is a general agreement on an interface protocol. One thing I would suggest is that some web savy individual set up a download website were all can download the lastest version of the pc software so others can beta test it out on their machines. What platform this runs on is a whole other topic but my guess is the majority are running the microsoft windows virus/spy ware on their systems as I am. I would offer to do this but I'm a web idiot. The hardware side get a little more difficult as there are many good solutions that can do just everything a reefer would need. I'm a big fan of simulation so having the hardware to test the software or vise versa become less important for testing so long as it is agreed that both sides of the equation are in agreement on how to communicate. In our serial setup we typically hook up to pc's together and one is running our control and DAQ software while the other one simulates the hardware. The end effect is that the software thinks its talking to the harware but actually it is getting spoofed by a laptop. As far as the hareware is concerned my guess is there are a few different options. The PLC looks like it is a very good drop in device that lends itself to be programmed and provide some level of automation. I personally am not familiar with PLC technology but the little I do know seems to indicate that it would be a good choice for control. Some other reefers have described custom setups with embedded processors and I am very familiar with this approach. Since both look like good alternatives it really comes down to who is more comfortable using what. What would be useful is if the pc software can select between which hardware it is using and use the appropriate driver for each of the different setup. My guess is that it would be desirable to be able to choose from different PLC models or embedded solutions.

miramont
 
I think sourceforge would be a good place to house hardware diagrams and such so that all can be easily shared as well as software.

Here's what we need to start a project on Sourceforge:

Registering a project for hosting on SourceForge.net is a simple process. We do require a reasonable amount of information in order to consider a project for hosting; please be prepared to provide details regarding the purpose of your project, its major intended features, and the licensing terms under which your project will be released.

I can put together the purpose. How about some suggestions for intended features (hardware as well as software)? One liners.
 
RAT.....Reef Automation Team
or
RATS - Reef Automation Team Sponsors

So you could search for it in RC.... must be greater than 3 letters. The folks that currently selling the control devices here are moaning.
 
that is true, I have also heard of people somehow running programs developed on the .net framework w/o actual windows being instaled. something about running the shell only makes it a low security riska and suuper stable. this would make vb.net a decent language to use. I can find the specifics on this out if there is interest. I work at a university and would be in a position to possible get the programming done by graduate students, if we had some design specification for them.

Personally I think we need to start by getting a formal plan as to what it needs to do and what i/o interface to use, and go from there.
 
In my opinion, linux and java are more robust, reliable, and flexible. And to fully tie them into being a great choice for open source and diy, they are FREE.

I don't understand why anyone would want to use Microsoft technology for this.

I aslo notice everyone discussing the user interface. How about designing and writing the controller software first?
 
there are advantages to each programming language... the one thing about the MS technologies (especially VB) is that there are many more VB programmers than any other language. I'm not saying it is better (so no flames!) I'm just saying, statistically, there are more codes and possibly more input into the app.

My opinion:
Java is fine but I''m not a big fan of requiring someone that does not otherwise need the java client to install a large client just to run one application.
 
Tekrecycle.com said:

My opinion:
Java is fine but I''m not a big fan of requiring someone that does not otherwise need the java client to install a large client just to run one application.

So instead you want them to go to comp usa and and buy VB? Or are you expecting your .exe to satisfy everyone's wants and that they will have no need to edit code?

I think it would be a mistake to not run this application on a dedicated pc, so who cares about the big client. And VB takes up hard disk space too.
 
I don't think the language is the most important thing here. More important IMO is robustness. I'd like this to be designed so that anyone can download it, install it, load a disc into their PLC (or however you put the rogramming in it - that's where the logic will reside) that they've connected to the hardware they want to use it with, fire up a browser, set the correct settings, and get voila. GUIwise, all we need is display area (most likely to be hacked up) and configuration setting page(s) which talk to the PLC so it knows what it's running at what intervals and such. The GUI side of it is mostly design rather than code. I've been given the first crack at setting up the PLC side (THANKS EastTN!). My main need is pseudo-code on what gets set based on what info. I can extract most of it from these 2 threads, but if anyone has anything else I should consider, please make a posting.

Thanks,
Eric
 
If the controller software is embedded in the circuitry, then it will be even harder to make software changes.

I hope for the end result of this project is knowledge for everyone to share, discuss, and BUILD THEIR OWN controllers and not simply take someone elses work and blindly put it to use. What's the point of that?

Everyone maintains their reef differently, so why would you think that the same controller would work for everyone? For example, there's many people that wish the aquacontroller had 2 ph probes, and others that wouldn't be willing to pay the extra money for it. I would think the reason for a project like this would be to help each other figure out how to build their own controller to their specific individual needs and wants.
 
Back
Top