Skip to content
This repository was archived by the owner on Feb 27, 2025. It is now read-only.

Improve thruster scaling algorithm #325

Closed
2 tasks
ShaanGondalia opened this issue Sep 1, 2022 · 1 comment
Closed
2 tasks

Improve thruster scaling algorithm #325

ShaanGondalia opened this issue Sep 1, 2022 · 1 comment
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
@vedarshshah
Copy link
Member

This has been done with the redesigned controls and offboard comms systems. Controls solves Wx = p to obtain the unconstrained thrust allocation vector and uses quadratic programming to adjust it to ensure none of the allocations are greater than 1. Controls does not try to keep thrust allocations "in line" with PID control efforts, as this is not necessary and actually interferes with proper operation controls system. And, offboard comms uses the thruster power curve provided by BlueRobotics to accurately map thrust allocations to PWM values.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
controls Related to robot control
Projects
None yet
Development

No branches or pull requests

2 participants