Skip to content

Commit cbc0be1

Browse files
authored
BLDCMotor typo angle instead of velocity
1 parent df5f6de commit cbc0be1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/BLDCMotor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void BLDCMotor::move(float new_target) {
419419
shaft_angle_sp = target;
420420
// calculate velocity set point
421421
shaft_velocity_sp = feed_forward_velocity + P_angle( shaft_angle_sp - shaft_angle );
422-
shaft_angle_sp = _constrain(shaft_angle_sp,-velocity_limit, velocity_limit);
422+
shaft_velocity_sp = _constrain(shaft_velocity_sp,-velocity_limit, velocity_limit);
423423
// calculate the torque command - sensor precision: this calculation is ok, but based on bad value from previous calculation
424424
current_sp = PID_velocity(shaft_velocity_sp - shaft_velocity); // if voltage torque control
425425
// if torque controlled through voltage

0 commit comments

Comments
 (0)