|
@@ -768,7 +768,7 @@ static void crosszero_step_towards(float *value, float target) {
|
|
|
float high_ramp_torque = CONFIG_RAMP_SECOND_TARGET;
|
|
float high_ramp_torque = CONFIG_RAMP_SECOND_TARGET;
|
|
|
if (target > 0) {
|
|
if (target > 0) {
|
|
|
if (v_now < -RAMPE_1) {
|
|
if (v_now < -RAMPE_1) {
|
|
|
- step_towards(value, -RAMPE_1, NORMAL_STEP);
|
|
|
|
|
|
|
+ step_towards(value, -RAMPE_1 + 0.001f, NORMAL_STEP);
|
|
|
cross_zero = true;
|
|
cross_zero = true;
|
|
|
}else if (v_now >= -RAMPE_1 && v_now <= high_ramp_torque) {
|
|
}else if (v_now >= -RAMPE_1 && v_now <= high_ramp_torque) {
|
|
|
step_towards(value, target, 0.03f);
|
|
step_towards(value, target, 0.03f);
|
|
@@ -776,7 +776,7 @@ static void crosszero_step_towards(float *value, float target) {
|
|
|
}
|
|
}
|
|
|
}else if (target == 0) {
|
|
}else if (target == 0) {
|
|
|
if (v_now > high_ramp_torque) {
|
|
if (v_now > high_ramp_torque) {
|
|
|
- step_towards(value, high_ramp_torque, NORMAL_STEP);
|
|
|
|
|
|
|
+ step_towards(value, high_ramp_torque - 0.001f, NORMAL_STEP);
|
|
|
cross_zero = true;
|
|
cross_zero = true;
|
|
|
}else if (v_now >= RAMPE_1 && v_now <= high_ramp_torque) {
|
|
}else if (v_now >= RAMPE_1 && v_now <= high_ramp_torque) {
|
|
|
step_towards(value, target, 0.03f);
|
|
step_towards(value, target, 0.03f);
|
|
@@ -784,7 +784,7 @@ static void crosszero_step_towards(float *value, float target) {
|
|
|
}
|
|
}
|
|
|
}else {
|
|
}else {
|
|
|
if (v_now > high_ramp_torque) {
|
|
if (v_now > high_ramp_torque) {
|
|
|
- step_towards(value, high_ramp_torque, NORMAL_STEP);
|
|
|
|
|
|
|
+ step_towards(value, high_ramp_torque - 0.001f, NORMAL_STEP);
|
|
|
cross_zero = true;
|
|
cross_zero = true;
|
|
|
}else if (v_now >= -RAMPE_1 && v_now <= high_ramp_torque) {
|
|
}else if (v_now >= -RAMPE_1 && v_now <= high_ramp_torque) {
|
|
|
step_towards(value, target, 0.03f);
|
|
step_towards(value, target, 0.03f);
|