control for robotic arm that can play chess using a granular gripper
Dependencies: Encoder mbed HIDScope Servo MODSERIAL
Fork of chessRobot by
Diff: actuators.cpp
- Revision:
- 101:b821e89fc108
- Parent:
- 100:222c27f55b85
- Child:
- 102:b3ab436fbe8e
--- a/actuators.cpp Thu Oct 22 08:51:50 2015 +0000 +++ b/actuators.cpp Thu Oct 22 09:34:31 2015 +0000 @@ -31,8 +31,8 @@ double motor2PWM = 0; // Set PID values - double Kp1 = 1; - double Ki1 = 0; + double Kp1 = 0.008; + double Ki1 = 0.08; double Kd1 = 0; double Kp2 = 0.008; @@ -119,10 +119,9 @@ void motorControl(){ // EMG signals to motor speeds - const double scaleVel = 20; - motor1SetSpeed = x_velocity*scaleVel; - motor2SetSpeed = y_velocity*scaleVel; - servoSpeed = z_velocity*scaleVel; + motor1SetSpeed = x_velocity*2; + motor2SetSpeed = y_velocity*20; + servoSpeed = z_velocity*20; // get encoder positions in degrees // 131.25:1 gear ratio