Kristian Lauszus
/
BalancingRobotPS3
Code for my balancing robot, controlled with a PS3 controller via bluetooth
Diff: BalancingRobot.h
- Revision:
- 7:f1d24c6119ac
- Parent:
- 5:fc6c7a059759
- Child:
- 8:87dd9d5f7001
diff -r defe36ce2346 -r f1d24c6119ac BalancingRobot.h --- a/BalancingRobot.h Tue Mar 06 22:38:41 2012 +0000 +++ b/BalancingRobot.h Mon Apr 09 21:40:47 2012 +0000 @@ -46,7 +46,7 @@ /* PID variables */ double Kp = 8; //11 - 7 -double Ki = 2; //2 +double Ki = 2; //1 double Kd = 9; //12 double targetAngle = 90; @@ -86,7 +86,7 @@ double targetOffset = 0; -uint8_t loopCounter = 0; // Used for wheel velocity +uint8_t loopCounter = 0; // Used for wheel velocity and battery voltage long wheelPosition; long lastWheelPosition; long wheelVelocity;