Example #1
0
        private static PIDSettings[] GetPIDSettings()
        {
            PIDSettings pitchSettings = new PIDSettings
            {
                DerivativeGain   = 3.2F,
                IntegralGain     = 0F,
                ProportionalGain = -.5F,
                WindupLimit      = 2000F
            };

            PIDSettings rollSettings = new PIDSettings
            {
                DerivativeGain   = 3.2F,
                IntegralGain     = 0F,
                ProportionalGain = -.5F,
                WindupLimit      = 2000F
            };

            PIDSettings yawSettings = new PIDSettings
            {
                DerivativeGain   = 3.2F,
                IntegralGain     = 0F,
                ProportionalGain = -.5F,
                WindupLimit      = 2000F
            };

            return(new[] { pitchSettings, rollSettings, yawSettings });
        }
Example #2
0
        public SettingsController(Form gameForm)
        {
            if (gameForm == null)
            {
                throw new ArgumentNullException("gameForm");
            }

            _gameForm = gameForm;

            // Create a settings form to enable the user to change settings in-game
            _settingsForm = new SettingsForm();
            _pidSetups    = SimulatorResources.GetPIDSetups();
            _scenarios    = SimulatorResources.GetScenarios();

            if (_pidSetups == null || _pidSetups.Count == 0)
            {
                throw new Exception("No PID setups were found!");
            }

            CurrentPIDSetup = _pidSetups[0];

            _pidSettings    = _settingsForm.PIDSettings;
            _pidListUI      = _pidSettings.PIDSetup;
            _scenarioListUI = _settingsForm.SimSettings.Scenarios;

            _scenarioListUI.SelectedValueChanged += Scenarios_SelectedValueChanged;
            _pidListUI.SelectedValueChanged      += SelectedPIDChanged;

            _pidSettings.PIDChanged += PIDValuesChanged;

            Populate();
        }
Example #3
0
 public AxesController(PIDSettings pitchSettings, PIDSettings rollSettings, PIDSettings yawSettings, bool useWindup)
 {
     if (useWindup)
     {
         _pitchController = new PIDWindup(pitchSettings);
         _rollController = new PIDWindup(rollSettings);
         _yawController = new PIDWindup(yawSettings);
     }
     else
     {
         _pitchController = new ControlAlgorithms.Implementations.PID.PID(pitchSettings);
         _rollController = new ControlAlgorithms.Implementations.PID.PID(rollSettings);
         _yawController = new ControlAlgorithms.Implementations.PID.PID(yawSettings);
     }
     Axes = new AircraftPrincipalAxes(){Pitch = 0, Roll = 0, Yaw = 0};
 }
Example #4
0
  public ConvPID(double * aProcValue)
    : base(aProcValue) 
  {
    settings = new PIDSettings(/*external data*/);

    this.autoTuningInThread.Start(); 
  }
 public PID_Controller(PIDSettings settings)
 {
     _proportionalGain = settings.PGain;
     _integralGain     = settings.IntegralGain;
     _derivativeGain   = settings.DerivativeGain;
 }
Example #6
0
 public PID(PIDSettings settings)
 {
     Settings = settings;
 }
 public PIDRegulator(PIDSettings stgs, string regName)
 {
     settigs = stgs;
     reulatorName = regName;
 }
Example #8
0
 public PIDWindup(PIDSettings settings) : base(settings)
 {
 }
Example #9
0
 public PID(PIDSettings settings) : base(settings)
 {
 }