Skip to content

angle control Back and forth #3

Description

@Meekdai

Hi @askuric ,
Today I tested your angle control code. I found it has two issues.

  1. I adjust the motor.P_angle.K value to allow the motor to start running smoothly, But it will always oscillate back and forth between target values. the log:
-0.10   10000.00        9999.98
-0.14   10000.00        9999.98
-0.18   10000.00        9999.98
-0.21   10000.00        9999.98
-0.25   10000.00        9999.98
-0.28   10000.00        9999.98
-0.25   10000.00        9999.97
-0.21   10000.00        9999.97
-0.17   10000.00        9999.97
-0.14   10000.00        9999.97
-0.10   10000.00        9999.97
-0.07   10000.00        9999.96
-0.03   10000.00        9999.96
0.00    10000.00        9999.96
0.04    10000.00        9999.96
0.07    10000.00        9999.96
0.11    10000.00        9999.96
0.14    10000.00        9999.96
0.18    10000.00        9999.96
0.22    10000.00        9999.96
0.25    10000.00        9999.96
0.29    10000.00        9999.96
0.32    10000.00        9999.96
0.28    10000.00        9999.97
0.25    10000.00        9999.97
0.21    10000.00        9999.98
0.18    10000.00        9999.98
0.14    10000.00        10000.00
0.11    10000.00        10000.00
0.07    10000.00        10000.01
0.03    10000.00        10000.01
-0.00   10000.00        10000.01
-0.04   10000.00        10000.01
-0.08   10000.00        10000.01
-0.11   10000.00        10000.01
-0.15   10000.00        10000.01
-0.18   10000.00        10000.01
-0.22   10000.00        10000.01
-0.26   10000.00        10000.01
-0.29   10000.00        10000.01
-0.33   10000.00        10000.01
-0.37   10000.00        10000.01
-0.33   10000.00        10000.00
-0.29   10000.00        10000.00
-0.25   10000.00        9999.98
-0.22   10000.00        9999.97
-0.18   10000.00        9999.96
-0.14   10000.00        9999.95
-0.10   10000.00        9999.94
-0.07   10000.00        9999.92
-0.03   10000.00        9999.92
0.00    10000.00        9999.92
-0.03   10000.00        9999.91
0.00    10000.00        9999.91
0.04    10000.00        9999.91
0.07    10000.00        9999.91
0.11    10000.00        9999.91
0.14    10000.00        9999.91
0.18    10000.00        9999.91
0.21    10000.00        9999.91
0.25    10000.00        9999.91
0.28    10000.00        9999.91
0.32    10000.00        9999.91
0.28    10000.00        9999.92
0.25    10000.00        9999.92
0.21    10000.00        9999.94
0.17    10000.00        9999.94
0.14    10000.00        9999.95
0.10    10000.00        9999.95
0.07    10000.00        9999.96
0.03    10000.00        9999.96
-0.00   10000.00        9999.96
-0.04   10000.00        9999.97
-0.07   10000.00        9999.97
-0.11   10000.00        9999.97
-0.15   10000.00        9999.97
-0.18   10000.00        9999.97
-0.15   10000.00        9999.96
-0.11   10000.00        9999.96
-0.08   10000.00        9999.96
-0.04   10000.00        9999.96
-0.01   10000.00        9999.96
0.03    10000.00        9999.96
0.06    10000.00        9999.96
0.10    10000.00        9999.96
0.14    10000.00        9999.96
0.17    10000.00        9999.96
0.21    10000.00        9999.96
0.24    10000.00        9999.96
0.20    10000.00        9999.97
-0.36   10000.00        9999.97
-0.32   10000.00        9999.96
-0.28   10000.00        9999.96
-0.25   10000.00        9999.95
-0.21   10000.00        9999.94
-0.17   10000.00        9999.92
-0.13   10000.00        9999.91
-0.10   10000.00        9999.91
-0.06   10000.00        9999.90
-0.02   10000.00        9999.89
0.01    10000.00        9999.89
-0.03   10000.00        9999.87
0.29    10000.00        9999.87
0.32    10000.00        9999.87
0.29    10000.00        9999.89
0.26    10000.00        9999.89
0.22    10000.00        9999.90
0.19    10000.00        9999.91
0.15    10000.00        9999.91
0.11    10000.00        9999.92
0.08    10000.00        9999.92
0.12    10000.00        9999.94
0.08    10000.00        9999.94
0.05    10000.00        9999.94
0.08    10000.00        9999.95
-0.30   10000.00        9999.95
-0.27   10000.00        9999.94
-0.23   10000.00        9999.94
-0.20   10000.00        9999.94
-0.16   10000.00        9999.92
-0.12   10000.00        9999.92
-0.09   10000.00        9999.92
-0.05   10000.00        9999.91
0.27    10000.00        9999.91
0.23    10000.00        9999.92
0.19    10000.00        9999.92
0.16    10000.00        9999.92
0.12    10000.00        9999.92
0.09    10000.00        9999.92
0.05    10000.00        9999.92
0.02    10000.00        9999.94
-0.02   10000.00        9999.94
-0.05   10000.00        9999.94
-0.09   10000.00        9999.94
-0.12   10000.00        9999.94
-0.16   10000.00        9999.94
-0.19   10000.00        9999.94
-0.23   10000.00        9999.94
-0.20   10000.00        9999.92
-0.16   10000.00        9999.92
-0.12   10000.00        9999.92
-0.09   10000.00        9999.92
-0.05   10000.00        9999.92
-0.02   10000.00        9999.92
0.02    10000.00        9999.92
0.05    10000.00        9999.92
0.09    10000.00        9999.92
0.12    10000.00        9999.92
0.16    10000.00        9999.92
0.19    10000.00        9999.92
0.23    10000.00        9999.92
0.26    10000.00        9999.92
0.30    10000.00        9999.92
0.26    10000.00        9999.94
0.24    10000.00        9999.94
0.21    10000.00        9999.94
0.18    10000.00        9999.95
0.14    10000.00        9999.95
-0.39   10000.00        9999.96
-0.35   10000.00        9999.95
-0.31   10000.00        9999.95
-0.28   10000.00        9999.94
-0.24   10000.00        9999.92
-0.20   10000.00        9999.90
-0.24   10000.00        9999.89
-0.20   10000.00        9999.87
-0.16   10000.00        9999.86
-0.13   10000.00        9999.85
-0.09   10000.00        9999.84
-0.05   10000.00        9999.82
-0.02   10000.00        9999.82
-0.06   10000.00        9999.81
0.33    10000.00        9999.81
0.36    10000.00        9999.81
0.40    10000.00        9999.82
0.43    10000.00        9999.82
0.40    10000.00        9999.84
0.36    10000.00        9999.85
0.32    10000.00        9999.86
0.29    10000.00        9999.89
0.25    10000.00        9999.91
0.21    10000.00        9999.94
0.25    10000.00        9999.95
0.21    10000.00        9999.97
0.18    10000.00        10000.00
0.14    10000.00        10000.02
0.10    10000.00        10000.05
0.06    10000.00        10000.07
0.03    10000.00        10000.08
-0.01   10000.00        10000.11
-0.05   10000.00        10000.12
-0.09   10000.00        10000.14
-0.13   10000.00        10000.14
-0.09   10000.00        10000.16
-0.27   10000.00        10000.17

In the position control loop, it can't reach the target and oscillates back and forth is bad.

  1. When I started running from position 0 to 10000, the motor stopped several times and did not run smoothly to 10000 as expected.

I have tried many parameters of K Ti velocity_limit voltage_limit, but they have no effect.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions