Skip to content

Commit 1df9470

Browse files
authored
StepperMotor typo, angle instead velocity
1 parent cbc0be1 commit 1df9470

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/StepperMotor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void StepperMotor::move(float new_target) {
308308
shaft_angle_sp = target;
309309
// calculate velocity set point
310310
shaft_velocity_sp = feed_forward_velocity + P_angle( shaft_angle_sp - shaft_angle );
311-
shaft_angle_sp = _constrain(shaft_angle_sp, -velocity_limit, velocity_limit);
311+
shaft_velocity_sp = _constrain(shaft_velocity_sp, -velocity_limit, velocity_limit);
312312
// calculate the torque command
313313
current_sp = PID_velocity(shaft_velocity_sp - shaft_velocity); // if voltage torque control
314314
// if torque controlled through voltage
@@ -440,4 +440,4 @@ float StepperMotor::angleOpenloop(float target_angle){
440440
open_loop_timestamp = now_us;
441441

442442
return Uq;
443-
}
443+
}

0 commit comments

Comments
 (0)