Пример #1
0
        // set control para
        private void button5_Click(object sender, EventArgs e)
        {
            MotorPara.maxCurrent = Convert.ToUInt16(textBox17.Text);
            MotorPara.maxDegree  = Convert.ToByte(textBox14.Text);

            if (checkBox1.Checked)
            {
                MotorPara.reversse = 1;
            }
            else
            {
                MotorPara.reversse = 0;
            }

            if (checkBox2.Checked)
            {
                MotorPara.run2zero = 1;
            }
            else
            {
                MotorPara.run2zero = 0;
            }

            CommProtocol.SendCmd(CommProtocol.CMD_SET_CONTROL_PARA);
        }
Пример #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     MotorPara.Kp  = Convert.ToUInt16(textBox1.Text);
     MotorPara.Ki  = Convert.ToUInt16(textBox5.Text);
     MotorPara.Ke1 = Convert.ToUInt16(textBox8.Text);
     MotorPara.Ke2 = Convert.ToUInt16(textBox11.Text);
     CommProtocol.SendCmd(CommProtocol.CMD_SET_PID_PARA);
 }
Пример #3
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (comm.IsOpen)
            {
                CommProtocol.SendCmd(CommProtocol.CMD_SET_RESET_MCU);
            }

            Delay(500);

            comm.Close();

            this.Close();
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            MotorPara.traceMode = CommProtocol.TRACE_MODE_NONE;
            if (radioButton4.Checked)
            {
                MotorPara.traceMode = CommProtocol.TRACE_MODE_PC;
            }
            else if (radioButton5.Checked)
            {
                MotorPara.traceMode = CommProtocol.TRACE_MODE_LOG;
            }
            else if (radioButton3.Checked)
            {
                MotorPara.traceMode = CommProtocol.TRACE_MODE_NONE;
            }

            CommProtocol.SendCmd(CommProtocol.CMD_SET_TRACE_MODE);
        }
Пример #5
0
 private void button6_Click(object sender, EventArgs e)
 {
     CommProtocol.SendCmd(CommProtocol.CMD_SET_ZERO_ANGLE);
 }