$               This information is provided by the
$                       Aptronix FuzzyNet
$                 http://www.aptronix.com/fuzzynet 
$                  email fuzzynet@aptronix.com 
$               Aptronix may also be reached by phone
$                       at 408-261-1898 or
$                       FAX at 408-490-2729
$
$
$ SPINDLE                                                                                                   }                            
$ disk drive spindle:  phase + tach control + delta phase (Demo4)
$ brian tremaine 15 Aug 1993 
$ revised 28 August 1993

fiu tvfi (min max) ;
 
>w_err "bits":-128()127  [
      Neg_Large (@-128,255, @-16,255, @-8,0),
      Neg_Med   (@-16,0,    @-8,255,  @0,0),
      Zero      (@-8,0,     @0,255,   @8,0),
      Pos_Med   (@0,0,      @8,255,   @16,0),
      Pos_Large (@8,0,      @16,255,  @127,255)
    ];
                               
>p_err "bits":-128()127  [
      Neg_Large (@-128,255, @-64,0),
      Neg_Med   (@-128,0,   @-64,255, @0,0),
      Zero      (@-64,0,    @0,255,   @64,0),
      Pos_Med   (@0,0,      @64,255,  @127,0),
      Pos_Large (@64,0,     @127,255)
    ];

>delta "bits":-128()127  [
      Neg_Large (@-128,255, @-8,0),
      Neg_Med   (@-128,0,   @-8,255,  @0,0),
      Zero      (@-8,0,     @0,255,   @8,0),
      Pos_Med   (@0,0,      @8,255,   @127,0),
      Pos_Large (@8,0,      @127,255)
    ];

< v_out "bits":  0()255* ( 
          Neg_Large =    0,    
          Neg_Med =     42, 
          Neg_Small =   85,    
          Zero =       128,
          Pos_Small =  170,
          Pos_Med =    212,
          Pos_Large =  255
        );  

$ rules start here:

if p_err is Neg_Large and w_err is Neg_Large then v_out is Neg_Large;
if p_err is Neg_Large and w_err is Neg_Med   then v_out is Neg_Large;
if p_err is Neg_Large and w_err is Zero      then v_out is Neg_Med;
if p_err is Neg_Large and w_err is Pos_Med   then v_out is Neg_Small;
if p_err is Neg_Large and w_err is Pos_Large then v_out is Pos_Med;

if p_err is Neg_Med and w_err is Neg_Large   then v_out is Neg_Large;
if p_err is Neg_Med and w_err is Neg_Med     then v_out is Neg_Large;
if p_err is Neg_Med and w_err is Zero        then v_out is Neg_Small;
if p_err is Neg_Med and w_err is Pos_Med     then v_out is Zero;
if p_err is Neg_Med and w_err is Pos_Large   then v_out is Pos_Med;

if p_err is Zero and w_err is Neg_Large      then v_out is Neg_Large;
if p_err is Zero and w_err is Neg_Med        then v_out is Neg_Small;
if p_err is Zero and w_err is Zero           then v_out is Zero;
if p_err is Zero and w_err is Pos_Med        then v_out is Pos_Small;
if p_err is Zero and w_err is Pos_Large      then v_out is Pos_Large;

if p_err is Pos_Med and w_err is Neg_Large   then v_out is Neg_Med;
if p_err is Pos_Med and w_err is Neg_Med     then v_out is Zero;
if p_err is Pos_Med and w_err is Zero        then v_out is Pos_Small;
if p_err is Pos_Med and w_err is Pos_Med     then v_out is Pos_Med;
if p_err is Pos_Med and w_err is Pos_Large   then v_out is Pos_Large;

if p_err is Pos_Large and w_err is Neg_Large then v_out is Neg_Small;
if p_err is Pos_Large and w_err is Neg_Med   then v_out is Pos_Small;
if p_err is Pos_Large and w_err is Zero      then v_out is Pos_Med;
if p_err is Pos_Large and w_err is Pos_Med   then v_out is Pos_Large;
if p_err is Pos_Large and w_err is Pos_Large then v_out is Pos_Large;


if delta is Neg_Large and w_err is Neg_Large then v_out is Neg_Large;
if delta is Neg_Med   and w_err is Neg_Large then v_out is Neg_Large;
if delta is Zero      and w_err is Neg_Large then v_out is Neg_Large;
if delta is Pos_Med   and w_err is Neg_Large then v_out is Neg_Med;
if delta is Pos_Large and w_err is Neg_Large then v_out is Neg_Small;

if delta is Neg_Large and w_err is Neg_Med then v_out is Neg_Large;
if delta is Neg_Med   and w_err is Neg_Med then v_out is Neg_Large;
if delta is Zero      and w_err is Neg_Med then v_out is Neg_Med;
if delta is Pos_Med   and w_err is Neg_Med then v_out is Neg_Small;
if delta is Pos_Large and w_err is Neg_Med then v_out is Zero;

if delta is Neg_Large and w_err is Zero then v_out is Neg_Med;
if delta is Neg_Med   and w_err is Zero then v_out is Neg_Small;
if delta is Zero      and w_err is Zero then v_out is Zero;
if delta is Pos_Med   and w_err is Zero then v_out is Pos_Small;
if delta is Pos_Large and w_err is Zero then v_out is Pos_Med;

if delta is Neg_Large and w_err is Pos_Med then v_out is Neg_Small;
if delta is Neg_Med   and w_err is Pos_Med then v_out is Zero;
if delta is Zero      and w_err is Pos_Med then v_out is Pos_Small;
if delta is Pos_Med   and w_err is Pos_Med then v_out is Pos_Med;
if delta is Pos_Large and w_err is Pos_Med then v_out is Pos_Large;

if delta is Neg_Large and w_err is Pos_Large then v_out is Pos_Small;
if delta is Neg_Med   and w_err is Pos_Large then v_out is Pos_Med;
if delta is Zero      and w_err is Pos_Large then v_out is Pos_Large;
if delta is Pos_Med   and w_err is Pos_Large then v_out is Pos_Large;
if delta is Pos_Large and w_err is Pos_Large then v_out is Pos_Large
end