Exemplo n.º 1
0
        public DehydratorController(AnalogTemperature tempSensor, SoftPwm heater, Relay fan, ITextDisplay display)
        {
            _tempSensor     = tempSensor;
            _heaterRelayPwm = heater;
            _fanRelay       = fan;
            _display        = display;

            _pidController = new StandardPidController();
            _pidController.ProportionalComponent   = .5f;  // proportional
            _pidController.IntegralComponent       = .55f; // integral time minutes
            _pidController.DerivativeComponent     = 0f;   // derivative time in minutes
            _pidController.OutputMin               = 0.0f; // 0% power minimum
            _pidController.OutputMax               = 1.0f; // 100% power max
            _pidController.OutputTuningInformation = false;
        }
        public TemperatureController(SoftPwm heatLampRelay, AnalogTemperature tempSensor)
        {
            // store references to the peripherals
            _heatLampRelay = heatLampRelay;
            _tempSensor    = tempSensor;

            // configure our PID controller
            _pidController = new StandardPidController();
            _pidController.ProportionalComponent   = .5f;  // proportional
            _pidController.IntegralComponent       = .55f; // integral time minutes
            _pidController.DerivativeComponent     = 0f;   // derivative time in minutes
            _pidController.OutputMin               = 0.0f; // 0% power minimum
            _pidController.OutputMax               = 1.0f; // 100% power max
            _pidController.OutputTuningInformation = true;
        }