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

integral action-LQR control for quadcopter UAV #25823

Closed
wants to merge 24 commits into from

Conversation

Astik-2002
Copy link
Contributor

An example attempt to integrate a custom attitude controller for quadcopter UAV. The controller is based on a Linear Quadratic Regulator with integral action to eliminate steady state errors.

	modified:   libraries/AC_CustomControl/AC_CustomControl.h
	new file:   libraries/AC_CustomControl/AC_CustomControl_LQR.cpp
	new file:   libraries/AC_CustomControl/AC_CustomControl_LQR.h
@Astik-2002 Astik-2002 closed this Dec 23, 2023
@Astik-2002 Astik-2002 reopened this Dec 23, 2023
Copy link
Collaborator

@Hwurzburg Hwurzburg left a comment

Choose a reason for hiding this comment

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

need to add to cc_type metadata
we should add explanation of PID and this one in description metadata also

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Dec 23, 2023
@Astik-2002
Copy link
Contributor Author

Astik-2002 commented Dec 26, 2023

need to add to cc_type metadata we should add explanation of PID and this one in description metadata also
@Hwurzburg
Can you pls explain in detail what needs to be added. Also, what will be the correct way to add additional information and explanation?

@Hwurzburg
Copy link
Collaborator

not your problem to add PID metadata...thats historical...but line 18 of AC_CustonControl.cpp needs this type added

@Astik-2002
Copy link
Contributor Author

@Hwurzburg kindly review this. Will be commiting hyperparams for making lqr viable for any quadcopter shortly


#include <GCS_MAVLink/GCS.h>

// table of user settable parameters
Copy link
Collaborator

Choose a reason for hiding this comment

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

where are these used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These parameters are not currently used. the lqr gains for each axis are hardcoded, and are currently set for a symmetrical 10 inch quadcopter. The details on how to calculate these params for different systems will be included in readme

@@ -8,14 +8,15 @@
#include "AC_CustomControl_Backend.h"
// #include "AC_CustomControl_Empty.h"
#include "AC_CustomControl_PID.h"
#include "AC_CustomControl_LQR.h"
#include <GCS_MAVLink/GCS.h>

// table of user settable parameters
const AP_Param::GroupInfo AC_CustomControl::var_info[] = {
// @Param: _TYPE
// @DisplayName: Custom control type
// @Description: Custom control type to be used
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// @Description: Custom control type to be used
// @Description: Custom control type to be used: See README.md file

you need to add a section in the README file for LQR...maybe with a wikipedia link to it also

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello @Hwurzburg, readme changes have been pushed. Kindly review them

@Astik-2002 Astik-2002 closed this Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WikiNeeded needs wiki update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants