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

WIP: Control Allocation #13351

Closed
wants to merge 129 commits into from
Closed

WIP: Control Allocation #13351

wants to merge 129 commits into from

Conversation

jlecoeur
Copy link
Contributor

@jlecoeur jlecoeur commented Nov 1, 2019

Work in progress control allocation module.

Edit: We decided to bring it in with multicopter support only for the start, and bring in FW/VTOL support in a followup. I've grouped the WIP items accordingly.

Minimal multicopter support (with this PR):

  • add topic dedicated to actuator setpoint
  • pipe new data into the existing mixer system
    => this is clean from a user perspective (A: 0-15 mixer definition), not so much internally (it actually uses two additional control groups actuator_controls_4 and actuator_controls_5)
  • add allocator module
  • add simple allocation technique based on pseudo inverse
  • add allocation technique using sequential desaturation
  • handle missing/faulty actuator (when setting act_min >= act_max, the actuator is disabled, and the allocation matrix recomputed accordingly)
  • autogenerate effectiveness matrices for multirotor
  • fly quadcopter
  • fly hexacopter
  • add params/metadata for actuator type (motor/servo --> prearm-able?)
  • Investigate CA_METHOD change segfault
  • solve v2 flash constraints

Followup PR:

  • autogenerate effectiveness matrices for fixed-wing
  • autogenerate effectiveness matrices for VTOL
  • bring VTOL control architecture in place for CA
  • thrust battery scaling, airspeed scaling
  • extend parameter metadata bitfield (enabled, battery-scaled, non-linear thrust, airspeed-scaled)
  • slew rate limiting
  • thrust non-linearity
  • flaps, landing gear, steering wheel
  • fly fixed-wing plane
  • fly standard VTOL
  • fly tiltrotor VTOL
  • fly tailsitter VTOL

@jlecoeur
Copy link
Contributor Author

jlecoeur commented Nov 1, 2019

Many Ci failures will be fixed by #13336

@dagar dagar self-requested a review November 1, 2019 17:52
@jlecoeur jlecoeur force-pushed the pr-control_allocation branch 2 times, most recently from 798399f to 6a7f1b3 Compare November 2, 2019 11:11
@jlecoeur jlecoeur force-pushed the pr-control_allocation branch 2 times, most recently from 2ca4fd2 to 38a5391 Compare November 16, 2019 19:09
@LorenzMeier
Copy link
Member

You might want to rebase on master to fix the Mac OS build.

@jlecoeur
Copy link
Contributor Author

Here is a demo of what can be done with this new module:

Motor failure handling!

Motor failure demo

On an hexacopter robot, two motors are manually disabled with minimum impact on the flight: the robot keeps hovering without drifting.

As motors are disabled (simulating motor failures), a new allocation matrix is automatically computed and the hexacopter keeps flying as if it was an asymmetric pentacopter, then a quadcopter.

The robot is not disturbed because the asymmetry is immediately compensated for in the allocation module. Without the logic implemented in the allocation module, the robot would drift sideways and downward while the integrators build up to compensate.

@jkflying
Copy link
Contributor

On an hexacopter robot, two motors are manually disabled with minimum impact on the flight: the robot keeps hovering without drifting.

So the only piece missing from a real vehicle would be detecting the motor is missing and removing it from the allocation table?

@jlecoeur
Copy link
Contributor Author

@jkflying Yes!
However note that it would not look as nice in a real world scenario. Until the failure is detected, the platform would be disturbed and integrators would build up, then, once the allocation table is updated, the integrators need to be emptied. In other words the disturbance would last a little longer than the failure detection time.

@stale
Copy link

stale bot commented Feb 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label Feb 29, 2020
@LorenzMeier
Copy link
Member

@jlecoeur @bkueng @RomanBapst Let's take the time to wrap this up!

dagar added a commit that referenced this pull request Jan 10, 2021
 - control allocation module with multirotor, VTOL standard, and tiltrotor support
 - angular_velocity_controller
 - See #13351 for details

Co-authored-by: Julien Lecoeur <julien.lecoeur@gmail.com>
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Roman Bapst <bapstroman@gmail.com>
dagar pushed a commit that referenced this pull request Jan 11, 2021
 - control allocation module with multirotor, VTOL standard, and tiltrotor support
 - angular_velocity_controller
 - See #13351 for details

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Roman Bapst <bapstroman@gmail.com>
dagar pushed a commit that referenced this pull request Jan 18, 2021
 - control allocation module with multirotor, VTOL standard, and tiltrotor support
 - angular_velocity_controller
 - See #13351 for details

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Roman Bapst <bapstroman@gmail.com>
dagar pushed a commit that referenced this pull request Jan 18, 2021
 - control allocation module with multirotor, VTOL standard, and tiltrotor support
 - angular_velocity_controller
 - See #13351 for details

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Roman Bapst <bapstroman@gmail.com>
dagar pushed a commit that referenced this pull request Jan 18, 2021
 - control allocation module with multirotor, VTOL standard, and tiltrotor support
 - angular_velocity_controller
 - See #13351 for details

Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Co-authored-by: Roman Bapst <bapstroman@gmail.com>
@mengchaoheng
Copy link

Here is a demo of what can be done with this new module:

Motor failure handling!

Motor failure demo

On an hexacopter robot, two motors are manually disabled with minimum impact on the flight: the robot keeps hovering without drifting.

As motors are disabled (simulating motor failures), a new allocation matrix is automatically computed and the hexacopter keeps flying as if it was an asymmetric pentacopter, then a quadcopter.

The robot is not disturbed because the asymmetry is immediately compensated for in the allocation module. Without the logic implemented in the allocation module, the robot would drift sideways and downward while the integrators build up to compensate.

This is really cool! But I have a question. How does the system know that a motor has failed? Does it imply that there is fault detection in the system?

@jlecoeur
Copy link
Contributor Author

@mengchaoheng yes you would need a detection mechanism. The failure is set manually in the demo above.

Comment on lines +3 to +7
# @name 3DR Iris Quadrotor SITL
#
# @type Quadrotor Wide
#
# @maintainer Julian Oes <julian@oes.ch>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so 😄

*/
void setFlightPhase(const FlightPhase &flight_phase) override;

int numActuators() const override { return 7; }
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
int numActuators() const override { return 7; }
int numActuators() const override { return 8; }

Copy link
Member

Choose a reason for hiding this comment

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

This may explain why standard_vtol never worked with control allocation.

@sfuhrer
Copy link
Contributor

sfuhrer commented Jan 7, 2022

I'd say with #16528 and #18776 being merged we can close this one.

@sfuhrer sfuhrer closed this Jan 7, 2022
@dagar dagar deleted the pr-control_allocation branch October 9, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet