Пример #1
0
        public RoverComputer(FlightComputer fc, double kp, double ki, double kd)
        {
            throttlePID = new PIDLoop(1, 0, 0);
            steerPID    = new PIDLoop(1, 0, 0);

            pidController = fc.PIDController; //don't think of putting second copy of PID here
            this.Kp       = kp;
            this.Ki       = ki;
            this.Kd       = kd;
        }
Пример #2
0
        public PIDController(double kp, double ki, double kd, double maxoutput = double.MaxValue, double minoutput = double.MinValue, bool extraUnwind = false)
        {
            Vessel           = null;
            Target           = new Quaternion();
            RollControlRange = 5.0 * Mathf.Deg2Rad;

            //Use http://www.ni.com/white-paper/3782/en/ to fine-tune
            pitchRatePI = new PIDLoop(kp, ki, kd, maxoutput, minoutput, extraUnwind);
            yawRatePI   = new PIDLoop(kp, ki, kd, maxoutput, minoutput, extraUnwind);
            rollRatePI  = new PIDLoop(kp, ki, kd, maxoutput, minoutput, extraUnwind);

            pitchPI = new TorquePI();
            yawPI   = new TorquePI();
            rollPI  = new TorquePI();

            Reset();
        }
Пример #3
0
 public TorquePI()
 {
     Loop         = new PIDLoop();
     Ts           = 2;
     TorqueAdjust = new MovingAverage();
 }