"FUZZY LOGIC" The alternative general purpose solution was running out table memory. A non-linear fuzzy logic solution is flexible and requires few lines of code even for the general solution. Even in the general case it can avoid the need for floating point or for that matter signed int's. FUZZY pid { IF Error IS LNegative THEN ManVar IS LPositive IF Error IS LPositive THEN ManVar IS LNegative IF Error IS normal AND DeltaError IS Positive THEN ManVar IS SNegative IF Error IS normal AND DeltaError IS Negative THEN ManVar IS SPositive IF Error IS close AND SumError IS LPos THEN ManVar IS SNegative IF Error IS close AND SumError IS LNeg THEN ManVar IS SPositive } w.. :) Michael Park wrote: > Stop beating about the bush and just come out and say it: FUZZY LOGIC! > :) > > >Another approach that has been used in problems like this is to create > >linguistic variables based on the the input crisp numbers and then define > >rules that manipulate the linguistic variables. The biggest advantage if > >you are using a PIC is all of the > >area's of interest are normalized to a common data type that depends on the > >resolution requirements of the outputs usually a byte or word sized. A PID > >controller implemented with this approach is capable of handling non linear > >systems and requires about a > >half dozen rules and half a K of code. > > > >w.. > > > >Denny Esterline wrote: > > > > > Like I said before, the math is complex and unspecified. A large part of > > > this project is developing a reasonable way for non-software folks to > > > interract with that math. That particular aspect needs to be alot > >further > > > along before I build any hardware. > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist