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.
Revision 142:43026242815a, committed 2020-10-08
- Comitter:
- Lightvalve
- Date:
- Thu Oct 08 06:10:16 2020 +0000
- Parent:
- 141:4eb8790e7b78
- Child:
- 143:d441540d477e
- Commit message:
- 201008-4
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Oct 08 03:44:03 2020 +0000
+++ b/main.cpp Thu Oct 08 06:10:16 2020 +0000
@@ -1720,7 +1720,7 @@
}
}
float tau = 0.01f;
- float K_valve = 0.04f;
+ float K_valve = 0.0004f;
float x_v = 0.0f; //x_v : -1~1
if(value>=VALVE_CENTER) {
@@ -1740,11 +1740,10 @@
torq.err = torq.ref - torq.sen; //[N]
torq.err_sum += torq.err/(float) TMR_FREQ_5k; //[N]
- float k3 = 2000.0f;
- float k4 = 1000.0f;
- float rho3 = 2.0f;
-// float rho4 = 50000.0f;
- float rho4 = 100000.0f;
+ float k3 = 20000.0f; //2000
+ float k4 = 10.0f;
+ float rho3 = 3.2f;
+ float rho4 = 25000000.0f;
float x_4_des = (-f3 + torq_ref_dot - k3*(-torq.err))/(gamma_hat*g3_prime);
if (x_4_des > 1) x_4_des = 1;
else if (x_4_des < -1) x_4_des = -1;
@@ -1761,7 +1760,7 @@
V_out = (-f4 + x_4_des_dot - k4*(x_v-x_4_des)- rho3/rho4*gamma_hat*g3_prime*(-torq.err))/g4;
- float rho_gamma = 10000.0f;
+ float rho_gamma = 50000.0f;//5000
float gamma_hat_dot = rho3*(-torq.err)/rho_gamma*((-f3+torq_ref_dot-k3*(-torq.err))/gamma_hat + g3_prime*(x_v-x_4_des));
gamma_hat = gamma_hat + gamma_hat_dot / (float) TMR_FREQ_5k;
break;