Sakshi pid controller and AK80 motor - #60
Conversation
|
@claude-review |
|
Claude finished @NGierden's task in 2m 50s —— View job Code Review — PR #60: Sakshi PID Controller and AK80 MotorTasks:
OverviewThis PR adds a PID position controller, a second-order low-pass filter with pluggable integration strategies (Forward Euler, Backward Euler, Trapezoidal, RK4), and support for the AK80-6 motor variant. The structure is clean and the LPF implementation is well-documented, but there are several bugs that need fixing before merge. 🐛 Bugs1. Swapped return values in
# step() returns (filtered_output, output_derivative)
y_dot, y = self.step(x=x, time_difference=dt) # ← swapped!
y_array.append(y) # actually gets output_derivative
y_dot_array.append(y_dot) # actually gets filtered_outputThe 2. Class attribute access instead of instance attribute [ MAX_VELOCITY_RAD_S = PIDConfig.output_limits # ← reads dataclass default, not instance value
3. Stale docstring parameter [ The 4. Redundant error calculation in
|
| Severity | Count |
|---|---|
| 🐛 Bug (must fix before merge) | 3 |
| 5 | |
| 📝 Code quality | 6 |
The most critical issues are the swapped return values in run() (#1), the class-level attribute access for output_limits (#2), and the dead PID instance in CubeMarsAK606v3CAN (#5). The PR checklist also shows no tests were added — given the complexity of the LPF, at minimum a test verifying that the four solvers produce monotonically converging outputs for a step input would be valuable.
NGierden
left a comment
There was a problem hiding this comment.
ignore the unneeded comments of claude, such as the embedding of the PID. Otherwise check Claude's comments please and change what is needed
Summary
Describe the main changes in this PR:
Code Quality Checklist
Before requesting review, ensure:
make treeto update the README.mdAdditional Notes