![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
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:
- 66:d1ab5904f8e5
- Parent:
- 62:6c566e6f9664
- Child:
- 68:21cb054f1399
--- a/actuators.cpp Wed Oct 14 13:52:16 2015 +0200 +++ b/actuators.cpp Thu Oct 15 16:06:35 2015 +0200 @@ -30,8 +30,8 @@ double Ki1 = 0; double Kd1 = 0; - double Kp2 = 1; - double Ki2 = 0; + double Kp2 = 0.0184; + double Ki2 = 0.32; double Kd2 = 0; double motor1PrevPos = 0; @@ -92,7 +92,7 @@ // check if motor's are within rotational boundarys // get encoder speeds in deg/sec - now = t.read(); + now = t.read(); timechange = (now - prevTime); motor1Speed = -((((encoder1.getPosition() - motor1PrevPos)/32)/131.25)*360)/timechange; motor2Speed = -((((encoder2.getPosition() - motor2PrevPos)/32)/131.25)*360)/timechange;