kostakis52 / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

dual channel ailerons with differential + mix with rudder #373

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Problem: my glider usually fly with 2 mix: ail to rudd, rudd to ail. APM is not 
able to understand when a rudd input is from the mix or a real command. Also is 
not able to send diff ail and mixed channel to control the easyglider in 3 
perpendicular axis.
actually it just give no diff ail command that results in a bad yaw tendency 
that is then felt from imu and corrected, sadly this yaw correction gives a 
roll coupling. To avoid this loop the only way is to reduce pid values. also in 
manual mode the 2nd aileron channel is not pushed to output so I should fly 
with no mix and single ail ch. I solved this.

I have the arduino code ready from my own autopilot made with arduinoPro, it is 
able to read dual ch ailerons with mix input and use them together with rudder 
mix on output. it gives perfect handling of my glider in autopilot mode and I 
can fly it in manual mode exactly as I wish. 

I wish to port it to APM but I need to touch multiple things and I'm not able 
to find them, need some help to do this:

radio setup: when setup radio I should ask if using 2ch ailerons, if using 
differential and if I should calculate the actual mixes rudd to ail and ail to 
rudd. this way you can setup a normal fly and the apm take care of mixes on 
input to discern real roll and yaw commands.

read_radio: I read both ailerons channels and rudd to output  single values for 
roll and rudd input (I don't understan how this value is used internally, my 
autopilot only adds values to radio inputs). 

set_servos_4: I should be able to write also the 5th servo, actually I can't 
figure how. also it should output the 5th channel in manual mode.

code is ready but sadly I'm not able to do that alone because APM code is 
really big and can't study everything.
If someone can give me some help it should be easy to do.

Original issue reported on code.google.com by ingop...@tiscali.it on 29 Jun 2011 at 10:24

GoogleCodeExporter commented 9 years ago
This is a quick and dirty code that make the dual ch ailerons working perfectly 
taking care of the differential both in input and output.
should be added at the end of the set_servos_4 in attitude tab, it works 
perfectly but trim of ch6 is not stored in eeprom.
also it uses map funcion and in this case lacks of resolution because expand 
the small lower movement to the upper on other channel.
also it is not able to avoid problems using spoilers.
I tried various methods but it mess up and still can't figure out all the 
funcions in the code, so many tabs I can't see them all in my fullhd monitor, 
what a pain.

//Frank Norton dual ch ailerons 
###################################################                 
        if  (control_mode == MANUAL) {APM_RC.OutputCh(CH_6, APM_RC.InputCh(CH_6));}

        else {int ail2;
              if (g.channel_roll.radio_out>=g.channel_roll.radio_trim) {ail2= map(g.channel_roll.radio_out,g.channel_roll.radio_trim,g.channel_roll.radio_max,g.rc_6.radio_trim,g.rc_6.radio_max);}
              else {ail2= map(g.channel_roll.radio_out,g.channel_roll.radio_trim,g.channel_roll.radio_min,g.rc_6.radio_trim,g.rc_6.radio_min);}        
              APM_RC.OutputCh(CH_6, ail2);}
//Frank Norton dual ch ailerons 
################################################### 

Original comment by ingop...@tiscali.it on 30 Jun 2011 at 10:00

GoogleCodeExporter commented 9 years ago
We have not implemented differential ailerons in the current code due to 
incompatibility with the 4 channel hardware multiplexer and limited code space. 

It is a feature expected in future versions as well as flaperons, flaps, etc.

If you are looking for help with personal revisions, please post in the forum.

I am closing this issue as differential ailerons are already a documented 
feature request.

Original comment by dewei...@gmail.com on 2 Jul 2011 at 9:20

GoogleCodeExporter commented 9 years ago
Please note that the little code posted actually solve completely the
problem , it take care of differential! I also have the code to store trims
on eeprom to complete everything, works like a charm.
Why don't you simply add it to the planner to enable or disable it. I can
provide a better code than that but is similar. I don't know  the problem
about multiplexer can you explain it. Code space no prob at all, guaranteed.

Original comment by ingop...@tiscali.it on 5 Jul 2011 at 4:03

GoogleCodeExporter commented 9 years ago
is this already solved? I can´t find it in a new software version :(

Original comment by timo.witte on 11 Jul 2014 at 10:52