Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: QEI mbed-rtos mbed
Diff: main.cpp
- Revision:
- 11:7e19e51b325d
- Parent:
- 10:d14c702c1992
- Child:
- 12:d09b8ffa176f
--- a/main.cpp Wed Dec 04 04:11:41 2013 +0000 +++ b/main.cpp Wed Dec 04 04:19:30 2013 +0000 @@ -43,7 +43,8 @@ //Controller gains - Full-state Feedback //float k1 = -0.0316, k2 = 9.7076, k3 = -0.4095, k4 = 1.2340, k5 = 0.0410; -float k1 = -0.3162, k2 = 18.278, k3 = -0.8964, k4 = 2.4441, k5 = 0.1843; +//float k1 = -0.3162, k2 = 18.278, k3 = -0.8964, k4 = 2.4441, k5 = 0.1843; +float k1 = -0.1000 , k2 = 12.0293, k3 = -0.5357, k4 = 1.5522, k5 = 0.1684; float encoder_conv = 2*OUR_PI/(float(ENCODER_PPR)*float(ENC_QUADRATURE_TYPE)); float motor_conv = 2*OUR_PI/(float(MOTOR_PPR)*float(MOT_QUADRATURE_TYPE)); @@ -176,7 +177,8 @@ if (cos(theta2) < 0.96) { flag = 1; currentEnergy = calcEnergy(); - inputVoltage = -2.3*dtheta2*(0.0372 - currentEnergy); + inputVoltage = -2.3*dtheta2*(0.0372 - currentEnergy); + inputVoltage = 0.0; } else { flag = 1;