PLC?

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

Reply to
Karl Townsend
Loading thread data ...

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 :-).

Reply to
Tim Wescott

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!

Reply to
Tim Wescott

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

Reply to
Karl Townsend

"Karl Townsend" fired this volley in news:4b1d5e08$0$77560$ snipped-for-privacy@auth.newsreader.octanews.com:

You're describing a PID (proportional-integral-derivative) control system, which, despite being described as "fuzzy logic", is not -- it's a software emulation of an analog, variable gain, proportional output system.

Most decent PLCs have freely-available PID loop software available for them. If you use one of the sorts that allows easy user programming (usually via both ladder logic and a crippled sort of BASIC) you can easily set one up for PID control.

You'll need to modify the curtain controller from simply on/off to a position-sensing controller to make best use of such a system.

I'm not sure they're in the price range you'd like to spend (although pretty cheap), but the TriLogic PLCs are both capable and easy to program with free software that comes with them. I have a three NC machines (dedicated automated machinery for manufacturing fireworks) operating under control of the TriLogic boards, and have not a single breakdown in seven years of operation (totalling 21 controller-years, 40-60 hours a week, year-round).

LLoyd

Reply to
Lloyd E. Sponenburgh

"Lloyd E. Sponenburgh" fired this volley in news:Xns9CDAA4F73B94Alloydspmindspringcom@216.168.3.70:

oops! Forgot to say, the TriLogic boards have some user-devised, free PID samples to play with.

LLoyd

Reply to
Lloyd E. Sponenburgh

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.

Reply to
Tim Wescott

...

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

Reply to
Karl Townsend

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:

formatting link
More involved:
formatting link
Best place to get started with the Stamp would be the Activity Kit. (that's probably gonna wrap)
formatting link
Example Projects:
formatting link
control example:
formatting link
formatting link
Development and info downloads: (including Stamp and application manuals)
formatting link

Reply to
cavelamb

...

formatting link

...

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

Reply to
Karl Townsend

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

Reply to
Wes

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

Reply to
Jim Wilkins

What's that Lassie? You say that Karl Townsend fell down the old rec.crafts.metalworking mine and will die if we don't mount a rescue by Sun, 6 Dec 2009 19:31:56 -0600:

You can make an analog-ish controller to do what you want.

I had good results using two small audio amplifiers as a servo drive to power a small gearmotor. For your project I would stick to relay control of the motor though. If you got two standard thermostats, and a few relays, I think you would have it.

Look at :

formatting link
for some ideas.

If you could rig a potentiometer with the curtain, then you could have proportional control. That is, the hotter it is, the more open the curtain is. With the right gain, it should hold temperature well.

Reply to
dan

formatting link

This place has some Basic Stamp kits for a pretty good discount.

formatting link
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

Reply to
RogerN

"Karl Townsend" wrote

If your goal is KISS, skip the PLC and try something like this:

formatting link
all the control logic is built in. the alarm can be used to revers the direction of the motor.

Lots of manufacturers out there with similar options.

Reply to
Stephen B.

I was thinking of an SSR like this:

formatting link
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:
formatting link
Karl

Reply to
Karl Townsend

formatting link

formatting link

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

Reply to
RogerN

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

Reply to
Karl Townsend

IIRC about all the controller can drive would be an LED, works with SSR's but would need a driver transistor for a 4PDT relay coil. I kinda like TIP120 transistors, something like 3A output capable with a current gain of at least 1000. A ~1K Ohm resistor, TIP120 NPN Darlington transistor and

1N4001 diode should make a nice relay drive... or a lower power SSR could do the job.

IIRC the Basic Stamp outputs can sink or source. I think they can handle a little more current sinking than sourcing, though it's been years since I played with them.

RogerN

Reply to
RogerN

"RogerN" fired this volley in news:d4mdnRlQdZusOoDWnZ2dnUVZ snipped-for-privacy@earthlink.com:

Roger, a decent PID algorithm accommodates changes in conditions, and "learns" the lead/lag characteristics of the system. Most of the even most-basic PID controllers (ready made) have that capability.

LLoyd

Reply to
Lloyd E. Sponenburgh

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.