PLC?

    --For a good time you might want to mess with a Basic Stamp. Building the circuit and understanding the process will make it much more
fun.
--
"Steamboat Ed" Haas : Currently broke and
Hacking the Trailing Edge! : looking for a job...
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 07 Dec 2009 18:39:57 +0000, steamer wrote:

There are a number of advantages and disadvantages to this (I was going to suggest it as a last resort).
- per-piece price will be lower, if you can find a home for it in an existing enclosure.
- It'll be way more versatile than a PLC
- It may be harder to wrap your brain around than PLC programming (although maybe not -- relay logic is good if you already do relay logic, but if you're new to it Basic may be better).
- It'll be easier to put a display on it if you want.
In the final analysis, though, my knee-jerk reaction is to avoid PLCs 'cause I've never used one, yet for this project I'd give it serious thought.
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I actually hate PLCs, never got on with ladder logic very well. I'm much more comfortable with computer programming. Are we talking about a PIC chip here, like a 16f628A/16f877A?
Would either you or Steamer be willing to get me started with what hardware to order? And stuff to start reading?
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 07 Dec 2009 15:08:44 -0600, Karl Townsend wrote:

Do you want to program in Basic, assembly, or C?
For Basic, you want to get a Basic Stamp -- these have a PIC on them, but it's hidden behind a layer of programming, so what you see is Basic. They're sold by Parallax, who is not pushing their "propeller" chip, which I can't find it in my heart to recommend because it uses a proprietary compiler, and those always end up burning you in the end.
For assembly or C you (probably) want to get a PicKit (SP?) designed by Microchip. They have what you need to get a basic computer up an running, and Microchip at least used to have a free C compiler for some of their computers.
I wouldn't recommend the C or assembly route unless you have some serious programming experience under your belt. C and assembly are each the programming equivalent of a manual lathe -- you can do anything possible with them, but you have a lot to learn before you can start doing anything useful with them.
_Any_ of these routes will get you a board that only drives logic levels out, and will leave you responsible for all of the surrounding drive electronics to turn it into motor commands and protection to keep it from going up in smoke during the first lightning storm. A PLC is much more likely to have some useful drive capability built in.
Look to the Parallax website and SparkFun electronics for neato modules that you can assemble into a working system. Used wisely, you should be able to get away without having to design a board, at least for the prototype system.
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

    --Parallax has a kit consisting of everything you'll need to get started and to get a solid understanding of what's going on. The book's called "What's a Microcontroller" and it comes with a kit of parts that are very well thought out. I had a UC Extension class called "Gizmology" that used this material and it was a real eye-opener; I've used it to make a pneumatic tapdancing robot (pretty primitive but it worked!) and lately I've used it to drive my calliope.     --Reason I like the Stamp: they've got the most comprehensive manual and it assumes you know NOTHING when you start out; something sadly lacking from all the other systems I've encountered..     --You'll want to start here: http://www.parallax.com/Default.aspx?tabid62     Ping me off list ifyawanna know more. And they have a forum at: http://forums.parallax.com/forums/
--
"Steamboat Ed" Haas : Currently broke and
Hacking the Trailing Edge! : looking for a job...
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Thanks for the advice. I ordered their starter kit and plan to spend several weeks with it right after Christmas. If these can play a calliope they must be "good stuff Maynard"
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Plc's are great. I had a couple 600 ton St Lawrence forming presses with about 22 control relays, 5 cycleflex counters or timers that would not stay running.
Took a class at Allen Bradley on programming a plc and in 43 rungs of logic, I replaced that mess and kept us from shutting down a GM assembly plant.
Wes -- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Sun, 06 Dec 2009 19:31:56 -0600, Karl Townsend wrote:

Your control rule sounds like it could result in continual oscillation given the right combination of hysteresis, outside temperature, and inside temperature ('continual' in this case being up - wait - down - wait - repeat).
Can you find a dead time that will let these things cycle continuously without draining the batteries, yet will still give you quick enough response when the sun comes out from the clouds or a cold front blows in?
Instead of a fast motion and then a wait, you could use smaller motors geared down more, and just let them grind things open or shut really slowly. This definitely increases the delay and therefore the potential for oscillation without a fancier control rule -- but then you don't have to struggle with the 'wait' logic.
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 07 Dec 2009 13:15:54 -0600, Tim Wescott

======This is one of the reasons I suggested using a PC as controller in the links. "Fuzzy logic," to minimize system oscillation/hunting, is relatively easy to implement and the other parameters such as minimum open/closed time are simple to set/vary. http://www.sciencedirect.com/science?_ob=ArticleURL&_udi V05-45MVNXH-5&_user&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_searchStrId26063724&_rerunOrigin=google&_acct00050221&_version=1&_urlVersion=0&_userid&md5104bbde30e71fc4b9bbb365222f942 http://portal.acm.org/citation.cfm?id `3724 http://www.actahort.org/members/showpdf?booknrarnr@6_46
Another reason is the ability for easy expansion to simultaneously control many more inputs, for example not watering during full sun [if that is important].
Inexpensive UPS are now available to maintain the control PC in cases of a power outage.
google on <"fuzzy logic" "process control" greenhouse> for c 4.7k hits
Unka' George [George McDuffee] ------------------------------------------- He that will not apply new remedies, must expect new evils: for Time is the greatest innovator: and if Time, of course, alter things to the worse, and wisdom and counsel shall not alter them to the better, what shall be the end?
Francis Bacon (1561-1626), English philosopher, essayist, statesman. Essays, "Of Innovations" (1597-1625).
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 07 Dec 2009 13:44:03 -0600, F. George McDuffee wrote:

_ob=ArticleURL&_udiV05-45MVNXH-5&_user&_rdoc=1&_fmt=&_orig=search&_sort=d&_docanchor=&view=c&_searchStrId26063724&_rerunOrigin=google&_acct00050221&_version=1&_urlVersion=0&_userid&md5104bbde30e71fc4b9bbb365222f942
In over twenty years of professional life closing control loops I have yet to personally see an instance where fuzzy logic was really necessary.
Fuzzy logic is designed as a way to encode an intuitive understanding of a problem and it's solution into hardware and software, when you have no way of getting a solid mathematical grasp on things. But you still have to know enough control theory to verify the resulting -- highly nonlinear -- controller. If you don't do the verification (and inevitable reengineering) then you're just using fuzzy logic as a ready source of mumbo-jumbo to intellectually intimidate the customer while you get paid lots of money to screw things up.
Not, mind you, that I have anything against fuzzy logic :-).
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

You described the exact issue. Mechanically, I've got it geared down to raise/lower 12"/minute with a total travel of 60 inches. Gets hard to gear it much slower. My "plan A" is two stats so you have a dead band, then play with % run to get response without oscillation. I suppose if you knew exactly what percent on/off was optimum you could just gear it for 100% on.
I'm intrigued with this analog input option on a PLC. I should be able to use a higher percent on when farther from temp target. The high end computer systems you see on university research houses do this.
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Mon, 07 Dec 2009 13:56:56 -0600, Karl Townsend wrote:

If only...
I suspect that the optimum percentage will vary depending on the difference between inside and outside temperature. You're essentially setting up a temperature control system that has a constant heat input (from the sun), and variable heat shedding (the vents). But the amount of heat shedding that you get at any one moment is dependent not only on the amount that the vents are open, but on the outside temperature and (I suspect) on the amount of wind.
So the interior temperature delta that you'll see for 1" of opening will be much bigger on a windy deep-winter day than it will on a mild day in the spring.
This points to either needing to change your tuning manually with the season, needing to have an external thermometer that you use to select a control rule, some sort of adaptive controller, a heavily compromised control rule that guarantees stability on bad days at the cost of being really sluggish on good days, or just a happy acceptance of the fact that your motors are always moving, but your greenhouses are always at a good temperature and generating money.

If you want to go there, let me suggest _right now_ that you forget the PLC approach and lean toward using a PC or a Basic Stamp -- or find a PLC that uses a real programming language. Unless you want to spend your time working around the limitations of your controller instead of solving your problem, you want to start out with a controller that is way more capable than you think you need -- because with control loops, you _always_ end up needing more smarts in the controller than you thought when you started.
I still have this problem, and I've been doing it for 20 years. If you look at your controller's capabilities and say "that's about right" then you're severely undershooting your goal.
This is actually an odd case, because while I'm thinking of this as if you were a client, I wouldn't necessarily take my own advice if I were doing it myself. Were I doing this for myself I'd start with the simple route that you have proposed or something close, see how it works, and be ready to improve on it next winter. You'll learn so much about the dependability of your mechanical arrangement, the sufficiency of your batteries, plus all the stuff that no one has anticipated even thinking about yet.
But if you were paying me to get it working I wouldn't do that. Instead I'd either walk or I'd get all complex (and expensive) on you. Why? Because when you engineer a system that shows promise but doesn't make the customer money, they don't remember the joy of your low-ball bill -- they just remember that you built them a system that didn't @#$% work!
--
www.wescottdesign.com

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
...

Your last paragraph explains why a gear motor on a thermostat is going for $700 a copy. its going to take some fool willing to have a few failures to come up with a $100 solution.
OK, I'm sold on trying this basic stamp approach. Sure could use some help on what items to purchase. I don't mind spending a few (several) weeks learning a new subject.
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Karl Townsend wrote:

