Example #1
0
 public void StartServoProfile(ETcServoMode inputMode, ETcServoMode outputMode)
 {
     lock (cmdLock)
     {
         cmd.CData.Command = (int)ETcMainCmd.StartServoProfile;
         cmd.CData.Iarg1   = (int)inputMode;
         cmd.CData.Iarg2   = (int)outputMode;
         SendBlocking(1000);
     }
 }
Example #2
0
        // Set PID parameter
        // axis : Servo axis number
        // mode  : Servo PID control mode 0-Torque 1-Speed 2-Position
        // kp    : Propotional factor(%)
        // ki    : Integral factor(msec)
        // kd    : Differencial factor(msec)
        // tv    : Velocity compensation
        // tf    : Friction
        // ti    : Rotor inertia
        // min   : Minimum output value
        // max   : Maximum output value
        public void SetParamServoPID(ETcServoAxis axis, ETcServoMode mode, bool closeLoop, double kp, double ki,
                                     double kd, double ka, double tv, double tf, double ti, double min, double max)
        {
            string sPid = string.Format(".gv.Axis[{0}].pidParam[{1}].", (int)axis, (int)mode);

            TcComm.WriteBool(sPid + "closeLoop", closeLoop, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Kp", (float)kp, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Ki", (float)ki, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Kd", (float)kd, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Ka", (float)ka, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Tv", (float)tv, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Tf", (float)tf, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "Ti", (float)ti, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "value.minValue", (float)min, ETcRunTime.RT1);
            TcComm.WriteReal(sPid + "value.maxValue", (float)max, ETcRunTime.RT1);
        }