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

Fix tiltrotor motor tilt oscillations #471

Merged
merged 2 commits into from
May 7, 2020
Merged

Conversation

Jaeyoung-Lim
Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim commented Apr 27, 2020

This PR fixes the tilt rotor motor tilts oscillating during flight and even during the vehicle is stationary. This was causing the joint position to be more or less random and was blocking a lot of functionalities to work that require joint position to be precise (e.g. controlling yaw based on tiltrotor tilt). Also, the flight shows instabilities due to the motors pointing in arbitrary directions during flight.

The oscillations were caused by the following reasons.

  • Joint controllers becoming unstable very quickly due to large control errors with large gains.
  • Inertia of the joints were too small
  • Poor handling of joint limits in combination of actuator input scaling

To solve the problem the following is proposed

  • Increase of motor inertia
  • Added friction to the tilt joints
  • Clamp error of the joint controller to prevent pid controller becoming unstable with large errors

Before PR
ezgif com-optimize(1)

After PR
ezgif com-optimize

Fix tiltrotor joint oscillations
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

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

It's much better with these changes, especially using tilt support in hover and transitions. Awesome @Jaeyoung-Lim !

@@ -156,6 +156,7 @@ void GazeboMavlinkInterface::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf
input_reference_.resize(n_out_max);
joints_.resize(n_out_max);
pids_.resize(n_out_max);
joint_max_errors_.resize(n_out_max);
Copy link
Member

Choose a reason for hiding this comment

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

Would be better to have a single vector for those 3, but given it's already done that way, no need to change here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, makes sense.

src/gazebo_mavlink_interface.cpp Outdated Show resolved Hide resolved
This removes the magic number of max joint errors to be able to explicitly define the maximum error handled for the pid controller in the joints
@Jaeyoung-Lim Jaeyoung-Lim force-pushed the pr-fix-oscillations branch from 9cbd687 to e820b9a Compare May 6, 2020 10:09
@Jaeyoung-Lim Jaeyoung-Lim merged commit 4c1c512 into master May 7, 2020
@Jaeyoung-Lim Jaeyoung-Lim deleted the pr-fix-oscillations branch May 7, 2020 08:12
RyosukeMatsushima pushed a commit to RyosukeMatsushima/PX4-SITL_gazebo that referenced this pull request Jun 21, 2022
* Fix tiltrotor oscillations

Fix tiltrotor joint oscillations

* Add maximum joint error as paramters

This removes the magic number of max joint errors to be able to explicitly define the maximum error handled for the pid controller in the joints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants