code: function PIDController(options)
  {
      // Options configuration
      this.opts       = {
          Kp         : 1.0,
          Ki         : 0.0,
          Kd         : 0.0,
          round      : true,
          Ts         : 1000,  // In MS. (Old sampleTime)
          uMin       : 0,
          uMax       : 255
      };
  
      options         = options || {};
      this.opts       = extend({}, this.opts, options);
  
      // Internal Use variables
      this.input           = function ()
      {
          // Function (Reading from sensor)
          this.setIVal(0);
      };
  
      this.direction       = 0;     // 0 = forward, 1 = drop down to and go forward, 3 = reverse
      this.duration        = 1;     // In seconds (How long to run - 0 = infinite)
  
      this.output          = function (val)
      {
          // Function (Writing to device)
          return val;
      };
  
      this.e          = [0.00, 0.00];
      this.PV         = [0.00, 0.00, 0.00];
      this.CO         = [0.00, 0.00];
      this.interval   = 0;
      this.iVal       = 0;
      this.running    = false;
      this.startTime  = 0;
      this.duration   = 0;
      this.SP         = 0;
      this.t1         = 0;
      this.timeLeft   = 0;
      this.tReached   = false;
  
      EventEmitter.call(this);
  }
docs: Based on:
  http://www.regnumelectronic.com/Docs/PID.pdf (Standard Independent Type C)