|
|
@@ -117,6 +117,7 @@ static void eRamp_set_step_target(e_Ramp *ramp, float c, u32 intval) {
|
|
|
eRamp_set_step(ramp, step_val);
|
|
|
}
|
|
|
|
|
|
+extern float PMSM_FOC_GetSpeed(void);
|
|
|
static void eRamp_X2_running(e_Ramp *r) {
|
|
|
#if 1
|
|
|
float target = r->target;
|
|
|
@@ -124,7 +125,11 @@ static void eRamp_X2_running(e_Ramp *r) {
|
|
|
bool cross_zero = false;
|
|
|
if (target > 0) {
|
|
|
if (v_now >= -CONFIG_RAMP_SECOND_TARGET && v_now <= CONFIG_RAMP_SECOND_TARGET * 1.5f) {
|
|
|
- step_towards(&r->interpolation, target, 0.04f);
|
|
|
+ if (PMSM_FOC_GetSpeed() <= 20.0f) {
|
|
|
+ step_towards(&r->interpolation, target, 0.02f);
|
|
|
+ }else {
|
|
|
+ step_towards(&r->interpolation, target, 0.04f);
|
|
|
+ }
|
|
|
cross_zero = true;
|
|
|
}
|
|
|
}else if (target == 0) {
|