self-balancing-robot
Dependencies: mbed mbed-rtos Motor
Diff: main.cpp
- Revision:
- 37:702943705f50
- Parent:
- 36:e1bbf24a1b66
- Child:
- 38:88be2aed48ba
--- a/main.cpp Fri Apr 24 19:56:04 2020 +0000 +++ b/main.cpp Fri Apr 24 19:57:25 2020 +0000 @@ -24,7 +24,7 @@ ///////////////////////////// Control System Variables///////////////////////// /////////////////////////////////////////////////////////////////////////////// float rp = 30; -float rd = 30; +float rd = 10; float ri = 30; float desired_angle = 0; @@ -159,7 +159,7 @@ get_current_angle(); angleMutex.lock(); - speed = -1*(rp*pAngle + ri*iAngle + rd*dAngle)/(70 * 150 * 3); + speed = -1*(rp*pAngle + ri*iAngle + rd*dAngle)/(70 * 150 * 2); set_wheel_speed(speed); angleMutex.unlock();