You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (leg->Mean_Torque_90P*leg->Setpoint_Ankle*leg->coef_in_3_steps <= 0) {
40
40
// if the sign are not concord, no auto update of KF
41
-
// Serial.println("Signals not concord");
41
+
// Serial.println("Signals not concord");
42
42
leg->auto_KF_update= false; //added after test of 11/7/18
43
43
return;
44
44
}
45
45
46
46
if ( abs((leg->Mean_Torque_90P- (leg->Setpoint_Ankle*leg->coef_in_3_steps)) / (leg->Setpoint_Ankle*leg->coef_in_3_steps)) <0.01) {
47
-
// Serial.println("Stop Auto KF");
47
+
// Serial.println("Stop Auto KF");
48
48
leg->auto_KF_update= false; //added after test of 11/7/18
49
49
return;
50
50
}// if the error is less than 1% no need to change KF
51
51
52
52
if (leg->coef_in_3_steps>0) {
53
-
leg->ERR=leg->ERR+ (leg->Mean_Torque_90P- (leg->Setpoint_Ankle*leg->coef_in_3_steps))/(leg->Setpoint_Ankle*leg->coef_in_3_steps); //Calculate a running sum of the relative error
53
+
leg->ERR=leg->ERR+ (leg->Mean_Torque_90P- (leg->Setpoint_Ankle*leg->coef_in_3_steps)) / (leg->Setpoint_Ankle*leg->coef_in_3_steps); //Calculate a running sum of the relative error
54
54
leg->KF=leg->KF- ((leg->Mean_Torque_90P- (leg->Setpoint_Ankle*leg->coef_in_3_steps)) / (leg->Setpoint_Ankle*leg->coef_in_3_steps) *0.6+leg->ERR*0.01); //changed from 0.4 to 0.6 after test of 11/7/18
55
55
}
56
56
57
57
ifisnan(leg->KF) {
58
-
leg->KF=1;
58
+
leg->KF=1;
59
59
}
60
-
61
-
// Serial.print("Setpoint Ankle");
62
-
// Serial.print(leg->Setpoint_Ankle);
63
-
// Serial.print("coeff");
64
-
// Serial.print(leg->coef_in_3_steps);
65
-
// Serial.print("Desired leg->KF ");
66
-
// Serial.println(leg->KF);
60
+
61
+
// Serial.print("Setpoint Ankle");
62
+
// Serial.print(leg->Setpoint_Ankle);
63
+
// Serial.print("coeff");
64
+
// Serial.print(leg->coef_in_3_steps);
65
+
// Serial.print("Desired leg->KF ");
66
+
// Serial.println(leg->KF);
67
67
68
68
if (leg->KF >= leg->max_KF) {
69
69
leg->KF=leg->max_KF;
@@ -76,8 +76,8 @@ void Auto_KF(Leg* leg) {
76
76
leg->Mean_Torque_90P=0;
77
77
leg->Torque_Sum_90P=0;
78
78
leg->count_err=0;
79
-
// Serial.print("Actual leg->KF ");
80
-
// Serial.println(leg->KF);
79
+
// Serial.print("Actual leg->KF ");
80
+
// Serial.println(leg->KF);
81
81
leg->auto_KF_update= false; // to be able to do this cycle just once every step, i.e. during the whole state 1 I have to execute this cycle just once
// Steady_multiplier Dynamic_multiplier to increase or decrease the sentitivitiness of the control to the baseline, it works as a gain that allows to engage the max torque earlier or later.
115
-
// in other words change the reference dimension of the estimated convex hull
114
+
// Steady_multiplier Dynamic_multiplier to increase or decrease the sentitivitiness of the control to the baseline, it works as a gain that allows to engage the max torque earlier or later.
115
+
// in other words change the reference dimension of the estimated convex hull
0 commit comments