Skip to content

Conversation

@Crafty15
Copy link
Collaborator

@Crafty15 Crafty15 commented Jun 30, 2025

  • Balance code stolen from Tom's old branch here, with the only major change being the use of gyro for roll/pitch rates.
  • This PR allows torso correction to be applied to FootControl tasks.
  • So far has been tested on spline kick and the walk. Limited success with spline kick unless gains are turned right up, leading to oscillations. Walk seemed decent with low gains.
    • More testing might be required on what happens when the robot falls. The delay in fall detection could cause some wild behaviour. I wonder if that could have contributed to Kevin's knees giving out recently.
    • Update to previous point. Added error check to stop correction if error is too large. It works, but if it occurs while the ankles are at an angle due to correction, they will snap back to their original, non corrected value, which could be just as bad.

P.S. It's probably not critical that we have this in and use it for robocup. I was thinking it might help with the tilting during get ups and starting to walk again when the batteries get low.

@@ -1,3 +1,5 @@
log_level: DEBUG
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log_level: DEBUG
log_level: INFO

right_elbow: -0.7
left_elbow: -0.7

# Use balance control. NOTE: correction_enabled must be true in FootController config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Use balance control. NOTE: correction_enabled must be true in FootController config
# Use balance control

right_elbow: -0.7
left_elbow: -0.7

# Use balance control. NOTE: correction_enabled must be true in FootController config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Use balance control. NOTE: correction_enabled must be true in FootController config
# Use balance control

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe the comment isn't needed anymore

roll_error,
pitch_error));
}
return; // Do not apply control if the error is too large
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than return here, flip the logic and wrap the control updates in this if so that we just pause increasing/decreasing desired roll/pitch and don't reset our desired pitch to the nominal

// Graph final corrected desired values
emit(graph("Balance/Desired_Roll_Final", desired_roll));
emit(graph("Balance/Desired_Pitch_Final", desired_pitch));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be good to apply a slew rate limit to these, just as a safety precaution. so basically just add a limit on the maximum change in desired pitch and roll per second, just so that if we get bad sensor data (like a faulty gyro reading) this doesn't blow up

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants