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

Copter: Pilot RC stick control of Circle mode radius, rate, & direction #12829

Open
wants to merge 2 commits into
base: master
from

Conversation

@Pedals2Paddles
Copy link
Contributor

Pedals2Paddles commented Nov 13, 2019

This allows the pilot to change the circle mode radius, rate, and direction using the RC pitch and roll sticks. This does not change the circle center point. Tested in SITL and working quite nicely. This would probably be a nice feature add for Copter 4 as well. There are a number of open issues that this will close.

  • Pitch stick down (negative) reduces the radius until it reaches zero.
  • Pitch stick up (positive) increases the radius
  • Roll stick right (think clockwise) will increase the speed while moving clockwise, or decrease the speed while moving counterclockwise until reaching zero, at which point it will stop.
  • Roll stick left (think counterclockwise) will increase the speed while moving counterclockwise, or decrease the speed while moving clockwise until reaching zero, at which point it will stop.
  • Once stopped (rate 0), releasing the roll stick and pushing it again in either direction will begin moving again in the desired direction. So yes, this allows you to completely change the direction on the fly.
  • Roll stick rate changes are inhibited when CH6 tuning knob is set for circle rate.
  • All stick changes are inhibited in radio failsafe.
  • Does not actually change the stored circle_rate or circle_radius parameter. Upon rebooting, any stick changes to rate and radius are gone and it will use the parameter values. So users should not have any surprises with every new flight.

To Do:

  • The radius change should have a maximum limit. What should it be? Maximum float? Or something more sane? It doesn't appear the circle_radius parameter has any sanity checking now.
  • The rate has a constrained max of 90 degrees per second since that's what the circle_rate parameter doc suggests. Is this a sane limit? I can't think of a use case where one would desire to spin that fast or faster. There is no current sanity checking on this in the code to begin with.
  • Wiki update for Circle Mode.
  • Copter 4 backport?
@amilcarlucas

This comment has been minimized.

Copy link
Contributor

amilcarlucas commented Nov 13, 2019

There was an older PR ( #7930 ) that did this already. Did you see that ?

@Pedals2Paddles

This comment has been minimized.

Copy link
Contributor Author

Pedals2Paddles commented Nov 13, 2019

I think there is an old one that only does the rate.

@robustini

This comment has been minimized.

Copy link
Contributor

robustini commented Nov 15, 2019

Nice add-on!

@Pedals2Paddles Pedals2Paddles changed the title Copter: Add pilot control of circle mode radius, rate, & direction with RC pitch & roll sticks Copter: Pilot RC stick control of Circle mode radius, rate, & direction Nov 18, 2019
@Pedals2Paddles

This comment has been minimized.

Copy link
Contributor Author

Pedals2Paddles commented Nov 18, 2019

2019-11-18 Dev Call:

  • Add parameter to enable/disable. Possibly CIRCLE_CONTROL. 0 for disabled, 1 for rate/radius control. Future use of 2 for center reposition or other options.
  • Verify copter doesn't exceed controllable limits with large radius changes
  • Set radius max for something large such as 50km
…h/roll

Allows the pilot to vary the circle mode radius with the RC pitch stick and circle mode rate with RC roll stick.
@Pedals2Paddles Pedals2Paddles force-pushed the Pedals2Paddles:circle branch from b1bca3f to 3a14d77 Dec 2, 2019
@Pedals2Paddles

This comment has been minimized.

Copy link
Contributor Author

Pedals2Paddles commented Dec 2, 2019

  • Created CIRCLE_CONTROL parameter to enable/disable this. Default disabled. Down the road, someone could easily add 2 as an option for changing the position of the center.
  • Limited radius to 2km, which seems sane.
  • Changing the radius now also triggers the calc_velocities function, which makes everything fly correctly.
  • Changes rate and radius smoothly in all directions without doing anything wonky
@Pedals2Paddles Pedals2Paddles force-pushed the Pedals2Paddles:circle branch from 3a14d77 to 9d53c9d Dec 2, 2019
@Pedals2Paddles Pedals2Paddles force-pushed the Pedals2Paddles:circle branch from 9d53c9d to 5d7d4ff Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.