Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve thruster scaling algorithm #325

Open
2 tasks
ShaanGondalia opened this issue Sep 1, 2022 · 0 comments
Open
2 tasks

Improve thruster scaling algorithm #325

ShaanGondalia opened this issue Sep 1, 2022 · 0 comments
Labels
controls Related to robot control
Milestone

Comments

@ShaanGondalia
Copy link
Contributor

Background

The thruster scaling algorithm is quite rudimentary, involving some hacky math that likely isn't optimal. Half of the scaling is done in thruster_manager.py and the other half is done in thruster_controls.py. The current algorithm is something like this:

  1. Obtain thruster allocations from solving Tx = p
  2. If any thruster allocation > 1, scale down all allocations such that the maximum thruster allocation is 1
    • This scaling is done by dividing all allocations by the largest allocation
  3. Round small values (< 0.001, chosen arbitrarily) to 0
  4. Multiply all values by (max pid control effort)/(max thruster allocation).
    • This was a very hacky solution to keep thruster allocations "in line" with pid control efforts. For instance, if the largest pid control effort is 0.1, this intuitively means that the robot shouldn't move very quickly in any direction, so we want to cap the thruster allocation to 0.1 (10% of thruster power).
    • This is a gross oversimplification of how the system should actually work, because pid control efforts and thruster allocations don't have such a simple direct relationship.
  5. Clamp values to [-1, 1] (this step is redundant but added for safety)
  6. Convert allocations to 8-bit integer by multiplying by 127 (and scaling down if we want to limit speed)

We should do more research on how to optimally scale thruster output after the thruster allocation calculation has occurred. The main areas of concern are steps 2 and 4.

Task

  • Research ways that thruster allocation is handled by other autonomous robots
  • Implement a more robust thruster scaling algorithm
@ShaanGondalia ShaanGondalia added the controls Related to robot control label Sep 1, 2022
@ShaanGondalia ShaanGondalia changed the title Improve Thruster Scaling Algorithm Improve thruster scaling algorithm Sep 3, 2022
@ShaanGondalia ShaanGondalia added this to the Fall 2022 milestone Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controls Related to robot control
Projects
None yet
Development

No branches or pull requests

1 participant