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

Rover: add roll and pitch stabilization #11034

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Apr 7, 2019

This adds a roll and pitch angle PID for use with boats with trim tabs. The desired pitch is always zero, the desired roll angle is calculated from the lateral acceleration.

The stabilization is active in all modes except manual and hold. It uses the equivalent plane output functions. currently just outputting on them all. (elevator, aileron, left elevon and right elevon)

Not tested

@IamPete1
Copy link
Member Author

rebased, might flash this onto a plane just to see if its correcting properly (not to fly)

@IamPete1
Copy link
Member Author

IamPete1 commented Jul 1, 2020

rebased

Rover/mode.cpp Outdated
@@ -444,6 +448,38 @@ void Mode::set_steering(float steering_value)
g2.motors.set_steering(steering_value);
}

// calculate target roll and pitch angles and output
void Mode::calc_roll_pitch()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to split this function up into two or three pieces. So there should be:

  1. method(s) in the mode class to transform the pilot's inputs into lean angles
  2. method that takes target lean angles and passes them to the attitude controller and maybe then pushes them directly into the motors class.

Copy link
Member Author

Choose a reason for hiding this comment

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

I have split into 2 methods and a helper that does them both, hopefully this it is closer to what you had in mind

@IamPete1
Copy link
Member Author

IamPete1 commented Jul 2, 2020

Added some things I though might be useful for walking robots, there is now a ANGLE_MAX param and a motor option bit to disable speed scaling all together.

@IamPete1
Copy link
Member Author

rebased, hopefully fixed and removed dependency on the removal of RCMAP

@IamPete1
Copy link
Member Author

failing CI due to:

ATC_PITCH_FLTT not in XML
ATC_PITCH_FLTD not in XML
ATC_PITCH_FLTE not in XML
ATC_ROLL_FLTT not in XML
ATC_ROLL_FLTD not in XML
ATC_ROLL_FLTE not in XML

@IamPete1
Copy link
Member Author

I had not updated the param descriptions to add the new PID filters params, I have now, should pass CI

@davidbuzz
Copy link
Collaborator

tests not passing.

@rmackay9
Copy link
Contributor

We do need roll and pitch control support for walking robots at least.

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

4 participants