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

Multirotor braking mode #3159

Merged
merged 28 commits into from Oct 6, 2018

Conversation

Projects
None yet
7 participants
@DzikuVx
Copy link
Member

commented May 4, 2018

just testing some ideas

@giacomo892

This comment has been minimized.

Copy link
Collaborator

commented May 4, 2018

Hi! Nice you are playing around here :)

I've played a lot around those lines to get a faster stopping performance and I was able to get a little better performance by modifying the calculateMulticopterInitialHoldPosition function to set the stop position without adding stoppingDistanceX/Y.

Also my idea (never coded) was to set a "static" pitch (like 20 degs) when the speed is high without waiting the navigation system to react (which is limited in the dps it can obtain) then as soon the speed is "low" navigation can take over and finally stop the copter.

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented May 4, 2018

My idea is to add conditional TPA for nav pids. Boost for stopping, loosen for high speed cruise. And to stop there copter stopped not where user released the sticks

@giacomo892

This comment has been minimized.

Copy link
Collaborator

commented May 4, 2018

@DzikuVx TPA idea is excellent! Did the same for stopping, used to add an if( speed < x) then hold position like you did.
Be aware that adjustMulticopterPositionFromRCInput is called also during FS and it may interfere it.

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented May 5, 2018

Few thoughts after first flights:

  • idea to reset position after braking is over is good, MR does not want to go back
  • breaking PIDs boost should be independent from BRAKING state
  • BRAKING state should behave like now: angage when user release the sticks and store position when MR halted
  • BRAKING_BOOST state should engage in the same moment, but should timeout or end when velocity goes below certail threshold
  • during BRAKING_BOOST we push up required acceleration, max banking angle and jerk limit
  • BRAKING_BOOST can engage only once during BRAKING
  • next BRAKING can happen only after user started to move MR
@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented May 8, 2018

  • There are 2 braking stages: BRAKE and BRAKE_BOOST
  • by default, BRAKE activates above 1m/s when sticks are released
  • BRAKE lasts max 2x
  • BRAKE allows for higher acceleration jerk
  • When BRAKE end (stick movement, timeout, stop) current position is stored as target position so MR does not have a tendency to go back
  • BRAKE_BOOST is activated with BRAKE only when speed is higher than 2m/s
  • BRAKE_BOOST lasts 750 or ends when speed goes below 1m/s
  • During BRAKE_BOOST MR is allowed for higher banking angle
  • if nav_mc_braking_boost_factor is set, it will also boost required accelerations what will make braking sharper. nav_mc_braking_boost_factor or 20 means 20% boost. This is good starting point
  • BRAKING_BOOST is allowed to kick only once per BRAKING
  • next BRAKING might happen only after pilot moved the sticks: requested movement

@DzikuVx DzikuVx force-pushed the dzikuvx-mr-cruise-experiments branch from 9eea03c to c7e15ef May 9, 2018

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented May 10, 2018

New approach tests looks good. With nav_mc_braking_boost_factor = 100 it brakes quite nicely. No runaways. Responsiveness is low, probably due to 2Hz lpf on required acceleration. More tests will follow, but looks promising
LOG00005.TXT

@DzikuVx DzikuVx force-pushed the dzikuvx-mr-cruise-experiments branch from 7460f1a to d363dc5 May 12, 2018

@DzikuVx DzikuVx force-pushed the dzikuvx-mr-cruise-experiments branch from 005adb8 to d7cb733 May 26, 2018

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented May 27, 2018

OK, almost there. It's not running away

@DzikuVx DzikuVx force-pushed the dzikuvx-mr-cruise-experiments branch from 7d70b98 to a4d7cff Jun 2, 2018

@DzikuVx DzikuVx added this to the Future milestone Jun 2, 2018

@DzikuVx DzikuVx changed the title MR CRUISE mode playground Multirotor braking mode Jun 2, 2018

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented Jun 13, 2018

OK, this became unrebaseable, switching to merge :)

@digitalentity

This comment has been minimized.

Copy link
Member

commented Jun 13, 2018

@DzikuVx please add "[skip ci]" to commit messages you don't want Travis to build

@DzikuVx DzikuVx modified the milestones: Future, 2.1 Jul 4, 2018

@DzikuVx DzikuVx removed the Don't merge label Jul 4, 2018

@Dronitoni

This comment has been minimized.

Copy link

commented Sep 2, 2018

Gentlemen,
I would like to know, if this feature will be available in one of the next releases?

Other question: can I download a hex-code for Matek F722 somewhere to test this feature in advance?
I have built up an experimental quad with 10" props for testing.

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented Sep 2, 2018

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented Sep 23, 2018

As promised, test release with braking mode is here: https://github.com/DzikuVx/inav/releases/tag/2.1-Braking-RC1

Please read release notes very very very carefully!

@Dronitoni

This comment has been minimized.

Copy link

commented Sep 24, 2018

Thanks Pawel,
I will give him a try when I'm back from my vacation, beginning of October.

@blackmennewstyle

This comment has been minimized.

Copy link

commented Sep 28, 2018

Oh that's really nice. I remember when i tried iNAV on my TBS Discovery few months ago, i did not like at all the way it was breaking. Problem also i am kinda fly a lot of DJI flight controllers and i always want my copters brake the same way most DJI FCs are doing it. I know i suck lol I should definitely give the feature a try.

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented Oct 6, 2018

OK, flight tested on 6" and 7" machine, works like expected although on 7" defaults are not longer optimal. Merging, more improvements will come in separate merge requests

@DzikuVx DzikuVx merged commit 8afa15c into development Oct 6, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@DzikuVx DzikuVx deleted the dzikuvx-mr-cruise-experiments branch Oct 6, 2018

@stronnag

This comment has been minimized.

Copy link
Collaborator

commented Oct 7, 2018

Flown today on a definitely not overpowered 420mm / 9" prop quad. Braking was more effective, still some back-tracking. Could probably do with less conservative settings on this particular machine. No adverse effects observed.

@DzikuVx

This comment has been minimized.

Copy link
Member Author

commented Oct 8, 2018

thanks @stronnag so far I'm getting mixed responses about default settings and braking efficiency. I think the key is the length and disengage speed of boost phase.

@teckel12

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2018

Can't wait to get in the air with the new build and test this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.