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

Elevons for wing controller #1

Open
ArduCrow opened this issue Mar 3, 2023 · 1 comment
Open

Elevons for wing controller #1

ArduCrow opened this issue Mar 3, 2023 · 1 comment

Comments

@ArduCrow
Copy link

ArduCrow commented Mar 3, 2023

Hi Tim! I love this idea. I have a couple of RC flying wings I would like to try this out on. Do you have any idea off the top of your head how you would convert this to work on a wing with elevons?

My thoughts are removing the elevator PID instance, to only have the aileron PID instance remaining. There would surely have to be some integration though.

@timmarkhuff
Copy link
Owner

I think this could definitely be adapted for elevons.

You would still need two PID controllers to manage roll and pitch, however the outputs of each would be shared by each elevon. The result might look something like the pseudocode below.

# run PID controllers
ail_output = roll_pid(roll)
ele_output = pitch_pid(pitch)

# actuate elevons
left_elevon_servo.value = ail_output  + ele_output 
right_elevon_servo.value = -ail_output  + ele_output 

Simply adding the values together should work, but perhaps there is a more nuanced approach that I haven't considered.

The function that actuates the servos only takes values between -1 and 1, so you have to make sure you are never providing values outside that range. One way to do that would be to set a limit for each controller that is equal to or less than .5. I recommend a low value like .2. You don't need a lot of deflection when running autopilot.

roll_pid.output_limits = -.2, .2
pitch_pid.output_limits = -.2, .2

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

No branches or pull requests

2 participants