There are a bunch of tiny little control processors on the market today.
For what you want to do, the BASIC stamp would probably be the best choice.
Start with Wiki for a good overviwew: http://en.wikipedia.org/wiki/BASIC_Stamp
More involved: http://www.parallax.com/tabid/295/Default.aspx
Best place to get started with the Stamp would be the Activity Kit. (that's probably gonna wrap) http://www.parallax.com/Store/Microcontrollers/BASICStampProgrammingKits/tabid/136/ProductID/313/List/0/Default.aspx?SortField=ProductName,ProductName
Example Projects: http://www.rentron.com/BasicStamp.htm Relay control example: http://www.rentron.com/pc-relay.htm
http://www.emesystems.com/BS2index.htm
Development and info downloads: (including Stamp and application manuals) http://webspace.webring.com/people/au/um_1338/downloads.html
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
...

http://www.parallax.com/Store/Microcontrollers/BASICStampProgrammingKits/tabid/136/ProductID/313/List/0/Default.aspx?SortField=ProductName,ProductName
...
I just found an Xmas present request. I'll work through this and other simple projects before even thinking of the task at hand.
Thanks for the advice
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
This looks simple enough to do with two time delay and a few regular relays. Ladder logic makes more sense to me if I draw it as states and transitions.
jsw
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

This place has some Basic Stamp kits for a pretty good discount.
http://www.kitsusa.net/phpstore/html/Parallax-Programming-Kits-17-1.html
Yesterday I ordered a Boe Bot (based on Parallax Board of Education kit) for my son for Christmas.
I first started to recommend a Basic Stamp to you for a control but I thought by the time you connected it to drivers for the old lady... err wench it was getting sort of complicated unless you want to fiddle with electronics.
Basic Stamp and temperature measurement is easy enough but what about the control of the motor? Do you have a winch control? A couple of relays or a solid state H bridge? Don't forget to protect the Basic stamp from the inductive kickback if you use electromagnetic relays. I kind of like the idea of something like the Gordos or Opto22 solid state optically isolated relay modules to drive the final electromagnetic relays (understand I don't know what kind of currents your motor will draw). Of course if you're into playing with electronics you could get some logic level power mosfets that would probably do the job.
Many of the Stamp kits have applications for sensing temperature. I would think the goal for your greenhouse would be to position curtain so that you have zero rate of change with zero temperature error and adjust to try to keep the rate of change of temperature proportional to the error in temperature. That way, if it works out right, as you approach zero temperature error, you would approach zero rate of change (curtain would be adjusted to hold temp). Perhaps as part of the program you could have it record how much adjust time of the curtains accumulated over a day. Try to tune the algorithm for best temperature control with minimal winch run time.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I was thinking of an SSR like this: http://cgi.ebay.com/Solid-State-Relay-SSR-5-220V-DC-40A-Heat-Sink_W0QQitemZ370303229805QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item5637cadf6d
Any problem here? I own a bunch. Also have hundreds of Opto-22 parts, but that would be two steps and a large board. Want to keep it compact. Here's the gearmotor: http://www.surpluscenter.com/item.asp?UID 09120719340393&item=5-1624&catname=electric
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

http://cgi.ebay.com/Solid-State-Relay-SSR-5-220V-DC-40A-Heat-Sink_W0QQitemZ370303229805QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item5637cadf6d
http://www.surpluscenter.com/item.asp?UID 09120719340393&item=5-1624&catname=electric

DC solid state relays like that should be great. I have a few SSR's like that but mine are mostly (or all?) AC. Also the motor didn't look like it would be bad with a .2A no load current, at least it isn't like a 200A starter motor. I guess you could use either 4 SSR's configured as an H bridge or maybe 1 DPDT relay for direction and the SSR to switch the motor ON/OFF. You could wire the limit switches to kill power to the motor and have spare directional relay contacts jump around the limit switches. For example if the UP limit switch was tripped, it wouldn't allow power to motor as long a directional relay was set for UP, but change direction to down and contacts would jumper around the UP limit switch (vice versa for down). Or just run the limit switches to the Basic Stamp and have it in the program.
For that your parts would be 1 solid state relay to turn motor ON/OFF and 1 electromechanical 4PDT relay motor direction UP/DOWN (2 Poles) and the other 2 poles to jump the limit switches (UP jumps down L/S and DOWN jumps up L/S). Or if you have and would prefer to use 4 SSR's that should work great too.
Sounds like you may enjoy tinkering with the Basic Stamp, it would be nice to detect the rate of temperature change and try to control from there.
I recently used an Allen Bradley PLC 5 to operate my Brinkman electric smoker. I had an RTD measuring temperature of the Pork BBQ and a thermocouple measuring temperature inside the smoker. My first ran oscillated allot because I turned the temp off when it was too high and turned on when it was too low. If I had put in my program to pay attention to rate of change I could have eliminated much of the oscillation. For example if it's one degree too cold but the temperature is raising 5 degrees per minute you can shut off the heat sooner than if it's one degree too cold and falling 5 degrees per minute. Anyway, the BBQ came out great, I don't think the temperature oscillations mattered too much to the pork. My next program revision will incorporate rate of change. The PLC 5 has a PID loop function built in but I haven't played with that yet. I bought a complete AB PLC 5 with 16 slot rack with power supply, a 5/30 processor, and 13 I/O cards for $85 shipped on eBay.
RogerN
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Will a basic stamp power a 4PDT relay coil directly? I haven't checked, but I assume it won't. If it will, do you set up the controller to sink the relay? Or can it also source?
Karl
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.