public ControladorPrincipal()
        {
            InitializeComponent();

            this.iniciado = false;

            this.serialPort1 = new SerialPort();
            this.serialPort1.DataReceived += this.serialPort1_DataReceived;

            this.pid = new PID(0, 0, 180, 10, 0.5F, 1, PID.MovementDirection.Direct);
            this.pid.SetOutputLimits (-100, 100);
            this.pid.Mode = PID.OperationMode.Auto;

            this.penduloVO = new PenduloVO();
        }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();

            this.portas.DataSource = SerialPort.GetPortNames();

            this.serialPort1 = new SerialPort();
            this.serialPort1.DataReceived += this.serialPort1_DataReceived;

            this.pid = new PID(0, 0, -135, 10, 5F, 1F, PID.MovementDirection.Direct);
            //this.pid = new PID(0, 0, -135, 1.3F, 2F, 1.2F, PID.MovementDirection.Direct);
            //this.pid = new PID(0, 0, -145, 2.5F, 5F, 0.8F, PID.MovementDirection.Direct);
            this.pid.SetOutputLimits(-200, 200);
            this.pid.Mode = PID.OperationMode.Auto;

            this.penduloVO = new PenduloVO();

            this.log.Multiline = true;
            this.log.WordWrap = true;

            this.sinal = 1;
            this.velocidade = 200;
        }