Thread: PLC?
View Single Post
  #62   Report Post  
Posted to rec.crafts.metalworking
Tim Wescott Tim Wescott is offline
external usenet poster
 
Posts: 1,620
Default PLC?

On Wed, 09 Dec 2009 00:53:28 -0600, cavelamb wrote:

Tim Wescott wrote:
On Tue, 08 Dec 2009 21:08:33 -0600, RogerN wrote:

"Lloyd E. Sponenburgh" lloydspinsidemindspring.com wrote in message
. 3.70...
"RogerN" fired this volley in
m:

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.


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
It's been a while since I messed with my Basic Stamp but IIRC they
used 8 bit integer math. My Basic Stamp 1 had only about 16 bytes
ram, I'm not sure that would do a PID control, maybe. I think the BS2
has about twice that amount of ram. I'm not to great at working with
integer math, especially 8 bit.

RogerN


Ouch. That's pretty restrictive. You'd need at least 16 bits to do
PID in this sort of thing, and mo is better.



'splain why?

The timing is closer to hours than milliseconds. A real time interrupt
(external 555?) for the long delay?

8 bits of temperature is 256 value spread.

The AtoD function can be external hardware, or an external mux if an
internal AtoD is there. One bit to select from two sources, two bits
for 4.

Motor control is one bit for direction, one for Go. An eight bit count
for run time to position the vent.



Too much bloatware in the world today.

What we need are more Assembly Programmers!


Because that's what you always end up needing, that's why!

If you are really using an integrator, either for the integrator or (more
likely) because you're band-limiting the differentiator, then you need
more bits to store the state than you have bits in the input. If you use
an 8-bit number for temperature, you need more bits for the state -- and
in an 8-bit processor, "more than 8" is 16.

Be glad -- many applications I end up doing need more than 16, in
assembly this means you have to decide between 24 and 32.

You may be able to do this effectively with Karl's original algorithm,
which will work fine with 8-bit math. But the advantage of a PID-type
controller is that (if everything comes together) you can maintain a much
more constant temperature inside the greenhouses instead of the constant
up/down you'd get from a hysteresis controller cycling all the time.

--
www.wescottdesign.com