Skip to content

Commit

Permalink
knob: Adjust velocity PID params for SPRING and DAMPED mode
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Jan 17, 2023
1 parent f473a79 commit e1a44af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/drivers/sensor/knob/knob.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ void knob_set_mode(const struct device *dev, enum knob_mode mode)
motor_set_enable(config->motor, true);
motor_set_torque_limit(config->motor, 1.5f);
mc->mode = ANGLE;
motor_set_velocity_pid(config->motor, 0.1f, 0.0f, 0.0f);
motor_set_velocity_pid(config->motor, 0.05f, 0.0f, 0.0f);
motor_set_angle_pid(config->motor, 100.0f, 0.0f, 3.5f);
mc->target = 4.2f;
} break;
case KNOB_DAMPED: {
motor_set_enable(config->motor, true);
motor_set_torque_limit(config->motor, 1.5f);
mc->mode = VELOCITY;
motor_set_velocity_pid(config->motor, 0.1f, 0.0f, 0.0f);
motor_set_velocity_pid(config->motor, 0.05f, 0.0f, 0.0f);
mc->target = 0.0f;
} break;
case KNOB_SPIN: {
Expand Down

0 comments on commit e1a44af

Please sign in to comment.